@lovrabet/lovrabet-cli 2.3.3 → 2.3.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- 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/approval/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.d.ts +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.d.ts +2 -2
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +4 -0
- 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.d.ts +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/kb-search-client.d.ts +7 -1
- package/lib/core/kb-search-client.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/generated/official-routing.d.ts +12 -3
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.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.d.ts +5 -0
- 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/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.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 +4 -2
- package/skills/lovrabet/guides/troubleshooting.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +8 -7
- package/skills/lovrabet/references/lovrabet-config.md +4 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +14 -2
- package/skills/lovrabet/references/lovrabet-service-tree.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a55_0x5352d3=a55_0x33ac;(function(_0xc97cfa,_0x1ec433){const _0x3b037d=a55_0x33ac,_0x24cc52=_0xc97cfa();while(!![]){try{const _0x523bf5=parseInt(_0x3b037d(0x1d9))/0x1*(parseInt(_0x3b037d(0x1ed))/0x2)+parseInt(_0x3b037d(0x1dc))/0x3*(-parseInt(_0x3b037d(0x203))/0x4)+parseInt(_0x3b037d(0x1eb))/0x5*(parseInt(_0x3b037d(0x1f7))/0x6)+parseInt(_0x3b037d(0x205))/0x7*(parseInt(_0x3b037d(0x1fa))/0x8)+parseInt(_0x3b037d(0x20b))/0x9+-parseInt(_0x3b037d(0x1ff))/0xa*(-parseInt(_0x3b037d(0x1ee))/0xb)+-parseInt(_0x3b037d(0x1fb))/0xc;if(_0x523bf5===_0x1ec433)break;else _0x24cc52['push'](_0x24cc52['shift']());}catch(_0x4711cc){_0x24cc52['push'](_0x24cc52['shift']());}}}(a55_0x450a,0xec489));function a55_0x450a(){const _0x2f3f10=['CUSTOM','includes','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','userCount','length','validation','Runtime\x20numeric\x20userId','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','Runtime\x20role\x20name\x20\x22','userName','expect-user-count','3asqOoQ','applyUserList','flag','2910093cIaNTA','paging','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','\x20was\x20not\x20found\x20in\x20app\x20','\x20is\x20not\x20in\x20runtime\x20role\x20','--role-code\x20cannot\x20exceed\x2064\x20characters.','\x22\x20is\x20ambiguous.','push','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','USER','roleCode','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','permitCount','items','totalCount','35mxWdVg','remark','801336smEGgr','4877642WWlBXW','filter','User\x20','role','Runtime\x20role\x20','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','OWNER','map','appCode','52194POpkam','userId','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','4129480dpGtWw','18372156ADHWsK','join','\x22\x20was\x20not\x20found\x20in\x20app\x20','str','20dPLPQE','code','string','\x20is\x20already\x20in\x20runtime\x20role\x20','4YRDdFg','Runtime\x20role\x20id\x20','14IjUVmZ','find','user','role-code','trim','user-add','2580750RuOyCH','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','Pass\x20one\x20role\x20ID:\x20','ADMIN','num','roleName','roleType','\x20built-in\x20runtime\x20role\x20','userList','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.',',\x20found\x20','isSafeInteger','Pass\x20--role\x20<id|name>.','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','number','--role-code\x20must\x20not\x20be\x20blank.','test','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','runtime'];a55_0x450a=function(){return _0x2f3f10;};return a55_0x450a();}import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{normalizePositiveSafeInteger}from'../../utils/positive-safe-integer.js';function a55_0x33ac(_0x1f7680,_0x166c03){_0x1f7680=_0x1f7680-0x1bf;const _0x450a3c=a55_0x450a();let _0x33ac78=_0x450a3c[_0x1f7680];return _0x33ac78;}export const RUNTIME_ROLE_TYPES=[a55_0x5352d3(0x20e),a55_0x5352d3(0x1e5),a55_0x5352d3(0x1f4),a55_0x5352d3(0x1ce)];const BUILTIN_ROLE_TYPES=[a55_0x5352d3(0x20e),a55_0x5352d3(0x1e5),'OWNER'];export const ROLE_ID_FLAG={'name':'id','type':a55_0x5352d3(0x1c7),'required':!![],'description':a55_0x5352d3(0x1f3)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a55_0x5352d3(0x1cb)};export const ROLE_CODE_FLAG={'name':a55_0x5352d3(0x208),'type':a55_0x5352d3(0x201),'description':'Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)'};export const USER_ID_FLAG={'name':a55_0x5352d3(0x207),'type':a55_0x5352d3(0x201),'required':!![],'description':a55_0x5352d3(0x1d4)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':'number','description':a55_0x5352d3(0x1de)};export function isBuiltinRuntimeRole(_0xa45ff0){return BUILTIN_ROLE_TYPES['includes'](_0xa45ff0);}export function assertCustomRuntimeRole(_0x435a07,_0x5a31cc){const _0x27d64a=a55_0x5352d3;if(_0x435a07[_0x27d64a(0x1bf)]!==_0x27d64a(0x1ce))throw CliErrors[_0x27d64a(0x1d3)]('Cannot\x20'+_0x5a31cc+_0x27d64a(0x1c0)+_0x435a07['roleName']+'\x20('+_0x435a07[_0x27d64a(0x1bf)]+').',_0x27d64a(0x1c6));}export function projectRuntimeRole(_0x261325){const _0x2f5e60=a55_0x5352d3;return{'id':_0x261325['id'],'roleCode':_0x261325[_0x2f5e60(0x1e6)],'roleName':_0x261325[_0x2f5e60(0x210)],'roleType':_0x261325[_0x2f5e60(0x1bf)],'remark':_0x261325[_0x2f5e60(0x1ec)],'userCount':_0x261325[_0x2f5e60(0x1d1)]??0x0,'permitCount':_0x261325[_0x2f5e60(0x1e8)]??0x0,'builtin':isBuiltinRuntimeRole(_0x261325[_0x2f5e60(0x1bf)])};}export function readOptionalRuntimeRoleCode(_0x3eca00){const _0x1e679f=a55_0x5352d3,_0x22dac4=_0x3eca00[_0x1e679f(0x1db)](_0x1e679f(0x208));if(_0x22dac4===undefined||_0x22dac4===null)return undefined;const _0x37c42d=String(_0x22dac4)[_0x1e679f(0x209)]();if(!_0x37c42d)throw CliErrors[_0x1e679f(0x1d3)](_0x1e679f(0x1c8));if(_0x37c42d['length']>0x40)throw CliErrors[_0x1e679f(0x1d3)](_0x1e679f(0x1e1));return _0x37c42d;}export async function getRuntimeRoleById(_0x465665,_0x3073d2){const _0x3354ed=a55_0x5352d3;if(!Number[_0x3354ed(0x1c4)](_0x3073d2)||_0x3073d2<=0x0)throw CliErrors[_0x3354ed(0x1d3)](_0x3354ed(0x1e7));const _0x330d7d=(await listAllRuntimeRoles(_0x465665))[_0x3354ed(0x1ef)](_0x393e65=>_0x393e65['id']===_0x3073d2&&(!_0x393e65[_0x3354ed(0x1f6)]||_0x393e65[_0x3354ed(0x1f6)]===_0x465665));if(_0x330d7d[_0x3354ed(0x1d2)]!==0x1)throw CliErrors[_0x3354ed(0x1d3)](_0x3354ed(0x204)+_0x3073d2+_0x3354ed(0x1df)+_0x465665+'.',_0x3354ed(0x1cc));return _0x330d7d[0x0];}export async function listAllRuntimeRoles(_0x4778c3,_0x1fddbd={}){const _0x439030=a55_0x5352d3,_0x5a3fbc=0x64,_0x547f91=[];for(let _0x5b219c=0x1;;_0x5b219c+=0x1){const _0x37c25d=await listRuntimeAppRoles(_0x4778c3,{..._0x1fddbd[_0x439030(0x210)]?{'roleName':_0x1fddbd['roleName']}:{},'currentPage':_0x5b219c,'pageSize':_0x5a3fbc});_0x547f91['push'](..._0x37c25d[_0x439030(0x1e9)]);if(_0x37c25d[_0x439030(0x1e9)][_0x439030(0x1d2)]<_0x5a3fbc||_0x37c25d[_0x439030(0x1dd)]&&_0x547f91[_0x439030(0x1d2)]>=_0x37c25d[_0x439030(0x1dd)][_0x439030(0x1ea)])return _0x547f91;}}export async function resolveRuntimeRoleRef(_0x315c25,_0x3c1efc){const _0x184bef=a55_0x5352d3,_0x14aeef=_0x3c1efc[_0x184bef(0x209)]();if(!_0x14aeef)throw CliErrors[_0x184bef(0x1d3)]('Missing\x20runtime\x20role\x20reference.',_0x184bef(0x1c5));if(/^\d+$/[_0x184bef(0x1c9)](_0x14aeef))return getRuntimeRoleById(_0x315c25,Number(_0x14aeef));const _0x2de9eb=(await listAllRuntimeRoles(_0x315c25))['filter'](_0x191022=>_0x191022['roleName']===_0x14aeef);if(_0x2de9eb[_0x184bef(0x1d2)]===0x0)throw CliErrors['validation'](_0x184bef(0x1d6)+_0x14aeef+_0x184bef(0x1fd)+_0x315c25+'.',_0x184bef(0x1d0));if(_0x2de9eb[_0x184bef(0x1d2)]>0x1)throw CliErrors['validation'](_0x184bef(0x1d6)+_0x14aeef+_0x184bef(0x1e2),_0x184bef(0x20d)+_0x2de9eb[_0x184bef(0x1f5)](_0xbb9e97=>_0xbb9e97['id'])[_0x184bef(0x1fc)](',\x20')+'.');return _0x2de9eb[0x0];}function parseRuntimeUserId(_0x3f5d68){const _0x4acab5=a55_0x5352d3,_0x56a6fe=_0x3f5d68[_0x4acab5(0x209)](),_0xc05416=normalizePositiveSafeInteger(_0x56a6fe);if(_0xc05416===undefined)throw CliErrors[_0x4acab5(0x1d3)](_0x4acab5(0x1c2),'Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.');return _0xc05416;}export async function prepareRuntimeMemberMutation(_0x5a3f51,_0x2c70c3){const _0x19dd2b=a55_0x5352d3,_0x465ec5=await resolveRuntimeRoleRef(_0x5a3f51['appCode'],_0x5a3f51[_0x19dd2b(0x1fe)](_0x19dd2b(0x1f1)));if(_0x465ec5[_0x19dd2b(0x1bf)]===_0x19dd2b(0x1f4))throw CliErrors[_0x19dd2b(0x1d3)](_0x19dd2b(0x1ca),_0x19dd2b(0x1e4));const _0x67af69=parseRuntimeUserId(_0x5a3f51['str'](_0x19dd2b(0x207))),_0x4eba03=(await listRuntimeRoleUsers(_0x5a3f51[_0x19dd2b(0x1f6)]))['map'](_0x5e2db7=>({..._0x5e2db7,'userList':[..._0x5e2db7['userList']??[]],'applyUserList':[..._0x5e2db7[_0x19dd2b(0x1da)]??[]]})),_0x83e31a=_0x4eba03[_0x19dd2b(0x206)](_0x49a3a2=>_0x49a3a2['id']===_0x465ec5['id']);if(!_0x83e31a)throw CliErrors[_0x19dd2b(0x1d3)](_0x19dd2b(0x1f2)+_0x465ec5['id']+_0x19dd2b(0x20c),'Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.');const _0xef280b=_0x83e31a[_0x19dd2b(0x1c1)][_0x19dd2b(0x1f5)](_0xc4a72=>_0xc4a72[_0x19dd2b(0x1f8)]),_0x21506a=_0x5a3f51[_0x19dd2b(0x1db)](_0x19dd2b(0x1d8));if(_0x21506a!==undefined&&_0x21506a!==null&&_0x21506a!==''){const _0x578434=_0x5a3f51[_0x19dd2b(0x20f)](_0x19dd2b(0x1d8));if(!Number['isSafeInteger'](_0x578434)||_0x578434<0x0)throw CliErrors['validation']('--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0xef280b[_0x19dd2b(0x1d2)]!==_0x578434)throw CliErrors[_0x19dd2b(0x1d3)](_0x19dd2b(0x1f9)+_0x578434+_0x19dd2b(0x1c3)+_0xef280b['length']+'.',_0x19dd2b(0x1d5));}const _0x3f4494=_0xef280b[_0x19dd2b(0x1cf)](_0x67af69),_0x4148bb=[];let _0x58015c=!![];if(_0x2c70c3===_0x19dd2b(0x20a)){const _0x2d53e6=await listRuntimeAppUsers(_0x5a3f51[_0x19dd2b(0x1f6)]),_0x214f56=_0x2d53e6[_0x19dd2b(0x1ef)](_0x4ff37d=>Number(_0x4ff37d[_0x19dd2b(0x200)])===_0x67af69);if(_0x214f56[_0x19dd2b(0x1d2)]!==0x1||!_0x214f56[0x0][_0x19dd2b(0x1d7)]?.[_0x19dd2b(0x209)]())throw CliErrors[_0x19dd2b(0x1d3)]('Runtime\x20user\x20'+_0x67af69+_0x19dd2b(0x1df)+_0x5a3f51[_0x19dd2b(0x1f6)]+'.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.');_0x3f4494?(_0x58015c=![],_0x4148bb[_0x19dd2b(0x1e3)](_0x19dd2b(0x1f0)+_0x67af69+_0x19dd2b(0x202)+_0x465ec5['id']+'.')):_0x83e31a[_0x19dd2b(0x1c1)][_0x19dd2b(0x1e3)]({'userId':_0x67af69,'username':_0x214f56[0x0][_0x19dd2b(0x1d7)]});}else!_0x3f4494?(_0x58015c=![],_0x4148bb[_0x19dd2b(0x1e3)](_0x19dd2b(0x1f0)+_0x67af69+_0x19dd2b(0x1e0)+_0x465ec5['id']+'.')):_0x83e31a[_0x19dd2b(0x1c1)]=_0x83e31a['userList'][_0x19dd2b(0x1ef)](_0x45ab46=>_0x45ab46['userId']!==_0x67af69);return{'role':_0x465ec5,'userId':_0x67af69,'roleList':_0x4eba03,'before':{'userIds':_0xef280b},'after':{'userIds':_0x83e31a['userList'][_0x19dd2b(0x1f5)](_0x186f9a=>_0x186f9a[_0x19dd2b(0x1f8)])},'shouldWrite':_0x58015c,'warnings':_0x4148bb};}export function runtimeRoleWriteResult(_0x9866ee,_0x451676,_0x411a01,_0xc561a6,_0x2dfdc2,_0x3ba434=[]){const _0x35c8d9=a55_0x5352d3;return{'operation':_0x9866ee,'scope':_0x35c8d9(0x1cd),'selector':_0x451676,'before':_0x411a01,'after':_0xc561a6,'dryRun':![],'backend':_0x2dfdc2,'warnings':_0x3ba434};}
|
|
1
|
+
const a55_0x39e4bb=a55_0x7511;(function(_0x4cdd62,_0x67bd1a){const _0x405334=a55_0x7511,_0x444fa7=_0x4cdd62();while(!![]){try{const _0x2769ae=-parseInt(_0x405334(0xba))/0x1*(parseInt(_0x405334(0xc1))/0x2)+parseInt(_0x405334(0x90))/0x3*(parseInt(_0x405334(0xcc))/0x4)+-parseInt(_0x405334(0xad))/0x5+parseInt(_0x405334(0xb5))/0x6*(-parseInt(_0x405334(0xc3))/0x7)+-parseInt(_0x405334(0xd8))/0x8+parseInt(_0x405334(0xdd))/0x9*(parseInt(_0x405334(0xc8))/0xa)+-parseInt(_0x405334(0xb0))/0xb*(-parseInt(_0x405334(0xa5))/0xc);if(_0x2769ae===_0x67bd1a)break;else _0x444fa7['push'](_0x444fa7['shift']());}catch(_0xe13ad1){_0x444fa7['push'](_0x444fa7['shift']());}}}(a55_0x593d,0xb4885));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{normalizePositiveSafeInteger}from'../../utils/positive-safe-integer.js';export const RUNTIME_ROLE_TYPES=[a55_0x39e4bb(0xc2),a55_0x39e4bb(0x91),a55_0x39e4bb(0xab),a55_0x39e4bb(0x97)];const BUILTIN_ROLE_TYPES=[a55_0x39e4bb(0xc2),a55_0x39e4bb(0x91),a55_0x39e4bb(0xab)];function a55_0x7511(_0x2b7069,_0x8f6392){_0x2b7069=_0x2b7069-0x90;const _0x593db2=a55_0x593d();let _0x75111f=_0x593db2[_0x2b7069];return _0x75111f;}export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a55_0x39e4bb(0xc6)};export const ROLE_REF_FLAG={'name':a55_0x39e4bb(0xbd),'type':'string','required':!![],'description':a55_0x39e4bb(0xb2)};export const ROLE_CODE_FLAG={'name':'role-code','type':a55_0x39e4bb(0xda),'description':a55_0x39e4bb(0x9c)};export const USER_ID_FLAG={'name':a55_0x39e4bb(0xd7),'type':a55_0x39e4bb(0xda),'required':!![],'description':a55_0x39e4bb(0xa4)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a55_0x39e4bb(0xa7),'description':'Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed'};export function isBuiltinRuntimeRole(_0x4fad62){const _0x4c34b2=a55_0x39e4bb;return BUILTIN_ROLE_TYPES[_0x4c34b2(0xd3)](_0x4fad62);}export function assertCustomRuntimeRole(_0x4aeb74,_0x31d085){const _0x4e8787=a55_0x39e4bb;if(_0x4aeb74[_0x4e8787(0x9d)]!==_0x4e8787(0x97))throw CliErrors[_0x4e8787(0xac)](_0x4e8787(0x93)+_0x31d085+_0x4e8787(0x9e)+_0x4aeb74['roleName']+'\x20('+_0x4aeb74['roleType']+').',_0x4e8787(0xde));}function a55_0x593d(){const _0x30b619=['1304IkBlgW','ADMIN','215929MotIFn','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','trim','550BSGFMq','remark','test','totalCount','4IfpoaO','length','push','userCount','roleName','Pass\x20--role\x20<id|name>.','Runtime\x20role\x20id\x20','includes','applyUserList','isSafeInteger',',\x20found\x20','user','2040664Zjgcjy','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','string','Runtime\x20user\x20','userName','33741XiBIeS','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','User\x20','roleCode','\x20is\x20already\x20in\x20runtime\x20role\x20','2379909KdvRKG','USER','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','Cannot\x20','code','\x20is\x20not\x20in\x20runtime\x20role\x20','userList','CUSTOM','userId','find','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)','roleType','\x20built-in\x20runtime\x20role\x20','appCode','filter','--role-code\x20must\x20not\x20be\x20blank.','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','str','Runtime\x20numeric\x20userId','20964fsMcPU','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','number','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','Runtime\x20role\x20name\x20\x22','role-code','OWNER','validation','960050KyAldd','--role-code\x20cannot\x20exceed\x2064\x20characters.','Missing\x20runtime\x20role\x20reference.','11297SQOrnT','Runtime\x20role\x20','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','expect-user-count','210CFkceJ','flag','permitCount','map','\x20was\x20not\x20found\x20in\x20app\x20','809ZnuTUF','items','\x22\x20was\x20not\x20found\x20in\x20app\x20','role','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','user-add'];a55_0x593d=function(){return _0x30b619;};return a55_0x593d();}export function projectRuntimeRole(_0x52777f){const _0x2cc28c=a55_0x39e4bb;return{'id':_0x52777f['id'],'roleCode':_0x52777f[_0x2cc28c(0xe0)],'roleName':_0x52777f[_0x2cc28c(0xd0)],'roleType':_0x52777f[_0x2cc28c(0x9d)],'remark':_0x52777f[_0x2cc28c(0xc9)],'userCount':_0x52777f[_0x2cc28c(0xcf)]??0x0,'permitCount':_0x52777f[_0x2cc28c(0xb7)]??0x0,'builtin':isBuiltinRuntimeRole(_0x52777f['roleType'])};}export function readOptionalRuntimeRoleCode(_0x2cd3cc){const _0x106889=a55_0x39e4bb,_0x35bb0c=_0x2cd3cc['flag'](_0x106889(0xaa));if(_0x35bb0c===undefined||_0x35bb0c===null)return undefined;const _0x2d43f6=String(_0x35bb0c)['trim']();if(!_0x2d43f6)throw CliErrors['validation'](_0x106889(0xa1));if(_0x2d43f6[_0x106889(0xcd)]>0x40)throw CliErrors[_0x106889(0xac)](_0x106889(0xae));return _0x2d43f6;}export async function getRuntimeRoleById(_0x448f27,_0x1f228b){const _0x19a28b=a55_0x39e4bb;if(!Number[_0x19a28b(0xd5)](_0x1f228b)||_0x1f228b<=0x0)throw CliErrors[_0x19a28b(0xac)](_0x19a28b(0x9a));const _0x5b9c67=(await listAllRuntimeRoles(_0x448f27))[_0x19a28b(0xa0)](_0x2493ee=>_0x2493ee['id']===_0x1f228b&&(!_0x2493ee['appCode']||_0x2493ee['appCode']===_0x448f27));if(_0x5b9c67[_0x19a28b(0xcd)]!==0x1)throw CliErrors['validation'](_0x19a28b(0xd2)+_0x1f228b+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x448f27+'.',_0x19a28b(0xa2));return _0x5b9c67[0x0];}export async function listAllRuntimeRoles(_0x31c935,_0xa386d2={}){const _0x4f4f32=a55_0x39e4bb,_0x4cd24f=0x64,_0x43f806=[];for(let _0xcf7f5=0x1;;_0xcf7f5+=0x1){const _0x298910=await listRuntimeAppRoles(_0x31c935,{..._0xa386d2[_0x4f4f32(0xd0)]?{'roleName':_0xa386d2[_0x4f4f32(0xd0)]}:{},'currentPage':_0xcf7f5,'pageSize':_0x4cd24f});_0x43f806[_0x4f4f32(0xce)](..._0x298910[_0x4f4f32(0xbb)]);if(_0x298910[_0x4f4f32(0xbb)][_0x4f4f32(0xcd)]<_0x4cd24f||_0x298910['paging']&&_0x43f806[_0x4f4f32(0xcd)]>=_0x298910['paging'][_0x4f4f32(0xcb)])return _0x43f806;}}export async function resolveRuntimeRoleRef(_0x3d5b6d,_0x5252cc){const _0x16dbfa=a55_0x39e4bb,_0x335b6f=_0x5252cc[_0x16dbfa(0xc7)]();if(!_0x335b6f)throw CliErrors[_0x16dbfa(0xac)](_0x16dbfa(0xaf),_0x16dbfa(0xd1));if(/^\d+$/[_0x16dbfa(0xca)](_0x335b6f))return getRuntimeRoleById(_0x3d5b6d,Number(_0x335b6f));const _0x288063=(await listAllRuntimeRoles(_0x3d5b6d))['filter'](_0xe862ab=>_0xe862ab[_0x16dbfa(0xd0)]===_0x335b6f);if(_0x288063['length']===0x0)throw CliErrors[_0x16dbfa(0xac)](_0x16dbfa(0xa9)+_0x335b6f+_0x16dbfa(0xbc)+_0x3d5b6d+'.',_0x16dbfa(0xb3));if(_0x288063[_0x16dbfa(0xcd)]>0x1)throw CliErrors['validation']('Runtime\x20role\x20name\x20\x22'+_0x335b6f+'\x22\x20is\x20ambiguous.','Pass\x20one\x20role\x20ID:\x20'+_0x288063[_0x16dbfa(0xb8)](_0x53b79a=>_0x53b79a['id'])['join'](',\x20')+'.');return _0x288063[0x0];}function parseRuntimeUserId(_0x3962ba){const _0x435eec=a55_0x39e4bb,_0xcff168=_0x3962ba[_0x435eec(0xc7)](),_0x3d9963=normalizePositiveSafeInteger(_0xcff168);if(_0x3d9963===undefined)throw CliErrors[_0x435eec(0xac)](_0x435eec(0xd9),_0x435eec(0x9b));return _0x3d9963;}export async function prepareRuntimeMemberMutation(_0x31f193,_0x770977){const _0x3adea1=a55_0x39e4bb,_0x51f6e9=await resolveRuntimeRoleRef(_0x31f193[_0x3adea1(0x9f)],_0x31f193['str'](_0x3adea1(0xbd)));if(_0x51f6e9['roleType']===_0x3adea1(0xab))throw CliErrors[_0x3adea1(0xac)](_0x3adea1(0xc4),'Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.');const _0x10bc2a=parseRuntimeUserId(_0x31f193[_0x3adea1(0xa3)](_0x3adea1(0xd7))),_0x2ee59d=(await listRuntimeRoleUsers(_0x31f193['appCode']))['map'](_0x55f387=>({..._0x55f387,'userList':[..._0x55f387['userList']??[]],'applyUserList':[..._0x55f387[_0x3adea1(0xd4)]??[]]})),_0x1a1258=_0x2ee59d[_0x3adea1(0x99)](_0x409887=>_0x409887['id']===_0x51f6e9['id']);if(!_0x1a1258)throw CliErrors[_0x3adea1(0xac)](_0x3adea1(0xb1)+_0x51f6e9['id']+_0x3adea1(0xbf),_0x3adea1(0xa6));const _0x585c14=_0x1a1258[_0x3adea1(0x96)][_0x3adea1(0xb8)](_0x5b9f08=>_0x5b9f08['userId']),_0x2e5376=_0x31f193[_0x3adea1(0xb6)](_0x3adea1(0xb4));if(_0x2e5376!==undefined&&_0x2e5376!==null&&_0x2e5376!==''){const _0x2925aa=_0x31f193['num'](_0x3adea1(0xb4));if(!Number[_0x3adea1(0xd5)](_0x2925aa)||_0x2925aa<0x0)throw CliErrors[_0x3adea1(0xac)](_0x3adea1(0xa8));if(_0x585c14[_0x3adea1(0xcd)]!==_0x2925aa)throw CliErrors[_0x3adea1(0xac)](_0x3adea1(0x92)+_0x2925aa+_0x3adea1(0xd6)+_0x585c14[_0x3adea1(0xcd)]+'.',_0x3adea1(0xc5));}const _0x4e235f=_0x585c14[_0x3adea1(0xd3)](_0x10bc2a),_0x20697b=[];let _0xb4e54a=!![];if(_0x770977===_0x3adea1(0xc0)){const _0x221197=await listRuntimeAppUsers(_0x31f193[_0x3adea1(0x9f)]),_0x3dce7e=_0x221197[_0x3adea1(0xa0)](_0x4ef1d4=>Number(_0x4ef1d4[_0x3adea1(0x94)])===_0x10bc2a);if(_0x3dce7e['length']!==0x1||!_0x3dce7e[0x0][_0x3adea1(0xdc)]?.['trim']())throw CliErrors[_0x3adea1(0xac)](_0x3adea1(0xdb)+_0x10bc2a+_0x3adea1(0xb9)+_0x31f193[_0x3adea1(0x9f)]+'.',_0x3adea1(0xbe));_0x4e235f?(_0xb4e54a=![],_0x20697b['push'](_0x3adea1(0xdf)+_0x10bc2a+_0x3adea1(0xe1)+_0x51f6e9['id']+'.')):_0x1a1258[_0x3adea1(0x96)][_0x3adea1(0xce)]({'userId':_0x10bc2a,'username':_0x3dce7e[0x0][_0x3adea1(0xdc)]});}else!_0x4e235f?(_0xb4e54a=![],_0x20697b[_0x3adea1(0xce)](_0x3adea1(0xdf)+_0x10bc2a+_0x3adea1(0x95)+_0x51f6e9['id']+'.')):_0x1a1258[_0x3adea1(0x96)]=_0x1a1258[_0x3adea1(0x96)][_0x3adea1(0xa0)](_0x4a0002=>_0x4a0002[_0x3adea1(0x98)]!==_0x10bc2a);return{'role':_0x51f6e9,'userId':_0x10bc2a,'roleList':_0x2ee59d,'before':{'userIds':_0x585c14},'after':{'userIds':_0x1a1258[_0x3adea1(0x96)][_0x3adea1(0xb8)](_0x4e7774=>_0x4e7774[_0x3adea1(0x98)])},'shouldWrite':_0xb4e54a,'warnings':_0x20697b};}export function runtimeRoleWriteResult(_0x255293,_0xfff0fa,_0x439924,_0x1d70b1,_0x5437d5,_0xdc13cd=[]){return{'operation':_0x255293,'scope':'runtime','selector':_0xfff0fa,'before':_0x439924,'after':_0x1d70b1,'dryRun':![],'backend':_0x5437d5,'warnings':_0xdc13cd};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a56_0x36b402=a56_0x33d0;(function(_0x3b43b1,_0x3ddb3c){const _0x2e3ab7=a56_0x33d0,_0x1f7e81=_0x3b43b1();while(!![]){try{const _0x2c3f7c=-parseInt(_0x2e3ab7(0x1f5))/0x1+parseInt(_0x2e3ab7(0x1fa))/0x2+parseInt(_0x2e3ab7(0x1f8))/0x3*(-parseInt(_0x2e3ab7(0x1fc))/0x4)+parseInt(_0x2e3ab7(0x1e3))/0x5*(parseInt(_0x2e3ab7(0x1ec))/0x6)+-parseInt(_0x2e3ab7(0x1ed))/0x7*(-parseInt(_0x2e3ab7(0x1e0))/0x8)+-parseInt(_0x2e3ab7(0x1f4))/0x9*(-parseInt(_0x2e3ab7(0x1e7))/0xa)+-parseInt(_0x2e3ab7(0x1df))/0xb;if(_0x2c3f7c===_0x3ddb3c)break;else _0x1f7e81['push'](_0x1f7e81['shift']());}catch(_0x862882){_0x1f7e81['push'](_0x1f7e81['shift']());}}}(a56_0x2a0e,0x4ef46));function a56_0x33d0(_0x328dcd,_0x59b362){_0x328dcd=_0x328dcd-0x1db;const _0x2a0e4d=a56_0x2a0e();let _0x33d0e3=_0x2a0e4d[_0x328dcd];return _0x33d0e3;}import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,readOptionalRuntimeRoleCode,ROLE_CODE_FLAG,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0xa42edd){const _0x5ab2a5=a56_0x33d0,_0x3878a3=_0xa42edd[_0x5ab2a5(0x1f1)](_0x5ab2a5(0x1e1))!==undefined,_0x571b48=_0xa42edd[_0x5ab2a5(0x1f1)](_0x5ab2a5(0x1f2))!==undefined,_0x522669=_0xa42edd[_0x5ab2a5(0x1f1)](_0x5ab2a5(0x1dd))!==undefined;if(!_0x3878a3&&!_0x571b48&&!_0x522669)throw CliErrors[_0x5ab2a5(0x1dc)]('Pass\x20--role-code,\x20--name,\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.');const _0x5615b7=readOptionalRuntimeRoleCode(_0xa42edd),_0x46963c=_0xa42edd[_0x5ab2a5(0x1ee)](_0x5ab2a5(0x1f2))[_0x5ab2a5(0x1e9)](),_0x3c456b=_0xa42edd[_0x5ab2a5(0x1ee)]('remark')[_0x5ab2a5(0x1e9)]();if(_0x571b48&&!_0x46963c)throw CliErrors['validation'](_0x5ab2a5(0x1ea));if(_0x522669&&!_0x3c456b)throw CliErrors[_0x5ab2a5(0x1dc)]('--remark\x20must\x20not\x20be\x20blank.',_0x5ab2a5(0x1db));return{..._0x5615b7?{'roleCode':_0x5615b7}:{},..._0x571b48?{'roleName':_0x46963c}:{},..._0x522669?{'remark':_0x3c456b}:{}};}function a56_0x2a0e(){const _0x40954e=['role-code','Update\x20a\x20runtime\x20CUSTOM\x20role\x27s\x20code,\x20name,\x20or\x20remark','2688155eCIHSd','body','New\x20non-empty\x20role\x20remark','build','10BpYdqj','Changes\x20the\x20custom\x20role\x20code,\x20name,\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20updates\x20immediately.','trim','--name\x20must\x20not\x20be\x20blank.','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','6MeaLzm','4415327XCOZoJ','str','New\x20role\x20name','string','flag','name','update','1398159yHNdCJ','258787dNyhiQ','POST','num','3XzurOj','appCode','842310oRDXyb','role','354252qLplPd','/client/permit/role/update','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','validation','remark','high-risk-write','11815650QOXkbz','8uEkUzo'];a56_0x2a0e=function(){return _0x40954e;};return a56_0x2a0e();}async function prepare(_0x48dfe1){const _0x53fbc9=a56_0x33d0,_0x3fd72f=await getRuntimeRoleById(_0x48dfe1[_0x53fbc9(0x1f9)],_0x48dfe1[_0x53fbc9(0x1f7)]('id'));return assertCustomRuntimeRole(_0x3fd72f,_0x53fbc9(0x1f3)),{'role':_0x3fd72f,'body':{'id':_0x3fd72f['id'],'appCode':_0x48dfe1[_0x53fbc9(0x1f9)],...updateFields(_0x48dfe1)}};}export const roleUpdate={'service':a56_0x36b402(0x1fb),'command':'update','description':a56_0x36b402(0x1e2),'risk':a56_0x36b402(0x1de),'confirmationDescription':a56_0x36b402(0x1e8),'flags':[ROLE_ID_FLAG,ROLE_CODE_FLAG,{'name':'name','type':a56_0x36b402(0x1f0),'description':a56_0x36b402(0x1ef)},{'name':'remark','type':a56_0x36b402(0x1f0),'description':a56_0x36b402(0x1e5)}],async 'validate'(_0x38d7cd){updateFields(_0x38d7cd);},async 'dryRun'(_0x2c6672){const _0x18cc13=a56_0x36b402,{body:_0x444c55}=await prepare(_0x2c6672);return dryRun(_0x18cc13(0x1f6),_0x18cc13(0x1fd))[_0x18cc13(0x1e4)](_0x444c55)['description'](_0x18cc13(0x1eb))[_0x18cc13(0x1e6)]();},async 'execute'(_0x16c903){const _0x3caa43=a56_0x36b402,{role:_0xf38017,body:_0x324606}=await prepare(_0x16c903),_0x531bae=await updateRuntimeAppRole(_0x324606);return{'ok':!![],'data':runtimeRoleWriteResult(_0x3caa43(0x1f3),{'roleId':_0xf38017['id']},projectRuntimeRole(_0xf38017),projectRuntimeRole(_0x531bae),{'method':'POST','path':_0x3caa43(0x1fd)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a57_0x4d5a(_0x29f917,_0x22c636){_0x29f917=_0x29f917-0xda;const _0x47a604=a57_0x47a6();let _0x4d5a95=_0x47a604[_0x29f917];return _0x4d5a95;}const a57_0x547703=a57_0x4d5a;function a57_0x47a6(){const _0x443bfc=['22315EejRJg','appCode','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','role','Preview:\x20add\x20runtime\x20role\x20member','6hHlUdT','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','roleList','1454143vZzgcp','6891864XIVqbn','434358PxnIhR','after','description','9bfFvJA','POST','warnings','high-risk-write','/client/permit/user-role/update-user-list','152bEObUE','before','7688984sPkVta','22hsIJIw','10900470hyPOVb','shouldWrite','user-add','3573894irWhMh'];a57_0x47a6=function(){return _0x443bfc;};return a57_0x47a6();}(function(_0x3c36fe,_0x535dd8){const _0x34219b=a57_0x4d5a,_0x361bde=_0x3c36fe();while(!![]){try{const _0x6a2fc2=parseInt(_0x34219b(0xdd))/0x1+parseInt(_0x34219b(0xdf))/0x2+parseInt(_0x34219b(0xee))/0x3+parseInt(_0x34219b(0xe7))/0x4*(parseInt(_0x34219b(0xef))/0x5)+-parseInt(_0x34219b(0xda))/0x6*(-parseInt(_0x34219b(0xde))/0x7)+-parseInt(_0x34219b(0xe9))/0x8*(parseInt(_0x34219b(0xe2))/0x9)+-parseInt(_0x34219b(0xeb))/0xa*(parseInt(_0x34219b(0xea))/0xb);if(_0x6a2fc2===_0x535dd8)break;else _0x361bde['push'](_0x361bde['shift']());}catch(_0x3d7ac4){_0x361bde['push'](_0x361bde['shift']());}}}(a57_0x47a6,0xd5c1d));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a57_0x547703(0xf2),'command':a57_0x547703(0xed),'description':a57_0x547703(0xf1),'risk':a57_0x547703(0xe5),'confirmationDescription':a57_0x547703(0xdb),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x4240c1){const _0x3e9145=a57_0x547703,_0x370dec=await prepareRuntimeMemberMutation(_0x4240c1,_0x3e9145(0xed));return dryRun('POST','/client/permit/user-role/update-user-list')['body']({'appCode':_0x4240c1[_0x3e9145(0xf0)],'roleList':_0x370dec[_0x3e9145(0xdc)]})[_0x3e9145(0xe1)](_0x370dec[_0x3e9145(0xec)]?_0x3e9145(0xf3):_0x370dec[_0x3e9145(0xe4)][0x0])['build']();},async 'execute'(_0x3cf5ae){const _0x4fe91d=a57_0x547703,_0x36343c=await prepareRuntimeMemberMutation(_0x3cf5ae,_0x4fe91d(0xed));return _0x36343c[_0x4fe91d(0xec)]&&await updateRuntimeRoleUsers(_0x3cf5ae[_0x4fe91d(0xf0)],_0x36343c[_0x4fe91d(0xdc)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x4fe91d(0xed),{'roleId':_0x36343c['role']['id'],'userId':_0x36343c['userId']},_0x36343c[_0x4fe91d(0xe8)],_0x36343c[_0x4fe91d(0xe0)],{'method':_0x4fe91d(0xe3),'path':_0x4fe91d(0xe6)},_0x36343c[_0x4fe91d(0xe4)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a58_0x2a96c2=a58_0x1ea8;function a58_0x5a97(){const _0xd95774=['before','Preview:\x20remove\x20runtime\x20role\x20member','after','84GqaAYN','role','warnings','roleList','user-remove','shouldWrite','3201136KrkKIs','12OJDsmK','7315315OQDJxb','18484848fnrXjP','50974txOLHk','userId','appCode','1207525crXnZs','3230852CXLZJA','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','description','70252MluETD','/client/permit/user-role/update-user-list','high-risk-write'];a58_0x5a97=function(){return _0xd95774;};return a58_0x5a97();}function a58_0x1ea8(_0x5f45f3,_0x4a6dec){_0x5f45f3=_0x5f45f3-0x1d4;const _0x5a974f=a58_0x5a97();let _0x1ea804=_0x5a974f[_0x5f45f3];return _0x1ea804;}(function(_0x374862,_0x5b818a){const _0x3ca2ec=a58_0x1ea8,_0xdc724d=_0x374862();while(!![]){try{const _0x53785d=-parseInt(_0x3ca2ec(0x1e5))/0x1+parseInt(_0x3ca2ec(0x1de))/0x2*(parseInt(_0x3ca2ec(0x1d4))/0x3)+parseInt(_0x3ca2ec(0x1e2))/0x4+-parseInt(_0x3ca2ec(0x1e1))/0x5*(-parseInt(_0x3ca2ec(0x1db))/0x6)+parseInt(_0x3ca2ec(0x1dc))/0x7+-parseInt(_0x3ca2ec(0x1da))/0x8+-parseInt(_0x3ca2ec(0x1dd))/0x9;if(_0x53785d===_0x5b818a)break;else _0xdc724d['push'](_0xdc724d['shift']());}catch(_0x20f266){_0xdc724d['push'](_0xdc724d['shift']());}}}(a58_0x5a97,0x80352));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a58_0x2a96c2(0x1d5),'command':a58_0x2a96c2(0x1d8),'description':'Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','risk':a58_0x2a96c2(0x1e7),'confirmationDescription':a58_0x2a96c2(0x1e3),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0xe3c15b){const _0x23c6e7=a58_0x2a96c2,_0x3db9a1=await prepareRuntimeMemberMutation(_0xe3c15b,_0x23c6e7(0x1d8));return dryRun('POST',_0x23c6e7(0x1e6))['body']({'appCode':_0xe3c15b[_0x23c6e7(0x1e0)],'roleList':_0x3db9a1[_0x23c6e7(0x1d7)]})[_0x23c6e7(0x1e4)](_0x3db9a1[_0x23c6e7(0x1d9)]?_0x23c6e7(0x1e9):_0x3db9a1[_0x23c6e7(0x1d6)][0x0])['build']();},async 'execute'(_0xab9f5){const _0x5c585c=a58_0x2a96c2,_0x876c9=await prepareRuntimeMemberMutation(_0xab9f5,_0x5c585c(0x1d8));return _0x876c9[_0x5c585c(0x1d9)]&&await updateRuntimeRoleUsers(_0xab9f5[_0x5c585c(0x1e0)],_0x876c9[_0x5c585c(0x1d7)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x5c585c(0x1d8),{'roleId':_0x876c9[_0x5c585c(0x1d5)]['id'],'userId':_0x876c9[_0x5c585c(0x1df)]},_0x876c9[_0x5c585c(0x1e8)],_0x876c9[_0x5c585c(0x1ea)],{'method':'POST','path':'/client/permit/user-role/update-user-list'},_0x876c9[_0x5c585c(0x1d6)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x266aa3=a59_0x91b5;(function(_0x2c8b66,_0x26dfcd){const _0x66c3d3=a59_0x91b5,_0x46721b=_0x2c8b66();while(!![]){try{const _0x298b2e=parseInt(_0x66c3d3(0x123))/0x1+parseInt(_0x66c3d3(0x118))/0x2*(parseInt(_0x66c3d3(0x11e))/0x3)+parseInt(_0x66c3d3(0x115))/0x4+parseInt(_0x66c3d3(0x10e))/0x5+-parseInt(_0x66c3d3(0x11b))/0x6+parseInt(_0x66c3d3(0x140))/0x7+-parseInt(_0x66c3d3(0x11d))/0x8;if(_0x298b2e===_0x26dfcd)break;else _0x46721b['push'](_0x46721b['shift']());}catch(_0x168cb2){_0x46721b['push'](_0x46721b['shift']());}}}(a59_0x1d16,0x2b112));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a59_0x266aa3(0x133),'type':a59_0x266aa3(0x111),'required':!![],'enum':[a59_0x266aa3(0x144),a59_0x266aa3(0x130)],'description':a59_0x266aa3(0x13f)},CRON_FLAG={'name':a59_0x266aa3(0x11c),'type':a59_0x266aa3(0x111),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a59_0x266aa3(0x152),'type':a59_0x266aa3(0x111),'description':a59_0x266aa3(0x149)},TITLE_FLAG={'name':a59_0x266aa3(0x148),'type':a59_0x266aa3(0x111),'required':!![],'description':a59_0x266aa3(0x117)},PROMPT_FLAG={'name':a59_0x266aa3(0x136),'type':a59_0x266aa3(0x111),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},MODEL_FLAG={'name':a59_0x266aa3(0x143),'type':a59_0x266aa3(0x111),'enum':[a59_0x266aa3(0x154),a59_0x266aa3(0x14d),a59_0x266aa3(0x145)],'default':'deepseek-v4-flash-0731','description':'Task\x20model\x20used\x20when\x20the\x20schedule\x20runs'},SCHEDULE_ID_FLAG={'name':a59_0x266aa3(0x10d),'type':a59_0x266aa3(0x111),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a59_0x266aa3(0x14c),'type':a59_0x266aa3(0x13c),'default':0x14,'description':a59_0x266aa3(0x113)},CURSOR_FLAG={'name':'cursor','type':'string','description':a59_0x266aa3(0x11f)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x128596){const _0x1fb5e4=a59_0x266aa3,_0x16b5ef=_0x128596[_0x1fb5e4(0x112)](_0x1fb5e4(0x133)),_0x1bf44d=_0x128596['str'](_0x1fb5e4(0x148))[_0x1fb5e4(0x141)](),_0xc464fe=_0x128596[_0x1fb5e4(0x112)](_0x1fb5e4(0x136))[_0x1fb5e4(0x141)](),_0x2973ae=_0x128596[_0x1fb5e4(0x112)]('model'),_0x1c22e4=_0x128596['str']('cron'),_0x4efe28=_0x128596[_0x1fb5e4(0x112)](_0x1fb5e4(0x152));if(!_0x1bf44d)throw CliErrors['validation'](_0x1fb5e4(0x139));if(!_0xc464fe)throw CliErrors['validation']('--prompt\x20must\x20not\x20be\x20blank.');if(_0x16b5ef===_0x1fb5e4(0x144)){if(!_0x1c22e4||_0x4efe28)throw CliErrors[_0x1fb5e4(0x11a)]('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x16b5ef,'timezone':_0x1fb5e4(0x13e),'cron':_0x1c22e4,'title':_0x1bf44d,'prompt':_0xc464fe,'model':_0x2973ae};}if(_0x16b5ef==='ONCE'){if(!_0x4efe28||_0x1c22e4)throw CliErrors['validation'](_0x1fb5e4(0x12f));return{'kind':_0x16b5ef,'timezone':'UTC','scheduledAt':_0x4efe28,'title':_0x1bf44d,'prompt':_0xc464fe,'model':_0x2973ae};}throw CliErrors[_0x1fb5e4(0x11a)](_0x1fb5e4(0x12c));}function scheduleCollectionPath(_0x2570c5){const _0xd59f83=a59_0x266aa3;return _0xd59f83(0x14e)+encodeURIComponent(_0x2570c5)+_0xd59f83(0x124);}function a59_0x91b5(_0x265555,_0x26c255){_0x265555=_0x265555-0x10d;const _0x1d16b6=a59_0x1d16();let _0x91b530=_0x1d16b6[_0x265555];return _0x91b530;}function scheduleItemPath(_0x10f15b,_0x405c12){return scheduleCollectionPath(_0x10f15b)+'/'+encodeURIComponent(_0x405c12);}const scheduleValidate={'service':a59_0x266aa3(0x12e),'command':a59_0x266aa3(0x122),'description':a59_0x266aa3(0x142),'risk':a59_0x266aa3(0x129),'flags':INPUT_FLAGS,async 'validate'(_0x251784){readScheduleInput(_0x251784);},async 'execute'(_0x5608c7){const _0x1202f0=a59_0x266aa3,_0xcc8942=readScheduleInput(_0x5608c7),_0x4e634e=await validateRuntimeSchedule(_0x5608c7[_0x1202f0(0x135)],_0xcc8942);return{'ok':!![],'data':_0x4e634e,'message':_0x1202f0(0x120)};}},scheduleCreate={'service':'schedule','command':a59_0x266aa3(0x146),'description':a59_0x266aa3(0x116),'risk':a59_0x266aa3(0x10f),'confirmationDescription':a59_0x266aa3(0x14b),'flags':INPUT_FLAGS,async 'validate'(_0x7d7511){readScheduleInput(_0x7d7511);},async 'execute'(_0x46fb88){const _0x2de568=a59_0x266aa3,_0x156571=readScheduleInput(_0x46fb88),_0x42b2eb=await validateRuntimeSchedule(_0x46fb88[_0x2de568(0x135)],_0x156571),_0x1c90fa=await createRuntimeSchedule(_0x46fb88[_0x2de568(0x135)],_0x42b2eb);return{'ok':!![],'data':_0x1c90fa,'message':_0x2de568(0x138)+_0x1c90fa[_0x2de568(0x133)]+_0x2de568(0x14a)+_0x1c90fa[_0x2de568(0x147)]};},async 'dryRun'(_0x6cf0cf){const _0x5198f3=a59_0x266aa3,_0x3fb511=readScheduleInput(_0x6cf0cf);return dryRun(_0x5198f3(0x150),scheduleCollectionPath(_0x6cf0cf['appCode']))[_0x5198f3(0x128)](_0x3fb511)[_0x5198f3(0x155)](_0x5198f3(0x12b))[_0x5198f3(0x127)]();}},scheduleList={'service':a59_0x266aa3(0x12e),'command':a59_0x266aa3(0x157),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a59_0x266aa3(0x129),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x45c4ea){const _0x365963=a59_0x266aa3,_0x1eb024=_0x45c4ea[_0x365963(0x110)](_0x365963(0x14c));if(!Number[_0x365963(0x12a)](_0x1eb024)||_0x1eb024<0x1||_0x1eb024>0x64)throw CliErrors['validation'](_0x365963(0x126));const _0x5150a2=_0x45c4ea[_0x365963(0x112)](_0x365963(0x131));if(_0x5150a2&&(_0x5150a2[_0x365963(0x13a)]>0x400||_0x5150a2[_0x365963(0x141)]()!==_0x5150a2))throw CliErrors[_0x365963(0x11a)](_0x365963(0x119));},async 'execute'(_0x14d4c3){const _0x4f2b28=a59_0x266aa3,_0x1e5685=_0x14d4c3['str'](_0x4f2b28(0x131)),_0x545ab3=await listRuntimeSchedules(_0x14d4c3[_0x4f2b28(0x135)],{'kind':_0x14d4c3[_0x4f2b28(0x112)](_0x4f2b28(0x133)),'limit':_0x14d4c3[_0x4f2b28(0x110)]('limit'),..._0x1e5685?{'cursor':_0x1e5685}:{}});return{'ok':!![],'data':_0x545ab3};}},scheduleDetail={'service':a59_0x266aa3(0x12e),'command':'detail','description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2d5d65){const _0x1e3949=a59_0x266aa3,_0x16b8bf=await getRuntimeSchedule(_0x2d5d65['appCode'],_0x2d5d65[_0x1e3949(0x112)]('schedule-id'));return{'ok':!![],'data':_0x16b8bf};}},scheduleRun={'service':a59_0x266aa3(0x12e),'command':a59_0x266aa3(0x12d),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a59_0x266aa3(0x10f),'confirmationDescription':'Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x639f2){const _0x58e815=a59_0x266aa3,_0x19b6a1=_0x639f2['str']('schedule-id'),_0xc3a4f2=await runRuntimeSchedule(_0x639f2['appCode'],_0x19b6a1);return{'ok':!![],'data':_0xc3a4f2,'message':_0x58e815(0x151)+_0xc3a4f2[_0x58e815(0x114)]+_0x58e815(0x121)+_0x19b6a1};},async 'dryRun'(_0x4f80c5){const _0x569f00=a59_0x266aa3,_0x513951=_0x4f80c5[_0x569f00(0x112)](_0x569f00(0x10d));return dryRun(_0x569f00(0x150),scheduleItemPath(_0x4f80c5['appCode'],_0x513951)+_0x569f00(0x13b))[_0x569f00(0x155)](_0x569f00(0x14f)+_0x513951+_0x569f00(0x132))[_0x569f00(0x127)]();}},scheduleDelete={'service':a59_0x266aa3(0x12e),'command':a59_0x266aa3(0x13d),'description':a59_0x266aa3(0x156),'risk':a59_0x266aa3(0x10f),'confirmationDescription':a59_0x266aa3(0x125),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2de55b){const _0x5c4728=a59_0x266aa3,_0x22f21d=_0x2de55b[_0x5c4728(0x112)]('schedule-id'),_0x2cbfe0=await deleteRuntimeSchedule(_0x2de55b['appCode'],_0x22f21d);return{'ok':!![],'data':_0x2cbfe0,'message':_0x5c4728(0x153)+_0x22f21d};},async 'dryRun'(_0x1152f1){const _0x4ae4fb=a59_0x266aa3,_0x218abe=_0x1152f1[_0x4ae4fb(0x112)]('schedule-id');return dryRun(_0x4ae4fb(0x134),scheduleItemPath(_0x1152f1[_0x4ae4fb(0x135)],_0x218abe))[_0x4ae4fb(0x155)](_0x4ae4fb(0x137)+_0x218abe)[_0x4ae4fb(0x127)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];function a59_0x1d16(){const _0x410714=['Queued\x20Task\x20','scheduled-at','Deleted\x20schedule\x20','kimi/k3','description','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','list','schedule-id','1017470zsesff','high-risk-write','num','string','str','Page\x20size\x20from\x201\x20to\x20100','taskId','363052ksnGzJ','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','Schedule\x20title','2978uDHfrF','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','validation','835584HZRpDf','cron','3439408YXwAYi','66FsIJou','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Schedule\x20input\x20is\x20valid','\x20from\x20schedule\x20','validate','162627eLedYB','/schedules','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','build','body','read','isSafeInteger','Preview:\x20create\x20an\x20Agent\x20schedule','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','run','schedule','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','ONCE','cursor','\x20immediately','kind','DELETE','appCode','prompt','Preview:\x20delete\x20schedule\x20','Created\x20','--title\x20must\x20not\x20be\x20blank.','length','/run','number','delete','UTC','Schedule\x20kind:\x20CRON\x20or\x20ONCE','1791650NwrJZE','trim','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','model','CRON','deepseek-v4-pro-0813','create','scheduleId','title','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','\x20schedule\x20','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','limit','deepseek-v4-flash-0731','/api/harness/apps/','Preview:\x20run\x20schedule\x20','POST'];a59_0x1d16=function(){return _0x410714;};return a59_0x1d16();}
|
|
1
|
+
function a59_0x16d7(){const _0x3353f0=['num','132871ryeqYt','isSafeInteger','Show\x20one\x20schedule\x20by\x20schedule\x20ID','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','body','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','Schedule\x20kind:\x20CRON\x20or\x20ONCE','detail','Queued\x20Task\x20','length','model','751610CAFrjA','appCode','/run','Preview:\x20delete\x20schedule\x20','/schedules','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','description','schedule-id','cron','Schedule\x20UUID','\x20schedule\x20','scheduled-at','765177tUpjwC','read','/api/harness/apps/','Schedule\x20title','list','Created\x20','validation','\x20from\x20schedule\x20','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','kind','string','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','CRON','POST','build','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','number','run','trim','7XOqVcp','scheduleId','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','create','Page\x20size\x20from\x201\x20to\x20100','4okRYtd','2106492mRgDyz','limit','schedule','prompt','Preview:\x20run\x20schedule\x20','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','--prompt\x20must\x20not\x20be\x20blank.','Preview:\x20create\x20an\x20Agent\x20schedule','ONCE','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','\x20immediately','30879855mXflWu','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','kimi/k3','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','deepseek-v4-flash-0731','title','8310955DySzla','high-risk-write','4141416iBfRhB','str','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','cursor'];a59_0x16d7=function(){return _0x3353f0;};return a59_0x16d7();}const a59_0x1df674=a59_0x3631;(function(_0x362c54,_0x428527){const _0x6b6384=a59_0x3631,_0x194aff=_0x362c54();while(!![]){try{const _0x5c3177=-parseInt(_0x6b6384(0xe0))/0x1+-parseInt(_0x6b6384(0xeb))/0x2+-parseInt(_0x6b6384(0xae))/0x3+parseInt(_0x6b6384(0xc6))/0x4*(-parseInt(_0x6b6384(0xd9))/0x5)+parseInt(_0x6b6384(0xc7))/0x6*(parseInt(_0x6b6384(0xc1))/0x7)+-parseInt(_0x6b6384(0xdb))/0x8+parseInt(_0x6b6384(0xd2))/0x9;if(_0x5c3177===_0x428527)break;else _0x194aff['push'](_0x194aff['shift']());}catch(_0x5d2932){_0x194aff['push'](_0x194aff['shift']());}}}(a59_0x16d7,0xccbae));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a59_0x3631(_0x1e36a7,_0x5b16bc){_0x1e36a7=_0x1e36a7-0xa9;const _0x16d78e=a59_0x16d7();let _0x363199=_0x16d78e[_0x1e36a7];return _0x363199;}const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':'kind','type':a59_0x1df674(0xb8),'required':!![],'enum':[a59_0x1df674(0xba),a59_0x1df674(0xcf)],'description':a59_0x1df674(0xe6)},CRON_FLAG={'name':'cron','type':'string','description':a59_0x1df674(0xd0)},SCHEDULED_AT_FLAG={'name':a59_0x1df674(0xad),'type':'string','description':a59_0x1df674(0xd4)},TITLE_FLAG={'name':a59_0x1df674(0xd8),'type':a59_0x1df674(0xb8),'required':!![],'description':a59_0x1df674(0xb1)},PROMPT_FLAG={'name':a59_0x1df674(0xca),'type':a59_0x1df674(0xb8),'required':!![],'description':a59_0x1df674(0xb6)},MODEL_FLAG={'name':a59_0x1df674(0xea),'type':a59_0x1df674(0xb8),'enum':[a59_0x1df674(0xd5),'deepseek-v4-flash-0731','deepseek-v4-pro-0813'],'default':a59_0x1df674(0xd7),'description':'Task\x20model\x20used\x20when\x20the\x20schedule\x20runs'},SCHEDULE_ID_FLAG={'name':'schedule-id','type':a59_0x1df674(0xb8),'required':!![],'description':a59_0x1df674(0xab),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a59_0x1df674(0xcc)}},LIMIT_FLAG={'name':a59_0x1df674(0xc8),'type':a59_0x1df674(0xbe),'default':0x14,'description':a59_0x1df674(0xc5)},CURSOR_FLAG={'name':'cursor','type':a59_0x1df674(0xb8),'description':'Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call'},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x193e85){const _0x587b54=a59_0x1df674,_0x4f3aaa=_0x193e85[_0x587b54(0xdc)](_0x587b54(0xb7)),_0x14e365=_0x193e85['str']('title')[_0x587b54(0xc0)](),_0x1990b3=_0x193e85[_0x587b54(0xdc)](_0x587b54(0xca))[_0x587b54(0xc0)](),_0x43c8b7=_0x193e85[_0x587b54(0xdc)](_0x587b54(0xea)),_0x5f2528=_0x193e85[_0x587b54(0xdc)](_0x587b54(0xaa)),_0x35a1a2=_0x193e85[_0x587b54(0xdc)](_0x587b54(0xad));if(!_0x14e365)throw CliErrors[_0x587b54(0xb4)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x1990b3)throw CliErrors[_0x587b54(0xb4)](_0x587b54(0xcd));if(_0x4f3aaa==='CRON'){if(!_0x5f2528||_0x35a1a2)throw CliErrors['validation'](_0x587b54(0xf0));return{'kind':_0x4f3aaa,'timezone':'UTC','cron':_0x5f2528,'title':_0x14e365,'prompt':_0x1990b3,'model':_0x43c8b7};}if(_0x4f3aaa===_0x587b54(0xcf)){if(!_0x35a1a2||_0x5f2528)throw CliErrors[_0x587b54(0xb4)](_0x587b54(0xbd));return{'kind':_0x4f3aaa,'timezone':'UTC','scheduledAt':_0x35a1a2,'title':_0x14e365,'prompt':_0x1990b3,'model':_0x43c8b7};}throw CliErrors[_0x587b54(0xb4)](_0x587b54(0xb9));}function scheduleCollectionPath(_0x19d4da){const _0x52f25f=a59_0x1df674;return _0x52f25f(0xb0)+encodeURIComponent(_0x19d4da)+_0x52f25f(0xef);}function scheduleItemPath(_0x1161c5,_0x570ce8){return scheduleCollectionPath(_0x1161c5)+'/'+encodeURIComponent(_0x570ce8);}const scheduleValidate={'service':a59_0x1df674(0xc9),'command':'validate','description':'Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','risk':a59_0x1df674(0xaf),'flags':INPUT_FLAGS,async 'validate'(_0xaa2f9d){readScheduleInput(_0xaa2f9d);},async 'execute'(_0x171208){const _0x5f84fb=readScheduleInput(_0x171208),_0x20286d=await validateRuntimeSchedule(_0x171208['appCode'],_0x5f84fb);return{'ok':!![],'data':_0x20286d,'message':'Schedule\x20input\x20is\x20valid'};}},scheduleCreate={'service':a59_0x1df674(0xc9),'command':a59_0x1df674(0xc4),'description':a59_0x1df674(0xe3),'risk':a59_0x1df674(0xda),'confirmationDescription':a59_0x1df674(0xd3),'flags':INPUT_FLAGS,async 'validate'(_0x9a93da){readScheduleInput(_0x9a93da);},async 'execute'(_0x516586){const _0x280f4f=a59_0x1df674,_0x3e4a8a=readScheduleInput(_0x516586),_0x54e7fa=await validateRuntimeSchedule(_0x516586[_0x280f4f(0xec)],_0x3e4a8a),_0x57cd13=await createRuntimeSchedule(_0x516586[_0x280f4f(0xec)],_0x54e7fa);return{'ok':!![],'data':_0x57cd13,'message':_0x280f4f(0xb3)+_0x57cd13[_0x280f4f(0xb7)]+_0x280f4f(0xac)+_0x57cd13[_0x280f4f(0xc2)]};},async 'dryRun'(_0x1318c4){const _0x349aa2=a59_0x1df674,_0x3f3734=readScheduleInput(_0x1318c4);return dryRun('POST',scheduleCollectionPath(_0x1318c4[_0x349aa2(0xec)]))[_0x349aa2(0xe4)](_0x3f3734)[_0x349aa2(0xf1)](_0x349aa2(0xce))[_0x349aa2(0xbc)]();}},scheduleList={'service':'schedule','command':a59_0x1df674(0xb2),'description':a59_0x1df674(0xd6),'risk':a59_0x1df674(0xaf),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x108722){const _0x212ae0=a59_0x1df674,_0x4b8f2b=_0x108722['num']('limit');if(!Number[_0x212ae0(0xe1)](_0x4b8f2b)||_0x4b8f2b<0x1||_0x4b8f2b>0x64)throw CliErrors[_0x212ae0(0xb4)](_0x212ae0(0xdd));const _0x61146b=_0x108722[_0x212ae0(0xdc)](_0x212ae0(0xde));if(_0x61146b&&(_0x61146b[_0x212ae0(0xe9)]>0x400||_0x61146b[_0x212ae0(0xc0)]()!==_0x61146b))throw CliErrors[_0x212ae0(0xb4)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x9b86e6){const _0x523739=a59_0x1df674,_0x30347b=_0x9b86e6[_0x523739(0xdc)]('cursor'),_0x438aaa=await listRuntimeSchedules(_0x9b86e6[_0x523739(0xec)],{'kind':_0x9b86e6[_0x523739(0xdc)]('kind'),'limit':_0x9b86e6[_0x523739(0xdf)](_0x523739(0xc8)),..._0x30347b?{'cursor':_0x30347b}:{}});return{'ok':!![],'data':_0x438aaa};}},scheduleDetail={'service':'schedule','command':a59_0x1df674(0xe7),'description':a59_0x1df674(0xe2),'risk':a59_0x1df674(0xaf),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x338326){const _0x3eeb2f=a59_0x1df674,_0x2cb18d=await getRuntimeSchedule(_0x338326['appCode'],_0x338326[_0x3eeb2f(0xdc)](_0x3eeb2f(0xa9)));return{'ok':!![],'data':_0x2cb18d};}},scheduleRun={'service':'schedule','command':a59_0x1df674(0xbf),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a59_0x1df674(0xda),'confirmationDescription':'Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xd5d461){const _0xe68196=a59_0x1df674,_0x3bc2c8=_0xd5d461[_0xe68196(0xdc)](_0xe68196(0xa9)),_0x418e67=await runRuntimeSchedule(_0xd5d461[_0xe68196(0xec)],_0x3bc2c8);return{'ok':!![],'data':_0x418e67,'message':_0xe68196(0xe8)+_0x418e67['taskId']+_0xe68196(0xb5)+_0x3bc2c8};},async 'dryRun'(_0x489d33){const _0x387d0d=a59_0x1df674,_0x971359=_0x489d33[_0x387d0d(0xdc)](_0x387d0d(0xa9));return dryRun(_0x387d0d(0xbb),scheduleItemPath(_0x489d33[_0x387d0d(0xec)],_0x971359)+_0x387d0d(0xed))[_0x387d0d(0xf1)](_0x387d0d(0xcb)+_0x971359+_0x387d0d(0xd1))[_0x387d0d(0xbc)]();}},scheduleDelete={'service':a59_0x1df674(0xc9),'command':'delete','description':a59_0x1df674(0xc3),'risk':a59_0x1df674(0xda),'confirmationDescription':a59_0x1df674(0xe5),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x50358d){const _0x221cdb=a59_0x1df674,_0x45984e=_0x50358d['str'](_0x221cdb(0xa9)),_0x21e910=await deleteRuntimeSchedule(_0x50358d[_0x221cdb(0xec)],_0x45984e);return{'ok':!![],'data':_0x21e910,'message':'Deleted\x20schedule\x20'+_0x45984e};},async 'dryRun'(_0x2ffa55){const _0x26df6c=a59_0x1df674,_0x4b39af=_0x2ffa55[_0x26df6c(0xdc)](_0x26df6c(0xa9));return dryRun('DELETE',scheduleItemPath(_0x2ffa55[_0x26df6c(0xec)],_0x4b39af))['description'](_0x26df6c(0xee)+_0x4b39af)[_0x26df6c(0xbc)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0xdc3d3e=a60_0x384f;(function(_0x11a475,_0x27db97){const _0x26d707=a60_0x384f,_0x4f3393=_0x11a475();while(!![]){try{const _0x540dfc=-parseInt(_0x26d707(0x1b9))/0x1+-parseInt(_0x26d707(0x1c3))/0x2*(-parseInt(_0x26d707(0x1c7))/0x3)+parseInt(_0x26d707(0x1c1))/0x4+-parseInt(_0x26d707(0x1ba))/0x5+parseInt(_0x26d707(0x1bf))/0x6*(parseInt(_0x26d707(0x1bc))/0x7)+-parseInt(_0x26d707(0x1be))/0x8*(-parseInt(_0x26d707(0x1c2))/0x9)+-parseInt(_0x26d707(0x1c4))/0xa*(parseInt(_0x26d707(0x1bb))/0xb);if(_0x540dfc===_0x27db97)break;else _0x4f3393['push'](_0x4f3393['shift']());}catch(_0x153cd4){_0x4f3393['push'](_0x4f3393['shift']());}}}(a60_0x4a6a,0x27163));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1dc409){const _0x182060=await buildSchemaPayload();return{'ok':!![],'data':_0x182060};}function a60_0x4a6a(){const _0x4f9dfb=['680388QZufiw','export','1066372kJqfAQ','3051goiPUe','2PZBFMP','3451490tMcGqb','schema','read','75783KLHQSs','129487LFfmHd','536580rDuNtT','11RtgbOU','14DrQwTC','Export\x20machine-readable\x20command\x20schema\x20(JSON)','5272FhyJzi'];a60_0x4a6a=function(){return _0x4f9dfb;};return a60_0x4a6a();}function a60_0x384f(_0x5a3873,_0x3b02bc){_0x5a3873=_0x5a3873-0x1b9;const _0x4a6a3e=a60_0x4a6a();let _0x384fa2=_0x4a6a3e[_0x5a3873];return _0x384fa2;}export const schemaDefinition={'service':a60_0xdc3d3e(0x1c5),'command':a60_0xdc3d3e(0x1c0),'description':a60_0xdc3d3e(0x1bd),'risk':a60_0xdc3d3e(0x1c6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x45f3dd,_0xef654c){const _0xab6b46=a61_0x416d,_0x21ef8f=_0x45f3dd();while(!![]){try{const _0x95d698=-parseInt(_0xab6b46(0x256))/0x1*(-parseInt(_0xab6b46(0x23b))/0x2)+parseInt(_0xab6b46(0x1fc))/0x3*(-parseInt(_0xab6b46(0x242))/0x4)+-parseInt(_0xab6b46(0x201))/0x5+-parseInt(_0xab6b46(0x206))/0x6*(-parseInt(_0xab6b46(0x23e))/0x7)+parseInt(_0xab6b46(0x1ff))/0x8*(parseInt(_0xab6b46(0x22f))/0x9)+-parseInt(_0xab6b46(0x208))/0xa+parseInt(_0xab6b46(0x251))/0xb;if(_0x95d698===_0xef654c)break;else _0x21ef8f['push'](_0x21ef8f['shift']());}catch(_0x5d4f0f){_0x21ef8f['push'](_0x21ef8f['shift']());}}}(a61_0xdb2c,0x356bd));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';function a61_0x416d(_0xca0920,_0x75cb27){_0xca0920=_0xca0920-0x1eb;const _0xdb2c24=a61_0xdb2c();let _0x416db1=_0xdb2c24[_0xca0920];return _0x416db1;}import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x2771c,_0x508903){const _0x5dd89c=a61_0x416d,_0x2de8ff=listLocalServiceTrees();let _0x3e73ee;for(const _0x103f6a of _0x2de8ff){const _0x4a3228=matchServiceTreeCommand(_0x103f6a,_0x2771c);if(!_0x4a3228)continue;(!_0x3e73ee||_0x4a3228[_0x5dd89c(0x204)][_0x5dd89c(0x213)][_0x5dd89c(0x1f8)]>_0x3e73ee[_0x5dd89c(0x204)][_0x5dd89c(0x213)][_0x5dd89c(0x1f8)])&&(_0x3e73ee={'tree':_0x103f6a,'command':_0x4a3228[_0x5dd89c(0x204)],'remainingArgs':_0x4a3228[_0x5dd89c(0x22e)]});}if(!_0x3e73ee)return undefined;const _0x30158d={..._0x508903};return applyAppBinding(_0x3e73ee[_0x5dd89c(0x238)],_0x3e73ee['command'],_0x30158d),{'definition':buildDynamicCommandDefinition(_0x3e73ee[_0x5dd89c(0x238)],_0x3e73ee[_0x5dd89c(0x204)]),'args':_0x3e73ee[_0x5dd89c(0x22e)],'flags':_0x30158d,'tree':_0x3e73ee['tree'],'command':_0x3e73ee['command']};}export function generateDynamicServiceHelp(_0x2fd5d1){const _0xe2bf20=a61_0x416d,_0x16ad02=listLocalServiceTrees()[_0xe2bf20(0x259)](_0x791017=>_0x791017[_0xe2bf20(0x23f)][_0xe2bf20(0x235)]===_0x2fd5d1);if(!_0x16ad02)return undefined;const _0x32b692=[CLI_BIN_NAME+'\x20'+_0x2fd5d1+_0xe2bf20(0x237),'',_0x16ad02['service']['name']||_0x2fd5d1,_0x16ad02[_0xe2bf20(0x23f)][_0xe2bf20(0x214)]?'\x20\x20'+_0x16ad02[_0xe2bf20(0x23f)][_0xe2bf20(0x214)]:'','',_0xe2bf20(0x20a),..._0x16ad02[_0xe2bf20(0x203)][_0xe2bf20(0x21a)](_0x39d7db=>{const _0x2ef9ab=_0xe2bf20,_0x128120=_0x39d7db[_0x2ef9ab(0x213)]['slice'](0x1)[_0x2ef9ab(0x229)]('\x20'),_0x3e5534=_0x39d7db[_0x2ef9ab(0x1f7)]==='read'?'':'\x20['+_0x39d7db[_0x2ef9ab(0x1f7)]+']';return'\x20\x20'+_0x128120['padEnd'](0x18)+'\x20'+(_0x39d7db['description']||'')+_0x3e5534;}),'',_0xe2bf20(0x219)+CLI_BIN_NAME+_0xe2bf20(0x1f1)+_0x2fd5d1+_0xe2bf20(0x255)][_0xe2bf20(0x20d)](Boolean);return _0x32b692[_0xe2bf20(0x229)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x2089ea=>{const _0x2e8e9c=a61_0x416d,_0x237bfa=_0x2089ea[_0x2e8e9c(0x1f6)];return{'service':_0x237bfa[_0x2e8e9c(0x23f)][_0x2e8e9c(0x235)],'label':_0x237bfa[_0x2e8e9c(0x23f)][_0x2e8e9c(0x253)]||_0x237bfa[_0x2e8e9c(0x23f)]['code'],'commands':_0x237bfa[_0x2e8e9c(0x203)][_0x2e8e9c(0x21a)](_0x537369=>({'command':dynamicCommandName(_0x537369),'description':_0x537369[_0x2e8e9c(0x214)]||_0x2e8e9c(0x215)+_0x537369[_0x2e8e9c(0x24c)],'tag':riskTag(_0x537369[_0x2e8e9c(0x1f7)])}))};});}export function getDynamicServiceEntry(_0x212324){const _0x201c64=a61_0x416d;return listDynamicServiceEntries()[_0x201c64(0x259)](_0xc455b=>_0xc455b['service']===_0x212324);}export function listDynamicServiceDefinitions(_0x28acc7){const _0x2382bd=a61_0x416d;return listLocalServiceTrees()[_0x2382bd(0x20d)](_0xd901f6=>!_0x28acc7||_0xd901f6['service'][_0x2382bd(0x235)]===_0x28acc7)['flatMap'](_0xe72d9c=>_0xe72d9c[_0x2382bd(0x203)][_0x2382bd(0x21a)](_0x213979=>buildDynamicCommandDefinition(_0xe72d9c,_0x213979)));}export function getDynamicServiceDefinitions(_0xd15224){const _0x1f1d55=a61_0x416d,_0x359ebd=listDynamicServiceDefinitions(_0xd15224);return _0x359ebd[_0x1f1d55(0x1f8)]>0x0?_0x359ebd:undefined;}export function findDynamicServiceDefinition(_0x1ce793,_0x43cb79){const _0x1c11e7=a61_0x416d;return listDynamicServiceDefinitions(_0x1ce793)['find'](_0x51b6a3=>_0x51b6a3[_0x1c11e7(0x204)]===_0x43cb79);}export function buildDynamicCommandDefinition(_0x23d701,_0x1cf9e8){const _0x37c4ad=a61_0x416d;return{'service':_0x23d701[_0x37c4ad(0x23f)][_0x37c4ad(0x235)],'command':dynamicCommandName(_0x1cf9e8),'description':_0x1cf9e8['description']||_0x37c4ad(0x215)+_0x1cf9e8['cliPath'],'risk':_0x1cf9e8[_0x37c4ad(0x1f7)],..._0x1cf9e8[_0x37c4ad(0x1f7)]===_0x37c4ad(0x247)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x1cf9e8)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x1cf9e8[_0x37c4ad(0x1f3)][_0x37c4ad(0x21a)](_0x150582=>({'name':_0x150582[_0x37c4ad(0x253)],'description':_0x150582[_0x37c4ad(0x214)]||_0x150582[_0x37c4ad(0x253)],'required':_0x150582['required']})),'flags':_0x1cf9e8[_0x37c4ad(0x221)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x1cf9e8),async 'dryRun'(_0x257b34){const _0x4bf9e0=_0x37c4ad,_0x4b20f3=await compilePlan(_0x1cf9e8,_0x257b34);return{'method':_0x4bf9e0(0x205),'url':_0x1cf9e8['cliPath'],'body':{'target':targetPreview(_0x4b20f3),'params':_0x4b20f3[_0x4bf9e0(0x244)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x1cf9e8[_0x4bf9e0(0x24c)]};},async 'execute'(_0x41046d){const _0x5b8477=_0x37c4ad,_0x4effb3=await compilePlan(_0x1cf9e8,_0x41046d),_0x17f7f7=Date['now'](),_0x8a2db4=await executePlan(_0x4effb3,_0x1cf9e8,_0x41046d),_0x49653c=Date[_0x5b8477(0x21b)]()-_0x17f7f7;return{'ok':!![],'data':{'service':_0x23d701[_0x5b8477(0x23f)],'command':_0x1cf9e8['cliPath'],'target':targetPreview(_0x4effb3),'result':_0x8a2db4,'elapsed':_0x49653c},'message':_0x5b8477(0x24b)+_0x1cf9e8['cliPath']+_0x5b8477(0x254)+_0x49653c+'ms'};}};}function buildDynamicConfirmationDescription(_0x36b744){const _0x4eda41=a61_0x416d,_0x8fb8ee=_0x36b744[_0x4eda41(0x214)]||_0x36b744[_0x4eda41(0x24c)],_0x3e8e25=_0x36b744[_0x4eda41(0x1f7)]===_0x4eda41(0x239)?_0x4eda41(0x258):_0x4eda41(0x24f);return'This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22'+_0x8fb8ee+_0x4eda41(0x1fa)+_0x3e8e25;}function dynamicCommandName(_0x3db6b9){const _0x267481=a61_0x416d;return _0x3db6b9['fullPath'][_0x267481(0x1fb)](0x1)[_0x267481(0x229)]('\x20');}function riskTag(_0x5e85ee){const _0x265cea=a61_0x416d;return _0x5e85ee===_0x265cea(0x247)?'':_0x265cea(0x21c)+_0x5e85ee+']';}function flagToCommandFlag(_0x4b9217){const _0x24244d=a61_0x416d;return{'name':_0x4b9217[_0x24244d(0x245)],'type':_0x4b9217['type']===_0x24244d(0x248)?_0x24244d(0x24e):_0x4b9217[_0x24244d(0x249)],'description':_0x4b9217[_0x24244d(0x214)]||_0x4b9217[_0x24244d(0x253)],'required':_0x4b9217[_0x24244d(0x24a)],'default':isPrimitiveFlagDefault(_0x4b9217[_0x24244d(0x209)])?_0x4b9217[_0x24244d(0x209)]:undefined,'enum':_0x4b9217[_0x24244d(0x230)]};}async function compilePlan(_0x428e4c,_0xb5d4f1){const _0x5cc8c4=a61_0x416d;return compileServiceTreeCommand(_0x428e4c,{'flags':_0xb5d4f1[_0x5cc8c4(0x1f4)],'args':_0xb5d4f1[_0x5cc8c4(0x1f3)],'context':await buildServiceContext(_0x428e4c,_0xb5d4f1)});}async function buildServiceContext(_0x4e7cf5,_0x131b8d){const _0x3ccc68=a61_0x416d,_0xbfde80={'appCode':_0x131b8d[_0x3ccc68(0x218)],'env':_0x131b8d[_0x3ccc68(0x224)],'envName':_0x131b8d[_0x3ccc68(0x224)]};if(!usesRuntimeContext(_0x4e7cf5))return _0xbfde80;const _0x39f1b2=await getLoginUserInfo(),_0x1c6c7b=pickFirst(_0x39f1b2[_0x3ccc68(0x22a)],_0x39f1b2['id']);return{..._0xbfde80,'user':_0x39f1b2,'userId':_0x1c6c7b,'id':_0x39f1b2['id'],'username':pickFirst(_0x39f1b2[_0x3ccc68(0x252)],_0x39f1b2[_0x3ccc68(0x1f2)],_0x39f1b2[_0x3ccc68(0x257)]),'userName':_0x39f1b2[_0x3ccc68(0x1f2)],'nickname':pickFirst(_0x39f1b2['nickname'],_0x39f1b2['nickName']),'nickName':_0x39f1b2['nickName'],'tenantCode':_0x39f1b2[_0x3ccc68(0x246)],'employeeId':_0x39f1b2[_0x3ccc68(0x23c)]};}function usesRuntimeContext(_0x2a825c){const _0x3ad127=a61_0x416d;return _0x2a825c['mapTo']['some'](_0x42b607=>typeof _0x42b607['source']===_0x3ad127(0x24e)&&(_0x42b607[_0x3ad127(0x21e)]['startsWith']('context.')||_0x42b607[_0x3ad127(0x21e)][_0x3ad127(0x24d)](_0x3ad127(0x20b))));}function pickFirst(..._0x532e4d){const _0x5050ce=a61_0x416d;return _0x532e4d[_0x5050ce(0x259)](_0x10152c=>_0x10152c!==undefined&&_0x10152c!==null);}async function executePlan(_0x3a4396,_0x5034ab,_0x4a5657){const _0x5225ea=a61_0x416d;if(_0x3a4396[_0x5225ea(0x22b)]===_0x5225ea(0x1f5)){const _0x153dae=await resolveDatasetCode(_0x3a4396,_0x5034ab,_0x4a5657);return executeData(_0x153dae,_0x3a4396[_0x5225ea(0x204)],_0x3a4396[_0x5225ea(0x244)]);}if(_0x3a4396[_0x5225ea(0x22b)]===_0x5225ea(0x222)){if(!_0x3a4396['sqlCode'])throw CliErrors[_0x5225ea(0x217)](_0x5225ea(0x24b)+_0x5034ab[_0x5225ea(0x24c)]+_0x5225ea(0x223));return executeSdkSql(_0x3a4396[_0x5225ea(0x240)],normalizeScalarParams(_0x3a4396[_0x5225ea(0x244)]));}if(_0x3a4396[_0x5225ea(0x22b)]===_0x5225ea(0x1ef)){const _0xedabfe=_0x3a4396[_0x5225ea(0x1f9)]||_0x3a4396[_0x5225ea(0x210)]||(_0x3a4396[_0x5225ea(0x22c)]==null?'':String(_0x3a4396['bffId']));if(!_0xedabfe)throw CliErrors[_0x5225ea(0x217)](_0x5225ea(0x24b)+_0x5034ab[_0x5225ea(0x24c)]+_0x5225ea(0x1f0));return executeSdkBff(_0xedabfe,_0x3a4396[_0x5225ea(0x244)]);}throw CliErrors[_0x5225ea(0x217)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x3a4396[_0x5225ea(0x22b)]);}async function resolveDatasetCode(_0x134ae3,_0x875b0e,_0x5e8924){const _0x3e8247=a61_0x416d;if(_0x134ae3[_0x3e8247(0x20f)])return _0x134ae3['datasetCode'];if(!_0x134ae3['datatable'])throw CliErrors[_0x3e8247(0x217)](_0x3e8247(0x24b)+_0x875b0e[_0x3e8247(0x24c)]+_0x3e8247(0x216));const _0x257b6e=await listDatasets(_0x5e8924[_0x3e8247(0x218)]),_0x1c7ff3=_0x257b6e[_0x3e8247(0x259)](_0x3ed406=>_0x3ed406[_0x3e8247(0x211)]?.[_0x3e8247(0x228)]===_0x134ae3[_0x3e8247(0x200)]);if(!_0x1c7ff3?.[_0x3e8247(0x235)])throw CliErrors[_0x3e8247(0x217)](_0x3e8247(0x227)+_0x134ae3[_0x3e8247(0x200)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x5e8924[_0x3e8247(0x218)]+'.',_0x3e8247(0x236));return _0x1c7ff3[_0x3e8247(0x235)];}function applyAppBinding(_0x5c6342,_0x124a2a,_0x39e056){const _0x42eb85=a61_0x416d,_0x5b583b=_0x124a2a[_0x42eb85(0x1fe)]['appRef'];if(!_0x5b583b)return;const _0x1bcf80=_0x5c6342[_0x42eb85(0x21d)][_0x5b583b];if(!_0x1bcf80)throw CliErrors['validation'](_0x42eb85(0x226)+_0x5b583b+_0x42eb85(0x202)+_0x124a2a[_0x42eb85(0x24c)]+'.',_0x42eb85(0x21f));const _0x24149e=_0x1bcf80['appcode']||_0x1bcf80['appCode'];_0x24149e&&!hasText(_0x39e056['appcode'])&&(_0x39e056['appcode']=_0x24149e),_0x1bcf80[_0x42eb85(0x243)]&&!hasText(_0x39e056['app'])&&!hasText(_0x39e056[_0x42eb85(0x1fd)])&&(_0x39e056['app']=_0x1bcf80[_0x42eb85(0x243)]),_0x1bcf80[_0x42eb85(0x1ed)]&&!hasText(_0x39e056[_0x42eb85(0x1ed)])&&(_0x39e056[_0x42eb85(0x1ed)]=_0x1bcf80['env']);}function renderDynamicCommandHelp(_0x505112){const _0x13a7c0=a61_0x416d,_0x53093e=[_0x13a7c0(0x232),_0x13a7c0(0x1eb)+_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x22b)],_0x13a7c0(0x22d)+_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x204)]];if(_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x20f)])_0x53093e['push'](_0x13a7c0(0x207)+_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x20f)]);if(_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x200)])_0x53093e[_0x13a7c0(0x1ee)](_0x13a7c0(0x225)+_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x200)]);if(_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x240)])_0x53093e[_0x13a7c0(0x1ee)](_0x13a7c0(0x250)+_0x505112[_0x13a7c0(0x1fe)]['sqlCode']);if(_0x505112[_0x13a7c0(0x1fe)][_0x13a7c0(0x1f9)])_0x53093e[_0x13a7c0(0x1ee)](_0x13a7c0(0x23d)+_0x505112['target'][_0x13a7c0(0x1f9)]);if(_0x505112[_0x13a7c0(0x212)][_0x13a7c0(0x1f8)]>0x0){_0x53093e['push']('',_0x13a7c0(0x23a));for(const _0x2d83a1 of _0x505112['mapTo']){_0x53093e[_0x13a7c0(0x1ee)](_0x13a7c0(0x1ec)+(_0x2d83a1[_0x13a7c0(0x21e)]||_0x13a7c0(0x20c))+_0x13a7c0(0x234)+_0x2d83a1[_0x13a7c0(0x1fe)]+(_0x2d83a1[_0x13a7c0(0x241)]?'.'+_0x2d83a1['operator']:''));}}return _0x53093e['join']('\x0a');}function targetPreview(_0x5b7f03){const _0x4b592b=a61_0x416d;return{'kind':_0x5b7f03[_0x4b592b(0x22b)],'command':_0x5b7f03[_0x4b592b(0x204)],'appRef':_0x5b7f03['appRef'],'datasetCode':_0x5b7f03[_0x4b592b(0x20f)],'datatable':_0x5b7f03[_0x4b592b(0x200)],'sqlCode':_0x5b7f03[_0x4b592b(0x240)],'bffCode':_0x5b7f03[_0x4b592b(0x210)],'bffId':_0x5b7f03[_0x4b592b(0x22c)],'functionName':_0x5b7f03[_0x4b592b(0x1f9)]};}function normalizeScalarParams(_0x32e0d5){const _0x62875=a61_0x416d;return Object[_0x62875(0x220)](Object[_0x62875(0x20e)](_0x32e0d5)[_0x62875(0x20d)](([,_0xe18df5])=>typeof _0xe18df5===_0x62875(0x24e)||typeof _0xe18df5===_0x62875(0x231)));}function hasText(_0x3134a3){const _0x402213=a61_0x416d;return typeof _0x3134a3===_0x402213(0x24e)&&_0x3134a3[_0x402213(0x233)]()['length']>0x0;}function a61_0xdb2c(){const _0x372cb5=['221864vIdOpD','datatable','506345LMhhbB','\x22\x20in\x20service\x20command\x20','commands','command','SERVICE_TREE','48OIPEGY','\x20\x20\x20\x20datasetCode:\x20','3316860OltkKA','default','Commands:','ctx.','const','filter','entries','datasetCode','bffCode','dbtableConfig','mapTo','fullPath','description','Run\x20service\x20command\x20','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','validation','appCode','Use\x20`','map','now','\x20\x20[','appBindings','source','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','fromEntries','flags','sql','\x20requires\x20target.sqlCode.','envName','\x20\x20\x20\x20datatable:\x20','Unknown\x20appRef\x20\x22','Cannot\x20resolve\x20datatable\x20\x22','tableName','join','userId','kind','bffId','\x20\x20\x20\x20command:\x20','remainingArgs','63nqqLHb','enum','number','\x20\x20SERVICE\x20TREE\x20TARGET','trim','\x20->\x20','code','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20<command>\x20[flags]','tree','high-risk-write','\x20\x20MAP\x20TO','22SHEQyg','employeeId','\x20\x20\x20\x20functionName:\x20','72191PWcCiP','service','sqlCode','operator','136SGCFvE','app','params','cliName','tenantCode','read','json','type','required','Service\x20command\x20','cliPath','startsWith','string','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','\x20\x20\x20\x20sqlCode:\x20','1691008VWTnOA','username','name','\x20completed\x20in\x20','`\x20to\x20inspect\x20the\x20manifest.','26393cdzOBk','loginName','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','find','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20\x20\x20\x20','env','push','bff','\x20requires\x20target.functionName.','\x20service\x20detail\x20--service\x20','userName','args','rawFlags','data','normalizedManifest','risk','length','scriptName','\x22.\x20','slice','6081yiezYs','appcode','target'];a61_0xdb2c=function(){return _0x372cb5;};return a61_0xdb2c();}function isPrimitiveFlagDefault(_0x10e2fe){const _0x5201dd=a61_0x416d;return _0x10e2fe===undefined||typeof _0x10e2fe==='string'||typeof _0x10e2fe===_0x5201dd(0x231)||typeof _0x10e2fe==='boolean';}
|
|
1
|
+
function a61_0xf62e(_0x5992ee,_0x2ea312){_0x5992ee=_0x5992ee-0x1bf;const _0x36f512=a61_0x36f5();let _0xf62e3b=_0x36f512[_0x5992ee];return _0xf62e3b;}(function(_0x64e6a1,_0x303623){const _0x5e97e2=a61_0xf62e,_0x3b198f=_0x64e6a1();while(!![]){try{const _0x1e55dd=parseInt(_0x5e97e2(0x216))/0x1*(parseInt(_0x5e97e2(0x203))/0x2)+-parseInt(_0x5e97e2(0x1d7))/0x3+-parseInt(_0x5e97e2(0x20c))/0x4+-parseInt(_0x5e97e2(0x20e))/0x5*(parseInt(_0x5e97e2(0x202))/0x6)+parseInt(_0x5e97e2(0x21e))/0x7+parseInt(_0x5e97e2(0x1ff))/0x8+parseInt(_0x5e97e2(0x214))/0x9;if(_0x1e55dd===_0x303623)break;else _0x3b198f['push'](_0x3b198f['shift']());}catch(_0x3958b2){_0x3b198f['push'](_0x3b198f['shift']());}}}(a61_0x36f5,0x8e630));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';function a61_0x36f5(){const _0x12bcf5=['data','args','description','context.','kind','appcode','startsWith','\x22\x20in\x20service\x20command\x20','push','bff','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','userName','join','\x20completed\x20in\x20','username','tree','type','\x20\x20\x20\x20functionName:\x20','datasetCode','Unsupported\x20service\x20target\x20kind:\x20','service','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','`\x20to\x20inspect\x20the\x20manifest.','\x20\x20[','ctx.','datatable','1319223gLAZIc','operator','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','commands','Preview\x20dynamic\x20service\x20command:\x20','length','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','rawFlags','tenantCode','now','filter','tableName','default','trim','target','nickname','cliName','cliPath','flags','\x20->\x20','loginName','env','employeeId','sqlCode','slice','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','name','number','scriptName','\x20service\x20detail\x20--service\x20','appCode','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','find','enum','padEnd','fullPath','map','source','1739280gnZWsC','code','\x20\x20\x20\x20','6kvIhvd','517394tpaImu','Commands:','Cannot\x20resolve\x20datatable\x20\x22','high-risk-write','mapTo','\x20\x20SERVICE\x20TREE\x20TARGET','SERVICE_TREE','required','appRef','3740088fBxGRH','normalizedManifest','3954180NVYbSD','string','Service\x20command\x20','app','some','const','10650186tCRyNi','\x20requires\x20target.sqlCode.','1jOQuqx','params','remainingArgs','\x20\x20\x20\x20command:\x20','Run\x20service\x20command\x20','command','appBindings','read','7625478NwweTP','bffId','validation','flatMap','envName','nickName','Use\x20`'];a61_0x36f5=function(){return _0x12bcf5;};return a61_0x36f5();}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x240b47,_0x3b7f86){const _0x3e4204=a61_0xf62e,_0x1e8a9e=listLocalServiceTrees();let _0x2e2199;for(const _0x529707 of _0x1e8a9e){const _0xc6d404=matchServiceTreeCommand(_0x529707,_0x240b47);if(!_0xc6d404)continue;(!_0x2e2199||_0xc6d404['command'][_0x3e4204(0x1fc)][_0x3e4204(0x1dc)]>_0x2e2199[_0x3e4204(0x21b)][_0x3e4204(0x1fc)][_0x3e4204(0x1dc)])&&(_0x2e2199={'tree':_0x529707,'command':_0xc6d404['command'],'remainingArgs':_0xc6d404[_0x3e4204(0x218)]});}if(!_0x2e2199)return undefined;const _0x2dee08={..._0x3b7f86};return applyAppBinding(_0x2e2199[_0x3e4204(0x1cc)],_0x2e2199[_0x3e4204(0x21b)],_0x2dee08),{'definition':buildDynamicCommandDefinition(_0x2e2199[_0x3e4204(0x1cc)],_0x2e2199[_0x3e4204(0x21b)]),'args':_0x2e2199[_0x3e4204(0x218)],'flags':_0x2dee08,'tree':_0x2e2199[_0x3e4204(0x1cc)],'command':_0x2e2199[_0x3e4204(0x21b)]};}export function generateDynamicServiceHelp(_0x124eeb){const _0x55a724=a61_0xf62e,_0x2d0aef=listLocalServiceTrees()[_0x55a724(0x1f9)](_0x5cf2e5=>_0x5cf2e5[_0x55a724(0x1d1)][_0x55a724(0x200)]===_0x124eeb);if(!_0x2d0aef)return undefined;const _0x2c342c=[CLI_BIN_NAME+'\x20'+_0x124eeb+'\x20<command>\x20[flags]','',_0x2d0aef[_0x55a724(0x1d1)][_0x55a724(0x1f2)]||_0x124eeb,_0x2d0aef[_0x55a724(0x1d1)][_0x55a724(0x1bf)]?'\x20\x20'+_0x2d0aef['service'][_0x55a724(0x1bf)]:'','',_0x55a724(0x204),..._0x2d0aef[_0x55a724(0x1da)][_0x55a724(0x1fd)](_0x1d595d=>{const _0x58d965=_0x55a724,_0x1011b1=_0x1d595d['fullPath'][_0x58d965(0x1ef)](0x1)[_0x58d965(0x1c9)]('\x20'),_0xafc44c=_0x1d595d[_0x58d965(0x1f8)]===_0x58d965(0x21d)?'':'\x20['+_0x1d595d[_0x58d965(0x1f8)]+']';return'\x20\x20'+_0x1011b1[_0x58d965(0x1fb)](0x18)+'\x20'+(_0x1d595d[_0x58d965(0x1bf)]||'')+_0xafc44c;}),'',_0x55a724(0x224)+CLI_BIN_NAME+_0x55a724(0x1f5)+_0x124eeb+_0x55a724(0x1d3)][_0x55a724(0x1e1)](Boolean);return _0x2c342c[_0x55a724(0x1c9)]('\x0a');}export function listDynamicServiceEntries(){const _0x2ef27b=a61_0xf62e;return listLocalServices()[_0x2ef27b(0x1fd)](_0x403d64=>{const _0x5cbd4d=_0x2ef27b,_0x512492=_0x403d64[_0x5cbd4d(0x20d)];return{'service':_0x512492[_0x5cbd4d(0x1d1)]['code'],'label':_0x512492['service'][_0x5cbd4d(0x1f2)]||_0x512492[_0x5cbd4d(0x1d1)][_0x5cbd4d(0x200)],'commands':_0x512492[_0x5cbd4d(0x1da)][_0x5cbd4d(0x1fd)](_0x388bac=>({'command':dynamicCommandName(_0x388bac),'description':_0x388bac[_0x5cbd4d(0x1bf)]||_0x5cbd4d(0x21a)+_0x388bac[_0x5cbd4d(0x1e8)],'tag':riskTag(_0x388bac[_0x5cbd4d(0x1f8)])}))};});}export function getDynamicServiceEntry(_0x19d4e8){const _0x113f9a=a61_0xf62e;return listDynamicServiceEntries()[_0x113f9a(0x1f9)](_0x1c5d27=>_0x1c5d27[_0x113f9a(0x1d1)]===_0x19d4e8);}export function listDynamicServiceDefinitions(_0x3f1981){const _0x1fe045=a61_0xf62e;return listLocalServiceTrees()['filter'](_0x58dee1=>!_0x3f1981||_0x58dee1[_0x1fe045(0x1d1)][_0x1fe045(0x200)]===_0x3f1981)[_0x1fe045(0x221)](_0x517d92=>_0x517d92['commands'][_0x1fe045(0x1fd)](_0x1a96f1=>buildDynamicCommandDefinition(_0x517d92,_0x1a96f1)));}export function getDynamicServiceDefinitions(_0x2ef7a4){const _0x3f206d=a61_0xf62e,_0x53c77d=listDynamicServiceDefinitions(_0x2ef7a4);return _0x53c77d[_0x3f206d(0x1dc)]>0x0?_0x53c77d:undefined;}export function findDynamicServiceDefinition(_0x29d796,_0x3949f8){const _0x1917a2=a61_0xf62e;return listDynamicServiceDefinitions(_0x29d796)[_0x1917a2(0x1f9)](_0xfd27fc=>_0xfd27fc[_0x1917a2(0x21b)]===_0x3949f8);}export function buildDynamicCommandDefinition(_0x419857,_0x33bbae){const _0x14e84e=a61_0xf62e;return{'service':_0x419857[_0x14e84e(0x1d1)][_0x14e84e(0x200)],'command':dynamicCommandName(_0x33bbae),'description':_0x33bbae[_0x14e84e(0x1bf)]||'Run\x20service\x20command\x20'+_0x33bbae[_0x14e84e(0x1e8)],'risk':_0x33bbae[_0x14e84e(0x1f8)],..._0x33bbae[_0x14e84e(0x1f8)]===_0x14e84e(0x21d)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x33bbae)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x33bbae[_0x14e84e(0x226)][_0x14e84e(0x1fd)](_0x1c0910=>({'name':_0x1c0910[_0x14e84e(0x1f2)],'description':_0x1c0910[_0x14e84e(0x1bf)]||_0x1c0910[_0x14e84e(0x1f2)],'required':_0x1c0910[_0x14e84e(0x20a)]})),'flags':_0x33bbae[_0x14e84e(0x1e9)][_0x14e84e(0x1fd)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x33bbae),async 'dryRun'(_0x6deff6){const _0x5dde8b=_0x14e84e,_0x5b95e6=await compilePlan(_0x33bbae,_0x6deff6);return{'method':_0x5dde8b(0x209),'url':_0x33bbae[_0x5dde8b(0x1e8)],'body':{'target':targetPreview(_0x5b95e6),'params':_0x5b95e6[_0x5dde8b(0x217)]},'description':_0x5dde8b(0x1db)+_0x33bbae['cliPath']};},async 'execute'(_0x2b388a){const _0x339c7f=_0x14e84e,_0x47d585=await compilePlan(_0x33bbae,_0x2b388a),_0x208f5c=Date[_0x339c7f(0x1e0)](),_0x51e6f7=await executePlan(_0x47d585,_0x33bbae,_0x2b388a),_0x278de4=Date[_0x339c7f(0x1e0)]()-_0x208f5c;return{'ok':!![],'data':{'service':_0x419857[_0x339c7f(0x1d1)],'command':_0x33bbae[_0x339c7f(0x1e8)],'target':targetPreview(_0x47d585),'result':_0x51e6f7,'elapsed':_0x278de4},'message':'Service\x20command\x20'+_0x33bbae[_0x339c7f(0x1e8)]+_0x339c7f(0x1ca)+_0x278de4+'ms'};}};}function buildDynamicConfirmationDescription(_0x1d4156){const _0x4fde6f=a61_0xf62e,_0x286f8e=_0x1d4156[_0x4fde6f(0x1bf)]||_0x1d4156[_0x4fde6f(0x1e8)],_0x4a3465=_0x1d4156[_0x4fde6f(0x1f8)]===_0x4fde6f(0x206)?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':_0x4fde6f(0x1d2);return _0x4fde6f(0x1dd)+_0x286f8e+'\x22.\x20'+_0x4a3465;}function dynamicCommandName(_0x177c76){const _0x1d0895=a61_0xf62e;return _0x177c76[_0x1d0895(0x1fc)][_0x1d0895(0x1ef)](0x1)['join']('\x20');}function riskTag(_0x570f58){const _0x35ffc1=a61_0xf62e;return _0x570f58===_0x35ffc1(0x21d)?'':_0x35ffc1(0x1d4)+_0x570f58+']';}function flagToCommandFlag(_0x30cdaf){const _0x207c94=a61_0xf62e;return{'name':_0x30cdaf[_0x207c94(0x1e7)],'type':_0x30cdaf[_0x207c94(0x1cd)]==='json'?_0x207c94(0x20f):_0x30cdaf[_0x207c94(0x1cd)],'description':_0x30cdaf[_0x207c94(0x1bf)]||_0x30cdaf[_0x207c94(0x1f2)],'required':_0x30cdaf[_0x207c94(0x20a)],'default':isPrimitiveFlagDefault(_0x30cdaf[_0x207c94(0x1e3)])?_0x30cdaf[_0x207c94(0x1e3)]:undefined,'enum':_0x30cdaf[_0x207c94(0x1fa)]};}async function compilePlan(_0x1636eb,_0x368d33){const _0x43045a=a61_0xf62e;return compileServiceTreeCommand(_0x1636eb,{'flags':_0x368d33[_0x43045a(0x1de)],'args':_0x368d33[_0x43045a(0x226)],'context':await buildServiceContext(_0x1636eb,_0x368d33)});}async function buildServiceContext(_0x210b95,_0x2cc009){const _0x55694e=a61_0xf62e,_0x474aea={'appCode':_0x2cc009['appCode'],'env':_0x2cc009[_0x55694e(0x222)],'envName':_0x2cc009['envName']};if(!usesRuntimeContext(_0x210b95))return _0x474aea;const _0x11d107=await getLoginUserInfo(),_0x3665f8=pickFirst(_0x11d107['userId'],_0x11d107['id']);return{..._0x474aea,'user':_0x11d107,'userId':_0x3665f8,'id':_0x11d107['id'],'username':pickFirst(_0x11d107[_0x55694e(0x1cb)],_0x11d107['userName'],_0x11d107[_0x55694e(0x1eb)]),'userName':_0x11d107[_0x55694e(0x1c8)],'nickname':pickFirst(_0x11d107[_0x55694e(0x1e6)],_0x11d107[_0x55694e(0x223)]),'nickName':_0x11d107[_0x55694e(0x223)],'tenantCode':_0x11d107[_0x55694e(0x1df)],'employeeId':_0x11d107[_0x55694e(0x1ed)]};}function usesRuntimeContext(_0x3d62cd){const _0x26796a=a61_0xf62e;return _0x3d62cd[_0x26796a(0x207)][_0x26796a(0x212)](_0x1de0da=>typeof _0x1de0da['source']===_0x26796a(0x20f)&&(_0x1de0da['source'][_0x26796a(0x1c3)](_0x26796a(0x1c0))||_0x1de0da[_0x26796a(0x1fe)][_0x26796a(0x1c3)](_0x26796a(0x1d5))));}function pickFirst(..._0x1fa719){const _0x12bce3=a61_0xf62e;return _0x1fa719[_0x12bce3(0x1f9)](_0x469ec1=>_0x469ec1!==undefined&&_0x469ec1!==null);}async function executePlan(_0x2c80f3,_0x10f8b3,_0x526047){const _0x107576=a61_0xf62e;if(_0x2c80f3[_0x107576(0x1c1)]===_0x107576(0x225)){const _0xc54d83=await resolveDatasetCode(_0x2c80f3,_0x10f8b3,_0x526047);return executeData(_0xc54d83,_0x2c80f3[_0x107576(0x21b)],_0x2c80f3[_0x107576(0x217)]);}if(_0x2c80f3[_0x107576(0x1c1)]==='sql'){if(!_0x2c80f3[_0x107576(0x1ee)])throw CliErrors[_0x107576(0x220)]('Service\x20command\x20'+_0x10f8b3[_0x107576(0x1e8)]+_0x107576(0x215));return executeSdkSql(_0x2c80f3['sqlCode'],normalizeScalarParams(_0x2c80f3[_0x107576(0x217)]));}if(_0x2c80f3[_0x107576(0x1c1)]===_0x107576(0x1c6)){const _0x21a3e9=_0x2c80f3[_0x107576(0x1f4)]||_0x2c80f3['bffCode']||(_0x2c80f3[_0x107576(0x21f)]==null?'':String(_0x2c80f3[_0x107576(0x21f)]));if(!_0x21a3e9)throw CliErrors[_0x107576(0x220)]('Service\x20command\x20'+_0x10f8b3[_0x107576(0x1e8)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x21a3e9,_0x2c80f3[_0x107576(0x217)]);}throw CliErrors[_0x107576(0x220)](_0x107576(0x1d0)+_0x2c80f3[_0x107576(0x1c1)]);}async function resolveDatasetCode(_0xf64742,_0x5b41c3,_0x17ba57){const _0x5a3b33=a61_0xf62e;if(_0xf64742[_0x5a3b33(0x1cf)])return _0xf64742[_0x5a3b33(0x1cf)];if(!_0xf64742[_0x5a3b33(0x1d6)])throw CliErrors['validation'](_0x5a3b33(0x210)+_0x5b41c3[_0x5a3b33(0x1e8)]+_0x5a3b33(0x1c7));const _0x221f27=await listDatasets(_0x17ba57[_0x5a3b33(0x1f6)]),_0x105414=_0x221f27[_0x5a3b33(0x1f9)](_0x59ea64=>_0x59ea64['dbtableConfig']?.[_0x5a3b33(0x1e2)]===_0xf64742[_0x5a3b33(0x1d6)]);if(!_0x105414?.[_0x5a3b33(0x200)])throw CliErrors['validation'](_0x5a3b33(0x205)+_0xf64742[_0x5a3b33(0x1d6)]+_0x5a3b33(0x1d9)+_0x17ba57['appCode']+'.',_0x5a3b33(0x1f0));return _0x105414[_0x5a3b33(0x200)];}function applyAppBinding(_0x5a9245,_0x24fa96,_0x3d9b80){const _0x5a406e=a61_0xf62e,_0x135e80=_0x24fa96[_0x5a406e(0x1e5)][_0x5a406e(0x20b)];if(!_0x135e80)return;const _0x4f777e=_0x5a9245[_0x5a406e(0x21c)][_0x135e80];if(!_0x4f777e)throw CliErrors[_0x5a406e(0x220)]('Unknown\x20appRef\x20\x22'+_0x135e80+_0x5a406e(0x1c4)+_0x24fa96['cliPath']+'.',_0x5a406e(0x1f1));const _0x37a42e=_0x4f777e['appcode']||_0x4f777e[_0x5a406e(0x1f6)];_0x37a42e&&!hasText(_0x3d9b80[_0x5a406e(0x1c2)])&&(_0x3d9b80[_0x5a406e(0x1c2)]=_0x37a42e),_0x4f777e[_0x5a406e(0x211)]&&!hasText(_0x3d9b80[_0x5a406e(0x211)])&&!hasText(_0x3d9b80[_0x5a406e(0x1c2)])&&(_0x3d9b80[_0x5a406e(0x211)]=_0x4f777e[_0x5a406e(0x211)]),_0x4f777e[_0x5a406e(0x1ec)]&&!hasText(_0x3d9b80[_0x5a406e(0x1ec)])&&(_0x3d9b80[_0x5a406e(0x1ec)]=_0x4f777e['env']);}function renderDynamicCommandHelp(_0x2a95a0){const _0x435e40=a61_0xf62e,_0x444abb=[_0x435e40(0x208),_0x435e40(0x1f7)+_0x2a95a0[_0x435e40(0x1e5)][_0x435e40(0x1c1)],_0x435e40(0x219)+_0x2a95a0[_0x435e40(0x1e5)]['command']];if(_0x2a95a0['target'][_0x435e40(0x1cf)])_0x444abb[_0x435e40(0x1c5)]('\x20\x20\x20\x20datasetCode:\x20'+_0x2a95a0['target'][_0x435e40(0x1cf)]);if(_0x2a95a0[_0x435e40(0x1e5)]['datatable'])_0x444abb[_0x435e40(0x1c5)]('\x20\x20\x20\x20datatable:\x20'+_0x2a95a0[_0x435e40(0x1e5)][_0x435e40(0x1d6)]);if(_0x2a95a0['target'][_0x435e40(0x1ee)])_0x444abb[_0x435e40(0x1c5)]('\x20\x20\x20\x20sqlCode:\x20'+_0x2a95a0[_0x435e40(0x1e5)][_0x435e40(0x1ee)]);if(_0x2a95a0[_0x435e40(0x1e5)]['scriptName'])_0x444abb[_0x435e40(0x1c5)](_0x435e40(0x1ce)+_0x2a95a0[_0x435e40(0x1e5)][_0x435e40(0x1f4)]);if(_0x2a95a0['mapTo']['length']>0x0){_0x444abb['push']('','\x20\x20MAP\x20TO');for(const _0x34c626 of _0x2a95a0[_0x435e40(0x207)]){_0x444abb[_0x435e40(0x1c5)](_0x435e40(0x201)+(_0x34c626['source']||_0x435e40(0x213))+_0x435e40(0x1ea)+_0x34c626[_0x435e40(0x1e5)]+(_0x34c626['operator']?'.'+_0x34c626[_0x435e40(0x1d8)]:''));}}return _0x444abb[_0x435e40(0x1c9)]('\x0a');}function targetPreview(_0x29fa71){const _0x2f6b3a=a61_0xf62e;return{'kind':_0x29fa71[_0x2f6b3a(0x1c1)],'command':_0x29fa71[_0x2f6b3a(0x21b)],'appRef':_0x29fa71[_0x2f6b3a(0x20b)],'datasetCode':_0x29fa71[_0x2f6b3a(0x1cf)],'datatable':_0x29fa71['datatable'],'sqlCode':_0x29fa71['sqlCode'],'bffCode':_0x29fa71['bffCode'],'bffId':_0x29fa71[_0x2f6b3a(0x21f)],'functionName':_0x29fa71[_0x2f6b3a(0x1f4)]};}function normalizeScalarParams(_0x2b1019){const _0x4d0454=a61_0xf62e;return Object['fromEntries'](Object['entries'](_0x2b1019)[_0x4d0454(0x1e1)](([,_0x4eb5cb])=>typeof _0x4eb5cb===_0x4d0454(0x20f)||typeof _0x4eb5cb===_0x4d0454(0x1f3)));}function hasText(_0x5a651c){const _0x3f12e7=a61_0xf62e;return typeof _0x5a651c===_0x3f12e7(0x20f)&&_0x5a651c[_0x3f12e7(0x1e4)]()[_0x3f12e7(0x1dc)]>0x0;}function isPrimitiveFlagDefault(_0x422821){const _0x18a3f5=a61_0xf62e;return _0x422821===undefined||typeof _0x422821===_0x18a3f5(0x20f)||typeof _0x422821==='number'||typeof _0x422821==='boolean';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e3d99,_0x55ec20){const _0x323148=a62_0x8198,_0x517f46=_0x3e3d99();while(!![]){try{const _0x138f00=parseInt(_0x323148(0xd1))/0x1*(parseInt(_0x323148(0xab))/0x2)+parseInt(_0x323148(0xce))/0x3+parseInt(_0x323148(0xc2))/0x4*(parseInt(_0x323148(0xc7))/0x5)+parseInt(_0x323148(0xad))/0x6+-parseInt(_0x323148(0xc5))/0x7*(-parseInt(_0x323148(0xc4))/0x8)+-parseInt(_0x323148(0xb6))/0x9*(parseInt(_0x323148(0xc6))/0xa)+-parseInt(_0x323148(0xc0))/0xb*(parseInt(_0x323148(0xb8))/0xc);if(_0x138f00===_0x55ec20)break;else _0x517f46['push'](_0x517f46['shift']());}catch(_0x820f52){_0x517f46['push'](_0x517f46['shift']());}}}(a62_0x4ecd,0x82b57));export function adaptServiceTreeManifestForLegacyFramework(_0x99642f){const _0x17f6f9=a62_0x8198,_0x46cac9=cloneJsonValue(_0x99642f),_0xb94a30=[];if(!isObjectRecord(_0x46cac9))return{'manifest':_0x46cac9,'errors':_0xb94a30};return Array[_0x17f6f9(0xb4)](_0x46cac9['commands'])&&_0x46cac9['commands'][_0x17f6f9(0xbf)]((_0x39efc9,_0xdc1c13)=>{const _0x562175=_0x17f6f9;if(!isObjectRecord(_0x39efc9))return;adaptBffTarget(_0x39efc9['target'],_0x562175(0xb5)+_0xdc1c13+_0x562175(0xcc),_0xb94a30);}),adaptResources(_0x46cac9[_0x17f6f9(0xae)],_0x17f6f9(0xaf),_0xb94a30),{'manifest':_0x46cac9,'errors':_0xb94a30};}export function toPublicServiceTreeTarget(_0x4eeb56){const _0x3447c8=a62_0x8198,{scriptName:_0x57340e,..._0x252221}=_0x4eeb56;return typeof _0x57340e===_0x3447c8(0xb9)&&_0x57340e[_0x3447c8(0xcf)]()&&(_0x252221[_0x3447c8(0xcb)]=_0x57340e),_0x252221;}export function toPublicNormalizedServiceTree(_0x252713){const _0x140a9c=a62_0x8198;return{..._0x252713,'commands':_0x252713['commands'][_0x140a9c(0xd3)](_0xbdc1e=>({..._0xbdc1e,'target':toPublicServiceTreeTarget(_0xbdc1e[_0x140a9c(0xc8)])}))};}function a62_0x8198(_0xa7875e,_0x6bebcc){_0xa7875e=_0xa7875e-0xaa;const _0x4ecd04=a62_0x4ecd();let _0x8198f8=_0x4ecd04[_0xa7875e];return _0x8198f8;}function adaptResources(_0x4b9328,_0x6d33dd,_0x12d0ff){const _0x4051ec=a62_0x8198;if(!isObjectRecord(_0x4b9328))return;for(const [_0x344b44,_0x18c211]of Object[_0x4051ec(0xd0)](_0x4b9328)){if(!isObjectRecord(_0x18c211))continue;const _0x4eb2f7=_0x6d33dd+'.'+_0x344b44;if(isObjectRecord(_0x18c211['actions']))for(const [_0x324b1c,_0x551e0b]of Object[_0x4051ec(0xd0)](_0x18c211[_0x4051ec(0xc1)])){if(!isObjectRecord(_0x551e0b))continue;const _0x1a903a=_0x4eb2f7+_0x4051ec(0xd2)+_0x324b1c,_0x459986=isObjectRecord(_0x551e0b[_0x4051ec(0xc8)])&&_0x551e0b[_0x4051ec(0xc8)][_0x4051ec(0xb3)]===_0x4051ec(0xbc);adaptBffTarget(_0x551e0b[_0x4051ec(0xc8)],_0x1a903a+_0x4051ec(0xcd),_0x12d0ff),(_0x459986||isBffAction(_0x551e0b))&&adaptFunctionNameField(_0x551e0b,_0x1a903a,_0x12d0ff);}adaptResources(_0x18c211['resources'],_0x4eb2f7+_0x4051ec(0xb0),_0x12d0ff);}}function adaptBffTarget(_0x45ca2f,_0x470ba9,_0x5337a3){const _0x23d737=a62_0x8198;if(!isObjectRecord(_0x45ca2f)||_0x45ca2f[_0x23d737(0xb3)]!==_0x23d737(0xbc))return;adaptFunctionNameField(_0x45ca2f,_0x470ba9,_0x5337a3);}function adaptFunctionNameField(_0x40fde9,_0x5be3d2,_0x4c913c){const _0x5d1730=a62_0x8198;Object[_0x5d1730(0xb2)][_0x5d1730(0xb7)]['call'](_0x40fde9,_0x5d1730(0xbe))&&_0x4c913c[_0x5d1730(0xb1)]({'level':_0x5d1730(0xbd),'path':_0x5be3d2+'.scriptName','message':_0x5d1730(0xbb)});if(Object['prototype']['hasOwnProperty'][_0x5d1730(0xac)](_0x40fde9,_0x5d1730(0xcb))){if(typeof _0x40fde9[_0x5d1730(0xcb)]!=='string'||!_0x40fde9[_0x5d1730(0xcb)][_0x5d1730(0xcf)]()){_0x4c913c['push']({'level':_0x5d1730(0xbd),'path':_0x5be3d2+_0x5d1730(0xc3),'message':_0x5d1730(0xba)}),delete _0x40fde9['functionName'];return;}_0x40fde9[_0x5d1730(0xbe)]=_0x40fde9[_0x5d1730(0xcb)],delete _0x40fde9[_0x5d1730(0xcb)];}}function isBffAction(_0x39f53f){const _0x147c23=a62_0x8198;return _0x39f53f[_0x147c23(0xb3)]===_0x147c23(0xbc)||_0x39f53f[_0x147c23(0xc9)]==='bff.exec'||_0x39f53f[_0x147c23(0xc8)]==='bff.exec';}function a62_0x4ecd(){const _0x4d66f2=['string','functionName\x20must\x20be\x20a\x20non-empty\x20string.','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','bff','error','scriptName','forEach','580877UKHfPa','actions','103528mhBjpy','.functionName','48xZtmrJ','807387OdCWLO','12080hSFsgY','15RSFLwM','target','action','fromEntries','functionName','].target','.target','2583321MUxgum','trim','entries','211657ThGqsG','.actions.','map','object','8QkHLdS','call','4500450MoxrMz','resources','$.resources','.resources','push','prototype','kind','isArray','$.commands[','7074poOXZD','hasOwnProperty','396SPkdGO'];a62_0x4ecd=function(){return _0x4d66f2;};return a62_0x4ecd();}function cloneJsonValue(_0x98e574){const _0x5e7cb8=a62_0x8198;if(Array[_0x5e7cb8(0xb4)](_0x98e574))return _0x98e574[_0x5e7cb8(0xd3)](_0x45a678=>cloneJsonValue(_0x45a678));if(isObjectRecord(_0x98e574))return Object[_0x5e7cb8(0xca)](Object[_0x5e7cb8(0xd0)](_0x98e574)[_0x5e7cb8(0xd3)](([_0x10f572,_0x36c7ce])=>[_0x10f572,cloneJsonValue(_0x36c7ce)]));return _0x98e574;}function isObjectRecord(_0x239eed){const _0x415d22=a62_0x8198;return Boolean(_0x239eed)&&typeof _0x239eed===_0x415d22(0xaa)&&!Array[_0x415d22(0xb4)](_0x239eed);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a63_0x5f54f9=a63_0x4fc3;(function(_0x539128,_0x2be3a9){const _0x178eab=a63_0x4fc3,_0x5c869e=_0x539128();while(!![]){try{const _0x56bb2d=-parseInt(_0x178eab(0x190))/0x1+parseInt(_0x178eab(0x192))/0x2*(parseInt(_0x178eab(0x1bf))/0x3)+-parseInt(_0x178eab(0x1b6))/0x4*(parseInt(_0x178eab(0x1b2))/0x5)+parseInt(_0x178eab(0x197))/0x6*(-parseInt(_0x178eab(0x1c6))/0x7)+-parseInt(_0x178eab(0x1aa))/0x8+parseInt(_0x178eab(0x1b1))/0x9*(parseInt(_0x178eab(0x1d4))/0xa)+parseInt(_0x178eab(0x1b9))/0xb*(parseInt(_0x178eab(0x1b0))/0xc);if(_0x56bb2d===_0x2be3a9)break;else _0x5c869e['push'](_0x5c869e['shift']());}catch(_0x100ad1){_0x5c869e['push'](_0x5c869e['shift']());}}}(a63_0x4300,0xdcbba));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a63_0x5f54f9(0x19b),'type':a63_0x5f54f9(0x1d2),'required':!![],'description':a63_0x5f54f9(0x1a9)},SERVICE_FLAG={'name':'service','type':a63_0x5f54f9(0x1d2),'required':!![],'description':a63_0x5f54f9(0x19e),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a63_0x5f54f9(0x1a0)}};function summarizeService(_0x5e880e){const _0x2a18d9=a63_0x5f54f9;return{'serviceCode':_0x5e880e[_0x2a18d9(0x1c8)],'name':_0x5e880e[_0x2a18d9(0x199)][_0x2a18d9(0x19f)][_0x2a18d9(0x1a5)],'version':_0x5e880e[_0x2a18d9(0x1d7)],'importedAt':_0x5e880e[_0x2a18d9(0x195)],'source':_0x5e880e[_0x2a18d9(0x198)],'commandCount':_0x5e880e[_0x2a18d9(0x199)]['commands'][_0x2a18d9(0x19d)],'commands':_0x5e880e[_0x2a18d9(0x199)][_0x2a18d9(0x1bc)][_0x2a18d9(0x1d9)](_0x2f25ca=>({'path':_0x2f25ca[_0x2a18d9(0x1d3)],'description':_0x2f25ca[_0x2a18d9(0x1bb)],'risk':_0x2f25ca[_0x2a18d9(0x1b3)],'target':toPublicServiceTreeTarget(_0x2f25ca[_0x2a18d9(0x1a3)]),'flags':_0x2f25ca['flags'][_0x2a18d9(0x1d9)](_0x20c98e=>({'name':_0x20c98e[_0x2a18d9(0x1a5)],'cliName':_0x20c98e[_0x2a18d9(0x1ae)],'type':_0x20c98e['type'],'required':_0x20c98e['required']===!![]}))}))};}function a63_0x4fc3(_0x3c0b60,_0x49edcf){_0x3c0b60=_0x3c0b60-0x190;const _0x4300dc=a63_0x4300();let _0x4fc393=_0x4300dc[_0x3c0b60];return _0x4fc393;}function summarizeLoadedManifest(_0x57ff67){const _0x18af5a=a63_0x5f54f9;return{'service':_0x57ff67[_0x18af5a(0x199)]?.[_0x18af5a(0x19f)],'version':_0x57ff67[_0x18af5a(0x199)]?.[_0x18af5a(0x1d7)],'commandCount':_0x57ff67[_0x18af5a(0x199)]?.['commands'][_0x18af5a(0x19d)]??0x0,'commands':_0x57ff67[_0x18af5a(0x199)]?.[_0x18af5a(0x1bc)]['map'](_0xdf19bd=>({'path':_0xdf19bd[_0x18af5a(0x1d3)],'risk':_0xdf19bd[_0x18af5a(0x1b3)],'target':toPublicServiceTreeTarget(_0xdf19bd['target'])}))??[],'registryIndex':_0x57ff67[_0x18af5a(0x19a)],'registryServiceCode':_0x57ff67['registryServiceCode'],'errors':_0x57ff67['report']['errors'],'warnings':_0x57ff67['report'][_0x18af5a(0x1c4)]};}export const serviceDefinitions=[{'service':'service','command':a63_0x5f54f9(0x1c9),'description':a63_0x5f54f9(0x193),'risk':a63_0x5f54f9(0x1b5),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4f3f25){const _0xddb1b1=a63_0x5f54f9,_0x329b96=loadServiceManifestFromFile(_0x4f3f25[_0xddb1b1(0x1cf)](_0xddb1b1(0x19b)));if(!_0x329b96[_0xddb1b1(0x196)]['ok'])return{'ok':![],'data':{'file':_0x329b96[_0xddb1b1(0x1d8)],'hash':_0x329b96[_0xddb1b1(0x191)],'kind':_0x329b96['kind'],'serviceCount':_0x329b96[_0xddb1b1(0x1a6)]['length'],'services':_0x329b96[_0xddb1b1(0x1a6)][_0xddb1b1(0x1d9)](summarizeLoadedManifest),'errors':_0x329b96[_0xddb1b1(0x196)][_0xddb1b1(0x19c)],'warnings':_0x329b96[_0xddb1b1(0x196)][_0xddb1b1(0x1c4)]},'message':formatValidationFailure(_0x329b96['report'])};if(_0x329b96['kind']===_0xddb1b1(0x1a2)||_0x329b96[_0xddb1b1(0x1a6)][_0xddb1b1(0x19d)]!==0x1)return{'ok':!![],'data':{'file':_0x329b96[_0xddb1b1(0x1d8)],'hash':_0x329b96[_0xddb1b1(0x191)],'kind':_0x329b96[_0xddb1b1(0x1cb)],'serviceCount':_0x329b96[_0xddb1b1(0x1a6)][_0xddb1b1(0x19d)],'commandCount':_0x329b96[_0xddb1b1(0x1a6)][_0xddb1b1(0x1cc)]((_0x537f4c,_0x1f2363)=>_0x537f4c+(_0x1f2363['normalizedManifest']?.[_0xddb1b1(0x1bc)][_0xddb1b1(0x19d)]??0x0),0x0),'services':_0x329b96[_0xddb1b1(0x1a6)][_0xddb1b1(0x1d9)](summarizeLoadedManifest),'warnings':_0x329b96[_0xddb1b1(0x196)][_0xddb1b1(0x1c4)]},'message':_0xddb1b1(0x1d5)};return{'ok':!![],'data':{'file':_0x329b96[_0xddb1b1(0x1d8)],'hash':_0x329b96['hash'],'kind':_0x329b96[_0xddb1b1(0x1cb)],'service':_0x329b96['normalizedManifest']?.[_0xddb1b1(0x19f)],'version':_0x329b96[_0xddb1b1(0x199)]?.[_0xddb1b1(0x1d7)],'commandCount':_0x329b96[_0xddb1b1(0x199)]?.[_0xddb1b1(0x1bc)][_0xddb1b1(0x19d)]??0x0,'commands':_0x329b96[_0xddb1b1(0x199)]?.['commands'][_0xddb1b1(0x1d9)](_0x939618=>({'path':_0x939618[_0xddb1b1(0x1d3)],'risk':_0x939618['risk'],'target':toPublicServiceTreeTarget(_0x939618[_0xddb1b1(0x1a3)])})),'warnings':_0x329b96[_0xddb1b1(0x196)][_0xddb1b1(0x1c4)]},'message':_0xddb1b1(0x1a1)};}},{'service':'service','command':a63_0x5f54f9(0x1d1),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a63_0x5f54f9(0x194),'confirmationDescription':a63_0x5f54f9(0x1b8),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x278e1d){const _0xfc600c=a63_0x5f54f9,_0x177ee9=loadServiceManifestFromFile(_0x278e1d[_0xfc600c(0x1cf)](_0xfc600c(0x19b)));return{'method':_0xfc600c(0x1be),'url':getServiceRegistryPath(),'body':{'file':_0x177ee9[_0xfc600c(0x1d8)],'hash':_0x177ee9[_0xfc600c(0x191)],'kind':_0x177ee9[_0xfc600c(0x1cb)],'ok':_0x177ee9['report']['ok'],'service':_0x177ee9['normalizedManifest']?.[_0xfc600c(0x19f)],'version':_0x177ee9[_0xfc600c(0x199)]?.['version'],'serviceCount':_0x177ee9[_0xfc600c(0x1a6)][_0xfc600c(0x19d)],'services':_0x177ee9[_0xfc600c(0x1a6)][_0xfc600c(0x1d9)](_0x2e350f=>({'service':_0x2e350f[_0xfc600c(0x199)]?.['service'],'version':_0x2e350f[_0xfc600c(0x199)]?.['version'],'commandCount':_0x2e350f[_0xfc600c(0x199)]?.[_0xfc600c(0x1bc)][_0xfc600c(0x19d)]??0x0,'errors':_0x2e350f[_0xfc600c(0x196)][_0xfc600c(0x19c)]})),'errors':_0x177ee9['report'][_0xfc600c(0x19c)],'commandCount':_0x177ee9['normalizedManifest']?.[_0xfc600c(0x1bc)]['length']??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x59f6eb){const _0xa5a593=a63_0x5f54f9,_0x1befb6=importServiceManifest(_0x59f6eb[_0xa5a593(0x1cf)]('file'));if(_0x1befb6[_0xa5a593(0x1a8)][_0xa5a593(0x19d)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1befb6[_0xa5a593(0x1c7)],'imported':_0x1befb6[_0xa5a593(0x1cd)],'updated':_0x1befb6['updated'],'serviceCount':_0x1befb6[_0xa5a593(0x1c5)],'services':_0x1befb6[_0xa5a593(0x1a8)][_0xa5a593(0x1d9)](summarizeService)},'message':_0xa5a593(0x1c2)+_0x1befb6[_0xa5a593(0x1cd)]+_0xa5a593(0x1af)+_0x1befb6['updated']+_0xa5a593(0x1bd)};return{'ok':!![],'data':{'registryPath':_0x1befb6[_0xa5a593(0x1c7)],'replaced':_0x1befb6[_0xa5a593(0x1a7)],'imported':_0x1befb6[_0xa5a593(0x1cd)],'updated':_0x1befb6[_0xa5a593(0x1c0)],'serviceCount':_0x1befb6[_0xa5a593(0x1c5)],'service':summarizeService(_0x1befb6[_0xa5a593(0x1da)])},'message':(_0x1befb6[_0xa5a593(0x1a7)]?_0xa5a593(0x1c1):_0xa5a593(0x1ca))+'\x20service\x20'+_0x1befb6[_0xa5a593(0x1da)][_0xa5a593(0x1c8)]+'.'};}},{'service':a63_0x5f54f9(0x19f),'command':a63_0x5f54f9(0x1ce),'description':a63_0x5f54f9(0x1d0),'risk':'write','confirmationDescription':a63_0x5f54f9(0x1ab),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x328775){const _0x12b342=a63_0x5f54f9,_0x25f805=getLocalServiceEntry(_0x328775['str'](_0x12b342(0x19f)));return{'method':_0x12b342(0x1be),'url':_0x328775['str'](_0x12b342(0x19b)),'body':{'service':_0x328775[_0x12b342(0x1cf)]('service'),'found':Boolean(_0x25f805),'version':_0x25f805?.['version'],'source':_0x25f805?.[_0x12b342(0x198)]},'description':_0x12b342(0x1ad)};},async 'execute'(_0x4ac3fd){const _0x10437c=a63_0x5f54f9,_0x4e2530=exportServiceManifest(_0x4ac3fd[_0x10437c(0x1cf)](_0x10437c(0x19f)),_0x4ac3fd[_0x10437c(0x1cf)](_0x10437c(0x19b)));return{'ok':!![],'data':{'registryPath':_0x4e2530[_0x10437c(0x1c7)],'file':_0x4e2530[_0x10437c(0x1d8)],'service':summarizeService(_0x4e2530[_0x10437c(0x1da)])},'message':'Exported\x20service\x20'+_0x4e2530[_0x10437c(0x1da)][_0x10437c(0x1c8)]+'.'};}},{'service':'service','command':'list','description':a63_0x5f54f9(0x1b4),'risk':a63_0x5f54f9(0x1b5),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x198a32=a63_0x5f54f9,_0x1b2a41=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1b2a41[_0x198a32(0x19d)],'services':_0x1b2a41['map'](summarizeService)}};}},{'service':a63_0x5f54f9(0x19f),'command':a63_0x5f54f9(0x1d6),'description':'Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','risk':a63_0x5f54f9(0x194),'confirmationDescription':'Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x479561){const _0x2a1ce4=a63_0x5f54f9,_0x503645=getLocalServiceEntry(_0x479561[_0x2a1ce4(0x1cf)](_0x2a1ce4(0x19f)));return{'method':_0x2a1ce4(0x1be),'url':getServiceRegistryPath(),'body':{'service':_0x479561['str'](_0x2a1ce4(0x19f)),'found':Boolean(_0x503645),'version':_0x503645?.['version'],'source':_0x503645?.[_0x2a1ce4(0x198)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x249180){const _0xf8a7ab=a63_0x5f54f9,_0x1a36bf=removeServiceManifest(_0x249180[_0xf8a7ab(0x1cf)](_0xf8a7ab(0x19f)));return{'ok':!![],'data':{'registryPath':_0x1a36bf[_0xf8a7ab(0x1c7)],'serviceCount':_0x1a36bf[_0xf8a7ab(0x1c5)],'service':summarizeService(_0x1a36bf[_0xf8a7ab(0x1da)])},'message':_0xf8a7ab(0x1ac)+_0x1a36bf['entry'][_0xf8a7ab(0x1c8)]+'.'};}},{'service':a63_0x5f54f9(0x19f),'command':a63_0x5f54f9(0x1a4),'description':a63_0x5f54f9(0x1ba),'risk':a63_0x5f54f9(0x1b5),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xeefa2a){const _0x1bcd2c=a63_0x5f54f9,_0x2a8889=getLocalServiceEntry(_0xeefa2a['str'](_0x1bcd2c(0x19f)));if(!_0x2a8889)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xeefa2a['str'](_0x1bcd2c(0x19f))},'message':_0x1bcd2c(0x1c3)+_0xeefa2a['str'](_0x1bcd2c(0x19f))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2a8889),'manifest':_0x2a8889[_0x1bcd2c(0x1b7)],'normalizedManifest':toPublicNormalizedServiceTree(_0x2a8889[_0x1bcd2c(0x199)])}};}}];function a63_0x4300(){const _0x38ecbf=['7191074WRXOsn','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','description','commands','\x20service(s).','WRITE','10326GuMNua','updated','Updated','Imported\x20','Local\x20service\x20not\x20found:\x20','warnings','serviceCount','14287BDgFnP','registryPath','serviceCode','validate','Imported','kind','reduce','imported','export','str','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','import','string','cliPath','15670680BgUvGv','Service\x20registry\x20validation\x20passed.','remove','version','filePath','map','entry','1023980RZniho','hash','626IBJKGC','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','write','importedAt','report','426KhaASx','source','normalizedManifest','registryIndex','file','errors','length','Local\x20service\x20code,\x20for\x20example\x20crm','service','lower\x20kebab-case\x20service\x20code','Service\x20manifest\x20validation\x20passed.','registry','target','detail','name','manifests','replaced','entries','Service\x20Tree\x20manifest\x20file\x20path','4196872JPawsF','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','Removed\x20service\x20','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','cliName','\x20service(s),\x20updated\x20','12Hommsi','9zmwflj','5TBKNKG','risk','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','read','2802104Qbagjy','manifest','Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.'];a63_0x4300=function(){return _0x38ecbf;};return a63_0x4300();}
|
|
1
|
+
const a63_0x6b6460=a63_0x64ff;(function(_0x4ded50,_0xbaeefc){const _0x2dfebd=a63_0x64ff,_0x2be13d=_0x4ded50();while(!![]){try{const _0x58964f=parseInt(_0x2dfebd(0x1e9))/0x1+-parseInt(_0x2dfebd(0x1c7))/0x2*(-parseInt(_0x2dfebd(0x1f7))/0x3)+-parseInt(_0x2dfebd(0x1b8))/0x4+-parseInt(_0x2dfebd(0x1d9))/0x5+parseInt(_0x2dfebd(0x1f5))/0x6+parseInt(_0x2dfebd(0x1f6))/0x7*(parseInt(_0x2dfebd(0x1ba))/0x8)+parseInt(_0x2dfebd(0x1e5))/0x9;if(_0x58964f===_0xbaeefc)break;else _0x2be13d['push'](_0x2be13d['shift']());}catch(_0x3878d6){_0x2be13d['push'](_0x2be13d['shift']());}}}(a63_0x443f,0x4b255));function a63_0x443f(){const _0x118032=['WRITE','lower\x20kebab-case\x20service\x20code','validate','registry','string','manifests','kind','entry','636355zBcHMg','manifest','write','service','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','\x20service(s),\x20updated\x20','Writes\x20the\x20local\x20Service\x20Tree\x20manifest\x20for\x20the\x20given\x20service\x20to\x20a\x20JSON\x20file.\x20An\x20existing\x20file\x20at\x20the\x20target\x20may\x20be\x20overwritten.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','registryPath','cliPath','Local\x20service\x20code,\x20for\x20example\x20crm','errors','file','634023uYyiOd','report','remove','Local\x20service\x20not\x20found:\x20','211084PvmFEL','length','warnings','imported','Exported\x20service\x20','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','version','Removed\x20service\x20','source','reduce','entries','str','966210NaaIaZ','3010akFGyM','37683cybkmd','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','target','flags','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','filePath','name','\x20service\x20','1430208vJkGvM','export','904zYfRuq','normalizedManifest','replaced','description','map','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','importedAt','Imported','risk','Service\x20Tree\x20manifest\x20file\x20path','import','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Service\x20manifest\x20validation\x20passed.','48QSsuCT','detail','hash','serviceCode','read','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20registry\x20validation\x20passed.','serviceCount','updated','commands'];a63_0x443f=function(){return _0x118032;};return a63_0x443f();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a63_0x6b6460(0x1e4),'type':a63_0x6b6460(0x1d5),'required':!![],'description':a63_0x6b6460(0x1c3)},SERVICE_FLAG={'name':a63_0x6b6460(0x1dc),'type':a63_0x6b6460(0x1d5),'required':!![],'description':a63_0x6b6460(0x1e2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a63_0x6b6460(0x1d2)}};function summarizeService(_0x22a791){const _0x14acde=a63_0x6b6460;return{'serviceCode':_0x22a791['serviceCode'],'name':_0x22a791[_0x14acde(0x1bb)][_0x14acde(0x1dc)][_0x14acde(0x1b6)],'version':_0x22a791['version'],'importedAt':_0x22a791[_0x14acde(0x1c0)],'source':_0x22a791[_0x14acde(0x1f1)],'commandCount':_0x22a791['normalizedManifest'][_0x14acde(0x1d0)]['length'],'commands':_0x22a791[_0x14acde(0x1bb)][_0x14acde(0x1d0)][_0x14acde(0x1be)](_0x58b528=>({'path':_0x58b528[_0x14acde(0x1e1)],'description':_0x58b528[_0x14acde(0x1bd)],'risk':_0x58b528[_0x14acde(0x1c2)],'target':toPublicServiceTreeTarget(_0x58b528[_0x14acde(0x1f9)]),'flags':_0x58b528[_0x14acde(0x1fa)][_0x14acde(0x1be)](_0x4543f3=>({'name':_0x4543f3['name'],'cliName':_0x4543f3['cliName'],'type':_0x4543f3['type'],'required':_0x4543f3['required']===!![]}))}))};}function summarizeLoadedManifest(_0x40c850){const _0x5c58a5=a63_0x6b6460;return{'service':_0x40c850[_0x5c58a5(0x1bb)]?.[_0x5c58a5(0x1dc)],'version':_0x40c850[_0x5c58a5(0x1bb)]?.[_0x5c58a5(0x1ef)],'commandCount':_0x40c850[_0x5c58a5(0x1bb)]?.[_0x5c58a5(0x1d0)]['length']??0x0,'commands':_0x40c850['normalizedManifest']?.[_0x5c58a5(0x1d0)][_0x5c58a5(0x1be)](_0x11e316=>({'path':_0x11e316[_0x5c58a5(0x1e1)],'risk':_0x11e316[_0x5c58a5(0x1c2)],'target':toPublicServiceTreeTarget(_0x11e316[_0x5c58a5(0x1f9)])}))??[],'registryIndex':_0x40c850['registryIndex'],'registryServiceCode':_0x40c850['registryServiceCode'],'errors':_0x40c850[_0x5c58a5(0x1e6)]['errors'],'warnings':_0x40c850[_0x5c58a5(0x1e6)][_0x5c58a5(0x1eb)]};}function a63_0x64ff(_0x3804d8,_0x2c0197){_0x3804d8=_0x3804d8-0x1b5;const _0x443fbe=a63_0x443f();let _0x64ff5a=_0x443fbe[_0x3804d8];return _0x64ff5a;}export const serviceDefinitions=[{'service':'service','command':a63_0x6b6460(0x1d3),'description':a63_0x6b6460(0x1dd),'risk':a63_0x6b6460(0x1cb),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2a8740){const _0x130df7=a63_0x6b6460,_0x672957=loadServiceManifestFromFile(_0x2a8740[_0x130df7(0x1f4)]('file'));if(!_0x672957[_0x130df7(0x1e6)]['ok'])return{'ok':![],'data':{'file':_0x672957[_0x130df7(0x1b5)],'hash':_0x672957['hash'],'kind':_0x672957[_0x130df7(0x1d7)],'serviceCount':_0x672957[_0x130df7(0x1d6)][_0x130df7(0x1ea)],'services':_0x672957['manifests']['map'](summarizeLoadedManifest),'errors':_0x672957[_0x130df7(0x1e6)][_0x130df7(0x1e3)],'warnings':_0x672957[_0x130df7(0x1e6)]['warnings']},'message':formatValidationFailure(_0x672957['report'])};if(_0x672957[_0x130df7(0x1d7)]===_0x130df7(0x1d4)||_0x672957[_0x130df7(0x1d6)][_0x130df7(0x1ea)]!==0x1)return{'ok':!![],'data':{'file':_0x672957[_0x130df7(0x1b5)],'hash':_0x672957['hash'],'kind':_0x672957['kind'],'serviceCount':_0x672957[_0x130df7(0x1d6)][_0x130df7(0x1ea)],'commandCount':_0x672957[_0x130df7(0x1d6)][_0x130df7(0x1f2)]((_0x38446c,_0x2ff4b6)=>_0x38446c+(_0x2ff4b6[_0x130df7(0x1bb)]?.[_0x130df7(0x1d0)][_0x130df7(0x1ea)]??0x0),0x0),'services':_0x672957[_0x130df7(0x1d6)]['map'](summarizeLoadedManifest),'warnings':_0x672957[_0x130df7(0x1e6)][_0x130df7(0x1eb)]},'message':_0x130df7(0x1cd)};return{'ok':!![],'data':{'file':_0x672957['filePath'],'hash':_0x672957[_0x130df7(0x1c9)],'kind':_0x672957[_0x130df7(0x1d7)],'service':_0x672957[_0x130df7(0x1bb)]?.['service'],'version':_0x672957[_0x130df7(0x1bb)]?.[_0x130df7(0x1ef)],'commandCount':_0x672957[_0x130df7(0x1bb)]?.[_0x130df7(0x1d0)][_0x130df7(0x1ea)]??0x0,'commands':_0x672957[_0x130df7(0x1bb)]?.[_0x130df7(0x1d0)][_0x130df7(0x1be)](_0x56c0a1=>({'path':_0x56c0a1['cliPath'],'risk':_0x56c0a1['risk'],'target':toPublicServiceTreeTarget(_0x56c0a1[_0x130df7(0x1f9)])})),'warnings':_0x672957[_0x130df7(0x1e6)][_0x130df7(0x1eb)]},'message':_0x130df7(0x1c6)};}},{'service':a63_0x6b6460(0x1dc),'command':a63_0x6b6460(0x1c4),'description':a63_0x6b6460(0x1fb),'risk':a63_0x6b6460(0x1db),'confirmationDescription':'Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x53080e){const _0x250a7a=a63_0x6b6460,_0x69e0c8=loadServiceManifestFromFile(_0x53080e['str'](_0x250a7a(0x1e4)));return{'method':_0x250a7a(0x1d1),'url':getServiceRegistryPath(),'body':{'file':_0x69e0c8[_0x250a7a(0x1b5)],'hash':_0x69e0c8[_0x250a7a(0x1c9)],'kind':_0x69e0c8['kind'],'ok':_0x69e0c8[_0x250a7a(0x1e6)]['ok'],'service':_0x69e0c8['normalizedManifest']?.[_0x250a7a(0x1dc)],'version':_0x69e0c8['normalizedManifest']?.[_0x250a7a(0x1ef)],'serviceCount':_0x69e0c8['manifests'][_0x250a7a(0x1ea)],'services':_0x69e0c8['manifests']['map'](_0x342094=>({'service':_0x342094[_0x250a7a(0x1bb)]?.[_0x250a7a(0x1dc)],'version':_0x342094[_0x250a7a(0x1bb)]?.[_0x250a7a(0x1ef)],'commandCount':_0x342094[_0x250a7a(0x1bb)]?.[_0x250a7a(0x1d0)][_0x250a7a(0x1ea)]??0x0,'errors':_0x342094[_0x250a7a(0x1e6)][_0x250a7a(0x1e3)]})),'errors':_0x69e0c8[_0x250a7a(0x1e6)][_0x250a7a(0x1e3)],'commandCount':_0x69e0c8[_0x250a7a(0x1bb)]?.['commands']['length']??0x0},'description':_0x250a7a(0x1c5)};},async 'execute'(_0x41c621){const _0x37c1a7=a63_0x6b6460,_0x42ed19=importServiceManifest(_0x41c621[_0x37c1a7(0x1f4)]('file'));if(_0x42ed19[_0x37c1a7(0x1f3)][_0x37c1a7(0x1ea)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x42ed19[_0x37c1a7(0x1e0)],'imported':_0x42ed19[_0x37c1a7(0x1ec)],'updated':_0x42ed19['updated'],'serviceCount':_0x42ed19[_0x37c1a7(0x1ce)],'services':_0x42ed19['entries'][_0x37c1a7(0x1be)](summarizeService)},'message':'Imported\x20'+_0x42ed19[_0x37c1a7(0x1ec)]+_0x37c1a7(0x1de)+_0x42ed19[_0x37c1a7(0x1cf)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x42ed19['registryPath'],'replaced':_0x42ed19[_0x37c1a7(0x1bc)],'imported':_0x42ed19[_0x37c1a7(0x1ec)],'updated':_0x42ed19[_0x37c1a7(0x1cf)],'serviceCount':_0x42ed19[_0x37c1a7(0x1ce)],'service':summarizeService(_0x42ed19[_0x37c1a7(0x1d8)])},'message':(_0x42ed19['replaced']?'Updated':_0x37c1a7(0x1c1))+_0x37c1a7(0x1b7)+_0x42ed19[_0x37c1a7(0x1d8)]['serviceCode']+'.'};}},{'service':'service','command':a63_0x6b6460(0x1b9),'description':'Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a63_0x6b6460(0x1db),'confirmationDescription':a63_0x6b6460(0x1df),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x18c257){const _0x1ebcab=a63_0x6b6460,_0x935569=getLocalServiceEntry(_0x18c257['str']('service'));return{'method':'WRITE','url':_0x18c257[_0x1ebcab(0x1f4)](_0x1ebcab(0x1e4)),'body':{'service':_0x18c257[_0x1ebcab(0x1f4)](_0x1ebcab(0x1dc)),'found':Boolean(_0x935569),'version':_0x935569?.['version'],'source':_0x935569?.[_0x1ebcab(0x1f1)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x212d68){const _0x166b04=a63_0x6b6460,_0x1a1590=exportServiceManifest(_0x212d68[_0x166b04(0x1f4)](_0x166b04(0x1dc)),_0x212d68[_0x166b04(0x1f4)](_0x166b04(0x1e4)));return{'ok':!![],'data':{'registryPath':_0x1a1590[_0x166b04(0x1e0)],'file':_0x1a1590[_0x166b04(0x1b5)],'service':summarizeService(_0x1a1590[_0x166b04(0x1d8)])},'message':_0x166b04(0x1ed)+_0x1a1590[_0x166b04(0x1d8)][_0x166b04(0x1ca)]+'.'};}},{'service':a63_0x6b6460(0x1dc),'command':'list','description':a63_0x6b6460(0x1f8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x49bbfb=a63_0x6b6460,_0xb1abc9=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xb1abc9[_0x49bbfb(0x1ea)],'services':_0xb1abc9['map'](summarizeService)}};}},{'service':'service','command':a63_0x6b6460(0x1e7),'description':a63_0x6b6460(0x1fc),'risk':a63_0x6b6460(0x1db),'confirmationDescription':a63_0x6b6460(0x1bf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1059c8){const _0x40f7fb=a63_0x6b6460,_0x8d5c5d=getLocalServiceEntry(_0x1059c8[_0x40f7fb(0x1f4)]('service'));return{'method':_0x40f7fb(0x1d1),'url':getServiceRegistryPath(),'body':{'service':_0x1059c8[_0x40f7fb(0x1f4)](_0x40f7fb(0x1dc)),'found':Boolean(_0x8d5c5d),'version':_0x8d5c5d?.[_0x40f7fb(0x1ef)],'source':_0x8d5c5d?.[_0x40f7fb(0x1f1)]},'description':_0x40f7fb(0x1ee)};},async 'execute'(_0xe906b6){const _0x5c0f09=a63_0x6b6460,_0x1c3788=removeServiceManifest(_0xe906b6[_0x5c0f09(0x1f4)]('service'));return{'ok':!![],'data':{'registryPath':_0x1c3788[_0x5c0f09(0x1e0)],'serviceCount':_0x1c3788['serviceCount'],'service':summarizeService(_0x1c3788[_0x5c0f09(0x1d8)])},'message':_0x5c0f09(0x1f0)+_0x1c3788[_0x5c0f09(0x1d8)]['serviceCode']+'.'};}},{'service':a63_0x6b6460(0x1dc),'command':a63_0x6b6460(0x1c8),'description':a63_0x6b6460(0x1cc),'risk':a63_0x6b6460(0x1cb),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x15eff0){const _0x21852f=a63_0x6b6460,_0x3d6533=getLocalServiceEntry(_0x15eff0[_0x21852f(0x1f4)](_0x21852f(0x1dc)));if(!_0x3d6533)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x15eff0['str'](_0x21852f(0x1dc))},'message':_0x21852f(0x1e8)+_0x15eff0['str'](_0x21852f(0x1dc))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3d6533),'manifest':_0x3d6533[_0x21852f(0x1da)],'normalizedManifest':toPublicNormalizedServiceTree(_0x3d6533[_0x21852f(0x1bb)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x2674c4=a64_0x10a0;(function(_0x5b2075,_0x4981c3){const _0x3ebde7=a64_0x10a0,_0x28e637=_0x5b2075();while(!![]){try{const _0x50e818=-parseInt(_0x3ebde7(0x16b))/0x1*(parseInt(_0x3ebde7(0x160))/0x2)+-parseInt(_0x3ebde7(0x175))/0x3*(parseInt(_0x3ebde7(0x194))/0x4)+-parseInt(_0x3ebde7(0x19b))/0x5*(parseInt(_0x3ebde7(0x1a0))/0x6)+-parseInt(_0x3ebde7(0x162))/0x7*(-parseInt(_0x3ebde7(0x189))/0x8)+-parseInt(_0x3ebde7(0x15a))/0x9+-parseInt(_0x3ebde7(0x176))/0xa*(-parseInt(_0x3ebde7(0x154))/0xb)+parseInt(_0x3ebde7(0x197))/0xc*(parseInt(_0x3ebde7(0x19a))/0xd);if(_0x50e818===_0x4981c3)break;else _0x28e637['push'](_0x28e637['shift']());}catch(_0x1de0d8){_0x28e637['push'](_0x28e637['shift']());}}}(a64_0x347b,0x2b989));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';function a64_0x10a0(_0x19b339,_0x30c7b4){_0x19b339=_0x19b339-0x14e;const _0x347bc8=a64_0x347b();let _0x10a0b4=_0x347bc8[_0x19b339];return _0x10a0b4;}export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a64_0x2674c4(0x19c);export function getServiceRegistryPath(_0x418320={}){const _0xd45f54=a64_0x2674c4;return resolve(_0x418320[_0xd45f54(0x184)]??homedir(),PRODUCT_CONFIG[_0xd45f54(0x172)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x521984={}){const _0x824489=a64_0x2674c4,_0x49724a=getServiceRegistryPath(_0x521984);if(!existsSync(_0x49724a))return emptyServiceRegistry();try{const _0x46f2c9=readFileSync(_0x49724a,'utf8');if(!_0x46f2c9['trim']())return emptyServiceRegistry();const _0xf6c5be=JSON['parse'](_0x46f2c9);if(_0xf6c5be['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x824489(0x18a)+String(_0xf6c5be[_0x824489(0x19f)]),_0x824489(0x166)+_0x49724a+'.');if(!Array[_0x824489(0x15c)](_0xf6c5be[_0x824489(0x180)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0xf6c5be[_0x824489(0x1a5)],'services':_0xf6c5be[_0x824489(0x180)]};}catch(_0x25f3a1){if(_0x25f3a1 instanceof Error&&_0x25f3a1[_0x824489(0x173)]===_0x824489(0x17c))throw _0x25f3a1;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x49724a,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x130d70,_0x4753da={}){const _0x2a2275=a64_0x2674c4,_0xe60cad=getServiceRegistryPath(_0x4753da),_0x31b8e2=dirname(_0xe60cad);!existsSync(_0x31b8e2)&&mkdirSync(_0x31b8e2,{'recursive':!![]});const _0x259a59=_0xe60cad+_0x2a2275(0x15b);try{writeFileSync(_0x259a59,JSON[_0x2a2275(0x179)](_0x130d70,null,0x2)+'\x0a',{'encoding':_0x2a2275(0x188),'mode':0x180}),renameSync(_0x259a59,_0xe60cad);}catch(_0x1b2753){try{unlinkSync(_0x259a59);}catch{}if(_0x1b2753?.['code']===_0x2a2275(0x16c))throw CliErrors[_0x2a2275(0x17b)](_0x2a2275(0x177)+_0xe60cad);throw _0x1b2753;}return _0xe60cad;}export function loadServiceManifestFromFile(_0x5edbb9){const _0x56a392=a64_0x2674c4,_0x12ca48=resolve(_0x5edbb9);if(!existsSync(_0x12ca48))throw CliErrors[_0x56a392(0x17b)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x5edbb9);let _0x521c11;const _0x398698=readFileSync(_0x12ca48,'utf8');try{_0x521c11=JSON[_0x56a392(0x198)](_0x398698);}catch{throw CliErrors[_0x56a392(0x17b)](_0x56a392(0x14e)+_0x5edbb9,_0x56a392(0x16e));}const _0x579766=sha256(_0x398698),_0x135ce2=extractLoadedServiceManifests(_0x521c11,_0x579766),_0x5e2473=aggregateValidationReports(_0x135ce2),_0x5f284a=_0x135ce2[0x0];return{'filePath':_0x12ca48,'hash':_0x579766,'kind':isServiceRegistryLike(_0x521c11)?_0x56a392(0x164):_0x56a392(0x161),'manifest':_0x5f284a?.[_0x56a392(0x161)]??_0x521c11,'report':_0x5e2473,'normalizedManifest':_0x135ce2['length']===0x1?_0x5f284a?.[_0x56a392(0x151)]:undefined,'manifests':_0x135ce2};}export function importServiceManifest(_0x14c2a6,_0x29fcb5={}){const _0x209c92=a64_0x2674c4,_0x1a7c0f=loadServiceManifestFromFile(_0x14c2a6);if(!_0x1a7c0f[_0x209c92(0x1a1)]['ok'])throw CliErrors[_0x209c92(0x17b)](formatValidationFailure(_0x1a7c0f[_0x209c92(0x1a1)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x1a7c0f['manifests']['length']===0x0)throw CliErrors[_0x209c92(0x17b)](_0x209c92(0x150),_0x209c92(0x19e));const _0x44845c=readServiceRegistry(_0x29fcb5),_0x1afd8b=(_0x29fcb5[_0x209c92(0x153)]??(()=>new Date()))()[_0x209c92(0x186)](),_0x55bccf=[];let _0x198c28=0x0,_0xc50973=0x0;for(const _0xbee601 of _0x1a7c0f[_0x209c92(0x15e)]){if(!_0xbee601[_0x209c92(0x151)])continue;const _0x4e49ba=_0xbee601['normalizedManifest']['service']['code'],_0x1a8514={'serviceCode':_0x4e49ba,'version':_0xbee601['normalizedManifest'][_0x209c92(0x19d)],'importedAt':_0x1afd8b,'source':{'type':'file','path':_0x1a7c0f['filePath'],'hash':_0xbee601[_0x209c92(0x15d)]},'manifest':_0xbee601[_0x209c92(0x161)],'normalizedManifest':_0xbee601[_0x209c92(0x151)]},_0x2d581e=_0x44845c[_0x209c92(0x180)][_0x209c92(0x15f)](_0x79cf29=>_0x79cf29[_0x209c92(0x152)]===_0x4e49ba);_0x2d581e>=0x0?(_0x44845c['services'][_0x2d581e]=_0x1a8514,_0xc50973++):(_0x44845c[_0x209c92(0x180)][_0x209c92(0x156)](_0x1a8514),_0x198c28++),_0x55bccf[_0x209c92(0x156)](_0x1a8514);}_0x44845c[_0x209c92(0x180)][_0x209c92(0x178)]((_0xaf664d,_0x161593)=>_0xaf664d[_0x209c92(0x152)][_0x209c92(0x17e)](_0x161593[_0x209c92(0x152)])),_0x44845c[_0x209c92(0x1a5)]=_0x1afd8b;const _0x4cdfab=writeServiceRegistry(_0x44845c,_0x29fcb5);return{'registryPath':_0x4cdfab,'entry':_0x55bccf[0x0],'replaced':_0x55bccf[_0x209c92(0x181)]===0x1?_0xc50973===0x1:_0xc50973>0x0,'entries':_0x55bccf,'imported':_0x198c28,'updated':_0xc50973,'serviceCount':_0x44845c[_0x209c92(0x180)][_0x209c92(0x181)]};}export function exportServiceManifest(_0x22aeda,_0x9801f3,_0x34b068={}){const _0x21ae75=a64_0x2674c4,_0xf61b83=getServiceRegistryPath(_0x34b068),_0x357687=getLocalServiceEntry(_0x22aeda,_0x34b068);if(!_0x357687)throw CliErrors['validation'](_0x21ae75(0x17a)+_0x22aeda,_0x21ae75(0x157));const _0x24ac2e=resolve(_0x9801f3),_0x3d51be=dirname(_0x24ac2e);return!existsSync(_0x3d51be)&&mkdirSync(_0x3d51be,{'recursive':!![]}),writeFileSync(_0x24ac2e,JSON[_0x21ae75(0x179)](_0x357687[_0x21ae75(0x161)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0xf61b83,'filePath':_0x24ac2e,'entry':_0x357687};}export function removeServiceManifest(_0x5b69f6,_0x57c3ba={}){const _0xd31d1a=a64_0x2674c4,_0x21c9a0=readServiceRegistry(_0x57c3ba),_0x4977f1=_0x5b69f6[_0xd31d1a(0x159)](),_0x146d47=_0x21c9a0[_0xd31d1a(0x180)][_0xd31d1a(0x15f)](_0x392280=>_0x392280['serviceCode']===_0x4977f1);if(_0x146d47<0x0)throw CliErrors[_0xd31d1a(0x17b)](_0xd31d1a(0x17a)+_0x4977f1,_0xd31d1a(0x157));const [_0x46aaef]=_0x21c9a0[_0xd31d1a(0x180)][_0xd31d1a(0x17d)](_0x146d47,0x1),_0x1c7df9=(_0x57c3ba[_0xd31d1a(0x153)]??(()=>new Date()))()['toISOString']();_0x21c9a0[_0xd31d1a(0x1a5)]=_0x1c7df9;const _0x4c22df=writeServiceRegistry(_0x21c9a0,_0x57c3ba);return{'registryPath':_0x4c22df,'entry':_0x46aaef,'serviceCount':_0x21c9a0[_0xd31d1a(0x180)][_0xd31d1a(0x181)]};}export function listLocalServices(_0x105f7d={}){const _0x9f8039=a64_0x2674c4;return readServiceRegistry(_0x105f7d)[_0x9f8039(0x180)];}export function getLocalServiceEntry(_0xe51e4e,_0xeda0e8={}){const _0xecb2d8=a64_0x2674c4;return readServiceRegistry(_0xeda0e8)[_0xecb2d8(0x180)][_0xecb2d8(0x1a4)](_0x4ca93c=>_0x4ca93c[_0xecb2d8(0x152)]===_0xe51e4e['trim']());}export function listLocalServiceTrees(_0x3d9e6b={}){const _0x21f7d1=a64_0x2674c4;return readServiceRegistry(_0x3d9e6b)[_0x21f7d1(0x180)][_0x21f7d1(0x190)](_0x2e53b2=>_0x2e53b2[_0x21f7d1(0x151)]);}export function inspectServiceRegistry(_0x47da41={}){const _0x56aa86=a64_0x2674c4,_0x3afed9=getServiceRegistryPath(_0x47da41);if(!existsSync(_0x3afed9))return emptyServiceRegistryInspection(_0x3afed9,_0x56aa86(0x158),![]);try{const _0x27bd40=readFileSync(_0x3afed9,_0x56aa86(0x188));if(!_0x27bd40[_0x56aa86(0x159)]())return emptyServiceRegistryInspection(_0x3afed9,_0x56aa86(0x18e),!![]);const _0x3da24b=JSON[_0x56aa86(0x198)](_0x27bd40);if(_0x3da24b['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x3afed9,_0x56aa86(0x17f),!![]),'schemaVersion':_0x3da24b[_0x56aa86(0x19f)],'message':_0x56aa86(0x1a6)+String(_0x3da24b[_0x56aa86(0x19f)])};if(!Array[_0x56aa86(0x15c)](_0x3da24b[_0x56aa86(0x180)]))return{...emptyServiceRegistryInspection(_0x3afed9,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3da24b[_0x56aa86(0x1a5)],'message':'services\x20must\x20be\x20an\x20array'};const _0x56b957=_0x3da24b[_0x56aa86(0x180)][_0x56aa86(0x190)](summarizeLocalServiceEntry);return{'registryPath':_0x3afed9,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3da24b[_0x56aa86(0x1a5)],'serviceCount':_0x56b957[_0x56aa86(0x181)],'commandCount':_0x56b957[_0x56aa86(0x16d)]((_0x3c9db1,_0x31eddc)=>_0x3c9db1+_0x31eddc[_0x56aa86(0x167)],0x0),'services':_0x56b957};}catch(_0x1b1083){return{...emptyServiceRegistryInspection(_0x3afed9,_0x56aa86(0x17f),!![]),'message':_0x1b1083 instanceof Error?_0x1b1083[_0x56aa86(0x185)]:String(_0x1b1083)};}}function a64_0x347b(){const _0x2a21f4=['CliError','splice','localeCompare','invalid','services','length','path','risk','homeDir','message','toISOString','source','utf8','681040TGkrjQ','Unsupported\x20service\x20registry\x20schemaVersion:\x20','].manifest.','digest','slice','empty','].manifest','map','hex','registryIndex','bff\x20target\x20requires\x20functionName.','12oVvoID','description','cliPath','20232ULNRUl','parse','importedAt','3679DBPEKe','10555BDIhCj','service.json','version','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','schemaVersion','318BFWIlH','report','startsWith','target','find','updatedAt','Unsupported\x20schemaVersion:\x20','Invalid\x20service\x20manifest\x20JSON:\x20','commands','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','normalizedManifest','serviceCode','now','341FoPpRm','update','push','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','missing','trim','922437EeEpct','.tmp','isArray','sourceHash','manifests','findIndex','1622LknCgs','manifest','14XPcidV','command','registry','$.services[','Remove\x20or\x20migrate\x20','commandCount','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','flatMap','warnings','139psFXnE','ENOENT','reduce','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','service','object','sha256','homeDirName','name','errors','294771RAomPa','49370FXFhdP','Cannot\x20write\x20service\x20registry:\x20','sort','stringify','Local\x20service\x20not\x20found:\x20','validation'];a64_0x347b=function(){return _0x2a21f4;};return a64_0x347b();}export function formatValidationFailure(_0x4b8db8){const _0x3940c0=a64_0x2674c4,_0x21ecc7=_0x4b8db8['errors'][_0x3940c0(0x190)](_0x48d934=>_0x48d934[_0x3940c0(0x182)]+':\x20'+_0x48d934['message']);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x21ecc7['join']('\x0a');}function extractLoadedServiceManifests(_0x50c1a0,_0x317151){const _0x500609=a64_0x2674c4;if(!isServiceRegistryLike(_0x50c1a0)){const _0x4def98=_0x50c1a0,{manifest:_0x56b057,errors:_0x72a0f8}=adaptServiceTreeManifestForLegacyFramework(_0x4def98),_0x4a7172=validateServiceTreeManifest(_0x56b057),_0xc079df=mergeValidationErrors(_0x4a7172,_0x72a0f8);return[{'manifest':_0x4def98,'report':_0xc079df,'normalizedManifest':_0xc079df['ok']?normalizeServiceTreeManifest(_0x56b057):undefined,'sourceHash':_0x317151}];}return _0x50c1a0[_0x500609(0x180)][_0x500609(0x190)]((_0x44082d,_0x209ae8)=>{const _0x38fbd3=_0x500609,_0x57b0fc=isObjectRecord(_0x44082d)?_0x44082d[_0x38fbd3(0x161)]:undefined,{manifest:_0x51a526,errors:_0x4b361a}=adaptServiceTreeManifestForLegacyFramework(_0x57b0fc),_0x467d2d=validateServiceTreeManifest(_0x51a526),_0x346830=mergeValidationErrors(_0x467d2d,_0x4b361a),_0x488adf=isObjectRecord(_0x44082d)&&typeof _0x44082d[_0x38fbd3(0x152)]==='string'?_0x44082d['serviceCode']:undefined;return{'manifest':_0x57b0fc,'report':_0x346830,'normalizedManifest':_0x346830['ok']?normalizeServiceTreeManifest(_0x51a526):undefined,'sourceHash':sha256(JSON[_0x38fbd3(0x179)](_0x57b0fc,null,0x2)+'\x0a'),'registryIndex':_0x209ae8,'registryServiceCode':_0x488adf};});}function mergeValidationErrors(_0x206f9f,_0x4ed141){const _0x517e89=a64_0x2674c4,_0x4fe9ac=_0x206f9f[_0x517e89(0x174)][_0x517e89(0x190)](_0x11a77b=>_0x11a77b[_0x517e89(0x185)]===_0x517e89(0x168)?{..._0x11a77b,'message':_0x517e89(0x193)}:_0x11a77b),_0x1b3f39=[..._0x4ed141,..._0x4fe9ac];return{'ok':_0x1b3f39[_0x517e89(0x181)]===0x0,'errors':_0x1b3f39,'warnings':_0x206f9f['warnings']};}function aggregateValidationReports(_0x2a6f89){const _0x1469b2=a64_0x2674c4,_0x2a20b8=_0x2a6f89[_0x1469b2(0x169)](_0x4aaa92=>_0x4aaa92['registryIndex']===undefined?_0x4aaa92[_0x1469b2(0x1a1)]['errors']:_0x4aaa92[_0x1469b2(0x1a1)][_0x1469b2(0x174)][_0x1469b2(0x190)](_0x35a579=>({..._0x35a579,'path':prefixRegistryIssuePath(_0x4aaa92[_0x1469b2(0x192)],_0x35a579['path'])}))),_0x4dc312=_0x2a6f89[_0x1469b2(0x169)](_0x202db6=>_0x202db6[_0x1469b2(0x192)]===undefined?_0x202db6[_0x1469b2(0x1a1)][_0x1469b2(0x16a)]:_0x202db6[_0x1469b2(0x1a1)][_0x1469b2(0x16a)][_0x1469b2(0x190)](_0x2d24f7=>({..._0x2d24f7,'path':prefixRegistryIssuePath(_0x202db6[_0x1469b2(0x192)],_0x2d24f7['path'])})));return{'ok':_0x2a20b8[_0x1469b2(0x181)]===0x0,'errors':_0x2a20b8,'warnings':_0x4dc312};}function prefixRegistryIssuePath(_0x2b27f7,_0x54e322){const _0x5577db=a64_0x2674c4;if(_0x54e322==='$')return _0x5577db(0x165)+_0x2b27f7+_0x5577db(0x18f);if(_0x54e322[_0x5577db(0x1a2)]('$.'))return _0x5577db(0x165)+_0x2b27f7+_0x5577db(0x18f)+_0x54e322[_0x5577db(0x18d)](0x1);if(_0x54e322['startsWith']('$['))return _0x5577db(0x165)+_0x2b27f7+'].manifest'+_0x54e322[_0x5577db(0x18d)](0x1);return _0x5577db(0x165)+_0x2b27f7+_0x5577db(0x18b)+_0x54e322;}function isServiceRegistryLike(_0x4ccc8a){const _0x31fa94=a64_0x2674c4;return isObjectRecord(_0x4ccc8a)&&_0x4ccc8a[_0x31fa94(0x19f)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x31fa94(0x15c)](_0x4ccc8a[_0x31fa94(0x180)]);}function isObjectRecord(_0x4809f5){const _0x359286=a64_0x2674c4;return Boolean(_0x4809f5)&&typeof _0x4809f5===_0x359286(0x170)&&!Array['isArray'](_0x4809f5);}function emptyServiceRegistryInspection(_0x1df4f9,_0x2b4d94,_0x231771){return{'registryPath':_0x1df4f9,'exists':_0x231771,'status':_0x2b4d94,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x5ed256){const _0x15da93=a64_0x2674c4,_0x727ddf=_0x5ed256[_0x15da93(0x151)],_0x1db35b=_0x727ddf[_0x15da93(0x14f)][_0x15da93(0x190)](_0x5e5dca=>({'path':_0x5e5dca[_0x15da93(0x196)],'description':_0x5e5dca[_0x15da93(0x195)],'risk':_0x5e5dca[_0x15da93(0x183)],'targetKind':_0x5e5dca[_0x15da93(0x1a3)]['kind'],'targetCommand':_0x5e5dca[_0x15da93(0x1a3)][_0x15da93(0x163)]}));return{'serviceCode':_0x5ed256[_0x15da93(0x152)],'name':_0x727ddf[_0x15da93(0x16f)][_0x15da93(0x173)],'description':_0x727ddf[_0x15da93(0x16f)]['description'],'version':_0x5ed256[_0x15da93(0x19d)],'importedAt':_0x5ed256[_0x15da93(0x199)],'source':_0x5ed256[_0x15da93(0x187)],'commandCount':_0x1db35b[_0x15da93(0x181)],'commands':_0x1db35b};}function sha256(_0x27a60f){const _0x277250=a64_0x2674c4;return createHash(_0x277250(0x171))[_0x277250(0x155)](_0x27a60f)[_0x277250(0x18c)](_0x277250(0x191));}
|
|
1
|
+
const a64_0x26d2f9=a64_0x1cbb;(function(_0x2d2e96,_0x373be1){const _0x212778=a64_0x1cbb,_0x11eb85=_0x2d2e96();while(!![]){try{const _0x1a2110=-parseInt(_0x212778(0x1ee))/0x1+parseInt(_0x212778(0x21a))/0x2*(-parseInt(_0x212778(0x1dc))/0x3)+-parseInt(_0x212778(0x1e0))/0x4+parseInt(_0x212778(0x201))/0x5*(parseInt(_0x212778(0x1e5))/0x6)+parseInt(_0x212778(0x1e6))/0x7*(-parseInt(_0x212778(0x1e3))/0x8)+-parseInt(_0x212778(0x21d))/0x9+-parseInt(_0x212778(0x1d8))/0xa*(-parseInt(_0x212778(0x1f5))/0xb);if(_0x1a2110===_0x373be1)break;else _0x11eb85['push'](_0x11eb85['shift']());}catch(_0x2cb444){_0x11eb85['push'](_0x11eb85['shift']());}}}(a64_0x4cf3,0x1afa7));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a64_0x1cbb(_0x2b03f9,_0x526c11){_0x2b03f9=_0x2b03f9-0x1d8;const _0x4cf3e5=a64_0x4cf3();let _0x1cbbad=_0x4cf3e5[_0x2b03f9];return _0x1cbbad;}import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';function a64_0x4cf3(){const _0x15dd49=['registryIndex','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','normalizedManifest','version','schemaVersion','Invalid\x20service\x20registry\x20JSON:\x20','commandCount','trim','message','report','Cannot\x20write\x20service\x20registry:\x20','warnings','Invalid\x20service\x20manifest\x20JSON:\x20','2DVLcQC','updatedAt','CliError','1807209UTEqbG','bff\x20target\x20requires\x20functionName.','kind','service','path','ENOENT','manifests','target','now','.tmp','validation','sort','importedAt','manifest','length','].manifest.','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','10OiBVNL','].manifest','parse','join','607833TJsoiM','description','code','utf8','742820eNKBkL','services','map','456GREiIp','splice','1122DHiUou','18039jxPOAl','service.json','push','startsWith','toISOString','flatMap','Remove\x20or\x20migrate\x20','Unsupported\x20service\x20registry\x20schemaVersion:\x20','86425dVALFl','hex','homeDirName','command','errors','slice','name','8594047LPNCwn','serviceCode','filePath','services\x20must\x20be\x20an\x20array','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','findIndex','invalid','registry','commands','sha256','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','4055SHZvnN','empty','isArray','missing','$.services[','Local\x20service\x20not\x20found:\x20','stringify','Service\x20manifest\x20file\x20not\x20found:\x20','risk','Service\x20manifest\x20validation\x20failed:\x0a','cliPath','object'];a64_0x4cf3=function(){return _0x15dd49;};return a64_0x4cf3();}import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a64_0x26d2f9(0x1e7);export function getServiceRegistryPath(_0x489f74={}){const _0x5173f4=a64_0x26d2f9;return resolve(_0x489f74['homeDir']??homedir(),PRODUCT_CONFIG[_0x5173f4(0x1f0)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x55bccc={}){const _0x147b8a=a64_0x26d2f9,_0x93c717=getServiceRegistryPath(_0x55bccc);if(!existsSync(_0x93c717))return emptyServiceRegistry();try{const _0x32a8dc=readFileSync(_0x93c717,_0x147b8a(0x1df));if(!_0x32a8dc['trim']())return emptyServiceRegistry();const _0x61d339=JSON['parse'](_0x32a8dc);if(_0x61d339[_0x147b8a(0x211)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x147b8a(0x227)](_0x147b8a(0x1ed)+String(_0x61d339['schemaVersion']),_0x147b8a(0x1ec)+_0x93c717+'.');if(!Array[_0x147b8a(0x203)](_0x61d339[_0x147b8a(0x1e1)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x61d339[_0x147b8a(0x21b)],'services':_0x61d339[_0x147b8a(0x1e1)]};}catch(_0x29e99e){if(_0x29e99e instanceof Error&&_0x29e99e[_0x147b8a(0x1f4)]===_0x147b8a(0x21c))throw _0x29e99e;throw CliErrors[_0x147b8a(0x227)](_0x147b8a(0x212)+_0x93c717,_0x147b8a(0x1f9));}}export function writeServiceRegistry(_0x590b1c,_0x19af90={}){const _0x468122=a64_0x26d2f9,_0x62f235=getServiceRegistryPath(_0x19af90),_0x535b62=dirname(_0x62f235);!existsSync(_0x535b62)&&mkdirSync(_0x535b62,{'recursive':!![]});const _0x2eca4d=_0x62f235+_0x468122(0x226);try{writeFileSync(_0x2eca4d,JSON[_0x468122(0x207)](_0x590b1c,null,0x2)+'\x0a',{'encoding':_0x468122(0x1df),'mode':0x180}),renameSync(_0x2eca4d,_0x62f235);}catch(_0x3695e6){try{unlinkSync(_0x2eca4d);}catch{}if(_0x3695e6?.[_0x468122(0x1de)]===_0x468122(0x222))throw CliErrors[_0x468122(0x227)](_0x468122(0x217)+_0x62f235);throw _0x3695e6;}return _0x62f235;}export function loadServiceManifestFromFile(_0x19bc18){const _0x4f0c12=a64_0x26d2f9,_0x401daa=resolve(_0x19bc18);if(!existsSync(_0x401daa))throw CliErrors['validation'](_0x4f0c12(0x208)+_0x19bc18);let _0x20dbf1;const _0x452b8d=readFileSync(_0x401daa,'utf8');try{_0x20dbf1=JSON[_0x4f0c12(0x1da)](_0x452b8d);}catch{throw CliErrors[_0x4f0c12(0x227)](_0x4f0c12(0x219)+_0x19bc18,_0x4f0c12(0x1fa));}const _0x124074=sha256(_0x452b8d),_0x21c895=extractLoadedServiceManifests(_0x20dbf1,_0x124074),_0x5d1b21=aggregateValidationReports(_0x21c895),_0x5c9c05=_0x21c895[0x0];return{'filePath':_0x401daa,'hash':_0x124074,'kind':isServiceRegistryLike(_0x20dbf1)?_0x4f0c12(0x1fd):_0x4f0c12(0x22a),'manifest':_0x5c9c05?.[_0x4f0c12(0x22a)]??_0x20dbf1,'report':_0x5d1b21,'normalizedManifest':_0x21c895[_0x4f0c12(0x22b)]===0x1?_0x5c9c05?.['normalizedManifest']:undefined,'manifests':_0x21c895};}export function importServiceManifest(_0xbcb49d,_0x402e1f={}){const _0x588c7c=a64_0x26d2f9,_0x209efc=loadServiceManifestFromFile(_0xbcb49d);if(!_0x209efc[_0x588c7c(0x216)]['ok'])throw CliErrors[_0x588c7c(0x227)](formatValidationFailure(_0x209efc[_0x588c7c(0x216)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x209efc[_0x588c7c(0x223)][_0x588c7c(0x22b)]===0x0)throw CliErrors[_0x588c7c(0x227)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x588c7c(0x22d));const _0x4544b7=readServiceRegistry(_0x402e1f),_0x54e578=(_0x402e1f['now']??(()=>new Date()))()[_0x588c7c(0x1ea)](),_0x4c167a=[];let _0x2bf04a=0x0,_0x2131ed=0x0;for(const _0x2a6a36 of _0x209efc[_0x588c7c(0x223)]){if(!_0x2a6a36['normalizedManifest'])continue;const _0x1dda8e=_0x2a6a36['normalizedManifest'][_0x588c7c(0x220)][_0x588c7c(0x1de)],_0x290913={'serviceCode':_0x1dda8e,'version':_0x2a6a36[_0x588c7c(0x20f)][_0x588c7c(0x210)],'importedAt':_0x54e578,'source':{'type':'file','path':_0x209efc[_0x588c7c(0x1f7)],'hash':_0x2a6a36['sourceHash']},'manifest':_0x2a6a36[_0x588c7c(0x22a)],'normalizedManifest':_0x2a6a36[_0x588c7c(0x20f)]},_0x3f3171=_0x4544b7[_0x588c7c(0x1e1)]['findIndex'](_0x308ef0=>_0x308ef0['serviceCode']===_0x1dda8e);_0x3f3171>=0x0?(_0x4544b7[_0x588c7c(0x1e1)][_0x3f3171]=_0x290913,_0x2131ed++):(_0x4544b7['services']['push'](_0x290913),_0x2bf04a++),_0x4c167a[_0x588c7c(0x1e8)](_0x290913);}_0x4544b7['services'][_0x588c7c(0x228)]((_0x32232c,_0x45bbcf)=>_0x32232c[_0x588c7c(0x1f6)]['localeCompare'](_0x45bbcf[_0x588c7c(0x1f6)])),_0x4544b7[_0x588c7c(0x21b)]=_0x54e578;const _0x20fd77=writeServiceRegistry(_0x4544b7,_0x402e1f);return{'registryPath':_0x20fd77,'entry':_0x4c167a[0x0],'replaced':_0x4c167a[_0x588c7c(0x22b)]===0x1?_0x2131ed===0x1:_0x2131ed>0x0,'entries':_0x4c167a,'imported':_0x2bf04a,'updated':_0x2131ed,'serviceCount':_0x4544b7['services'][_0x588c7c(0x22b)]};}export function exportServiceManifest(_0x2d7a0b,_0x80d985,_0x469caa={}){const _0x38a75c=a64_0x26d2f9,_0x4bf1fa=getServiceRegistryPath(_0x469caa),_0x403c6c=getLocalServiceEntry(_0x2d7a0b,_0x469caa);if(!_0x403c6c)throw CliErrors[_0x38a75c(0x227)](_0x38a75c(0x206)+_0x2d7a0b,_0x38a75c(0x20e));const _0x2bfe5e=resolve(_0x80d985),_0x1b1774=dirname(_0x2bfe5e);return!existsSync(_0x1b1774)&&mkdirSync(_0x1b1774,{'recursive':!![]}),writeFileSync(_0x2bfe5e,JSON[_0x38a75c(0x207)](_0x403c6c[_0x38a75c(0x22a)],null,0x2)+'\x0a',{'encoding':_0x38a75c(0x1df),'mode':0x180}),{'registryPath':_0x4bf1fa,'filePath':_0x2bfe5e,'entry':_0x403c6c};}export function removeServiceManifest(_0x194e3d,_0x294c92={}){const _0x3dceb8=a64_0x26d2f9,_0x1f45de=readServiceRegistry(_0x294c92),_0x3e596b=_0x194e3d[_0x3dceb8(0x214)](),_0x21deaf=_0x1f45de[_0x3dceb8(0x1e1)][_0x3dceb8(0x1fb)](_0x1257bc=>_0x1257bc[_0x3dceb8(0x1f6)]===_0x3e596b);if(_0x21deaf<0x0)throw CliErrors[_0x3dceb8(0x227)](_0x3dceb8(0x206)+_0x3e596b,_0x3dceb8(0x20e));const [_0x134e7d]=_0x1f45de[_0x3dceb8(0x1e1)][_0x3dceb8(0x1e4)](_0x21deaf,0x1),_0x3bab4f=(_0x294c92[_0x3dceb8(0x225)]??(()=>new Date()))()[_0x3dceb8(0x1ea)]();_0x1f45de[_0x3dceb8(0x21b)]=_0x3bab4f;const _0x3cb1f2=writeServiceRegistry(_0x1f45de,_0x294c92);return{'registryPath':_0x3cb1f2,'entry':_0x134e7d,'serviceCount':_0x1f45de[_0x3dceb8(0x1e1)]['length']};}export function listLocalServices(_0x8db52e={}){const _0x518782=a64_0x26d2f9;return readServiceRegistry(_0x8db52e)[_0x518782(0x1e1)];}export function getLocalServiceEntry(_0xee9b1b,_0x2cbf93={}){const _0x2cc913=a64_0x26d2f9;return readServiceRegistry(_0x2cbf93)[_0x2cc913(0x1e1)]['find'](_0x1cf574=>_0x1cf574[_0x2cc913(0x1f6)]===_0xee9b1b[_0x2cc913(0x214)]());}export function listLocalServiceTrees(_0x21c523={}){const _0x917cec=a64_0x26d2f9;return readServiceRegistry(_0x21c523)[_0x917cec(0x1e1)]['map'](_0x2192f8=>_0x2192f8[_0x917cec(0x20f)]);}export function inspectServiceRegistry(_0x14a608={}){const _0x356ec0=a64_0x26d2f9,_0x3e08cc=getServiceRegistryPath(_0x14a608);if(!existsSync(_0x3e08cc))return emptyServiceRegistryInspection(_0x3e08cc,_0x356ec0(0x204),![]);try{const _0x7e0e5b=readFileSync(_0x3e08cc,'utf8');if(!_0x7e0e5b[_0x356ec0(0x214)]())return emptyServiceRegistryInspection(_0x3e08cc,_0x356ec0(0x202),!![]);const _0x38f74e=JSON['parse'](_0x7e0e5b);if(_0x38f74e[_0x356ec0(0x211)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x3e08cc,_0x356ec0(0x1fc),!![]),'schemaVersion':_0x38f74e[_0x356ec0(0x211)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x38f74e[_0x356ec0(0x211)])};if(!Array[_0x356ec0(0x203)](_0x38f74e[_0x356ec0(0x1e1)]))return{...emptyServiceRegistryInspection(_0x3e08cc,_0x356ec0(0x1fc),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x38f74e[_0x356ec0(0x21b)],'message':_0x356ec0(0x1f8)};const _0x1ecea9=_0x38f74e[_0x356ec0(0x1e1)][_0x356ec0(0x1e2)](summarizeLocalServiceEntry);return{'registryPath':_0x3e08cc,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x38f74e[_0x356ec0(0x21b)],'serviceCount':_0x1ecea9['length'],'commandCount':_0x1ecea9['reduce']((_0x294409,_0x3cb571)=>_0x294409+_0x3cb571[_0x356ec0(0x213)],0x0),'services':_0x1ecea9};}catch(_0x564dff){return{...emptyServiceRegistryInspection(_0x3e08cc,_0x356ec0(0x1fc),!![]),'message':_0x564dff instanceof Error?_0x564dff[_0x356ec0(0x215)]:String(_0x564dff)};}}export function formatValidationFailure(_0x1718cd){const _0x80874=a64_0x26d2f9,_0x36af86=_0x1718cd['errors'][_0x80874(0x1e2)](_0x314d8d=>_0x314d8d[_0x80874(0x221)]+':\x20'+_0x314d8d[_0x80874(0x215)]);return _0x80874(0x20a)+_0x36af86[_0x80874(0x1db)]('\x0a');}function extractLoadedServiceManifests(_0x3e89c3,_0x5b3739){const _0x4ec5d0=a64_0x26d2f9;if(!isServiceRegistryLike(_0x3e89c3)){const _0x3df9e3=_0x3e89c3,{manifest:_0x2d0347,errors:_0x333c4e}=adaptServiceTreeManifestForLegacyFramework(_0x3df9e3),_0x16484c=validateServiceTreeManifest(_0x2d0347),_0x30af7b=mergeValidationErrors(_0x16484c,_0x333c4e);return[{'manifest':_0x3df9e3,'report':_0x30af7b,'normalizedManifest':_0x30af7b['ok']?normalizeServiceTreeManifest(_0x2d0347):undefined,'sourceHash':_0x5b3739}];}return _0x3e89c3[_0x4ec5d0(0x1e1)][_0x4ec5d0(0x1e2)]((_0x542e88,_0x315c4b)=>{const _0x3b19bf=_0x4ec5d0,_0x207fc6=isObjectRecord(_0x542e88)?_0x542e88['manifest']:undefined,{manifest:_0x447c43,errors:_0x2883c8}=adaptServiceTreeManifestForLegacyFramework(_0x207fc6),_0x3b7f38=validateServiceTreeManifest(_0x447c43),_0x1541d0=mergeValidationErrors(_0x3b7f38,_0x2883c8),_0x319f71=isObjectRecord(_0x542e88)&&typeof _0x542e88['serviceCode']==='string'?_0x542e88[_0x3b19bf(0x1f6)]:undefined;return{'manifest':_0x207fc6,'report':_0x1541d0,'normalizedManifest':_0x1541d0['ok']?normalizeServiceTreeManifest(_0x447c43):undefined,'sourceHash':sha256(JSON[_0x3b19bf(0x207)](_0x207fc6,null,0x2)+'\x0a'),'registryIndex':_0x315c4b,'registryServiceCode':_0x319f71};});}function mergeValidationErrors(_0x425c2b,_0x585484){const _0x1c463e=a64_0x26d2f9,_0x1813cd=_0x425c2b[_0x1c463e(0x1f2)][_0x1c463e(0x1e2)](_0x518bd7=>_0x518bd7[_0x1c463e(0x215)]===_0x1c463e(0x200)?{..._0x518bd7,'message':_0x1c463e(0x21e)}:_0x518bd7),_0x7939f=[..._0x585484,..._0x1813cd];return{'ok':_0x7939f[_0x1c463e(0x22b)]===0x0,'errors':_0x7939f,'warnings':_0x425c2b[_0x1c463e(0x218)]};}function aggregateValidationReports(_0x42d1d9){const _0x366457=a64_0x26d2f9,_0x4a84eb=_0x42d1d9[_0x366457(0x1eb)](_0x19e955=>_0x19e955[_0x366457(0x20d)]===undefined?_0x19e955[_0x366457(0x216)][_0x366457(0x1f2)]:_0x19e955['report'][_0x366457(0x1f2)][_0x366457(0x1e2)](_0x2a5605=>({..._0x2a5605,'path':prefixRegistryIssuePath(_0x19e955[_0x366457(0x20d)],_0x2a5605[_0x366457(0x221)])}))),_0x2e83c7=_0x42d1d9[_0x366457(0x1eb)](_0x23b953=>_0x23b953['registryIndex']===undefined?_0x23b953[_0x366457(0x216)][_0x366457(0x218)]:_0x23b953[_0x366457(0x216)][_0x366457(0x218)]['map'](_0xd84625=>({..._0xd84625,'path':prefixRegistryIssuePath(_0x23b953[_0x366457(0x20d)],_0xd84625[_0x366457(0x221)])})));return{'ok':_0x4a84eb[_0x366457(0x22b)]===0x0,'errors':_0x4a84eb,'warnings':_0x2e83c7};}function prefixRegistryIssuePath(_0x43cefc,_0xb3bffa){const _0x17555e=a64_0x26d2f9;if(_0xb3bffa==='$')return _0x17555e(0x205)+_0x43cefc+'].manifest';if(_0xb3bffa[_0x17555e(0x1e9)]('$.'))return _0x17555e(0x205)+_0x43cefc+_0x17555e(0x1d9)+_0xb3bffa[_0x17555e(0x1f3)](0x1);if(_0xb3bffa[_0x17555e(0x1e9)]('$['))return _0x17555e(0x205)+_0x43cefc+'].manifest'+_0xb3bffa[_0x17555e(0x1f3)](0x1);return _0x17555e(0x205)+_0x43cefc+_0x17555e(0x22c)+_0xb3bffa;}function isServiceRegistryLike(_0x3e81c9){const _0x142d62=a64_0x26d2f9;return isObjectRecord(_0x3e81c9)&&_0x3e81c9[_0x142d62(0x211)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x3e81c9[_0x142d62(0x1e1)]);}function isObjectRecord(_0x220d8a){const _0x30678a=a64_0x26d2f9;return Boolean(_0x220d8a)&&typeof _0x220d8a===_0x30678a(0x20c)&&!Array[_0x30678a(0x203)](_0x220d8a);}function emptyServiceRegistryInspection(_0x82eac0,_0x2df955,_0x12a08a){return{'registryPath':_0x82eac0,'exists':_0x12a08a,'status':_0x2df955,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x5699e8){const _0x1390dc=a64_0x26d2f9,_0x5c27e2=_0x5699e8[_0x1390dc(0x20f)],_0x5176d1=_0x5c27e2[_0x1390dc(0x1fe)][_0x1390dc(0x1e2)](_0x1159f6=>({'path':_0x1159f6[_0x1390dc(0x20b)],'description':_0x1159f6['description'],'risk':_0x1159f6[_0x1390dc(0x209)],'targetKind':_0x1159f6[_0x1390dc(0x224)][_0x1390dc(0x21f)],'targetCommand':_0x1159f6[_0x1390dc(0x224)][_0x1390dc(0x1f1)]}));return{'serviceCode':_0x5699e8[_0x1390dc(0x1f6)],'name':_0x5c27e2['service']['name'],'description':_0x5c27e2['service'][_0x1390dc(0x1dd)],'version':_0x5699e8['version'],'importedAt':_0x5699e8[_0x1390dc(0x229)],'source':_0x5699e8['source'],'commandCount':_0x5176d1[_0x1390dc(0x22b)],'commands':_0x5176d1};}function sha256(_0x7ce2dc){const _0x2f6063=a64_0x26d2f9;return createHash(_0x2f6063(0x1ff))['update'](_0x7ce2dc)['digest'](_0x2f6063(0x1ef));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a65_0x121f1c=a65_0x30a0;(function(_0x2f8e80,_0x1ea28d){const _0x3a3011=a65_0x30a0,_0xf3e9f2=_0x2f8e80();while(!![]){try{const _0x1c1f5a=-parseInt(_0x3a3011(0xa1))/0x1*(-parseInt(_0x3a3011(0x82))/0x2)+parseInt(_0x3a3011(0x87))/0x3+parseInt(_0x3a3011(0x9d))/0x4*(parseInt(_0x3a3011(0x8f))/0x5)+-parseInt(_0x3a3011(0x9e))/0x6*(-parseInt(_0x3a3011(0xa0))/0x7)+-parseInt(_0x3a3011(0xa2))/0x8+parseInt(_0x3a3011(0x92))/0x9*(-parseInt(_0x3a3011(0x86))/0xa)+parseInt(_0x3a3011(0x95))/0xb;if(_0x1c1f5a===_0x1ea28d)break;else _0xf3e9f2['push'](_0xf3e9f2['shift']());}catch(_0x60c8ef){_0xf3e9f2['push'](_0xf3e9f2['shift']());}}}(a65_0x141e,0x8a5fc));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a65_0x141e(){const _0x586f0f=['6rZTdHa','map','6195049CPtDTV','38CFhJvO','6949400IfzVzJ','2716LlwUkf','path','isSymbolicLink','Refusing\x20to\x20overwrite\x20symlink:\x20','10AFEnHt','822033fhZNnG','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','target','skill','str','rendered','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','244370LdSdwz','utf8','files','10099422pZkOmQ','read','type','11591217RPEgGB','skillDir','trim','Created\x20local\x20Skill\x20draft\x20','name','force','WRITE','skillName','24IgGUEW'];a65_0x141e=function(){return _0x586f0f;};return a65_0x141e();}import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';function a65_0x30a0(_0x4f4d5d,_0x427ad5){_0x4f4d5d=_0x4f4d5d-0x82;const _0x141e05=a65_0x141e();let _0x30a0ef=_0x141e05[_0x4f4d5d];return _0x30a0ef;}import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a65_0x121f1c(0x8a),'command':'create','description':'Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','risk':a65_0x121f1c(0x93),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x19ee7c){const _0x149634=a65_0x121f1c,_0x4aa51c=buildSkillCreatePlan(_0x19ee7c[_0x149634(0x8b)](_0x149634(0x99)),_0x19ee7c['str'](_0x149634(0x94)),_0x19ee7c[_0x149634(0x8b)](_0x149634(0x89)));return{'method':_0x149634(0x9b),'url':_0x4aa51c[_0x149634(0x96)],'body':{'skillName':_0x4aa51c[_0x149634(0x8c)][_0x149634(0x9c)],'type':_0x4aa51c[_0x149634(0x8c)]['type'],'selfContained':!![],'files':_0x4aa51c[_0x149634(0x8c)][_0x149634(0x91)]['map'](_0x21940d=>_0x21940d[_0x149634(0x83)])},'description':'Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'};},async 'execute'(_0x2bc4d9){const _0x5bd5ef=a65_0x121f1c,_0x41624e=buildSkillCreatePlan(_0x2bc4d9['str'](_0x5bd5ef(0x99)),_0x2bc4d9[_0x5bd5ef(0x8b)]('type'),_0x2bc4d9[_0x5bd5ef(0x8b)](_0x5bd5ef(0x89)));return writeSkillDraft(_0x41624e,_0x2bc4d9['bool'](_0x5bd5ef(0x9a))),{'ok':!![],'data':{'skillName':_0x41624e[_0x5bd5ef(0x8c)][_0x5bd5ef(0x9c)],'type':_0x41624e[_0x5bd5ef(0x8c)][_0x5bd5ef(0x94)],'dir':_0x41624e[_0x5bd5ef(0x96)],'files':_0x41624e[_0x5bd5ef(0x8c)]['files'][_0x5bd5ef(0x9f)](_0x2f645d=>_0x2f645d[_0x5bd5ef(0x83)])},'message':_0x5bd5ef(0x98)+_0x41624e['rendered'][_0x5bd5ef(0x9c)]};}};function buildSkillCreatePlan(_0x53842c,_0x50a9a2,_0x5afea2){const _0x5a100d=a65_0x121f1c,_0x5a90c4=_0x50a9a2[_0x5a100d(0x97)](),_0x3d558d=renderSkillTemplate({'skillName':_0x53842c,'type':_0x5a90c4});!_0x5a90c4&&writeCliSideChannelLine(_0x5a100d(0x88));const _0x1c3a45=resolve(normalizeSkillTarget(_0x5afea2));return{'rendered':_0x3d558d,'targetRoot':_0x1c3a45,'skillDir':resolve(_0x1c3a45,_0x3d558d[_0x5a100d(0x9c)])};}function normalizeSkillTarget(_0x58aedb){const _0x1ce0ea=a65_0x121f1c;return(_0x58aedb||DEFAULT_SKILL_TARGET)[_0x1ce0ea(0x97)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x205175,_0x4557e5){const _0x184e79=a65_0x121f1c;if(existsSync(_0x205175[_0x184e79(0x96)])){const _0x3c62a0=lstatSync(_0x205175[_0x184e79(0x96)]);if(!_0x3c62a0['isDirectory']()||_0x3c62a0[_0x184e79(0x84)]())throw CliErrors['validation'](_0x184e79(0x8d)+_0x205175[_0x184e79(0x96)]);if(!_0x4557e5)throw CliErrors['validation']('Skill\x20directory\x20already\x20exists:\x20'+_0x205175[_0x184e79(0x96)],_0x184e79(0x8e));}for(const _0x1ad18e of _0x205175[_0x184e79(0x8c)][_0x184e79(0x91)]){const _0x37b09e=resolve(_0x205175[_0x184e79(0x96)],_0x1ad18e[_0x184e79(0x83)]),_0x487095=dirname(_0x37b09e);mkdirSync(_0x487095,{'recursive':!![]});if(existsSync(_0x37b09e)&&lstatSync(_0x37b09e)['isSymbolicLink']())throw CliErrors['validation'](_0x184e79(0x85)+_0x37b09e);writeFileSync(_0x37b09e,_0x1ad18e['content'],_0x184e79(0x90));}}
|