@lovrabet/lovrabet-cli 2.3.0-beta.2 → 2.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/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/init.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/domain-config.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/region.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/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0xb79f(){const _0x3a10d3=['\x20does\x20not\x20expose\x20','155029EzbIGj','11OboGNt','POST','str','allowSelf','Page\x20menu\x20','body','validation','description','length','page-set','6175iyzbCe','page','menu-id','before','2CYQXKv','72934pqVlUL','1434590TvHimC','Preview:\x20update\x20page\x20permission\x20slots\x20','menuId','18LUURiL','num','high-risk-write','4ApVFyr','appCode','slots','/client/permit/page/save','27711VKpltb','6324yxlJAi','join','\x20does\x20not\x20belong\x20to\x20app\x20','flag','Set\x20selected\x20runtime\x20page\x20permission\x20slots','build','Menu\x20','rolePermit','58424ZTraPu','180WphFeM','720170OTbaWq','key'];a43_0xb79f=function(){return _0x3a10d3;};return a43_0xb79f();}const a43_0x351240=a43_0x1312;(function(_0x41ce79,_0x1face7){const _0x212e55=a43_0x1312,_0x2acfd3=_0x41ce79();while(!![]){try{const _0x427132=-parseInt(_0x212e55(0x102))/0x1*(parseInt(_0x212e55(0x103))/0x2)+-parseInt(_0x212e55(0xe5))/0x3*(-parseInt(_0x212e55(0x10a))/0x4)+-parseInt(_0x212e55(0xf0))/0x5+parseInt(_0x212e55(0x107))/0x6*(parseInt(_0x212e55(0xf3))/0x7)+-parseInt(_0x212e55(0xee))/0x8*(-parseInt(_0x212e55(0xef))/0x9)+parseInt(_0x212e55(0x104))/0xa*(-parseInt(_0x212e55(0xf4))/0xb)+-parseInt(_0x212e55(0xe6))/0xc*(-parseInt(_0x212e55(0xfe))/0xd);if(_0x427132===_0x1face7)break;else _0x2acfd3['push'](_0x2acfd3['shift']());}catch(_0x3b3af4){_0x2acfd3['push'](_0x2acfd3['shift']());}}}(a43_0xb79f,0x1b414));import{getRuntimePagePermit,saveRuntimePagePermit}from'../../core/api-client.js';function a43_0x1312(_0x4aac4a,_0x55fa36){_0x4aac4a=_0x4aac4a-0xe5;const _0xb79fbd=a43_0xb79f();let _0x131267=_0xb79fbd[_0x4aac4a];return _0x131267;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertRuntimePermissionManager,MENU_ID_FLAG,PAGE_ROLE_FLAGS,PAGE_SLOT_SPECS,projectRuntimePagePermit,resolveRuntimePermitRoles,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';async function prepare(_0x271da2){const _0x227123=a43_0x1312;await assertRuntimePermissionManager(_0x271da2[_0x227123(0x10b)]);const _0x410d72=_0x271da2[_0x227123(0x108)](_0x227123(0x100)),_0x49f06e=await getRuntimePagePermit(_0x410d72);if(_0x49f06e[_0x227123(0x10b)]&&_0x49f06e[_0x227123(0x10b)]!==_0x271da2[_0x227123(0x10b)])throw CliErrors[_0x227123(0xfa)](_0x227123(0xec)+_0x410d72+_0x227123(0xe8)+_0x271da2[_0x227123(0x10b)]+'.');const _0x5faf1c=structuredClone(_0x49f06e),_0x560f8b=[];for(const _0x465506 of PAGE_SLOT_SPECS){if(_0x271da2[_0x227123(0xe9)](_0x465506['flag'])===undefined)continue;const _0x44aef0=_0x49f06e[_0x465506['key']];if(!_0x44aef0)throw CliErrors['validation'](_0x227123(0xf8)+_0x410d72+_0x227123(0xf2)+_0x465506[_0x227123(0xf1)]+'.');_0x44aef0[_0x227123(0xed)]=await resolveRuntimePermitRoles(_0x271da2[_0x227123(0x10b)],splitRefs(_0x271da2[_0x227123(0xf6)](_0x465506[_0x227123(0xe9)]),'--'+_0x465506['flag']),_0x465506[_0x227123(0xf7)]),_0x560f8b['push'](_0x465506[_0x227123(0xf1)]);}if(_0x560f8b[_0x227123(0xfc)]===0x0)throw CliErrors[_0x227123(0xfa)]('Pass\x20at\x20least\x20one\x20page\x20role\x20flag\x20to\x20update.');return{'menuId':_0x410d72,'page':_0x49f06e,'before':_0x5faf1c,'slots':_0x560f8b};}export const permitPageSet={'service':'permit','command':a43_0x351240(0xfd),'description':a43_0x351240(0xea),'risk':a43_0x351240(0x109),'confirmationDescription':'Changes\x20role\x20permission\x20slots\x20on\x20the\x20given\x20runtime\x20page.\x20Unauthorized\x20users\x20may\x20be\x20unable\x20to\x20view\x20the\x20page\x20or\x20run\x20data\x20operations.','flags':[MENU_ID_FLAG,...PAGE_ROLE_FLAGS],async 'dryRun'(_0x45ae1d){const _0xf5051f=a43_0x351240,_0x4b3fe4=await prepare(_0x45ae1d);return dryRun(_0xf5051f(0xf5),_0xf5051f(0x10d))[_0xf5051f(0xf9)](_0x4b3fe4[_0xf5051f(0xff)])[_0xf5051f(0xfb)](_0xf5051f(0x105)+_0x4b3fe4[_0xf5051f(0x10c)][_0xf5051f(0xe7)](',\x20'))[_0xf5051f(0xeb)]();},async 'execute'(_0x311eb6){const _0x4a4286=a43_0x351240,_0x402360=await prepare(_0x311eb6),_0x31052b=await saveRuntimePagePermit(_0x402360[_0x4a4286(0xff)]);return{'ok':!![],'data':runtimePermitWriteResult(_0x4a4286(0xfd),{'menuId':_0x402360[_0x4a4286(0x106)],'slots':_0x402360[_0x4a4286(0x10c)]},projectRuntimePagePermit(_0x402360[_0x4a4286(0x101)]),projectRuntimePagePermit(_0x31052b),{'method':_0x4a4286(0xf5),'path':_0x4a4286(0x10d)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a44_0x13ef1a=a44_0x18bf;(function(_0x1da43d,_0x1ff8cf){const _0x207ffe=a44_0x18bf,_0x19e14f=_0x1da43d();while(!![]){try{const _0xb00e4b=-parseInt(_0x207ffe(0xc6))/0x1*(parseInt(_0x207ffe(0xcd))/0x2)+parseInt(_0x207ffe(0xd9))/0x3+parseInt(_0x207ffe(0xde))/0x4+-parseInt(_0x207ffe(0xdc))/0x5*(-parseInt(_0x207ffe(0xd5))/0x6)+-parseInt(_0x207ffe(0xda))/0x7*(-parseInt(_0x207ffe(0xe3))/0x8)+-parseInt(_0x207ffe(0xcc))/0x9+parseInt(_0x207ffe(0xe2))/0xa;if(_0xb00e4b===_0x1ff8cf)break;else _0x19e14f['push'](_0x19e14f['shift']());}catch(_0x5ca7b0){_0x19e14f['push'](_0x19e14f['shift']());}}}(a44_0x4ba9,0xa2f3a));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';function a44_0x18bf(_0x2b5094,_0x3b45b9){_0x2b5094=_0x2b5094-0xb5;const _0x4ba962=a44_0x4ba9();let _0x18bf3e=_0x4ba962[_0x2b5094];return _0x18bf3e;}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':'menus','type':a44_0x13ef1a(0xbc),'required':!![],'description':'Comma-separated\x20runtime\x20menu\x20IDs'};async function prepare(_0x84bdf1){const _0x5da022=a44_0x13ef1a;await assertRuntimePermissionManager(_0x84bdf1['appCode']);const _0xf343a8=assertGrantOrRevoke(_0x84bdf1[_0x5da022(0xdf)](_0x5da022(0xe1)),_0x84bdf1[_0x5da022(0xdf)](_0x5da022(0xe4))),_0x93f5e2=await resolveRuntimeRoleRef(_0x84bdf1['appCode'],_0x84bdf1[_0x5da022(0xb6)](_0x5da022(0xc8)));assertRuntimePermitRoleConfigurable(_0x93f5e2);const _0x295043=[...new Set(splitRefs(_0x84bdf1[_0x5da022(0xb6)](_0x5da022(0xc1)),_0x5da022(0xbe))[_0x5da022(0xbb)](_0x159622=>{const _0x350697=_0x5da022,_0x58971b=Number(_0x159622);if(!/^\d+$/[_0x350697(0xdb)](_0x159622)||!Number[_0x350697(0xc4)](_0x58971b)||_0x58971b<=0x0)throw CliErrors[_0x350697(0xc2)](_0x350697(0xca)+_0x159622+'.');return _0x58971b;}))],_0x5b5b91=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x84bdf1[_0x5da022(0xd1)])),_0x2701d9=await listRuntimePermitRoles(_0x84bdf1[_0x5da022(0xd1)]),_0x4de9d8=[],_0x105bab=[],_0x1d60bb=[],_0x13f906=[];for(const _0x1a28cf of _0x295043){const _0x28cbf0=_0x5b5b91[_0x5da022(0xd0)](_0x1108f8=>_0x1108f8['id']===_0x1a28cf);if(!_0x28cbf0)throw CliErrors[_0x5da022(0xc2)](_0x5da022(0xcf)+_0x1a28cf+_0x5da022(0xce));const _0x16a16d=applyRuntimeRolePermission(_0x28cbf0[_0x5da022(0xd7)],_0x93f5e2,_0x2701d9,_0xf343a8);_0x105bab[_0x5da022(0xc3)]({'menuId':_0x1a28cf,'rolePermit':_0x28cbf0[_0x5da022(0xd7)]}),_0x1d60bb[_0x5da022(0xc3)]({'menuId':_0x1a28cf,'rolePermit':_0x16a16d[_0x5da022(0xc0)]});if(_0x16a16d[_0x5da022(0xd2)])_0x4de9d8[_0x5da022(0xc3)](menuPermitDto(_0x84bdf1[_0x5da022(0xd1)],_0x28cbf0,_0x16a16d[_0x5da022(0xc0)]));else _0x13f906['push']('Runtime\x20menu\x20'+_0x1a28cf+_0x5da022(0xcb)+_0xf343a8+_0x5da022(0xd8)+_0x93f5e2['id']+'.');}return{'operation':_0xf343a8,'role':_0x93f5e2,'menuIds':_0x295043,'permitList':_0x4de9d8,'before':_0x105bab,'after':_0x1d60bb,'warnings':_0x13f906};}export const permitRoleMenusSet={'service':a44_0x13ef1a(0xe0),'command':'role-menus-set','description':'Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','risk':a44_0x13ef1a(0xdd),'confirmationDescription':a44_0x13ef1a(0xba),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0x45fdd1){const _0x466ab7=a44_0x13ef1a;assertGrantOrRevoke(_0x45fdd1['bool'](_0x466ab7(0xe1)),_0x45fdd1[_0x466ab7(0xdf)]('revoke'));},async 'dryRun'(_0x52fd12){const _0x52b038=a44_0x13ef1a,_0x329571=await prepare(_0x52fd12);return dryRun('POST',_0x52b038(0xb7))[_0x52b038(0xbd)]({'appCode':_0x52fd12[_0x52b038(0xd1)],'permitList':_0x329571[_0x52b038(0xc5)]})[_0x52b038(0xd3)](_0x52b038(0xb5)+_0x329571['operation']+_0x52b038(0xb8))[_0x52b038(0xc7)]();},async 'execute'(_0x20e062){const _0x3bb690=a44_0x13ef1a,_0x5f3bac=await prepare(_0x20e062);return _0x5f3bac['permitList'][_0x3bb690(0xd4)]>0x0&&await saveRuntimeMenuRolePermits(_0x20e062[_0x3bb690(0xd1)],_0x5f3bac[_0x3bb690(0xc5)]),{'ok':!![],'data':runtimePermitWriteResult('menu-'+_0x5f3bac['operation'],{'roleId':_0x5f3bac[_0x3bb690(0xc8)]['id'],'menuIds':_0x5f3bac[_0x3bb690(0xd6)]},_0x5f3bac[_0x3bb690(0xbf)],_0x5f3bac[_0x3bb690(0xb9)],{'method':_0x3bb690(0xc9),'path':_0x3bb690(0xb7)},_0x5f3bac['warnings'])};}};function a44_0x4ba9(){const _0x3ba65a=['revoke','Preview:\x20','str','/client/permit/resource/batch-save-menu','\x20selected\x20runtime\x20menus','after','Grants\x20or\x20revokes\x20the\x20target\x20role\x20access\x20to\x20the\x20given\x20runtime\x20menus.\x20Menu\x20visibility\x20for\x20users\x20in\x20that\x20role\x20will\x20change.','map','string','body','--menus','before','roles','menus','validation','push','isSafeInteger','permitList','1nQOczk','build','role','POST','Invalid\x20runtime\x20menu\x20ID:\x20','\x20already\x20reflects\x20','230886oTDhKX','2550820yKnTVx','\x20was\x20not\x20found.','Runtime\x20menu\x20','find','appCode','changed','description','length','6JNIMnk','menuIds','rolePermit','\x20for\x20role\x20','1573680yAyrKZ','1540TDeWFY','test','1736255YzRESC','high-risk-write','3818052kBvwpQ','bool','permit','grant','579300YSUcmF','3064itbdNl'];a44_0x4ba9=function(){return _0x3ba65a;};return a44_0x4ba9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a45_0x3389(_0x2244c8,_0x11f15c){_0x2244c8=_0x2244c8-0x1e2;const _0x15df95=a45_0x15df();let _0x3389dd=_0x15df95[_0x2244c8];return _0x3389dd;}const a45_0x86f70b=a45_0x3389;(function(_0x16f682,_0x59655e){const _0x137aee=a45_0x3389,_0x2678c8=_0x16f682();while(!![]){try{const _0x440ac9=-parseInt(_0x137aee(0x1e5))/0x1+-parseInt(_0x137aee(0x1e4))/0x2*(-parseInt(_0x137aee(0x1e7))/0x3)+parseInt(_0x137aee(0x1f2))/0x4+parseInt(_0x137aee(0x1ec))/0x5*(-parseInt(_0x137aee(0x1e8))/0x6)+-parseInt(_0x137aee(0x1e2))/0x7+parseInt(_0x137aee(0x1e9))/0x8+parseInt(_0x137aee(0x1e6))/0x9;if(_0x440ac9===_0x59655e)break;else _0x2678c8['push'](_0x2678c8['shift']());}catch(_0x4aec5e){_0x2678c8['push'](_0x2678c8['shift']());}}}(a45_0x15df,0x22d2d));import{getRuntimeRoleMenuResources}from'../../core/api-client.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a45_0x15df(){const _0x158b5e=['7785WbgeLM','6GAQGwl','371744Qyepnm','permit','role','622585GIoHlK','appCode','role-menus','str','roleName','roleType','971976HObRyM','1015322lMkgbm','Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','80rqrLix','265322HSYhVi','2558340aZADmj'];a45_0x15df=function(){return _0x158b5e;};return a45_0x15df();}export const permitRoleMenus={'service':a45_0x86f70b(0x1ea),'command':a45_0x86f70b(0x1ee),'description':a45_0x86f70b(0x1e3),'risk':'read','flags':[ROLE_REF_FLAG],async 'execute'(_0x37fd23){const _0x554d44=a45_0x86f70b,_0x4bfe08=await resolveRuntimeRoleRef(_0x37fd23[_0x554d44(0x1ed)],_0x37fd23[_0x554d44(0x1ef)](_0x554d44(0x1eb))),_0x468ebe=await getRuntimeRoleMenuResources(_0x37fd23[_0x554d44(0x1ed)],_0x4bfe08['id']);return{'ok':!![],'data':{'scope':'runtime','role':{'id':_0x4bfe08['id'],'roleName':_0x4bfe08[_0x554d44(0x1f0)],'roleType':_0x4bfe08[_0x554d44(0x1f1)]},'menus':_0x468ebe}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0xd3b6be=a46_0x984e;(function(_0x5c3c03,_0x342b73){const _0x3c8a6d=a46_0x984e,_0xcbbef6=_0x5c3c03();while(!![]){try{const _0x4e369f=parseInt(_0x3c8a6d(0x14b))/0x1*(-parseInt(_0x3c8a6d(0x132))/0x2)+parseInt(_0x3c8a6d(0x120))/0x3*(-parseInt(_0x3c8a6d(0x130))/0x4)+-parseInt(_0x3c8a6d(0x150))/0x5*(-parseInt(_0x3c8a6d(0x124))/0x6)+parseInt(_0x3c8a6d(0x14c))/0x7*(parseInt(_0x3c8a6d(0x155))/0x8)+parseInt(_0x3c8a6d(0x13b))/0x9+-parseInt(_0x3c8a6d(0x134))/0xa+parseInt(_0x3c8a6d(0x153))/0xb*(parseInt(_0x3c8a6d(0x14a))/0xc);if(_0x4e369f===_0x342b73)break;else _0xcbbef6['push'](_0xcbbef6['shift']());}catch(_0x34cb03){_0xcbbef6['push'](_0xcbbef6['shift']());}}}(a46_0x9b3f,0x27097));import{getLoginUserInfo,listRuntimePermitRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a46_0xd3b6be(0x146),'type':a46_0xd3b6be(0x158),'required':!![],'description':'Runtime\x20menu\x20ID'};function a46_0x9b3f(){const _0x36a672=['18664scOHoL','\x20must\x20contain\x20at\x20least\x20one\x20value.','251846tvhIlH','Use\x20a\x20role\x20ID\x20from\x20`lovrabet\x20role\x20list`.','2954770CzzZDu','Configure\x20USER,\x20CUSTOM,\x20or\x20an\x20applicable\x20special\x20role\x20instead.','test','some','find','\x20runtime\x20role\x20','key','2257452WGOFXX','boolean','userId','trim','dataUpdate','datasetCode','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','runtime','Grant\x20the\x20selected\x20resources\x20to\x20the\x20role','Runtime\x20resource\x20permission\x20changes\x20require\x20an\x20ADMIN\x20or\x20OWNER\x20role.','validation','menu-id','menu-roles','revoke','\x22\x20is\x20ambiguous.','288cDvIXC','1WyZCpk','634669RzcrYW','roleType','string','Cannot\x20change\x20resource\x20permissions\x20for\x20','10XeTxvC','OWNER','\x22\x20was\x20not\x20found.','116864twzBxN','map','8XGHZLx','grant','pageId','number','Cannot\x20resolve\x20the\x20current\x20AK\x20userId\x20for\x20permission\x20management.','ALL','Permission\x20role\x20\x22','\x20has\x20full\x20runtime\x20access\x20and\x20cannot\x20be\x20a\x20resource\x20permission\x20target.','resourceType','flag','menuPermit','The\x20current\x20service\x20contract\x20does\x20not\x20persist\x20an\x20empty\x20rolePermit;\x20grant\x20another\x20role\x20first.','export-roles','values','Ask\x20an\x20application\x20manager\x20to\x20perform\x20this\x20operation.','rolePermit','push','permitId','39tnvmbi','userList','appCode','dataExport','136446iqpctn','ADMIN\x20and\x20OWNER\x20have\x20full\x20runtime\x20access;\x20configure\x20USER\x20or\x20CUSTOM\x20instead.','ADMIN','role','Pass\x20exactly\x20one\x20of\x20--grant\x20or\x20--revoke.','roleName','dataCreate','filter','delete-roles','length','SELF','dataDetail'];a46_0x9b3f=function(){return _0x36a672;};return a46_0x9b3f();}export const ROLE_REF_FLAG={'name':a46_0xd3b6be(0x127),'type':'string','required':!![],'description':a46_0xd3b6be(0x141)};export const GRANT_FLAG={'name':'grant','type':a46_0xd3b6be(0x13c),'description':a46_0xd3b6be(0x143)};export const REVOKE_FLAG={'name':a46_0xd3b6be(0x148),'type':a46_0xd3b6be(0x13c),'description':'Revoke\x20the\x20selected\x20resources\x20from\x20the\x20role'};export const PAGE_SLOT_SPECS=[{'flag':a46_0xd3b6be(0x147),'key':a46_0xd3b6be(0x15f),'allowSelf':![]},{'flag':'create-roles','key':a46_0xd3b6be(0x12a),'allowSelf':![]},{'flag':'update-roles','key':a46_0xd3b6be(0x13f),'allowSelf':![]},{'flag':a46_0xd3b6be(0x12c),'key':'dataDelete','allowSelf':![]},{'flag':'detail-roles','key':a46_0xd3b6be(0x12f),'allowSelf':![]},{'flag':a46_0xd3b6be(0x11a),'key':a46_0xd3b6be(0x123),'allowSelf':![]},{'flag':'row-roles','key':'dataPermit','allowSelf':!![]}];export const PAGE_ROLE_FLAGS=PAGE_SLOT_SPECS[a46_0xd3b6be(0x154)](_0x494a93=>({'name':_0x494a93[a46_0xd3b6be(0x15e)],'type':a46_0xd3b6be(0x14e),'description':'Comma-separated\x20runtime\x20role\x20IDs\x20or\x20names'}));export function splitRefs(_0x32c787,_0x32089d){const _0x539f2c=a46_0xd3b6be,_0x1f8a97=[...new Set(_0x32c787['split'](',')['map'](_0x567d93=>_0x567d93[_0x539f2c(0x13e)]())[_0x539f2c(0x12b)](Boolean))];if(_0x1f8a97[_0x539f2c(0x12d)]===0x0)throw CliErrors['validation'](_0x32089d+_0x539f2c(0x131));return _0x1f8a97;}export function assertGrantOrRevoke(_0x554722,_0xe8b0a4){const _0x21e544=a46_0xd3b6be;if(_0x554722===_0xe8b0a4)throw CliErrors['validation'](_0x21e544(0x128));return _0x554722?_0x21e544(0x156):_0x21e544(0x148);}function resolvePermitRole(_0x1b5b75,_0x128d38){const _0x5a7ff2=a46_0xd3b6be,_0x401f0f=_0x128d38[_0x5a7ff2(0x13e)](),_0x138e23=/^-?\d+$/[_0x5a7ff2(0x136)](_0x401f0f)?_0x1b5b75['filter'](_0x1704a4=>_0x1704a4['id']===Number(_0x401f0f)):_0x1b5b75[_0x5a7ff2(0x12b)](_0x4c467b=>_0x4c467b['roleName']===_0x401f0f||_0x4c467b[_0x5a7ff2(0x14d)]===_0x401f0f['toUpperCase']());if(_0x138e23[_0x5a7ff2(0x12d)]!==0x1)throw CliErrors[_0x5a7ff2(0x145)](_0x138e23[_0x5a7ff2(0x12d)]===0x0?_0x5a7ff2(0x15b)+_0x401f0f+_0x5a7ff2(0x152):_0x5a7ff2(0x15b)+_0x401f0f+_0x5a7ff2(0x149),_0x5a7ff2(0x133));return _0x138e23[0x0];}export async function resolveRuntimePermitRoles(_0x24d821,_0x4efbee,_0x2a632d){const _0x2a3167=a46_0xd3b6be,_0x352f1c=await listRuntimePermitRoles(_0x24d821,{'needSelf':!![],'needPublic':!![]}),_0x49d581=[...new Map(_0x4efbee[_0x2a3167(0x154)](_0x4e8999=>resolvePermitRole(_0x352f1c,_0x4e8999))['map'](_0x16b8ca=>[_0x16b8ca['id'],_0x16b8ca]))[_0x2a3167(0x11b)]()],_0xce7240=_0x49d581[_0x2a3167(0x138)](_0x51828e=>_0x51828e[_0x2a3167(0x14d)]===_0x2a3167(0x126)||_0x51828e[_0x2a3167(0x14d)]===_0x2a3167(0x151));if(_0xce7240)throw CliErrors[_0x2a3167(0x145)](_0xce7240['roleType']+_0x2a3167(0x15c),_0x2a3167(0x135));if(!_0x2a632d&&_0x49d581[_0x2a3167(0x137)](_0x50a211=>_0x50a211[_0x2a3167(0x14d)]===_0x2a3167(0x12e)))throw CliErrors[_0x2a3167(0x145)]('SELF\x20is\x20only\x20valid\x20for\x20--row-roles.');return _0x49d581;}export async function assertRuntimePermissionManager(_0x5d3d87){const _0xf310d5=a46_0xd3b6be,_0x369d83=await getLoginUserInfo(),_0x4aa963=_0x369d83[_0xf310d5(0x13d)]??_0x369d83['id'],_0x2c83a1=Number(_0x4aa963);if(!Number['isSafeInteger'](_0x2c83a1)||_0x2c83a1<=0x0)throw CliErrors[_0xf310d5(0x145)](_0xf310d5(0x159));const _0x43c5a3=await listRuntimeRoleUsers(_0x5d3d87),_0xbea3b3=_0x43c5a3[_0xf310d5(0x137)](_0x55a611=>(_0x55a611['roleType']===_0xf310d5(0x126)||_0x55a611['roleType']==='OWNER')&&_0x55a611[_0xf310d5(0x121)][_0xf310d5(0x137)](_0x19f3c6=>_0x19f3c6[_0xf310d5(0x13d)]===_0x2c83a1));if(!_0xbea3b3)throw CliErrors['validation'](_0xf310d5(0x144),_0xf310d5(0x11c));}export function assertRuntimePermitRoleConfigurable(_0x5c979e){const _0x2c1c5e=a46_0xd3b6be;if(_0x5c979e['roleType']===_0x2c1c5e(0x126)||_0x5c979e[_0x2c1c5e(0x14d)]===_0x2c1c5e(0x151))throw CliErrors['validation'](_0x2c1c5e(0x14f)+_0x5c979e[_0x2c1c5e(0x14d)]+_0x2c1c5e(0x139)+_0x5c979e[_0x2c1c5e(0x129)]+'.',_0x2c1c5e(0x125));}function asPermitRole(_0x40e139){const _0x48ba19=a46_0xd3b6be;return{'id':_0x40e139['id'],'roleName':_0x40e139[_0x48ba19(0x129)],'roleType':_0x40e139['roleType'],'allowed':!![]};}export function applyRuntimeRolePermission(_0x3198b1,_0xacc3a3,_0x3b6335,_0xbd1f1){const _0x44dfbf=a46_0xd3b6be,_0x3302f2=!_0x3198b1||_0x3198b1['length']===0x0,_0x1eae45=_0x3198b1?.['some'](_0x223aa9=>_0x223aa9['roleType']===_0x44dfbf(0x15a))??![];if(_0xbd1f1==='grant'&&(_0x3302f2||_0x1eae45))return{'roles':_0x3198b1??null,'changed':![]};let _0x14842c=_0x3302f2||_0x1eae45?_0x3b6335[_0x44dfbf(0x12b)](_0x2ff62b=>_0x2ff62b['id']>0x0):[..._0x3198b1];const _0x4c315d=_0x14842c[_0x44dfbf(0x137)](_0x3addad=>_0x3addad['id']===_0xacc3a3['id']);if(_0xbd1f1===_0x44dfbf(0x156)){if(_0x4c315d)return{'roles':_0x14842c,'changed':![]};return _0x14842c[_0x44dfbf(0x11e)](asPermitRole(_0xacc3a3)),{'roles':_0x14842c,'changed':!![]};}if(!_0x4c315d)return{'roles':_0x14842c,'changed':_0x3302f2||_0x1eae45};_0x14842c=_0x14842c[_0x44dfbf(0x12b)](_0x3834dd=>_0x3834dd['id']!==_0xacc3a3['id']);if(_0x14842c[_0x44dfbf(0x12d)]===0x0)throw CliErrors[_0x44dfbf(0x145)]('Cannot\x20revoke\x20the\x20last\x20role\x20from\x20a\x20runtime\x20resource.',_0x44dfbf(0x160));return{'roles':_0x14842c,'changed':!![]};}export function projectRuntimePagePermit(_0x21987a){const _0x209aeb=a46_0xd3b6be,_0x28ca1d={'menuId':_0x21987a['menuId'],'pageId':_0x21987a[_0x209aeb(0x157)],'appCode':_0x21987a[_0x209aeb(0x122)],'datasetCode':_0x21987a[_0x209aeb(0x140)]};for(const _0xf19493 of PAGE_SLOT_SPECS){const _0xac9731=_0x21987a[_0xf19493['key']];_0xac9731&&(_0x28ca1d[_0xf19493[_0x209aeb(0x13a)]]={'resourceCode':_0xac9731['resourceCode'],'resourceType':_0xac9731[_0x209aeb(0x15d)],'roles':(_0xac9731[_0x209aeb(0x11d)]??[])[_0x209aeb(0x154)](_0x4017d2=>({'id':_0x4017d2['id'],'roleName':_0x4017d2['roleName'],'roleType':_0x4017d2[_0x209aeb(0x14d)]}))});}return _0x28ca1d;}function a46_0x984e(_0x1ff06b,_0x8c7f81){_0x1ff06b=_0x1ff06b-0x11a;const _0x9b3fcf=a46_0x9b3f();let _0x984ece=_0x9b3fcf[_0x1ff06b];return _0x984ece;}export function flattenRuntimeMenuRolePermits(_0x4fa4cd){const _0x19ea21=[],_0x293864=_0x4048f0=>{const _0x4dc1b4=a46_0x984e;_0x19ea21[_0x4dc1b4(0x11e)](_0x4048f0);for(const _0x25f961 of _0x4048f0['children']??[])_0x293864(_0x25f961);};for(const _0x25c515 of _0x4fa4cd)_0x293864(_0x25c515);return _0x19ea21;}export function runtimePermitWriteResult(_0x432737,_0x3ddf6f,_0x2f8408,_0x267ee0,_0xa36b44,_0x26bf7d=[]){const _0x1e9f8a=a46_0xd3b6be;return{'operation':_0x432737,'scope':_0x1e9f8a(0x142),'selector':_0x3ddf6f,'before':_0x2f8408,'after':_0x267ee0,'dryRun':![],'backend':_0xa36b44,'warnings':_0x26bf7d};}export function menuPermitDto(_0x55bafd,_0x21f39d,_0x1a5561){const _0x17bd06=a46_0xd3b6be;return{..._0x21f39d['permitId']!=null?{'id':_0x21f39d[_0x17bd06(0x11f)]}:{},'appCode':_0x55bafd,'menuId':_0x21f39d['id'],'pageId':_0x21f39d[_0x17bd06(0x157)]??null,'resourceCode':String(_0x21f39d['id']),'resourceType':'MENU','resourceName':_0x21f39d['label'],'rolePermit':_0x1a5561};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a47_0x5add52=a47_0x541a;(function(_0x285000,_0x66077f){const _0xf0f9b1=a47_0x541a,_0x321abb=_0x285000();while(!![]){try{const _0x3bcf19=parseInt(_0xf0f9b1(0x177))/0x1+-parseInt(_0xf0f9b1(0x15a))/0x2+parseInt(_0xf0f9b1(0x16b))/0x3+parseInt(_0xf0f9b1(0x18d))/0x4+parseInt(_0xf0f9b1(0x185))/0x5*(parseInt(_0xf0f9b1(0x17b))/0x6)+parseInt(_0xf0f9b1(0x172))/0x7+-parseInt(_0xf0f9b1(0x158))/0x8;if(_0x3bcf19===_0x66077f)break;else _0x321abb['push'](_0x321abb['shift']());}catch(_0x411875){_0x321abb['push'](_0x321abb['shift']());}}}(a47_0x2f6a,0xd8737));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':a47_0x5add52(0x169),'type':a47_0x5add52(0x193),'description':a47_0x5add52(0x182)},FUNCTION_NAME_FLAG={'name':'name','type':a47_0x5add52(0x193),'required':!![],'description':'Personal\x20Backend\x20Function\x20name,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':a47_0x5add52(0x16d),'type':a47_0x5add52(0x193),'description':'Personal\x20Backend\x20Function\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a47_0x5add52(0x193),'description':a47_0x5add52(0x166)};function normalizeFunctionName(_0x51ca7e){const _0xffe450=a47_0x5add52,_0x55ef88=String(_0x51ca7e||'')[_0xffe450(0x161)]();if(!_0x55ef88||!FUNCTION_NAME_PATTERN[_0xffe450(0x15c)](_0x55ef88))throw CliErrors['validation'](_0xffe450(0x18e));return _0x55ef88;}function readScriptFile(_0x356e87){const _0xd88e46=a47_0x5add52;if(!_0x356e87)throw CliErrors[_0xd88e46(0x180)]('File\x20path\x20is\x20required.');if(!existsSync(_0x356e87))throw CliErrors[_0xd88e46(0x180)]('File\x20not\x20found:\x20'+_0x356e87);if(!statSync(_0x356e87)[_0xd88e46(0x179)]())throw CliErrors[_0xd88e46(0x180)](_0xd88e46(0x186)+_0x356e87);const _0xf41f08=readFileSync(_0x356e87,_0xd88e46(0x191));if(!_0xf41f08[_0xd88e46(0x161)]())throw CliErrors[_0xd88e46(0x180)](_0xd88e46(0x174));return _0xf41f08;}function optionalTrimmed(_0x25955d){const _0x3350d9=a47_0x5add52,_0x28a86e=String(_0x25955d||'')[_0x3350d9(0x161)]();return _0x28a86e||undefined;}function summarizeBff(_0x177350){const _0x3dbe1b=a47_0x5add52;return{'id':_0x177350['id'],'appCode':_0x177350[_0x3dbe1b(0x15f)],'functionName':_0x177350['functionName'],'description':_0x177350['description'],'scriptType':_0x177350[_0x3dbe1b(0x187)],'version':_0x177350[_0x3dbe1b(0x171)],'gmtModified':_0x177350[_0x3dbe1b(0x159)],'updateTime':_0x177350['updateTime']};}function a47_0x2f6a(){const _0x4e5a75=['functionName','17318616ITMDtp','gmtModified','3121172XsBzio','keys','test','build','isArray','appCode','createTime','trim','Show\x20one\x20Personal\x20Backend\x20Function\x20by\x20id','exec','personal-bff','flag','Optional\x20source\x20RuntimeAgent\x20session\x20id','params','Created\x20Personal\x20Backend\x20Function\x20','file','map','1748319HLwoTu','POST','description','source-session-id','detail','gmtCreate','version','9163203SjllmD','bool','Personal\x20Backend\x20Function\x20script\x20file\x20is\x20blank.','length','List\x20current\x20user\x27s\x20Personal\x20Backend\x20Function\x20scripts\x20for\x20the\x20current\x20app','1244753gavwRF','Personal\x20Backend\x20Function\x20script\x20ID','isFile','createUserId','30vATdUx','Updated\x20Personal\x20Backend\x20Function\x20','str','scriptContent','verbose','validation','body','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','num','61060FiSoWk','File\x20is\x20not\x20a\x20regular\x20file:\x20','scriptType','Updates\x20the\x20Personal\x20Backend\x20Function\x20script\x20or\x20metadata.\x20Later\x20calls\x20use\x20the\x20new\x20version.','/update','JSON\x20object\x20passed\x20to\x20the\x20Personal\x20Backend\x20Function\x20execution','sourceSessionId','Update\x20a\x20Personal\x20Backend\x20Function\x20by\x20ID','5657524tLRqdu','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','/client/runtime-bff/personal/create','updateTime','utf8','name','string','Executed\x20Personal\x20Backend\x20Function\x20','list','write'];a47_0x2f6a=function(){return _0x4e5a75;};return a47_0x2f6a();}function detailBff(_0x2839c0){const _0x7e570b=a47_0x5add52;return{'id':_0x2839c0['id'],'appCode':_0x2839c0[_0x7e570b(0x15f)],'functionName':_0x2839c0[_0x7e570b(0x157)],'description':_0x2839c0[_0x7e570b(0x16d)],'scriptType':_0x2839c0[_0x7e570b(0x187)],'scriptContent':_0x2839c0['scriptContent']??'','config':_0x2839c0['config'],'version':_0x2839c0[_0x7e570b(0x171)],'createUserId':_0x2839c0[_0x7e570b(0x17a)],'gmtCreate':_0x2839c0[_0x7e570b(0x170)],'gmtModified':_0x2839c0[_0x7e570b(0x159)],'createTime':_0x2839c0[_0x7e570b(0x160)],'updateTime':_0x2839c0[_0x7e570b(0x190)]};}function buildCreateInput(_0x8578b5){const _0x13160b=a47_0x5add52;return{'functionName':normalizeFunctionName(_0x8578b5[_0x13160b(0x17d)](_0x13160b(0x192))),...optionalTrimmed(_0x8578b5['str'](_0x13160b(0x16d)))?{'description':optionalTrimmed(_0x8578b5[_0x13160b(0x17d)](_0x13160b(0x16d)))}:{},'scriptContent':readScriptFile(_0x8578b5[_0x13160b(0x17d)](_0x13160b(0x169))),...optionalTrimmed(_0x8578b5['str'](_0x13160b(0x16e)))?{'sourceSessionId':optionalTrimmed(_0x8578b5[_0x13160b(0x17d)](_0x13160b(0x16e)))}:{}};}function buildUpdateInput(_0x1dc61f){const _0x1d7589=a47_0x5add52,_0x417719={};optionalTrimmed(_0x1dc61f[_0x1d7589(0x17d)]('name'))&&(_0x417719[_0x1d7589(0x157)]=normalizeFunctionName(_0x1dc61f[_0x1d7589(0x17d)](_0x1d7589(0x192))));_0x1dc61f[_0x1d7589(0x165)](_0x1d7589(0x16d))!==undefined&&(_0x417719[_0x1d7589(0x16d)]=_0x1dc61f[_0x1d7589(0x17d)](_0x1d7589(0x16d)));optionalTrimmed(_0x1dc61f[_0x1d7589(0x17d)](_0x1d7589(0x169)))&&(_0x417719[_0x1d7589(0x17e)]=readScriptFile(_0x1dc61f[_0x1d7589(0x17d)](_0x1d7589(0x169))));_0x1dc61f['flag'](_0x1d7589(0x16e))!==undefined&&(_0x417719[_0x1d7589(0x18b)]=_0x1dc61f['str'](_0x1d7589(0x16e)));if(Object[_0x1d7589(0x15b)](_0x417719)[_0x1d7589(0x175)]===0x0)throw CliErrors['validation'](_0x1d7589(0x183));return _0x417719;}function parseExecParams(_0x583f9c){const _0x267ab4=a47_0x5add52,_0x2d54fa=parseJsonParams(_0x583f9c)??{};if(Array[_0x267ab4(0x15e)](_0x2d54fa))throw CliErrors[_0x267ab4(0x180)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x2d54fa;}function a47_0x541a(_0x4507dc,_0x3589ed){_0x4507dc=_0x4507dc-0x157;const _0x2f6aa4=a47_0x2f6a();let _0x541aed=_0x2f6aa4[_0x4507dc];return _0x541aed;}const personalBffList={'service':a47_0x5add52(0x164),'command':a47_0x5add52(0x195),'description':a47_0x5add52(0x176),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x50c323){const _0xbd164b=a47_0x5add52,_0x426725=await listPersonalBffs(_0x50c323[_0xbd164b(0x15f)]);return{'ok':!![],'data':{'total':_0x426725[_0xbd164b(0x175)],'items':_0x50c323[_0xbd164b(0x173)](_0xbd164b(0x17f))?_0x426725:_0x426725[_0xbd164b(0x16a)](summarizeBff)}};}},personalBffDetail={'service':a47_0x5add52(0x164),'command':a47_0x5add52(0x16f),'description':a47_0x5add52(0x162),'risk':'read','flags':[{...ID_FLAG,'description':a47_0x5add52(0x178)}],async 'execute'(_0x6c5b77){const _0x5eb7f9=a47_0x5add52,_0xd4f15a=await getPersonalBff(_0x6c5b77[_0x5eb7f9(0x184)]('id'),_0x6c5b77[_0x5eb7f9(0x15f)]);return{'ok':!![],'data':detailBff(_0xd4f15a)};}},personalBffCreate={'service':a47_0x5add52(0x164),'command':'create','description':'Create\x20a\x20Personal\x20Backend\x20Function\x20from\x20a\x20local\x20script\x20file','risk':a47_0x5add52(0x196),'confirmationDescription':'Saves\x20the\x20local\x20script\x20as\x20a\x20Personal\x20Backend\x20Function.\x20The\x20script\x20can\x20then\x20be\x20called\x20in\x20the\x20current\x20app.','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3a6127){const _0x47ffc3=a47_0x5add52,_0xdbc025=buildCreateInput(_0x3a6127),_0x42c0e7=await createPersonalBff(_0x3a6127[_0x47ffc3(0x15f)],_0xdbc025);return{'ok':!![],'data':detailBff(_0x42c0e7),'message':_0x47ffc3(0x168)+_0x42c0e7['id']+(_0x42c0e7[_0x47ffc3(0x157)]?'\x20('+_0x42c0e7[_0x47ffc3(0x157)]+')':'')};},async 'dryRun'(_0x1ac040){const _0x2d5996=a47_0x5add52,_0x29c537=buildCreateInput(_0x1ac040);return dryRun(_0x2d5996(0x16c),_0x2d5996(0x18f))[_0x2d5996(0x181)]({'appCode':_0x1ac040[_0x2d5996(0x15f)],..._0x29c537})['description']('Preview:\x20create\x20Personal\x20Backend\x20Function\x20'+_0x29c537[_0x2d5996(0x157)])['build']();}},personalBffUpdate={'service':a47_0x5add52(0x164),'command':'update','description':a47_0x5add52(0x18c),'risk':a47_0x5add52(0x196),'confirmationDescription':a47_0x5add52(0x188),'flags':[{...ID_FLAG,'description':a47_0x5add52(0x178)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x6e033e){const _0x4849db=a47_0x5add52,_0x12fef0=_0x6e033e[_0x4849db(0x184)]('id'),_0x23e5fa=buildUpdateInput(_0x6e033e),_0x21da04=await updatePersonalBff(_0x12fef0,_0x6e033e['appCode'],_0x23e5fa);return{'ok':!![],'data':detailBff(_0x21da04),'message':_0x4849db(0x17c)+_0x21da04['id']+(_0x21da04[_0x4849db(0x157)]?'\x20('+_0x21da04[_0x4849db(0x157)]+')':'')};},async 'dryRun'(_0x1f9ee0){const _0x25039e=a47_0x5add52,_0x57122c=_0x1f9ee0[_0x25039e(0x184)]('id'),_0x159de7=buildUpdateInput(_0x1f9ee0);return dryRun(_0x25039e(0x16c),'/client/runtime-bff/personal/'+_0x57122c+_0x25039e(0x189))[_0x25039e(0x181)]({'appCode':_0x1f9ee0[_0x25039e(0x15f)],..._0x159de7})[_0x25039e(0x16d)]('Preview:\x20update\x20Personal\x20Backend\x20Function\x20'+_0x57122c)[_0x25039e(0x15d)]();}},personalBffExec={'service':a47_0x5add52(0x164),'command':a47_0x5add52(0x163),'description':'Execute\x20a\x20Personal\x20Backend\x20Function\x20by\x20ID,\x20optionally\x20with\x20JSON\x20params','risk':'write','confirmationDescription':'Runs\x20the\x20Personal\x20Backend\x20Function\x20script.\x20The\x20script\x20may\x20read\x20or\x20change\x20business\x20data,\x20or\x20call\x20external\x20services.','flags':[{...ID_FLAG,'description':a47_0x5add52(0x178)},{...PARAMS_FLAG,'description':a47_0x5add52(0x18a)}],async 'validate'(_0x194e07){const _0x470cc4=a47_0x5add52;parseExecParams(_0x194e07[_0x470cc4(0x17d)](_0x470cc4(0x167)));},async 'execute'(_0x4fa007){const _0x2a9c3b=a47_0x5add52,_0xd0d431=_0x4fa007['num']('id'),_0xae1e23=parseExecParams(_0x4fa007[_0x2a9c3b(0x17d)](_0x2a9c3b(0x167))),_0x4b4858=await executePersonalBff(_0xd0d431,_0x4fa007[_0x2a9c3b(0x15f)],_0xae1e23);return{'ok':!![],'data':{'result':_0x4b4858},'message':_0x2a9c3b(0x194)+_0xd0d431};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a47_0x149c2d=a47_0x4701;(function(_0x12536b,_0x5c8fcd){const _0x24e29e=a47_0x4701,_0x3abd56=_0x12536b();while(!![]){try{const _0x112b9d=-parseInt(_0x24e29e(0x206))/0x1*(parseInt(_0x24e29e(0x1f5))/0x2)+-parseInt(_0x24e29e(0x1fe))/0x3*(parseInt(_0x24e29e(0x1d4))/0x4)+-parseInt(_0x24e29e(0x1d0))/0x5+-parseInt(_0x24e29e(0x1dc))/0x6*(-parseInt(_0x24e29e(0x20f))/0x7)+parseInt(_0x24e29e(0x1e8))/0x8+parseInt(_0x24e29e(0x1f2))/0x9+parseInt(_0x24e29e(0x1cc))/0xa*(parseInt(_0x24e29e(0x201))/0xb);if(_0x112b9d===_0x5c8fcd)break;else _0x3abd56['push'](_0x3abd56['shift']());}catch(_0xd87b31){_0x3abd56['push'](_0x3abd56['shift']());}}}(a47_0x1d78,0xd49cb));import{existsSync,readFileSync,statSync}from'node:fs';function a47_0x1d78(){const _0x1b7abf=['13047536AoaXzT','build','Update\x20a\x20Personal\x20Backend\x20Function\x20by\x20ID','Updates\x20the\x20Personal\x20Backend\x20Function\x20script\x20or\x20metadata.\x20Later\x20calls\x20use\x20the\x20new\x20version.','Show\x20one\x20Personal\x20Backend\x20Function\x20by\x20id','Preview:\x20update\x20Personal\x20Backend\x20Function\x20','file','scriptContent','utf8','params','9432027buXyWU','/client/runtime-bff/personal/','gmtCreate','340LESSXI','Personal\x20Backend\x20Function\x20script\x20ID','body','gmtModified','updateTime','bool','validation','createTime','createUserId','6VAfVLf','Optional\x20source\x20RuntimeAgent\x20session\x20id','scriptType','704tDPdVq','str','name','JSON\x20object\x20passed\x20to\x20the\x20Personal\x20Backend\x20Function\x20execution','/client/runtime-bff/personal/create','409QDQXeV','POST','Updated\x20Personal\x20Backend\x20Function\x20','Saves\x20the\x20local\x20script\x20as\x20a\x20Personal\x20Backend\x20Function.\x20The\x20script\x20can\x20then\x20be\x20called\x20in\x20the\x20current\x20app.','write','list','Personal\x20Backend\x20Function\x20description','source-session-id','Create\x20a\x20Personal\x20Backend\x20Function\x20from\x20a\x20local\x20script\x20file','1323hfGdil','Preview:\x20create\x20Personal\x20Backend\x20Function\x20','verbose','File\x20not\x20found:\x20','List\x20current\x20user\x27s\x20Personal\x20Backend\x20Function\x20scripts\x20for\x20the\x20current\x20app','functionName','20940ofRxyj','flag','Executed\x20Personal\x20Backend\x20Function\x20','exec','5273475TrzQAe','config','description','length','2178940JVKRCr','personal-bff','Personal\x20Backend\x20Function\x20script\x20file\x20is\x20blank.','string','File\x20is\x20not\x20a\x20regular\x20file:\x20','/update','Runs\x20the\x20Personal\x20Backend\x20Function\x20script.\x20The\x20script\x20may\x20read\x20or\x20change\x20business\x20data,\x20or\x20call\x20external\x20services.','File\x20path\x20is\x20required.','8622yHGRjY','read','update','create','appCode','sourceSessionId','version','num','trim','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','--params\x20must\x20be\x20a\x20JSON\x20object.','test'];a47_0x1d78=function(){return _0x1b7abf;};return a47_0x1d78();}function a47_0x4701(_0x4abe60,_0x3e3973){_0x4abe60=_0x4abe60-0x1c9;const _0x1d78e2=a47_0x1d78();let _0x47018e=_0x1d78e2[_0x4abe60];return _0x47018e;}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':a47_0x149c2d(0x1ee),'type':a47_0x149c2d(0x1d7),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a47_0x149c2d(0x203),'type':'string','required':!![],'description':'Personal\x20Backend\x20Function\x20name,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':'description','type':a47_0x149c2d(0x1d7),'description':a47_0x149c2d(0x20c)},SOURCE_SESSION_FLAG={'name':a47_0x149c2d(0x20d),'type':'string','description':a47_0x149c2d(0x1ff)};function normalizeFunctionName(_0x30a3da){const _0x596eb7=a47_0x149c2d,_0x212799=String(_0x30a3da||'')[_0x596eb7(0x1e4)]();if(!_0x212799||!FUNCTION_NAME_PATTERN[_0x596eb7(0x1e7)](_0x212799))throw CliErrors[_0x596eb7(0x1fb)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x212799;}function readScriptFile(_0x586c66){const _0x49b251=a47_0x149c2d;if(!_0x586c66)throw CliErrors['validation'](_0x49b251(0x1db));if(!existsSync(_0x586c66))throw CliErrors['validation'](_0x49b251(0x1c9)+_0x586c66);if(!statSync(_0x586c66)['isFile']())throw CliErrors['validation'](_0x49b251(0x1d8)+_0x586c66);const _0x3536d8=readFileSync(_0x586c66,_0x49b251(0x1f0));if(!_0x3536d8[_0x49b251(0x1e4)]())throw CliErrors[_0x49b251(0x1fb)](_0x49b251(0x1d6));return _0x3536d8;}function optionalTrimmed(_0x396a42){const _0x57c0e4=a47_0x149c2d,_0x49300b=String(_0x396a42||'')[_0x57c0e4(0x1e4)]();return _0x49300b||undefined;}function summarizeBff(_0x1b4a4f){const _0x26b056=a47_0x149c2d;return{'id':_0x1b4a4f['id'],'appCode':_0x1b4a4f[_0x26b056(0x1e0)],'functionName':_0x1b4a4f['functionName'],'description':_0x1b4a4f[_0x26b056(0x1d2)],'scriptType':_0x1b4a4f[_0x26b056(0x200)],'version':_0x1b4a4f[_0x26b056(0x1e2)],'gmtModified':_0x1b4a4f[_0x26b056(0x1f8)],'updateTime':_0x1b4a4f['updateTime']};}function detailBff(_0x501eba){const _0x47cb63=a47_0x149c2d;return{'id':_0x501eba['id'],'appCode':_0x501eba[_0x47cb63(0x1e0)],'functionName':_0x501eba['functionName'],'description':_0x501eba['description'],'scriptType':_0x501eba['scriptType'],'scriptContent':_0x501eba[_0x47cb63(0x1ef)]??'','config':_0x501eba[_0x47cb63(0x1d1)],'version':_0x501eba[_0x47cb63(0x1e2)],'createUserId':_0x501eba[_0x47cb63(0x1fd)],'gmtCreate':_0x501eba[_0x47cb63(0x1f4)],'gmtModified':_0x501eba[_0x47cb63(0x1f8)],'createTime':_0x501eba[_0x47cb63(0x1fc)],'updateTime':_0x501eba[_0x47cb63(0x1f9)]};}function buildCreateInput(_0x44d6db){const _0x451556=a47_0x149c2d;return{'functionName':normalizeFunctionName(_0x44d6db[_0x451556(0x202)](_0x451556(0x203))),...optionalTrimmed(_0x44d6db[_0x451556(0x202)](_0x451556(0x1d2)))?{'description':optionalTrimmed(_0x44d6db['str'](_0x451556(0x1d2)))}:{},'scriptContent':readScriptFile(_0x44d6db[_0x451556(0x202)](_0x451556(0x1ee))),...optionalTrimmed(_0x44d6db['str'](_0x451556(0x20d)))?{'sourceSessionId':optionalTrimmed(_0x44d6db['str']('source-session-id'))}:{}};}function buildUpdateInput(_0x25ab4b){const _0x539f99=a47_0x149c2d,_0x54a590={};optionalTrimmed(_0x25ab4b['str'](_0x539f99(0x203)))&&(_0x54a590[_0x539f99(0x1cb)]=normalizeFunctionName(_0x25ab4b[_0x539f99(0x202)](_0x539f99(0x203))));_0x25ab4b[_0x539f99(0x1cd)](_0x539f99(0x1d2))!==undefined&&(_0x54a590[_0x539f99(0x1d2)]=_0x25ab4b['str'](_0x539f99(0x1d2)));optionalTrimmed(_0x25ab4b[_0x539f99(0x202)]('file'))&&(_0x54a590[_0x539f99(0x1ef)]=readScriptFile(_0x25ab4b['str'](_0x539f99(0x1ee))));_0x25ab4b[_0x539f99(0x1cd)]('source-session-id')!==undefined&&(_0x54a590[_0x539f99(0x1e1)]=_0x25ab4b[_0x539f99(0x202)](_0x539f99(0x20d)));if(Object['keys'](_0x54a590)[_0x539f99(0x1d3)]===0x0)throw CliErrors[_0x539f99(0x1fb)](_0x539f99(0x1e5));return _0x54a590;}function parseExecParams(_0x4aee49){const _0x29e312=a47_0x149c2d,_0x178d3d=parseJsonParams(_0x4aee49)??{};if(Array['isArray'](_0x178d3d))throw CliErrors[_0x29e312(0x1fb)](_0x29e312(0x1e6));return _0x178d3d;}const personalBffList={'service':'personal-bff','command':a47_0x149c2d(0x20b),'description':a47_0x149c2d(0x1ca),'risk':a47_0x149c2d(0x1dd),'flags':[VERBOSE_FLAG],async 'execute'(_0x212161){const _0x4471a5=a47_0x149c2d,_0x5c6353=await listPersonalBffs(_0x212161[_0x4471a5(0x1e0)]);return{'ok':!![],'data':{'total':_0x5c6353['length'],'items':_0x212161[_0x4471a5(0x1fa)](_0x4471a5(0x211))?_0x5c6353:_0x5c6353['map'](summarizeBff)}};}},personalBffDetail={'service':a47_0x149c2d(0x1d5),'command':'detail','description':a47_0x149c2d(0x1ec),'risk':a47_0x149c2d(0x1dd),'flags':[{...ID_FLAG,'description':a47_0x149c2d(0x1f6)}],async 'execute'(_0x145894){const _0xe13391=a47_0x149c2d,_0x280ca9=await getPersonalBff(_0x145894[_0xe13391(0x1e3)]('id'),_0x145894[_0xe13391(0x1e0)]);return{'ok':!![],'data':detailBff(_0x280ca9)};}},personalBffCreate={'service':a47_0x149c2d(0x1d5),'command':a47_0x149c2d(0x1df),'description':a47_0x149c2d(0x20e),'risk':'write','confirmationDescription':a47_0x149c2d(0x209),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x12bb45){const _0x32eea0=a47_0x149c2d,_0x355e60=buildCreateInput(_0x12bb45),_0x59a94f=await createPersonalBff(_0x12bb45[_0x32eea0(0x1e0)],_0x355e60);return{'ok':!![],'data':detailBff(_0x59a94f),'message':'Created\x20Personal\x20Backend\x20Function\x20'+_0x59a94f['id']+(_0x59a94f[_0x32eea0(0x1cb)]?'\x20('+_0x59a94f['functionName']+')':'')};},async 'dryRun'(_0x51b064){const _0xfb83c3=a47_0x149c2d,_0x298bca=buildCreateInput(_0x51b064);return dryRun(_0xfb83c3(0x207),_0xfb83c3(0x205))[_0xfb83c3(0x1f7)]({'appCode':_0x51b064[_0xfb83c3(0x1e0)],..._0x298bca})[_0xfb83c3(0x1d2)](_0xfb83c3(0x210)+_0x298bca[_0xfb83c3(0x1cb)])[_0xfb83c3(0x1e9)]();}},personalBffUpdate={'service':a47_0x149c2d(0x1d5),'command':a47_0x149c2d(0x1de),'description':a47_0x149c2d(0x1ea),'risk':'write','confirmationDescription':a47_0x149c2d(0x1eb),'flags':[{...ID_FLAG,'description':'Personal\x20Backend\x20Function\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x1837e9){const _0x571ba3=a47_0x149c2d,_0x123683=_0x1837e9[_0x571ba3(0x1e3)]('id'),_0xf0556b=buildUpdateInput(_0x1837e9),_0x2f21aa=await updatePersonalBff(_0x123683,_0x1837e9[_0x571ba3(0x1e0)],_0xf0556b);return{'ok':!![],'data':detailBff(_0x2f21aa),'message':_0x571ba3(0x208)+_0x2f21aa['id']+(_0x2f21aa[_0x571ba3(0x1cb)]?'\x20('+_0x2f21aa[_0x571ba3(0x1cb)]+')':'')};},async 'dryRun'(_0x4f590a){const _0x5d1108=a47_0x149c2d,_0x4ff4db=_0x4f590a['num']('id'),_0x3fd812=buildUpdateInput(_0x4f590a);return dryRun(_0x5d1108(0x207),_0x5d1108(0x1f3)+_0x4ff4db+_0x5d1108(0x1d9))[_0x5d1108(0x1f7)]({'appCode':_0x4f590a[_0x5d1108(0x1e0)],..._0x3fd812})['description'](_0x5d1108(0x1ed)+_0x4ff4db)[_0x5d1108(0x1e9)]();}},personalBffExec={'service':a47_0x149c2d(0x1d5),'command':a47_0x149c2d(0x1cf),'description':'Execute\x20a\x20Personal\x20Backend\x20Function\x20by\x20ID,\x20optionally\x20with\x20JSON\x20params','risk':a47_0x149c2d(0x20a),'confirmationDescription':a47_0x149c2d(0x1da),'flags':[{...ID_FLAG,'description':a47_0x149c2d(0x1f6)},{...PARAMS_FLAG,'description':a47_0x149c2d(0x204)}],async 'validate'(_0x2a9393){const _0x27b1f1=a47_0x149c2d;parseExecParams(_0x2a9393[_0x27b1f1(0x202)](_0x27b1f1(0x1f1)));},async 'execute'(_0x512b77){const _0x4885aa=a47_0x149c2d,_0x7fe06d=_0x512b77[_0x4885aa(0x1e3)]('id'),_0x1aa52f=parseExecParams(_0x512b77[_0x4885aa(0x202)](_0x4885aa(0x1f1))),_0x13f3ce=await executePersonalBff(_0x7fe06d,_0x512b77[_0x4885aa(0x1e0)],_0x1aa52f);return{'ok':!![],'data':{'result':_0x13f3ce},'message':_0x4885aa(0x1ce)+_0x7fe06d};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x1c4fe7=a48_0x20d7;(function(_0x41bdde,_0x11e85a){const _0x27b664=a48_0x20d7,_0x363825=_0x41bdde();while(!![]){try{const _0x1fcbe9=-parseInt(_0x27b664(0x195))/0x1+-parseInt(_0x27b664(0x18a))/0x2*(parseInt(_0x27b664(0x174))/0x3)+-parseInt(_0x27b664(0x178))/0x4*(parseInt(_0x27b664(0x188))/0x5)+-parseInt(_0x27b664(0x179))/0x6*(parseInt(_0x27b664(0x176))/0x7)+-parseInt(_0x27b664(0x167))/0x8*(-parseInt(_0x27b664(0x158))/0x9)+parseInt(_0x27b664(0x182))/0xa*(parseInt(_0x27b664(0x15e))/0xb)+parseInt(_0x27b664(0x191))/0xc;if(_0x1fcbe9===_0x11e85a)break;else _0x363825['push'](_0x363825['shift']());}catch(_0x2d3ce9){_0x363825['push'](_0x363825['shift']());}}}(a48_0xae35,0x9e6e8));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';export const serviceRegistry=[];function a48_0x20d7(_0x29f58d,_0x4dcd1c){_0x29f58d=_0x29f58d-0x157;const _0xae35b4=a48_0xae35();let _0x20d732=_0xae35b4[_0x29f58d];return _0x20d732;}const serviceByName=new Map();export const definitions=new Map();function a48_0xae35(){const _0x44c9f1=['471270QBFMED','User\x20Accounts','logs\x20clear','write','list','auth\x20init','523640xfGhAM','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','2Adrmsc','Configuration','get','Instant\x20API','read','install','Self\x20Update','24042372NBxtHT','Schema','Runtime\x20Permissions','Skills','1013112QKNbyF','Knowledge\x20Base','app\x20use','auth','description','app','Notification\x20Configs','9wESIgd','File','App\x20Management','OCR','SQL\x20Queries','\x20\x20[high-risk-write]','198AaQwhH','Artifacts','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','set','`lovrabet\x20auth\x20init`\x20has\x20been\x20removed.','clear','CLI\x20Built-in\x20Skill','defaultCommand','logs','3410192YcwKXh','app\x20init','command','from','Runtime\x20Roles','run','Service\x20Tree','use','Logs','push','Agent\x20Schedules','\x20\x20[write]','service','961875pREEDO','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','8334830fzpjjG','API\x20Documentation','4GJPEJX','6gXcked','Authentication','Workspace','Diagnostics','Backend\x20Function\x20Scripts','show','risk','Runtime\x20App\x20Config','init'];a48_0xae35=function(){return _0x44c9f1;};return a48_0xae35();}export const serviceGroups=new Map();function registerDefinitions(_0x4d00a5){const _0x5765bd=a48_0x20d7;for(const _0x56505b of _0x4d00a5){definitions['set'](_0x56505b[_0x5765bd(0x173)]+':'+_0x56505b['command'],_0x56505b);let _0x13e57f=serviceGroups[_0x5765bd(0x18c)](_0x56505b[_0x5765bd(0x173)]);!_0x13e57f&&(_0x13e57f=[],serviceGroups[_0x5765bd(0x161)](_0x56505b['service'],_0x13e57f)),_0x13e57f[_0x5765bd(0x170)](_0x56505b);}}function registerService(_0x3e83cf,_0x5bae12,_0x2f2685){const _0x5e68b7=a48_0x20d7;registerDefinitions(_0x5bae12);const _0x57b5b1=_0x22b580=>_0x22b580===_0x5e68b7(0x18e)?'':_0x22b580===_0x5e68b7(0x185)?_0x5e68b7(0x172):_0x5e68b7(0x15d),_0x435501={'service':_0x5bae12[0x0]['service'],'label':_0x3e83cf,'commands':_0x5bae12['map'](_0x1553bf=>({'command':_0x1553bf[_0x5e68b7(0x169)],'description':_0x1553bf[_0x5e68b7(0x199)],'tag':_0x57b5b1(_0x1553bf[_0x5e68b7(0x17f)])})),'defaultCommand':_0x2f2685?.[_0x5e68b7(0x165)]??(_0x2f2685?.['isSingleCommand']?_0x5bae12[0x0]['command']:undefined),'isSingleCommand':_0x2f2685?.['isSingleCommand']};serviceRegistry['push'](_0x435501),serviceByName['set'](_0x435501['service'],_0x435501);}registerService(a48_0x1c4fe7(0x17a),authDefinitions,{'defaultCommand':'login'}),registerService(a48_0x1c4fe7(0x183),userAccountDefinitions),registerService(a48_0x1c4fe7(0x15a),appDefinitions,{'defaultCommand':a48_0x1c4fe7(0x186)}),registerService(a48_0x1c4fe7(0x17b),workspaceDefinitions),registerService(a48_0x1c4fe7(0x180),appConfigDefinitions),registerService(a48_0x1c4fe7(0x18b),configDefinitions,{'defaultCommand':a48_0x1c4fe7(0x186)}),registerService(a48_0x1c4fe7(0x16b),roleDefinitions,{'defaultCommand':'list'}),registerService(a48_0x1c4fe7(0x193),permitDefinitions),registerService(a48_0x1c4fe7(0x177),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a48_0x1c4fe7(0x18d),dataDefinitions),registerService(a48_0x1c4fe7(0x15c),sqlDefinitions),registerService(a48_0x1c4fe7(0x17d),bffDefinitions),registerService('Personal\x20Backend\x20Function',personalBffDefinitions),registerService(a48_0x1c4fe7(0x15f),artifactDefinitions),registerService(a48_0x1c4fe7(0x159),fileDefinitions),registerService(a48_0x1c4fe7(0x15b),ocrDefinitions),registerService(a48_0x1c4fe7(0x196),kbDefinitions),registerService(a48_0x1c4fe7(0x157),notificationDefinitions,{'defaultCommand':'config-list'}),registerService(a48_0x1c4fe7(0x171),scheduleDefinitions,{'defaultCommand':'list'}),registerService(a48_0x1c4fe7(0x16d),serviceDefinitions,{'defaultCommand':a48_0x1c4fe7(0x186)}),registerService(a48_0x1c4fe7(0x194),skillDefinitions,{'defaultCommand':a48_0x1c4fe7(0x18f)}),registerService(a48_0x1c4fe7(0x164),cliSkillDefinitions,{'defaultCommand':a48_0x1c4fe7(0x18f)}),registerService(a48_0x1c4fe7(0x190),[updateDefinition],{'defaultCommand':a48_0x1c4fe7(0x16c),'isSingleCommand':!![]}),registerService(a48_0x1c4fe7(0x17c),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a48_0x1c4fe7(0x192),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a48_0x1c4fe7(0x16f),logsDefinitions,{'defaultCommand':a48_0x1c4fe7(0x17e)});export function findDefinition(_0x49daef,_0x3478ac){return definitions['get'](_0x49daef+':'+_0x3478ac);}export function resolveRemovedCommand(_0x482b70,_0x129191){const _0x13e886=a48_0x1c4fe7;if(_0x482b70===_0x13e886(0x198)&&_0x129191==='init')return{'command':_0x13e886(0x187),'message':_0x13e886(0x162),'hint':'Use\x20`lovrabet\x20config\x20init`\x20for\x20node\x20configuration,\x20then\x20`lovrabet\x20auth\x20login`\x20for\x20AccessKey\x20authentication.'};if(_0x482b70===_0x13e886(0x19a)&&_0x129191===_0x13e886(0x181))return{'command':_0x13e886(0x168),'message':_0x13e886(0x189),'hint':_0x13e886(0x160)};if(_0x482b70===_0x13e886(0x19a)&&_0x129191===_0x13e886(0x16e))return{'command':_0x13e886(0x197),'message':'`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','hint':'Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.'};if(_0x482b70===_0x13e886(0x166)&&_0x129191===_0x13e886(0x163))return{'command':_0x13e886(0x184),'message':_0x13e886(0x175),'hint':'Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.'};return undefined;}export function isKnownService(_0x112143){return serviceByName['has'](_0x112143);}export function getServiceEntry(_0x1a7ae4){const _0x2c776f=a48_0x1c4fe7;return serviceByName[_0x2c776f(0x18c)](_0x1a7ae4);}export function getAllDefinitions(){const _0x331b14=a48_0x1c4fe7;return Array[_0x331b14(0x16a)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x366268=a49_0x9861;(function(_0x40c95a,_0x376508){const _0x5988d7=a49_0x9861,_0x27fdc8=_0x40c95a();while(!![]){try{const _0x5aed8e=parseInt(_0x5988d7(0x1e2))/0x1+-parseInt(_0x5988d7(0x1ee))/0x2+-parseInt(_0x5988d7(0x1e7))/0x3*(-parseInt(_0x5988d7(0x1f0))/0x4)+parseInt(_0x5988d7(0x1e1))/0x5*(-parseInt(_0x5988d7(0x1de))/0x6)+parseInt(_0x5988d7(0x1ef))/0x7*(parseInt(_0x5988d7(0x1e5))/0x8)+parseInt(_0x5988d7(0x1df))/0x9+-parseInt(_0x5988d7(0x1da))/0xa*(parseInt(_0x5988d7(0x1db))/0xb);if(_0x5aed8e===_0x376508)break;else _0x27fdc8['push'](_0x27fdc8['shift']());}catch(_0x5b5d41){_0x27fdc8['push'](_0x27fdc8['shift']());}}}(a49_0x3bb4,0x9f6e6));import{createRuntimeAppRole}from'../../core/api-client.js';function a49_0x3bb4(){const _0x2c308a=['13050RAqFGr','5481387CjglfK','trim','955jGCDVL','1109969qlGBeF','high-risk-write','validation','8djROlv','description','13686kGWNif','name','Optional\x20role\x20remark','/client/permit/role/create','str','POST','string','1610598HGclQF','8759786WSqmSY','392lSBocy','build','Create\x20a\x20runtime\x20CUSTOM\x20role','Role\x20name','188260wczqEP','902LMRZqv','create','remark'];a49_0x3bb4=function(){return _0x2c308a;};return a49_0x3bb4();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{projectRuntimeRole,runtimeRoleWriteResult}from'../../commands/role/shared.js';function input(_0x11ec2c){const _0x415540=a49_0x9861,_0xa7056a=_0x11ec2c[_0x415540(0x1eb)](_0x415540(0x1e8))[_0x415540(0x1e0)]();if(!_0xa7056a)throw CliErrors[_0x415540(0x1e4)]('--name\x20must\x20not\x20be\x20blank.');const _0x1327b6=_0x11ec2c[_0x415540(0x1eb)](_0x415540(0x1dd))['trim']();return{'appCode':_0x11ec2c['appCode'],'roleName':_0xa7056a,..._0x1327b6?{'remark':_0x1327b6}:{}};}function a49_0x9861(_0x1e9171,_0x5185a5){_0x1e9171=_0x1e9171-0x1d9;const _0x3bb4d7=a49_0x3bb4();let _0x986167=_0x3bb4d7[_0x1e9171];return _0x986167;}export const roleCreate={'service':'role','command':a49_0x366268(0x1dc),'description':a49_0x366268(0x1f2),'risk':a49_0x366268(0x1e3),'confirmationDescription':'Creates\x20a\x20custom\x20role\x20in\x20the\x20current\x20runtime\x20app.\x20After\x20creation\x20it\x20can\x20be\x20used\x20for\x20member\x20and\x20resource\x20permissions.','flags':[{'name':'name','type':a49_0x366268(0x1ed),'required':!![],'description':a49_0x366268(0x1d9)},{'name':a49_0x366268(0x1dd),'type':'string','description':a49_0x366268(0x1e9)}],async 'validate'(_0x241c27){input(_0x241c27);},async 'dryRun'(_0x1f2430){const _0x439134=a49_0x366268;return dryRun(_0x439134(0x1ec),_0x439134(0x1ea))['body']({'roleType':'CUSTOM',...input(_0x1f2430)})[_0x439134(0x1e6)]('Preview:\x20create\x20a\x20runtime\x20CUSTOM\x20role')[_0x439134(0x1f1)]();},async 'execute'(_0x668dea){const _0xf40a47=a49_0x366268,_0x2c2787=await createRuntimeAppRole(input(_0x668dea));return{'ok':!![],'data':runtimeRoleWriteResult(_0xf40a47(0x1dc),{'roleId':_0x2c2787['id']},null,projectRuntimeRole(_0x2c2787),{'method':_0xf40a47(0x1ec),'path':_0xf40a47(0x1ea)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a50_0xc4b3a8=a50_0x1dc2;(function(_0x3b8194,_0x1a4df8){const _0x54cf31=a50_0x1dc2,_0x42f966=_0x3b8194();while(!![]){try{const _0x1ec63b=-parseInt(_0x54cf31(0x1a3))/0x1+parseInt(_0x54cf31(0x1ae))/0x2*(parseInt(_0x54cf31(0x1a7))/0x3)+-parseInt(_0x54cf31(0x1a6))/0x4*(parseInt(_0x54cf31(0x1a8))/0x5)+-parseInt(_0x54cf31(0x1af))/0x6*(parseInt(_0x54cf31(0x1b1))/0x7)+-parseInt(_0x54cf31(0x1b3))/0x8*(-parseInt(_0x54cf31(0x1a5))/0x9)+parseInt(_0x54cf31(0x1a9))/0xa*(-parseInt(_0x54cf31(0x1b2))/0xb)+parseInt(_0x54cf31(0x1b9))/0xc*(parseInt(_0x54cf31(0x1ad))/0xd);if(_0x1ec63b===_0x1a4df8)break;else _0x42f966['push'](_0x42f966['shift']());}catch(_0x545d54){_0x42f966['push'](_0x42f966['shift']());}}}(a50_0x14d5,0x594b1));function a50_0x14d5(){const _0x3a7825=['110HBGeYI','role','body','delete','12389RZHjyj','2TLnavC','6areYDo','appCode','984977rRTETH','553663tjfbLE','1240PIMYgr','num','Preview:\x20delete\x20a\x20runtime\x20CUSTOM\x20role','/client/permit/role/delete','description','Deletes\x20the\x20custom\x20role\x20in\x20the\x20current\x20runtime\x20app.\x20Membership\x20and\x20permission\x20config\x20for\x20that\x20role\x20may\x20become\x20invalid.','24900LcAyQI','high-risk-write','654645ecelCG','POST','8595AbvSop','4MPionQ','523293PgWFHP','2925835jverQY'];a50_0x14d5=function(){return _0x3a7825;};return a50_0x14d5();}import{deleteRuntimeAppRole}from'../../core/api-client.js';function a50_0x1dc2(_0x3f8473,_0x27954f){_0x3f8473=_0x3f8473-0x1a3;const _0x14d546=a50_0x14d5();let _0x1dc27e=_0x14d546[_0x3f8473];return _0x1dc27e;}import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';async function prepare(_0x51e1d4){const _0x593bd9=a50_0x1dc2,_0xb8c1bc=await getRuntimeRoleById(_0x51e1d4[_0x593bd9(0x1b0)],_0x51e1d4[_0x593bd9(0x1b4)]('id'));return assertCustomRuntimeRole(_0xb8c1bc,_0x593bd9(0x1ac)),_0xb8c1bc;}export const roleDelete={'service':a50_0xc4b3a8(0x1aa),'command':'delete','description':'Delete\x20a\x20runtime\x20CUSTOM\x20role','risk':a50_0xc4b3a8(0x1ba),'confirmationDescription':a50_0xc4b3a8(0x1b8),'flags':[ROLE_ID_FLAG],async 'dryRun'(_0x4228c9){const _0x1cf6b2=a50_0xc4b3a8,_0x570ead=await prepare(_0x4228c9);return dryRun(_0x1cf6b2(0x1a4),'/client/permit/role/delete')[_0x1cf6b2(0x1ab)]({'id':_0x570ead['id']})[_0x1cf6b2(0x1b7)](_0x1cf6b2(0x1b5))['build']();},async 'execute'(_0x1c949d){const _0x3330d8=a50_0xc4b3a8,_0x106288=await prepare(_0x1c949d);return await deleteRuntimeAppRole(_0x106288['id']),{'ok':!![],'data':runtimeRoleWriteResult(_0x3330d8(0x1ac),{'roleId':_0x106288['id']},projectRuntimeRole(_0x106288),null,{'method':'POST','path':_0x3330d8(0x1b6)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x6aa1ef=a51_0x2f93;(function(_0x5ed96f,_0x111012){const _0x4d0a01=a51_0x2f93,_0x211459=_0x5ed96f();while(!![]){try{const _0x3ec1d2=parseInt(_0x4d0a01(0x130))/0x1*(parseInt(_0x4d0a01(0x12a))/0x2)+parseInt(_0x4d0a01(0x129))/0x3+parseInt(_0x4d0a01(0x12f))/0x4+parseInt(_0x4d0a01(0x12d))/0x5+-parseInt(_0x4d0a01(0x132))/0x6+-parseInt(_0x4d0a01(0x12c))/0x7+-parseInt(_0x4d0a01(0x126))/0x8*(parseInt(_0x4d0a01(0x131))/0x9);if(_0x3ec1d2===_0x111012)break;else _0x211459['push'](_0x211459['shift']());}catch(_0x4928f9){_0x211459['push'](_0x211459['shift']());}}}(a51_0x2279,0x1db06));function a51_0x2f93(_0x2b70e5,_0x59003c){_0x2b70e5=_0x2b70e5-0x123;const _0x227960=a51_0x2279();let _0x2f9383=_0x227960[_0x2b70e5];return _0x2f9383;}import{getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a51_0x2279(){const _0x45e8d2=['481994ZMXzfV','num','194691FAgNNa','867805kTcVlM','Show\x20one\x20runtime\x20role\x20by\x20ID','180540GXBcbD','1IHoByO','138078gOyzwL','177126QTEGty','appCode','detail','role','216zwUsra','runtime','read','400443kUuedK'];a51_0x2279=function(){return _0x45e8d2;};return a51_0x2279();}export const roleDetail={'service':a51_0x6aa1ef(0x125),'command':a51_0x6aa1ef(0x124),'description':a51_0x6aa1ef(0x12e),'risk':a51_0x6aa1ef(0x128),'flags':[ROLE_ID_FLAG],async 'execute'(_0x1b8b28){const _0x3a619b=a51_0x6aa1ef,_0x52c263=await getRuntimeRoleById(_0x1b8b28[_0x3a619b(0x123)],_0x1b8b28[_0x3a619b(0x12b)]('id'));return{'ok':!![],'data':{'scope':_0x3a619b(0x127),'role':projectRuntimeRole(_0x52c263)}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30a233,_0x384833){const _0x157bd8=a52_0x59dd,_0x14df27=_0x30a233();while(!![]){try{const _0x2a581b=parseInt(_0x157bd8(0x195))/0x1+-parseInt(_0x157bd8(0x18e))/0x2*(parseInt(_0x157bd8(0x18f))/0x3)+parseInt(_0x157bd8(0x192))/0x4*(-parseInt(_0x157bd8(0x193))/0x5)+-parseInt(_0x157bd8(0x18d))/0x6+-parseInt(_0x157bd8(0x191))/0x7*(parseInt(_0x157bd8(0x196))/0x8)+-parseInt(_0x157bd8(0x190))/0x9*(-parseInt(_0x157bd8(0x194))/0xa)+parseInt(_0x157bd8(0x197))/0xb;if(_0x2a581b===_0x384833)break;else _0x14df27['push'](_0x14df27['shift']());}catch(_0x15a6c3){_0x14df27['push'](_0x14df27['shift']());}}}(a52_0x3c64,0xb0da5));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';function a52_0x3c64(){const _0x3ea816=['115hqxcRc','124690CVuEbp','1178965odqDAM','24qHNnBk','32866779EyibFn','6659262mzLDFA','2JbQFfn','2321820BehAWy','738AbnUYh','3328997sXNiUT','200764pwMafW'];a52_0x3c64=function(){return _0x3ea816;};return a52_0x3c64();}function a52_0x59dd(_0x95ad7a,_0x422baf){_0x95ad7a=_0x95ad7a-0x18d;const _0x3c64c2=a52_0x3c64();let _0x59ddb7=_0x3c64c2[_0x95ad7a];return _0x59ddb7;}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
|
+
function a53_0x2265(_0x5a783a,_0xee0d3f){_0x5a783a=_0x5a783a-0xbf;const _0x47ecb7=a53_0x47ec();let _0x2265bb=_0x47ecb7[_0x5a783a];return _0x2265bb;}function a53_0x47ec(){const _0x410f21=['1035vsnoYG','role','type','Fuzzy\x20role-name\x20filter','map','items','10qwgOHO','Invalid\x20runtime\x20role\x20type:\x20','validation','includes','1384683pfxsGF','isSafeInteger','55756349lMpdAz','9211305yBTAEb','appCode','3949413mRGtxv','paging','page','12820871XdBIow','2vpowzJ','--page\x20must\x20be\x20a\x20positive\x20integer.','name','number','pagesize','runtime','str','read','toUpperCase','78104cjwZxM','length','slice','6000756ByhAoG','trim','num','6dsISpm','string','filter'];a53_0x47ec=function(){return _0x410f21;};return a53_0x47ec();}const a53_0x59325e=a53_0x2265;(function(_0x388d5d,_0x57de62){const _0x848919=a53_0x2265,_0x59a3c8=_0x388d5d();while(!![]){try{const _0x84de7b=-parseInt(_0x848919(0xde))/0x1*(-parseInt(_0x848919(0xc2))/0x2)+parseInt(_0x848919(0xe3))/0x3+-parseInt(_0x848919(0xce))/0x4+parseInt(_0x848919(0xe1))/0x5+parseInt(_0x848919(0xd1))/0x6*(parseInt(_0x848919(0xc1))/0x7)+parseInt(_0x848919(0xcb))/0x8*(parseInt(_0x848919(0xd4))/0x9)+-parseInt(_0x848919(0xda))/0xa*(parseInt(_0x848919(0xe0))/0xb);if(_0x84de7b===_0x57de62)break;else _0x59a3c8['push'](_0x59a3c8['shift']());}catch(_0x1ba4dc){_0x59a3c8['push'](_0x59a3c8['shift']());}}}(a53_0x47ec,0xe2bfd));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':a53_0x59325e(0xd5),'command':'list','description':'List\x20runtime\x20roles\x20for\x20the\x20current\x20app','risk':a53_0x59325e(0xc9),'flags':[{'name':a53_0x59325e(0xd6),'type':a53_0x59325e(0xd2),'enum':RUNTIME_ROLE_TYPES,'description':'Runtime\x20role\x20type'},{'name':a53_0x59325e(0xc4),'type':a53_0x59325e(0xd2),'description':a53_0x59325e(0xd7)},{'name':a53_0x59325e(0xc0),'type':a53_0x59325e(0xc5),'default':0x1,'description':'Page\x20number'},{'name':a53_0x59325e(0xc6),'type':a53_0x59325e(0xc5),'default':0x64,'description':'Page\x20size\x20from\x201\x20to\x20100'}],async 'validate'(_0x1a775b){const _0x2b9db9=a53_0x59325e,_0x46b234=_0x1a775b[_0x2b9db9(0xc8)](_0x2b9db9(0xd6))[_0x2b9db9(0xca)]();if(_0x46b234&&!RUNTIME_ROLE_TYPES[_0x2b9db9(0xdd)](_0x46b234))throw CliErrors[_0x2b9db9(0xdc)](_0x2b9db9(0xdb)+_0x46b234+'.');const _0x4eb87d=_0x1a775b[_0x2b9db9(0xd0)](_0x2b9db9(0xc0),0x1),_0x2f7c76=_0x1a775b[_0x2b9db9(0xd0)](_0x2b9db9(0xc6),0x64);if(!Number['isSafeInteger'](_0x4eb87d)||_0x4eb87d<0x1)throw CliErrors[_0x2b9db9(0xdc)](_0x2b9db9(0xc3));if(!Number[_0x2b9db9(0xdf)](_0x2f7c76)||_0x2f7c76<0x1||_0x2f7c76>0x64)throw CliErrors[_0x2b9db9(0xdc)]('--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');},async 'execute'(_0x53e9eb){const _0x5d1534=a53_0x59325e,_0x24452e=_0x53e9eb[_0x5d1534(0xc8)](_0x5d1534(0xd6))[_0x5d1534(0xca)](),_0x24d499=_0x53e9eb['str'](_0x5d1534(0xc4))[_0x5d1534(0xcf)](),_0x82d840=_0x53e9eb[_0x5d1534(0xd0)]('page',0x1),_0x22259e=_0x53e9eb[_0x5d1534(0xd0)](_0x5d1534(0xc6),0x64);if(_0x24452e){const _0x421752=(await listAllRuntimeRoles(_0x53e9eb[_0x5d1534(0xe2)],{..._0x24d499?{'roleName':_0x24d499}:{}}))[_0x5d1534(0xd3)](_0x55f8bb=>_0x55f8bb['roleType']===_0x24452e),_0x5b0be4=(_0x82d840-0x1)*_0x22259e;return{'ok':!![],'data':{'scope':_0x5d1534(0xc7),'roles':_0x421752[_0x5d1534(0xcd)](_0x5b0be4,_0x5b0be4+_0x22259e)['map'](projectRuntimeRole),'paging':{'currentPage':_0x82d840,'pageSize':_0x22259e,'totalCount':_0x421752[_0x5d1534(0xcc)]}}};}const _0x5865fc=await listRuntimeAppRoles(_0x53e9eb[_0x5d1534(0xe2)],{..._0x24d499?{'roleName':_0x24d499}:{},'currentPage':_0x82d840,'pageSize':_0x22259e});return{'ok':!![],'data':{'scope':_0x5d1534(0xc7),'roles':_0x5865fc[_0x5d1534(0xd9)][_0x5d1534(0xd8)](projectRuntimeRole),'paging':_0x5865fc[_0x5d1534(0xbf)]}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a54_0xe293(_0x314070,_0xaa86a8){_0x314070=_0x314070-0x1ca;const _0x3f5dc4=a54_0x3f5d();let _0xe293de=_0x3f5dc4[_0x314070];return _0xe293de;}const a54_0x58fbff=a54_0xe293;(function(_0x31a570,_0x1c2fa2){const _0x4d4407=a54_0xe293,_0x39f472=_0x31a570();while(!![]){try{const _0x496241=-parseInt(_0x4d4407(0x1df))/0x1*(-parseInt(_0x4d4407(0x1ed))/0x2)+parseInt(_0x4d4407(0x1d9))/0x3*(-parseInt(_0x4d4407(0x1f7))/0x4)+parseInt(_0x4d4407(0x20f))/0x5+parseInt(_0x4d4407(0x1da))/0x6*(-parseInt(_0x4d4407(0x1cd))/0x7)+parseInt(_0x4d4407(0x1f3))/0x8*(-parseInt(_0x4d4407(0x207))/0x9)+-parseInt(_0x4d4407(0x1e5))/0xa*(parseInt(_0x4d4407(0x1cc))/0xb)+parseInt(_0x4d4407(0x1e1))/0xc;if(_0x496241===_0x1c2fa2)break;else _0x39f472['push'](_0x39f472['shift']());}catch(_0x158f8d){_0x39f472['push'](_0x39f472['shift']());}}}(a54_0x3f5d,0x58b4e));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=['ADMIN',a54_0x58fbff(0x20a),a54_0x58fbff(0x1de),a54_0x58fbff(0x204)];const BUILTIN_ROLE_TYPES=[a54_0x58fbff(0x1f1),a54_0x58fbff(0x20a),'OWNER'];function a54_0x3f5d(){const _0x5af7fc=['Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','\x20built-in\x20runtime\x20role\x20','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','1383230CYvuaA','Pass\x20one\x20role\x20ID:\x20','\x20is\x20already\x20in\x20runtime\x20role\x20','permitCount','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','runtime','items','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','847yzxYki','7LnJSNR','validation','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','user-add','find','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','paging','Runtime\x20role\x20name\x20\x22','includes','User\x20','code','roleType','519PDQUQV','177888OwYrCF','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','expect-user-count','\x22\x20was\x20not\x20found\x20in\x20app\x20','OWNER','558811cKJYGg','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','10285896NyUmbd','map','test','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','23870iwtFyD','filter','isSafeInteger','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','number','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','push','string','2mJGDPQ','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','\x20is\x20not\x20in\x20runtime\x20role\x20','appCode','ADMIN','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','3910992qKCqqe','num','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','length','14496HMbIIe','userName','role','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','\x22\x20is\x20ambiguous.','Runtime\x20role\x20id\x20','userId','roleName','\x20was\x20not\x20found\x20in\x20app\x20','userCount','Runtime\x20numeric\x20userId','join','remark','CUSTOM','userList','trim','9dStjdl','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','user','USER','totalCount'];a54_0x3f5d=function(){return _0x5af7fc;};return a54_0x3f5d();}export const ROLE_ID_FLAG={'name':'id','type':a54_0x58fbff(0x1e9),'required':!![],'description':a54_0x58fbff(0x1ee)};export const ROLE_REF_FLAG={'name':a54_0x58fbff(0x1f9),'type':a54_0x58fbff(0x1ec),'required':!![],'description':a54_0x58fbff(0x208)};export const USER_ID_FLAG={'name':'user','type':a54_0x58fbff(0x1ec),'required':!![],'description':a54_0x58fbff(0x201)};export const EXPECT_USER_COUNT_FLAG={'name':a54_0x58fbff(0x1dc),'type':a54_0x58fbff(0x1e9),'description':a54_0x58fbff(0x1e4)};export function isBuiltinRuntimeRole(_0x5f3ebb){const _0x93a1b=a54_0x58fbff;return BUILTIN_ROLE_TYPES[_0x93a1b(0x1d5)](_0x5f3ebb);}export function assertCustomRuntimeRole(_0x579d90,_0x18c8d9){const _0x408bd8=a54_0x58fbff;if(_0x579d90[_0x408bd8(0x1d8)]!==_0x408bd8(0x204))throw CliErrors[_0x408bd8(0x1ce)]('Cannot\x20'+_0x18c8d9+_0x408bd8(0x20d)+_0x579d90['roleName']+'\x20('+_0x579d90[_0x408bd8(0x1d8)]+').',_0x408bd8(0x213));}export function projectRuntimeRole(_0xfe7590){const _0x58bed7=a54_0x58fbff;return{'id':_0xfe7590['id'],'roleName':_0xfe7590[_0x58bed7(0x1fe)],'roleType':_0xfe7590['roleType'],'remark':_0xfe7590[_0x58bed7(0x203)],'userCount':_0xfe7590[_0x58bed7(0x200)]??0x0,'permitCount':_0xfe7590[_0x58bed7(0x212)]??0x0,'builtin':isBuiltinRuntimeRole(_0xfe7590[_0x58bed7(0x1d8)])};}export async function getRuntimeRoleById(_0x262463,_0xcb8206){const _0x2dd436=a54_0x58fbff;if(!Number['isSafeInteger'](_0xcb8206)||_0xcb8206<=0x0)throw CliErrors[_0x2dd436(0x1ce)](_0x2dd436(0x1ea));const _0x45615d=(await listAllRuntimeRoles(_0x262463))[_0x2dd436(0x1e6)](_0x4bf364=>_0x4bf364['id']===_0xcb8206&&(!_0x4bf364['appCode']||_0x4bf364[_0x2dd436(0x1f0)]===_0x262463));if(_0x45615d[_0x2dd436(0x1f6)]!==0x1)throw CliErrors['validation'](_0x2dd436(0x1fc)+_0xcb8206+_0x2dd436(0x1ff)+_0x262463+'.',_0x2dd436(0x1cf));return _0x45615d[0x0];}export async function listAllRuntimeRoles(_0x50dc7a,_0x53372f={}){const _0x3e59f0=a54_0x58fbff,_0xd137df=0x64,_0x5252b0=[];for(let _0x5a32a5=0x1;;_0x5a32a5+=0x1){const _0xd015c1=await listRuntimeAppRoles(_0x50dc7a,{..._0x53372f[_0x3e59f0(0x1fe)]?{'roleName':_0x53372f[_0x3e59f0(0x1fe)]}:{},'currentPage':_0x5a32a5,'pageSize':_0xd137df});_0x5252b0[_0x3e59f0(0x1eb)](..._0xd015c1['items']);if(_0xd015c1[_0x3e59f0(0x1ca)][_0x3e59f0(0x1f6)]<_0xd137df||_0xd015c1['paging']&&_0x5252b0['length']>=_0xd015c1[_0x3e59f0(0x1d3)][_0x3e59f0(0x20b)])return _0x5252b0;}}export async function resolveRuntimeRoleRef(_0xab46af,_0x9358be){const _0x55159e=a54_0x58fbff,_0x559a45=_0x9358be[_0x55159e(0x206)]();if(!_0x559a45)throw CliErrors[_0x55159e(0x1ce)]('Missing\x20runtime\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x55159e(0x1e3)](_0x559a45))return getRuntimeRoleById(_0xab46af,Number(_0x559a45));const _0x3ed272=(await listAllRuntimeRoles(_0xab46af))[_0x55159e(0x1e6)](_0x4afd54=>_0x4afd54[_0x55159e(0x1fe)]===_0x559a45);if(_0x3ed272[_0x55159e(0x1f6)]===0x0)throw CliErrors[_0x55159e(0x1ce)](_0x55159e(0x1d4)+_0x559a45+_0x55159e(0x1dd)+_0xab46af+'.',_0x55159e(0x20c));if(_0x3ed272[_0x55159e(0x1f6)]>0x1)throw CliErrors[_0x55159e(0x1ce)](_0x55159e(0x1d4)+_0x559a45+_0x55159e(0x1fb),_0x55159e(0x210)+_0x3ed272[_0x55159e(0x1e2)](_0x1720e7=>_0x1720e7['id'])[_0x55159e(0x202)](',\x20')+'.');return _0x3ed272[0x0];}function parseRuntimeUserId(_0x1792b3){const _0x2d3744=a54_0x58fbff,_0x3c5c1a=_0x1792b3[_0x2d3744(0x206)]();if(!/^\d+$/[_0x2d3744(0x1e3)](_0x3c5c1a))throw CliErrors['validation'](_0x2d3744(0x1f2),_0x2d3744(0x1e8));const _0x575b52=Number(_0x3c5c1a);if(!Number['isSafeInteger'](_0x575b52)||_0x575b52<=0x0)throw CliErrors['validation'](_0x2d3744(0x1f5));return _0x575b52;}export async function prepareRuntimeMemberMutation(_0x2c7b1f,_0xaca09a){const _0x3a39c8=a54_0x58fbff,_0x4e4dff=await resolveRuntimeRoleRef(_0x2c7b1f[_0x3a39c8(0x1f0)],_0x2c7b1f['str'](_0x3a39c8(0x1f9)));if(_0x4e4dff[_0x3a39c8(0x1d8)]==='OWNER')throw CliErrors[_0x3a39c8(0x1ce)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.',_0x3a39c8(0x1cb));const _0xa65375=parseRuntimeUserId(_0x2c7b1f['str'](_0x3a39c8(0x209))),_0x3db50c=(await listRuntimeRoleUsers(_0x2c7b1f[_0x3a39c8(0x1f0)]))[_0x3a39c8(0x1e2)](_0x471a3e=>({..._0x471a3e,'userList':[..._0x471a3e[_0x3a39c8(0x205)]??[]],'applyUserList':[..._0x471a3e['applyUserList']??[]]})),_0x29f155=_0x3db50c[_0x3a39c8(0x1d1)](_0x497271=>_0x497271['id']===_0x4e4dff['id']);if(!_0x29f155)throw CliErrors[_0x3a39c8(0x1ce)]('Runtime\x20role\x20'+_0x4e4dff['id']+'\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.',_0x3a39c8(0x20e));const _0x5c84de=_0x29f155[_0x3a39c8(0x205)]['map'](_0xe0d4d4=>_0xe0d4d4[_0x3a39c8(0x1fd)]),_0x365ec1=_0x2c7b1f['flag']('expect-user-count');if(_0x365ec1!==undefined&&_0x365ec1!==null&&_0x365ec1!==''){const _0x80707c=_0x2c7b1f[_0x3a39c8(0x1f4)]('expect-user-count');if(!Number[_0x3a39c8(0x1e7)](_0x80707c)||_0x80707c<0x0)throw CliErrors[_0x3a39c8(0x1ce)](_0x3a39c8(0x1fa));if(_0x5c84de[_0x3a39c8(0x1f6)]!==_0x80707c)throw CliErrors['validation'](_0x3a39c8(0x1d2)+_0x80707c+',\x20found\x20'+_0x5c84de[_0x3a39c8(0x1f6)]+'.',_0x3a39c8(0x1db));}const _0x114738=_0x5c84de['includes'](_0xa65375),_0x34813b=[];let _0x214975=!![];if(_0xaca09a===_0x3a39c8(0x1d0)){const _0x4d0b93=await listRuntimeAppUsers(_0x2c7b1f['appCode']),_0x3904de=_0x4d0b93[_0x3a39c8(0x1e6)](_0x3abe59=>Number(_0x3abe59[_0x3a39c8(0x1d7)])===_0xa65375);if(_0x3904de[_0x3a39c8(0x1f6)]!==0x1||!_0x3904de[0x0][_0x3a39c8(0x1f8)]?.['trim']())throw CliErrors['validation']('Runtime\x20user\x20'+_0xa65375+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x2c7b1f[_0x3a39c8(0x1f0)]+'.',_0x3a39c8(0x1e0));_0x114738?(_0x214975=![],_0x34813b[_0x3a39c8(0x1eb)](_0x3a39c8(0x1d6)+_0xa65375+_0x3a39c8(0x211)+_0x4e4dff['id']+'.')):_0x29f155[_0x3a39c8(0x205)][_0x3a39c8(0x1eb)]({'userId':_0xa65375,'username':_0x3904de[0x0][_0x3a39c8(0x1f8)]});}else!_0x114738?(_0x214975=![],_0x34813b[_0x3a39c8(0x1eb)]('User\x20'+_0xa65375+_0x3a39c8(0x1ef)+_0x4e4dff['id']+'.')):_0x29f155[_0x3a39c8(0x205)]=_0x29f155[_0x3a39c8(0x205)][_0x3a39c8(0x1e6)](_0x2f8384=>_0x2f8384[_0x3a39c8(0x1fd)]!==_0xa65375);return{'role':_0x4e4dff,'userId':_0xa65375,'roleList':_0x3db50c,'before':{'userIds':_0x5c84de},'after':{'userIds':_0x29f155[_0x3a39c8(0x205)][_0x3a39c8(0x1e2)](_0x249207=>_0x249207['userId'])},'shouldWrite':_0x214975,'warnings':_0x34813b};}export function runtimeRoleWriteResult(_0x5b6c27,_0x240f3b,_0x5c0357,_0x54e742,_0x59cc36,_0x1c787b=[]){const _0x4231a5=a54_0x58fbff;return{'operation':_0x5b6c27,'scope':_0x4231a5(0x214),'selector':_0x240f3b,'before':_0x5c0357,'after':_0x54e742,'dryRun':![],'backend':_0x59cc36,'warnings':_0x1c787b};}
|
|
1
|
+
function a54_0x21a8(){const _0x5ce9bd=['Cannot\x20','3814BdYUsI','paging','userId','role','userCount','test','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','Runtime\x20role\x20id\x20','runtime','roleName',',\x20found\x20','18MIAHeq','OWNER','string','Pass\x20--role\x20<id|name>.','\x20built-in\x20runtime\x20role\x20','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','\x22\x20is\x20ambiguous.','appCode','num','validation','trim','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','user','\x22\x20was\x20not\x20found\x20in\x20app\x20','roleType','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','CUSTOM','Runtime\x20role\x20name\x20\x22','isSafeInteger','1438638leAAtc','\x20is\x20not\x20in\x20runtime\x20role\x20','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','expect-user-count','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','Runtime\x20role\x20','filter','length','ADMIN','join','userName','410976Fbtmhs','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','applyUserList','items','userList','code','User\x20','5702435tRrXco','3790488VARsWD','includes','find','1739384zjBxNC','13305020dvGrYf','Pass\x20one\x20role\x20ID:\x20','USER','user-add','609wfaCyA','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','number','\x20was\x20not\x20found\x20in\x20app\x20','map','push','Missing\x20runtime\x20role\x20reference.','remark','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','28EjIpwB'];a54_0x21a8=function(){return _0x5ce9bd;};return a54_0x21a8();}const a54_0x483ca8=a54_0x1367;(function(_0x4a4a57,_0x1aba57){const _0x3b399c=a54_0x1367,_0x53e567=_0x4a4a57();while(!![]){try{const _0x41f1c8=-parseInt(_0x3b399c(0x17b))/0x1*(-parseInt(_0x3b399c(0x186))/0x2)+-parseInt(_0x3b399c(0x15f))/0x3+-parseInt(_0x3b399c(0x16a))/0x4+-parseInt(_0x3b399c(0x172))/0x5+-parseInt(_0x3b399c(0x173))/0x6+-parseInt(_0x3b399c(0x184))/0x7*(parseInt(_0x3b399c(0x176))/0x8)+-parseInt(_0x3b399c(0x148))/0x9*(-parseInt(_0x3b399c(0x177))/0xa);if(_0x41f1c8===_0x1aba57)break;else _0x53e567['push'](_0x53e567['shift']());}catch(_0x596f82){_0x53e567['push'](_0x53e567['shift']());}}}(a54_0x21a8,0x92086));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a54_0x483ca8(0x167),a54_0x483ca8(0x179),a54_0x483ca8(0x149),a54_0x483ca8(0x15c)];const BUILTIN_ROLE_TYPES=['ADMIN',a54_0x483ca8(0x179),'OWNER'];export const ROLE_ID_FLAG={'name':'id','type':a54_0x483ca8(0x17d),'required':!![],'description':a54_0x483ca8(0x14f)};export const ROLE_REF_FLAG={'name':a54_0x483ca8(0x189),'type':a54_0x483ca8(0x14a),'required':!![],'description':a54_0x483ca8(0x16c)};function a54_0x1367(_0x4353bd,_0x143cf8){_0x4353bd=_0x4353bd-0x145;const _0x21a809=a54_0x21a8();let _0x1367fb=_0x21a809[_0x4353bd];return _0x1367fb;}export const USER_ID_FLAG={'name':a54_0x483ca8(0x157),'type':a54_0x483ca8(0x14a),'required':!![],'description':'Runtime\x20numeric\x20userId'};export const EXPECT_USER_COUNT_FLAG={'name':a54_0x483ca8(0x162),'type':a54_0x483ca8(0x17d),'description':'Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed'};export function isBuiltinRuntimeRole(_0x4a2a1d){const _0x753ad9=a54_0x483ca8;return BUILTIN_ROLE_TYPES[_0x753ad9(0x174)](_0x4a2a1d);}export function assertCustomRuntimeRole(_0x1feaab,_0x142f7e){const _0x528d04=a54_0x483ca8;if(_0x1feaab[_0x528d04(0x159)]!=='CUSTOM')throw CliErrors[_0x528d04(0x153)](_0x528d04(0x185)+_0x142f7e+_0x528d04(0x14c)+_0x1feaab[_0x528d04(0x146)]+'\x20('+_0x1feaab[_0x528d04(0x159)]+').',_0x528d04(0x16b));}export function projectRuntimeRole(_0x1900e0){const _0x3d38e3=a54_0x483ca8;return{'id':_0x1900e0['id'],'roleName':_0x1900e0['roleName'],'roleType':_0x1900e0[_0x3d38e3(0x159)],'remark':_0x1900e0[_0x3d38e3(0x182)],'userCount':_0x1900e0[_0x3d38e3(0x18a)]??0x0,'permitCount':_0x1900e0['permitCount']??0x0,'builtin':isBuiltinRuntimeRole(_0x1900e0['roleType'])};}export async function getRuntimeRoleById(_0x1abf50,_0x38dac3){const _0x49330a=a54_0x483ca8;if(!Number[_0x49330a(0x15e)](_0x38dac3)||_0x38dac3<=0x0)throw CliErrors[_0x49330a(0x153)]('Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.');const _0x1c5b2b=(await listAllRuntimeRoles(_0x1abf50))['filter'](_0x550d42=>_0x550d42['id']===_0x38dac3&&(!_0x550d42[_0x49330a(0x151)]||_0x550d42['appCode']===_0x1abf50));if(_0x1c5b2b['length']!==0x1)throw CliErrors[_0x49330a(0x153)](_0x49330a(0x18d)+_0x38dac3+_0x49330a(0x17e)+_0x1abf50+'.',_0x49330a(0x161));return _0x1c5b2b[0x0];}export async function listAllRuntimeRoles(_0x4846ef,_0x4b4d66={}){const _0x56ce28=a54_0x483ca8,_0x1543ed=0x64,_0x1e1e39=[];for(let _0x538fb2=0x1;;_0x538fb2+=0x1){const _0x14be1b=await listRuntimeAppRoles(_0x4846ef,{..._0x4b4d66[_0x56ce28(0x146)]?{'roleName':_0x4b4d66[_0x56ce28(0x146)]}:{},'currentPage':_0x538fb2,'pageSize':_0x1543ed});_0x1e1e39['push'](..._0x14be1b[_0x56ce28(0x16e)]);if(_0x14be1b[_0x56ce28(0x16e)][_0x56ce28(0x166)]<_0x1543ed||_0x14be1b[_0x56ce28(0x187)]&&_0x1e1e39[_0x56ce28(0x166)]>=_0x14be1b[_0x56ce28(0x187)]['totalCount'])return _0x1e1e39;}}export async function resolveRuntimeRoleRef(_0x21da69,_0xc01d49){const _0x4376d6=a54_0x483ca8,_0x463f16=_0xc01d49[_0x4376d6(0x154)]();if(!_0x463f16)throw CliErrors[_0x4376d6(0x153)](_0x4376d6(0x181),_0x4376d6(0x14b));if(/^\d+$/[_0x4376d6(0x18b)](_0x463f16))return getRuntimeRoleById(_0x21da69,Number(_0x463f16));const _0xcbe17=(await listAllRuntimeRoles(_0x21da69))[_0x4376d6(0x165)](_0x49c307=>_0x49c307[_0x4376d6(0x146)]===_0x463f16);if(_0xcbe17[_0x4376d6(0x166)]===0x0)throw CliErrors[_0x4376d6(0x153)](_0x4376d6(0x15d)+_0x463f16+_0x4376d6(0x158)+_0x21da69+'.',_0x4376d6(0x15a));if(_0xcbe17['length']>0x1)throw CliErrors[_0x4376d6(0x153)]('Runtime\x20role\x20name\x20\x22'+_0x463f16+_0x4376d6(0x150),_0x4376d6(0x178)+_0xcbe17[_0x4376d6(0x17f)](_0x5b33fc=>_0x5b33fc['id'])[_0x4376d6(0x168)](',\x20')+'.');return _0xcbe17[0x0];}function parseRuntimeUserId(_0x870bf5){const _0x3e32ff=a54_0x483ca8,_0x2b7ef1=_0x870bf5[_0x3e32ff(0x154)]();if(!/^\d+$/['test'](_0x2b7ef1))throw CliErrors['validation'](_0x3e32ff(0x183),_0x3e32ff(0x18c));const _0xc624a7=Number(_0x2b7ef1);if(!Number['isSafeInteger'](_0xc624a7)||_0xc624a7<=0x0)throw CliErrors[_0x3e32ff(0x153)](_0x3e32ff(0x155));return _0xc624a7;}export async function prepareRuntimeMemberMutation(_0x1caeed,_0x15e299){const _0x1a6e25=a54_0x483ca8,_0x20609e=await resolveRuntimeRoleRef(_0x1caeed['appCode'],_0x1caeed['str'](_0x1a6e25(0x189)));if(_0x20609e['roleType']===_0x1a6e25(0x149))throw CliErrors[_0x1a6e25(0x153)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.',_0x1a6e25(0x156));const _0x5eb2e6=parseRuntimeUserId(_0x1caeed['str'](_0x1a6e25(0x157))),_0x16583a=(await listRuntimeRoleUsers(_0x1caeed[_0x1a6e25(0x151)]))['map'](_0x17dba8=>({..._0x17dba8,'userList':[..._0x17dba8['userList']??[]],'applyUserList':[..._0x17dba8[_0x1a6e25(0x16d)]??[]]})),_0x4af9e8=_0x16583a[_0x1a6e25(0x175)](_0x582028=>_0x582028['id']===_0x20609e['id']);if(!_0x4af9e8)throw CliErrors[_0x1a6e25(0x153)](_0x1a6e25(0x164)+_0x20609e['id']+_0x1a6e25(0x14e),_0x1a6e25(0x15b));const _0x263da3=_0x4af9e8[_0x1a6e25(0x16f)][_0x1a6e25(0x17f)](_0x2f239e=>_0x2f239e[_0x1a6e25(0x188)]),_0x541922=_0x1caeed['flag'](_0x1a6e25(0x162));if(_0x541922!==undefined&&_0x541922!==null&&_0x541922!==''){const _0x4aa511=_0x1caeed[_0x1a6e25(0x152)](_0x1a6e25(0x162));if(!Number[_0x1a6e25(0x15e)](_0x4aa511)||_0x4aa511<0x0)throw CliErrors[_0x1a6e25(0x153)](_0x1a6e25(0x17c));if(_0x263da3[_0x1a6e25(0x166)]!==_0x4aa511)throw CliErrors[_0x1a6e25(0x153)]('Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20'+_0x4aa511+_0x1a6e25(0x147)+_0x263da3[_0x1a6e25(0x166)]+'.',_0x1a6e25(0x163));}const _0x196926=_0x263da3[_0x1a6e25(0x174)](_0x5eb2e6),_0x2b3c60=[];let _0x35fef7=!![];if(_0x15e299===_0x1a6e25(0x17a)){const _0x5d79d4=await listRuntimeAppUsers(_0x1caeed[_0x1a6e25(0x151)]),_0x164d6d=_0x5d79d4[_0x1a6e25(0x165)](_0x22f50f=>Number(_0x22f50f[_0x1a6e25(0x170)])===_0x5eb2e6);if(_0x164d6d[_0x1a6e25(0x166)]!==0x1||!_0x164d6d[0x0]['userName']?.[_0x1a6e25(0x154)]())throw CliErrors[_0x1a6e25(0x153)]('Runtime\x20user\x20'+_0x5eb2e6+_0x1a6e25(0x17e)+_0x1caeed[_0x1a6e25(0x151)]+'.',_0x1a6e25(0x14d));_0x196926?(_0x35fef7=![],_0x2b3c60['push'](_0x1a6e25(0x171)+_0x5eb2e6+'\x20is\x20already\x20in\x20runtime\x20role\x20'+_0x20609e['id']+'.')):_0x4af9e8['userList'][_0x1a6e25(0x180)]({'userId':_0x5eb2e6,'username':_0x164d6d[0x0][_0x1a6e25(0x169)]});}else!_0x196926?(_0x35fef7=![],_0x2b3c60[_0x1a6e25(0x180)](_0x1a6e25(0x171)+_0x5eb2e6+_0x1a6e25(0x160)+_0x20609e['id']+'.')):_0x4af9e8['userList']=_0x4af9e8['userList'][_0x1a6e25(0x165)](_0x3ef949=>_0x3ef949['userId']!==_0x5eb2e6);return{'role':_0x20609e,'userId':_0x5eb2e6,'roleList':_0x16583a,'before':{'userIds':_0x263da3},'after':{'userIds':_0x4af9e8['userList']['map'](_0x271c05=>_0x271c05['userId'])},'shouldWrite':_0x35fef7,'warnings':_0x2b3c60};}export function runtimeRoleWriteResult(_0x17d830,_0x46c98f,_0x2e9cd5,_0x363ed3,_0xf67ff,_0x3da975=[]){const _0x4a4edc=a54_0x483ca8;return{'operation':_0x17d830,'scope':_0x4a4edc(0x145),'selector':_0x46c98f,'before':_0x2e9cd5,'after':_0x363ed3,'dryRun':![],'backend':_0xf67ff,'warnings':_0x3da975};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a55_0x1cc6(){const _0xc8d7fe=['/client/permit/role/update','353108LpQSrw','body','validation','POST','Changes\x20the\x20custom\x20role\x20name\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20display\x20updates\x20immediately.','--remark\x20must\x20not\x20be\x20blank.','1319520WRUriQ','string','210195XXUUML','2319795TGPDLB','12YYDBsf','description','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','role','8966PPXmEL','str','update','New\x20role\x20name','794066WSLdUh','6GodExC','trim','flag','Update\x20a\x20runtime\x20CUSTOM\x20role','--name\x20must\x20not\x20be\x20blank.','name','high-risk-write','612545vlLEPE','build','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','remark','appCode'];a55_0x1cc6=function(){return _0xc8d7fe;};return a55_0x1cc6();}const a55_0x3f1fc6=a55_0x2aca;(function(_0x322a34,_0x57a595){const _0x1289d7=a55_0x2aca,_0x202ef3=_0x322a34();while(!![]){try{const _0x15f874=-parseInt(_0x1289d7(0x1f3))/0x1*(parseInt(_0x1289d7(0x1ef))/0x2)+-parseInt(_0x1289d7(0x1ed))/0x3+parseInt(_0x1289d7(0x1e5))/0x4+parseInt(_0x1289d7(0x1df))/0x5*(parseInt(_0x1289d7(0x1f8))/0x6)+parseInt(_0x1289d7(0x1f7))/0x7+parseInt(_0x1289d7(0x1eb))/0x8+-parseInt(_0x1289d7(0x1ee))/0x9;if(_0x15f874===_0x57a595)break;else _0x202ef3['push'](_0x202ef3['shift']());}catch(_0x47c89c){_0x202ef3['push'](_0x202ef3['shift']());}}}(a55_0x1cc6,0x1a41c));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function a55_0x2aca(_0x1c5ed9,_0x5bb46c){_0x1c5ed9=_0x1c5ed9-0x1de;const _0x1cc6eb=a55_0x1cc6();let _0x2aca4c=_0x1cc6eb[_0x1c5ed9];return _0x2aca4c;}function updateFields(_0x5f3bcc){const _0x17fa4b=a55_0x2aca,_0x2255b5=_0x5f3bcc[_0x17fa4b(0x1fa)](_0x17fa4b(0x1fd))!==undefined,_0x2b8467=_0x5f3bcc[_0x17fa4b(0x1fa)](_0x17fa4b(0x1e2))!==undefined;if(!_0x2255b5&&!_0x2b8467)throw CliErrors[_0x17fa4b(0x1e7)](_0x17fa4b(0x1f1));const _0x1e8ddf=_0x5f3bcc[_0x17fa4b(0x1f4)](_0x17fa4b(0x1fd))[_0x17fa4b(0x1f9)](),_0x12c1f7=_0x5f3bcc[_0x17fa4b(0x1f4)]('remark')[_0x17fa4b(0x1f9)]();if(_0x2255b5&&!_0x1e8ddf)throw CliErrors[_0x17fa4b(0x1e7)](_0x17fa4b(0x1fc));if(_0x2b8467&&!_0x12c1f7)throw CliErrors[_0x17fa4b(0x1e7)](_0x17fa4b(0x1ea),_0x17fa4b(0x1e1));return{..._0x2255b5?{'roleName':_0x1e8ddf}:{},..._0x2b8467?{'remark':_0x12c1f7}:{}};}async function prepare(_0x3a42c0){const _0x1883f3=a55_0x2aca,_0x38c9fc=await getRuntimeRoleById(_0x3a42c0[_0x1883f3(0x1e3)],_0x3a42c0['num']('id'));return assertCustomRuntimeRole(_0x38c9fc,'update'),{'role':_0x38c9fc,'body':{'id':_0x38c9fc['id'],'appCode':_0x3a42c0[_0x1883f3(0x1e3)],...updateFields(_0x3a42c0)}};}export const roleUpdate={'service':a55_0x3f1fc6(0x1f2),'command':a55_0x3f1fc6(0x1f5),'description':a55_0x3f1fc6(0x1fb),'risk':a55_0x3f1fc6(0x1de),'confirmationDescription':a55_0x3f1fc6(0x1e9),'flags':[ROLE_ID_FLAG,{'name':'name','type':a55_0x3f1fc6(0x1ec),'description':a55_0x3f1fc6(0x1f6)},{'name':'remark','type':a55_0x3f1fc6(0x1ec),'description':'New\x20non-empty\x20role\x20remark'}],async 'validate'(_0x4ff34a){updateFields(_0x4ff34a);},async 'dryRun'(_0x17d1e2){const _0x5096d7=a55_0x3f1fc6,{body:_0x2741f4}=await prepare(_0x17d1e2);return dryRun(_0x5096d7(0x1e8),_0x5096d7(0x1e4))[_0x5096d7(0x1e6)](_0x2741f4)[_0x5096d7(0x1f0)]('Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role')[_0x5096d7(0x1e0)]();},async 'execute'(_0x510f86){const _0x272330=a55_0x3f1fc6,{role:_0x407726,body:_0x4c44e8}=await prepare(_0x510f86),_0x56a12c=await updateRuntimeAppRole(_0x4c44e8);return{'ok':!![],'data':runtimeRoleWriteResult(_0x272330(0x1f5),{'roleId':_0x407726['id']},projectRuntimeRole(_0x407726),projectRuntimeRole(_0x56a12c),{'method':_0x272330(0x1e8),'path':_0x272330(0x1e4)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x3bc9f4=a56_0x28f3;function a56_0x1b16(){const _0x3cb92c=['252570CGPyNI','14088KblwgQ','4bLJvjV','appCode','high-risk-write','role','POST','user-add','9448470mcCOQT','1922356NGLdzz','927xMUOih','358074itDxBj','description','/client/permit/user-role/update-user-list','warnings','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','shouldWrite','28OLvifo','465954HWdWPu','build','roleList','77187sAGENY','before'];a56_0x1b16=function(){return _0x3cb92c;};return a56_0x1b16();}(function(_0x3f4b67,_0x4ce121){const _0x150513=a56_0x28f3,_0x3d1647=_0x3f4b67();while(!![]){try{const _0x59f811=-parseInt(_0x150513(0x10f))/0x1*(-parseInt(_0x150513(0xfc))/0x2)+parseInt(_0x150513(0x105))/0x3+parseInt(_0x150513(0x103))/0x4+parseInt(_0x150513(0x111))/0x5+parseInt(_0x150513(0x10c))/0x6*(parseInt(_0x150513(0x10b))/0x7)+parseInt(_0x150513(0x112))/0x8*(parseInt(_0x150513(0x104))/0x9)+-parseInt(_0x150513(0x102))/0xa;if(_0x59f811===_0x4ce121)break;else _0x3d1647['push'](_0x3d1647['shift']());}catch(_0x7050d9){_0x3d1647['push'](_0x3d1647['shift']());}}}(a56_0x1b16,0x55f07));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a56_0x28f3(_0xffe7c,_0x3f68b3){_0xffe7c=_0xffe7c-0xfc;const _0x1b16c4=a56_0x1b16();let _0x28f31b=_0x1b16c4[_0xffe7c];return _0x28f31b;}import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a56_0x3bc9f4(0xff),'command':a56_0x3bc9f4(0x101),'description':'Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','risk':a56_0x3bc9f4(0xfe),'confirmationDescription':a56_0x3bc9f4(0x109),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x16942a){const _0x20cd16=a56_0x3bc9f4,_0x5b9022=await prepareRuntimeMemberMutation(_0x16942a,_0x20cd16(0x101));return dryRun(_0x20cd16(0x100),_0x20cd16(0x107))['body']({'appCode':_0x16942a['appCode'],'roleList':_0x5b9022[_0x20cd16(0x10e)]})[_0x20cd16(0x106)](_0x5b9022[_0x20cd16(0x10a)]?'Preview:\x20add\x20runtime\x20role\x20member':_0x5b9022[_0x20cd16(0x108)][0x0])[_0x20cd16(0x10d)]();},async 'execute'(_0x4b420f){const _0x1bf66e=a56_0x3bc9f4,_0x3b1e04=await prepareRuntimeMemberMutation(_0x4b420f,_0x1bf66e(0x101));return _0x3b1e04[_0x1bf66e(0x10a)]&&await updateRuntimeRoleUsers(_0x4b420f[_0x1bf66e(0xfd)],_0x3b1e04[_0x1bf66e(0x10e)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x1bf66e(0x101),{'roleId':_0x3b1e04[_0x1bf66e(0xff)]['id'],'userId':_0x3b1e04['userId']},_0x3b1e04[_0x1bf66e(0x110)],_0x3b1e04['after'],{'method':'POST','path':_0x1bf66e(0x107)},_0x3b1e04[_0x1bf66e(0x108)])};}};
|