@lovrabet/lovrabet-cli 2.3.2-beta.2 → 2.3.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/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/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.js +1 -1
- 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.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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x355a98=a54_0x355f;(function(_0x45f984,_0x5f48c1){const _0x34ae50=a54_0x355f,_0x122922=_0x45f984();while(!![]){try{const _0x3e3a7e=parseInt(_0x34ae50(0x13a))/0x1+parseInt(_0x34ae50(0x16c))/0x2+-parseInt(_0x34ae50(0x130))/0x3*(parseInt(_0x34ae50(0x146))/0x4)+parseInt(_0x34ae50(0x14e))/0x5*(parseInt(_0x34ae50(0x149))/0x6)+-parseInt(_0x34ae50(0x178))/0x7+-parseInt(_0x34ae50(0x16d))/0x8+parseInt(_0x34ae50(0x144))/0x9;if(_0x3e3a7e===_0x5f48c1)break;else _0x122922['push'](_0x122922['shift']());}catch(_0x3712e2){_0x122922['push'](_0x122922['shift']());}}}(a54_0x3f69,0x7af07));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a54_0x355f(_0x4c3b74,_0x2fcd00){_0x4c3b74=_0x4c3b74-0x130;const _0x3f69a0=a54_0x3f69();let _0x355fe8=_0x3f69a0[_0x4c3b74];return _0x355fe8;}export const RUNTIME_ROLE_TYPES=[a54_0x355a98(0x165),a54_0x355a98(0x169),a54_0x355a98(0x140),a54_0x355a98(0x164)];const BUILTIN_ROLE_TYPES=[a54_0x355a98(0x165),'USER','OWNER'];export const ROLE_ID_FLAG={'name':'id','type':a54_0x355a98(0x138),'required':!![],'description':'Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list'};export const ROLE_REF_FLAG={'name':'role','type':a54_0x355a98(0x14a),'required':!![],'description':a54_0x355a98(0x175)};export const ROLE_CODE_FLAG={'name':'role-code','type':'string','description':a54_0x355a98(0x163)};export const USER_ID_FLAG={'name':'user','type':a54_0x355a98(0x14a),'required':!![],'description':'Runtime\x20numeric\x20userId'};export const EXPECT_USER_COUNT_FLAG={'name':a54_0x355a98(0x168),'type':a54_0x355a98(0x138),'description':a54_0x355a98(0x179)};export function isBuiltinRuntimeRole(_0x15a47a){const _0x120d51=a54_0x355a98;return BUILTIN_ROLE_TYPES[_0x120d51(0x170)](_0x15a47a);}export function assertCustomRuntimeRole(_0x423377,_0x3ec723){const _0x4f2d8d=a54_0x355a98;if(_0x423377[_0x4f2d8d(0x14b)]!==_0x4f2d8d(0x164))throw CliErrors[_0x4f2d8d(0x148)](_0x4f2d8d(0x16e)+_0x3ec723+_0x4f2d8d(0x15d)+_0x423377[_0x4f2d8d(0x13f)]+'\x20('+_0x423377[_0x4f2d8d(0x14b)]+').','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRuntimeRole(_0x5ba71c){const _0x35c912=a54_0x355a98;return{'id':_0x5ba71c['id'],'roleCode':_0x5ba71c[_0x35c912(0x143)],'roleName':_0x5ba71c[_0x35c912(0x13f)],'roleType':_0x5ba71c['roleType'],'remark':_0x5ba71c[_0x35c912(0x160)],'userCount':_0x5ba71c[_0x35c912(0x156)]??0x0,'permitCount':_0x5ba71c[_0x35c912(0x152)]??0x0,'builtin':isBuiltinRuntimeRole(_0x5ba71c[_0x35c912(0x14b)])};}export function readOptionalRuntimeRoleCode(_0x5b5760){const _0x3a88ac=a54_0x355a98,_0x44960b=_0x5b5760[_0x3a88ac(0x171)](_0x3a88ac(0x13d));if(_0x44960b===undefined||_0x44960b===null)return undefined;const _0xa00f56=String(_0x44960b)[_0x3a88ac(0x141)]();if(!_0xa00f56)throw CliErrors[_0x3a88ac(0x148)]('--role-code\x20must\x20not\x20be\x20blank.');if(_0xa00f56['length']>0x40)throw CliErrors['validation']('--role-code\x20cannot\x20exceed\x2064\x20characters.');return _0xa00f56;}export async function getRuntimeRoleById(_0x2056b9,_0x1a2dfc){const _0x5585b3=a54_0x355a98;if(!Number[_0x5585b3(0x17a)](_0x1a2dfc)||_0x1a2dfc<=0x0)throw CliErrors[_0x5585b3(0x148)](_0x5585b3(0x137));const _0x219526=(await listAllRuntimeRoles(_0x2056b9))['filter'](_0x2cbefa=>_0x2cbefa['id']===_0x1a2dfc&&(!_0x2cbefa['appCode']||_0x2cbefa[_0x5585b3(0x134)]===_0x2056b9));if(_0x219526['length']!==0x1)throw CliErrors[_0x5585b3(0x148)](_0x5585b3(0x136)+_0x1a2dfc+_0x5585b3(0x15a)+_0x2056b9+'.',_0x5585b3(0x153));return _0x219526[0x0];}function a54_0x3f69(){const _0x27d170=['length','appCode','userList','Runtime\x20role\x20id\x20','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','number','paging','446091kpCjHS','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','find','role-code','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','roleName','OWNER','trim','filter','roleCode','7152093JBOWEJ','Runtime\x20user\x20','170468qyeqAZ','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','validation','6zUxWgC','string','roleType','totalCount','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','89570DsSZaQ','\x20is\x20not\x20in\x20runtime\x20role\x20','user','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','permitCount','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','Pass\x20one\x20role\x20ID:\x20','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','userCount','map','userName','Missing\x20runtime\x20role\x20reference.','\x20was\x20not\x20found\x20in\x20app\x20','\x20is\x20already\x20in\x20runtime\x20role\x20','User\x20','\x20built-in\x20runtime\x20role\x20','items','user-add','remark','str','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)','CUSTOM','ADMIN','userId','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','expect-user-count','USER',',\x20found\x20','applyUserList','659690gVHJJJ','7139984SYNpYF','Cannot\x20','Runtime\x20role\x20','includes','flag','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','Runtime\x20role\x20name\x20\x22','join','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','role','code','750652pWdCXV','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','isSafeInteger','\x22\x20is\x20ambiguous.','6bjMhIF','\x22\x20was\x20not\x20found\x20in\x20app\x20','push'];a54_0x3f69=function(){return _0x27d170;};return a54_0x3f69();}export async function listAllRuntimeRoles(_0x3ae6d8,_0x32af66={}){const _0x2341be=a54_0x355a98,_0x2f15ba=0x64,_0x4f7a69=[];for(let _0x15339f=0x1;;_0x15339f+=0x1){const _0x666bc6=await listRuntimeAppRoles(_0x3ae6d8,{..._0x32af66[_0x2341be(0x13f)]?{'roleName':_0x32af66[_0x2341be(0x13f)]}:{},'currentPage':_0x15339f,'pageSize':_0x2f15ba});_0x4f7a69[_0x2341be(0x132)](..._0x666bc6[_0x2341be(0x15e)]);if(_0x666bc6[_0x2341be(0x15e)][_0x2341be(0x133)]<_0x2f15ba||_0x666bc6[_0x2341be(0x139)]&&_0x4f7a69[_0x2341be(0x133)]>=_0x666bc6[_0x2341be(0x139)][_0x2341be(0x14c)])return _0x4f7a69;}}export async function resolveRuntimeRoleRef(_0x49892d,_0x3a5a9d){const _0x4ba63c=a54_0x355a98,_0x15a99e=_0x3a5a9d['trim']();if(!_0x15a99e)throw CliErrors[_0x4ba63c(0x148)](_0x4ba63c(0x159),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x15a99e))return getRuntimeRoleById(_0x49892d,Number(_0x15a99e));const _0x197581=(await listAllRuntimeRoles(_0x49892d))['filter'](_0x5d411c=>_0x5d411c[_0x4ba63c(0x13f)]===_0x15a99e);if(_0x197581[_0x4ba63c(0x133)]===0x0)throw CliErrors[_0x4ba63c(0x148)](_0x4ba63c(0x173)+_0x15a99e+_0x4ba63c(0x131)+_0x49892d+'.',_0x4ba63c(0x155));if(_0x197581[_0x4ba63c(0x133)]>0x1)throw CliErrors[_0x4ba63c(0x148)](_0x4ba63c(0x173)+_0x15a99e+_0x4ba63c(0x17b),_0x4ba63c(0x154)+_0x197581[_0x4ba63c(0x157)](_0x3868a9=>_0x3868a9['id'])[_0x4ba63c(0x174)](',\x20')+'.');return _0x197581[0x0];}function parseRuntimeUserId(_0x324721){const _0x2fce30=a54_0x355a98,_0x153ba9=_0x324721[_0x2fce30(0x141)]();if(!/^\d+$/['test'](_0x153ba9))throw CliErrors['validation']('Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.',_0x2fce30(0x14d));const _0x292e87=Number(_0x153ba9);if(!Number[_0x2fce30(0x17a)](_0x292e87)||_0x292e87<=0x0)throw CliErrors[_0x2fce30(0x148)](_0x2fce30(0x147));return _0x292e87;}export async function prepareRuntimeMemberMutation(_0x2663f2,_0x3ccc1d){const _0x52e4a4=a54_0x355a98,_0x9d7531=await resolveRuntimeRoleRef(_0x2663f2['appCode'],_0x2663f2[_0x52e4a4(0x161)](_0x52e4a4(0x176)));if(_0x9d7531[_0x52e4a4(0x14b)]===_0x52e4a4(0x140))throw CliErrors[_0x52e4a4(0x148)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.',_0x52e4a4(0x167));const _0x2f893f=parseRuntimeUserId(_0x2663f2[_0x52e4a4(0x161)](_0x52e4a4(0x150))),_0x2ec3f4=(await listRuntimeRoleUsers(_0x2663f2[_0x52e4a4(0x134)]))[_0x52e4a4(0x157)](_0x4c5daa=>({..._0x4c5daa,'userList':[..._0x4c5daa[_0x52e4a4(0x135)]??[]],'applyUserList':[..._0x4c5daa[_0x52e4a4(0x16b)]??[]]})),_0x1bd542=_0x2ec3f4[_0x52e4a4(0x13c)](_0x36b2c5=>_0x36b2c5['id']===_0x9d7531['id']);if(!_0x1bd542)throw CliErrors[_0x52e4a4(0x148)](_0x52e4a4(0x16f)+_0x9d7531['id']+_0x52e4a4(0x13b),_0x52e4a4(0x13e));const _0x5c7c5d=_0x1bd542[_0x52e4a4(0x135)]['map'](_0xd2620d=>_0xd2620d[_0x52e4a4(0x166)]),_0x308f94=_0x2663f2[_0x52e4a4(0x171)](_0x52e4a4(0x168));if(_0x308f94!==undefined&&_0x308f94!==null&&_0x308f94!==''){const _0x26cbdc=_0x2663f2['num']('expect-user-count');if(!Number[_0x52e4a4(0x17a)](_0x26cbdc)||_0x26cbdc<0x0)throw CliErrors[_0x52e4a4(0x148)](_0x52e4a4(0x172));if(_0x5c7c5d[_0x52e4a4(0x133)]!==_0x26cbdc)throw CliErrors[_0x52e4a4(0x148)](_0x52e4a4(0x162)+_0x26cbdc+_0x52e4a4(0x16a)+_0x5c7c5d['length']+'.',_0x52e4a4(0x151));}const _0x54f926=_0x5c7c5d['includes'](_0x2f893f),_0x72a910=[];let _0x1cb059=!![];if(_0x3ccc1d===_0x52e4a4(0x15f)){const _0x48524f=await listRuntimeAppUsers(_0x2663f2[_0x52e4a4(0x134)]),_0x4064f6=_0x48524f['filter'](_0x18ffdc=>Number(_0x18ffdc[_0x52e4a4(0x177)])===_0x2f893f);if(_0x4064f6[_0x52e4a4(0x133)]!==0x1||!_0x4064f6[0x0][_0x52e4a4(0x158)]?.['trim']())throw CliErrors[_0x52e4a4(0x148)](_0x52e4a4(0x145)+_0x2f893f+_0x52e4a4(0x15a)+_0x2663f2['appCode']+'.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.');_0x54f926?(_0x1cb059=![],_0x72a910[_0x52e4a4(0x132)](_0x52e4a4(0x15c)+_0x2f893f+_0x52e4a4(0x15b)+_0x9d7531['id']+'.')):_0x1bd542[_0x52e4a4(0x135)][_0x52e4a4(0x132)]({'userId':_0x2f893f,'username':_0x4064f6[0x0][_0x52e4a4(0x158)]});}else!_0x54f926?(_0x1cb059=![],_0x72a910['push']('User\x20'+_0x2f893f+_0x52e4a4(0x14f)+_0x9d7531['id']+'.')):_0x1bd542[_0x52e4a4(0x135)]=_0x1bd542['userList'][_0x52e4a4(0x142)](_0x4ed4f8=>_0x4ed4f8[_0x52e4a4(0x166)]!==_0x2f893f);return{'role':_0x9d7531,'userId':_0x2f893f,'roleList':_0x2ec3f4,'before':{'userIds':_0x5c7c5d},'after':{'userIds':_0x1bd542[_0x52e4a4(0x135)][_0x52e4a4(0x157)](_0x502e6c=>_0x502e6c['userId'])},'shouldWrite':_0x1cb059,'warnings':_0x72a910};}export function runtimeRoleWriteResult(_0x30899a,_0x2659eb,_0xdfbab7,_0x4b9a2d,_0x3209a2,_0x3c4452=[]){return{'operation':_0x30899a,'scope':'runtime','selector':_0x2659eb,'before':_0xdfbab7,'after':_0x4b9a2d,'dryRun':![],'backend':_0x3209a2,'warnings':_0x3c4452};}
|
|
1
|
+
const a54_0x571c9f=a54_0x2834;(function(_0x3c6f50,_0xdac783){const _0x2afbda=a54_0x2834,_0x5c5966=_0x3c6f50();while(!![]){try{const _0x5b0697=-parseInt(_0x2afbda(0x186))/0x1*(parseInt(_0x2afbda(0x198))/0x2)+parseInt(_0x2afbda(0x18e))/0x3*(parseInt(_0x2afbda(0x189))/0x4)+-parseInt(_0x2afbda(0x17a))/0x5*(-parseInt(_0x2afbda(0x1b1))/0x6)+parseInt(_0x2afbda(0x1b7))/0x7*(parseInt(_0x2afbda(0x187))/0x8)+parseInt(_0x2afbda(0x1ba))/0x9+parseInt(_0x2afbda(0x1b5))/0xa*(-parseInt(_0x2afbda(0x1ad))/0xb)+-parseInt(_0x2afbda(0x1b0))/0xc;if(_0x5b0697===_0xdac783)break;else _0x5c5966['push'](_0x5c5966['shift']());}catch(_0x1569a4){_0x5c5966['push'](_0x5c5966['shift']());}}}(a54_0x4f23,0x8ce80));function a54_0x4f23(){const _0x46ce83=['Runtime\x20role\x20name\x20\x22','Runtime\x20role\x20','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','flag','user','\x22\x20is\x20ambiguous.','code','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','map','Runtime\x20numeric\x20userId','test','isSafeInteger','55JpdLZw','validation','permitCount','2374116WdNTlg','282ziPywL','appCode','totalCount','roleCode','1118210QUtSqC','runtime','7SUpIPh','num','\x20was\x20not\x20found\x20in\x20app\x20','802116FXYnVC','Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Pass\x20--role\x20<id|name>.','User\x20','userId','push','OWNER','ADMIN','CUSTOM','\x20built-in\x20runtime\x20role\x20','87950mPmkKQ','includes','join','\x20is\x20not\x20in\x20runtime\x20role\x20','Runtime\x20role\x20id\x20','\x20is\x20already\x20in\x20runtime\x20role\x20','expect-user-count','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','role-code','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','userName','USER','11333JLypGI','1656576FtTAZg','--role-code\x20must\x20not\x20be\x20blank.','6548jtcCAD','str','\x22\x20was\x20not\x20found\x20in\x20app\x20','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','userCount','657KFqxpm','filter','role','find','length','string','paging','roleName','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','items','26JjEWdp','roleType','applyUserList','userList','Cannot\x20','trim','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.'];a54_0x4f23=function(){return _0x46ce83;};return a54_0x4f23();}import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=['ADMIN',a54_0x571c9f(0x185),'OWNER',a54_0x571c9f(0x178)];const BUILTIN_ROLE_TYPES=[a54_0x571c9f(0x177),a54_0x571c9f(0x185),a54_0x571c9f(0x1c1)];export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a54_0x571c9f(0x181)};export const ROLE_REF_FLAG={'name':a54_0x571c9f(0x190),'type':'string','required':!![],'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'};export const ROLE_CODE_FLAG={'name':a54_0x571c9f(0x182),'type':a54_0x571c9f(0x193),'description':a54_0x571c9f(0x1bb)};export const USER_ID_FLAG={'name':'user','type':a54_0x571c9f(0x193),'required':!![],'description':a54_0x571c9f(0x1aa)};export const EXPECT_USER_COUNT_FLAG={'name':a54_0x571c9f(0x180),'type':'number','description':a54_0x571c9f(0x19e)};export function isBuiltinRuntimeRole(_0x4b4399){const _0x1add39=a54_0x571c9f;return BUILTIN_ROLE_TYPES[_0x1add39(0x17b)](_0x4b4399);}function a54_0x2834(_0x3d0c4b,_0x2a2f45){_0x3d0c4b=_0x3d0c4b-0x177;const _0x4f23f8=a54_0x4f23();let _0x283455=_0x4f23f8[_0x3d0c4b];return _0x283455;}export function assertCustomRuntimeRole(_0x4fc23f,_0x2b19f2){const _0x4a4ab0=a54_0x571c9f;if(_0x4fc23f[_0x4a4ab0(0x199)]!==_0x4a4ab0(0x178))throw CliErrors[_0x4a4ab0(0x1ae)](_0x4a4ab0(0x19c)+_0x2b19f2+_0x4a4ab0(0x179)+_0x4fc23f[_0x4a4ab0(0x195)]+'\x20('+_0x4fc23f[_0x4a4ab0(0x199)]+').',_0x4a4ab0(0x1a0));}export function projectRuntimeRole(_0x2e07ad){const _0x2e95de=a54_0x571c9f;return{'id':_0x2e07ad['id'],'roleCode':_0x2e07ad[_0x2e95de(0x1b4)],'roleName':_0x2e07ad[_0x2e95de(0x195)],'roleType':_0x2e07ad['roleType'],'remark':_0x2e07ad['remark'],'userCount':_0x2e07ad[_0x2e95de(0x18d)]??0x0,'permitCount':_0x2e07ad[_0x2e95de(0x1af)]??0x0,'builtin':isBuiltinRuntimeRole(_0x2e07ad[_0x2e95de(0x199)])};}export function readOptionalRuntimeRoleCode(_0x1bca50){const _0x1daf04=a54_0x571c9f,_0x12a48c=_0x1bca50['flag']('role-code');if(_0x12a48c===undefined||_0x12a48c===null)return undefined;const _0x1775c7=String(_0x12a48c)['trim']();if(!_0x1775c7)throw CliErrors['validation'](_0x1daf04(0x188));if(_0x1775c7[_0x1daf04(0x192)]>0x40)throw CliErrors[_0x1daf04(0x1ae)]('--role-code\x20cannot\x20exceed\x2064\x20characters.');return _0x1775c7;}export async function getRuntimeRoleById(_0x180824,_0x4bdba3){const _0x751643=a54_0x571c9f;if(!Number['isSafeInteger'](_0x4bdba3)||_0x4bdba3<=0x0)throw CliErrors[_0x751643(0x1ae)](_0x751643(0x1a3));const _0xbfe6e7=(await listAllRuntimeRoles(_0x180824))['filter'](_0x580509=>_0x580509['id']===_0x4bdba3&&(!_0x580509['appCode']||_0x580509['appCode']===_0x180824));if(_0xbfe6e7[_0x751643(0x192)]!==0x1)throw CliErrors[_0x751643(0x1ae)](_0x751643(0x17e)+_0x4bdba3+_0x751643(0x1b9)+_0x180824+'.','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.');return _0xbfe6e7[0x0];}export async function listAllRuntimeRoles(_0x50a94d,_0x125394={}){const _0x48e195=a54_0x571c9f,_0x42a42d=0x64,_0x322e38=[];for(let _0xcf5202=0x1;;_0xcf5202+=0x1){const _0x3ebe5e=await listRuntimeAppRoles(_0x50a94d,{..._0x125394[_0x48e195(0x195)]?{'roleName':_0x125394[_0x48e195(0x195)]}:{},'currentPage':_0xcf5202,'pageSize':_0x42a42d});_0x322e38[_0x48e195(0x1c0)](..._0x3ebe5e[_0x48e195(0x197)]);if(_0x3ebe5e['items'][_0x48e195(0x192)]<_0x42a42d||_0x3ebe5e[_0x48e195(0x194)]&&_0x322e38['length']>=_0x3ebe5e[_0x48e195(0x194)][_0x48e195(0x1b3)])return _0x322e38;}}export async function resolveRuntimeRoleRef(_0xb1d880,_0xe6b4a6){const _0xe44421=a54_0x571c9f,_0x104059=_0xe6b4a6['trim']();if(!_0x104059)throw CliErrors[_0xe44421(0x1ae)]('Missing\x20runtime\x20role\x20reference.',_0xe44421(0x1bd));if(/^\d+$/[_0xe44421(0x1ab)](_0x104059))return getRuntimeRoleById(_0xb1d880,Number(_0x104059));const _0x22333e=(await listAllRuntimeRoles(_0xb1d880))[_0xe44421(0x18f)](_0x4b57e1=>_0x4b57e1[_0xe44421(0x195)]===_0x104059);if(_0x22333e[_0xe44421(0x192)]===0x0)throw CliErrors[_0xe44421(0x1ae)]('Runtime\x20role\x20name\x20\x22'+_0x104059+_0xe44421(0x18b)+_0xb1d880+'.','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.');if(_0x22333e[_0xe44421(0x192)]>0x1)throw CliErrors[_0xe44421(0x1ae)](_0xe44421(0x1a1)+_0x104059+_0xe44421(0x1a6),'Pass\x20one\x20role\x20ID:\x20'+_0x22333e[_0xe44421(0x1a9)](_0x4dc903=>_0x4dc903['id'])[_0xe44421(0x17c)](',\x20')+'.');return _0x22333e[0x0];}function parseRuntimeUserId(_0x38a4ea){const _0x3a6ac6=a54_0x571c9f,_0x358f1f=_0x38a4ea[_0x3a6ac6(0x19d)]();if(!/^\d+$/['test'](_0x358f1f))throw CliErrors[_0x3a6ac6(0x1ae)](_0x3a6ac6(0x183),_0x3a6ac6(0x1a8));const _0xabbeaa=Number(_0x358f1f);if(!Number[_0x3a6ac6(0x1ac)](_0xabbeaa)||_0xabbeaa<=0x0)throw CliErrors[_0x3a6ac6(0x1ae)](_0x3a6ac6(0x1bc));return _0xabbeaa;}export async function prepareRuntimeMemberMutation(_0x1eb5c5,_0x3e5d71){const _0x3b3189=a54_0x571c9f,_0x256a10=await resolveRuntimeRoleRef(_0x1eb5c5['appCode'],_0x1eb5c5[_0x3b3189(0x18a)](_0x3b3189(0x190)));if(_0x256a10[_0x3b3189(0x199)]===_0x3b3189(0x1c1))throw CliErrors['validation']('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.');const _0x5eaa40=parseRuntimeUserId(_0x1eb5c5[_0x3b3189(0x18a)](_0x3b3189(0x1a5))),_0x4e580d=(await listRuntimeRoleUsers(_0x1eb5c5['appCode']))[_0x3b3189(0x1a9)](_0xfa534f=>({..._0xfa534f,'userList':[..._0xfa534f[_0x3b3189(0x19b)]??[]],'applyUserList':[..._0xfa534f[_0x3b3189(0x19a)]??[]]})),_0x3fdafb=_0x4e580d[_0x3b3189(0x191)](_0x1b69ef=>_0x1b69ef['id']===_0x256a10['id']);if(!_0x3fdafb)throw CliErrors[_0x3b3189(0x1ae)](_0x3b3189(0x1a2)+_0x256a10['id']+_0x3b3189(0x196),_0x3b3189(0x19f));const _0x493601=_0x3fdafb[_0x3b3189(0x19b)][_0x3b3189(0x1a9)](_0x4622a4=>_0x4622a4[_0x3b3189(0x1bf)]),_0x594651=_0x1eb5c5[_0x3b3189(0x1a4)]('expect-user-count');if(_0x594651!==undefined&&_0x594651!==null&&_0x594651!==''){const _0x133969=_0x1eb5c5[_0x3b3189(0x1b8)](_0x3b3189(0x180));if(!Number[_0x3b3189(0x1ac)](_0x133969)||_0x133969<0x0)throw CliErrors[_0x3b3189(0x1ae)](_0x3b3189(0x18c));if(_0x493601['length']!==_0x133969)throw CliErrors[_0x3b3189(0x1ae)]('Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20'+_0x133969+',\x20found\x20'+_0x493601[_0x3b3189(0x192)]+'.','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.');}const _0x3e0c64=_0x493601[_0x3b3189(0x17b)](_0x5eaa40),_0x18141f=[];let _0x3679f6=!![];if(_0x3e5d71==='user-add'){const _0x816ec5=await listRuntimeAppUsers(_0x1eb5c5[_0x3b3189(0x1b2)]),_0x29aeeb=_0x816ec5[_0x3b3189(0x18f)](_0x4873fc=>Number(_0x4873fc[_0x3b3189(0x1a7)])===_0x5eaa40);if(_0x29aeeb['length']!==0x1||!_0x29aeeb[0x0][_0x3b3189(0x184)]?.[_0x3b3189(0x19d)]())throw CliErrors[_0x3b3189(0x1ae)]('Runtime\x20user\x20'+_0x5eaa40+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x1eb5c5[_0x3b3189(0x1b2)]+'.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.');_0x3e0c64?(_0x3679f6=![],_0x18141f['push']('User\x20'+_0x5eaa40+_0x3b3189(0x17f)+_0x256a10['id']+'.')):_0x3fdafb['userList'][_0x3b3189(0x1c0)]({'userId':_0x5eaa40,'username':_0x29aeeb[0x0][_0x3b3189(0x184)]});}else!_0x3e0c64?(_0x3679f6=![],_0x18141f[_0x3b3189(0x1c0)](_0x3b3189(0x1be)+_0x5eaa40+_0x3b3189(0x17d)+_0x256a10['id']+'.')):_0x3fdafb[_0x3b3189(0x19b)]=_0x3fdafb['userList'][_0x3b3189(0x18f)](_0x5a39bd=>_0x5a39bd[_0x3b3189(0x1bf)]!==_0x5eaa40);return{'role':_0x256a10,'userId':_0x5eaa40,'roleList':_0x4e580d,'before':{'userIds':_0x493601},'after':{'userIds':_0x3fdafb['userList'][_0x3b3189(0x1a9)](_0x38b9ef=>_0x38b9ef[_0x3b3189(0x1bf)])},'shouldWrite':_0x3679f6,'warnings':_0x18141f};}export function runtimeRoleWriteResult(_0x281873,_0x4f7dd3,_0x1e1052,_0x61871d,_0x59e4ae,_0x4d7000=[]){const _0xddd516=a54_0x571c9f;return{'operation':_0x281873,'scope':_0xddd516(0x1b6),'selector':_0x4f7dd3,'before':_0x1e1052,'after':_0x61871d,'dryRun':![],'backend':_0x59e4ae,'warnings':_0x4d7000};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a55_0x21c7(){const _0x119e8c=['28nZBuEc','body','trim','176txpWEy','159060tUpisV','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','5021706leXoiZ','99zcfWfq','appCode','string','validation','82572PXrYKQ','14GMDXWL','high-risk-write','build','flag','/client/permit/role/update','10zGIEtB','name','update','18Yhmgmk','description','Update\x20a\x20runtime\x20CUSTOM\x20role\x27s\x20code,\x20name,\x20or\x20remark','role-code','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','Pass\x20--role-code,\x20--name,\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','6242590YIjzsF','str','POST','345695LXQejp','remark','--remark\x20must\x20not\x20be\x20blank.','num','160aTbZui','229815BGdlur','891462IqgJIC','--name\x20must\x20not\x20be\x20blank.','role'];a55_0x21c7=function(){return _0x119e8c;};return a55_0x21c7();}function a55_0x703f(_0x5226de,_0x12a980){_0x5226de=_0x5226de-0xce;const _0x21c778=a55_0x21c7();let _0x703f46=_0x21c778[_0x5226de];return _0x703f46;}const a55_0x3ea7f2=a55_0x703f;(function(_0xd24515,_0x5f42f3){const _0x28714a=a55_0x703f,_0x46cb19=_0xd24515();while(!![]){try{const _0x500751=parseInt(_0x28714a(0xe4))/0x1*(parseInt(_0x28714a(0xce))/0x2)+-parseInt(_0x28714a(0xef))/0x3*(-parseInt(_0x28714a(0xec))/0x4)+parseInt(_0x28714a(0xd3))/0x5*(-parseInt(_0x28714a(0xee))/0x6)+parseInt(_0x28714a(0xdf))/0x7*(parseInt(_0x28714a(0xe3))/0x8)+-parseInt(_0x28714a(0xd6))/0x9*(parseInt(_0x28714a(0xdc))/0xa)+-parseInt(_0x28714a(0xeb))/0xb*(-parseInt(_0x28714a(0xf3))/0xc)+-parseInt(_0x28714a(0xe5))/0xd*(parseInt(_0x28714a(0xe8))/0xe);if(_0x500751===_0x5f42f3)break;else _0x46cb19['push'](_0x46cb19['shift']());}catch(_0x52b385){_0x46cb19['push'](_0x46cb19['shift']());}}}(a55_0x21c7,0xea2ca));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(_0x4d2ad7){const _0x1154ca=a55_0x703f,_0x31cb39=_0x4d2ad7[_0x1154ca(0xd1)](_0x1154ca(0xd9))!==undefined,_0x38a246=_0x4d2ad7[_0x1154ca(0xd1)](_0x1154ca(0xd4))!==undefined,_0x1325be=_0x4d2ad7[_0x1154ca(0xd1)]('remark')!==undefined;if(!_0x31cb39&&!_0x38a246&&!_0x1325be)throw CliErrors[_0x1154ca(0xf2)](_0x1154ca(0xdb));const _0x12ff85=readOptionalRuntimeRoleCode(_0x4d2ad7),_0x53e713=_0x4d2ad7[_0x1154ca(0xdd)](_0x1154ca(0xd4))['trim'](),_0x4dd23f=_0x4d2ad7['str'](_0x1154ca(0xe0))[_0x1154ca(0xea)]();if(_0x38a246&&!_0x53e713)throw CliErrors[_0x1154ca(0xf2)](_0x1154ca(0xe6));if(_0x1325be&&!_0x4dd23f)throw CliErrors['validation'](_0x1154ca(0xe1),_0x1154ca(0xda));return{..._0x12ff85?{'roleCode':_0x12ff85}:{},..._0x38a246?{'roleName':_0x53e713}:{},..._0x1325be?{'remark':_0x4dd23f}:{}};}async function prepare(_0x2aae97){const _0x59792a=a55_0x703f,_0x460582=await getRuntimeRoleById(_0x2aae97['appCode'],_0x2aae97[_0x59792a(0xe2)]('id'));return assertCustomRuntimeRole(_0x460582,'update'),{'role':_0x460582,'body':{'id':_0x460582['id'],'appCode':_0x2aae97[_0x59792a(0xf0)],...updateFields(_0x2aae97)}};}export const roleUpdate={'service':a55_0x3ea7f2(0xe7),'command':'update','description':a55_0x3ea7f2(0xd8),'risk':a55_0x3ea7f2(0xcf),'confirmationDescription':'Changes\x20the\x20custom\x20role\x20code,\x20name,\x20or\x20note\x20in\x20the\x20current\x20runtime\x20app.\x20The\x20role\x20updates\x20immediately.','flags':[ROLE_ID_FLAG,ROLE_CODE_FLAG,{'name':'name','type':a55_0x3ea7f2(0xf1),'description':'New\x20role\x20name'},{'name':a55_0x3ea7f2(0xe0),'type':a55_0x3ea7f2(0xf1),'description':'New\x20non-empty\x20role\x20remark'}],async 'validate'(_0x366c3d){updateFields(_0x366c3d);},async 'dryRun'(_0x1ab447){const _0x6b9b83=a55_0x3ea7f2,{body:_0x3e8900}=await prepare(_0x1ab447);return dryRun(_0x6b9b83(0xde),_0x6b9b83(0xd2))[_0x6b9b83(0xe9)](_0x3e8900)[_0x6b9b83(0xd7)](_0x6b9b83(0xed))[_0x6b9b83(0xd0)]();},async 'execute'(_0x1357ec){const _0x3028dc=a55_0x3ea7f2,{role:_0x30d6f2,body:_0x552c1b}=await prepare(_0x1357ec),_0x1b45f2=await updateRuntimeAppRole(_0x552c1b);return{'ok':!![],'data':runtimeRoleWriteResult(_0x3028dc(0xd5),{'roleId':_0x30d6f2['id']},projectRuntimeRole(_0x30d6f2),projectRuntimeRole(_0x1b45f2),{'method':_0x3028dc(0xde),'path':'/client/permit/role/update'})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0xa9f407=a56_0x1718;(function(_0x131a78,_0x4d7176){const _0xaeacf3=a56_0x1718,_0x25b2d7=_0x131a78();while(!![]){try{const _0x5a0c9f=-parseInt(_0xaeacf3(0x71))/0x1*(parseInt(_0xaeacf3(0x7d))/0x2)+-parseInt(_0xaeacf3(0x82))/0x3*(-parseInt(_0xaeacf3(0x86))/0x4)+-parseInt(_0xaeacf3(0x7a))/0x5*(parseInt(_0xaeacf3(0x79))/0x6)+-parseInt(_0xaeacf3(0x83))/0x7+-parseInt(_0xaeacf3(0x85))/0x8*(-parseInt(_0xaeacf3(0x76))/0x9)+parseInt(_0xaeacf3(0x7f))/0xa+parseInt(_0xaeacf3(0x84))/0xb;if(_0x5a0c9f===_0x4d7176)break;else _0x25b2d7['push'](_0x25b2d7['shift']());}catch(_0x348957){_0x25b2d7['push'](_0x25b2d7['shift']());}}}(a56_0x4730,0x6079d));function a56_0x4730(){const _0x300920=['after','shouldWrite','role','/client/permit/user-role/update-user-list','before','2DDTPnt','roleList','description','user-add','appCode','13707YHyTmc','warnings','high-risk-write','6kolYnL','78395JbqHAD','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','741932QQbJPM','build','7143120TrDkCL','POST','Preview:\x20add\x20runtime\x20role\x20member','260259rWzxoe','1402107NmJjSm','3142271YkTqbr','32XnAOWR','16TIVPGW'];a56_0x4730=function(){return _0x300920;};return a56_0x4730();}function a56_0x1718(_0x3955f2,_0x2c54c9){_0x3955f2=_0x3955f2-0x6e;const _0x47305b=a56_0x4730();let _0x17183a=_0x47305b[_0x3955f2];return _0x17183a;}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':a56_0xa9f407(0x6e),'command':a56_0xa9f407(0x74),'description':a56_0xa9f407(0x7c),'risk':a56_0xa9f407(0x78),'confirmationDescription':a56_0xa9f407(0x7b),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x40551c){const _0x1c1c99=a56_0xa9f407,_0x543d5=await prepareRuntimeMemberMutation(_0x40551c,_0x1c1c99(0x74));return dryRun(_0x1c1c99(0x80),_0x1c1c99(0x6f))['body']({'appCode':_0x40551c[_0x1c1c99(0x75)],'roleList':_0x543d5[_0x1c1c99(0x72)]})[_0x1c1c99(0x73)](_0x543d5[_0x1c1c99(0x88)]?_0x1c1c99(0x81):_0x543d5[_0x1c1c99(0x77)][0x0])[_0x1c1c99(0x7e)]();},async 'execute'(_0x1a6339){const _0x1f59a9=a56_0xa9f407,_0x2e9f43=await prepareRuntimeMemberMutation(_0x1a6339,'user-add');return _0x2e9f43[_0x1f59a9(0x88)]&&await updateRuntimeRoleUsers(_0x1a6339['appCode'],_0x2e9f43['roleList']),{'ok':!![],'data':runtimeRoleWriteResult(_0x1f59a9(0x74),{'roleId':_0x2e9f43[_0x1f59a9(0x6e)]['id'],'userId':_0x2e9f43['userId']},_0x2e9f43[_0x1f59a9(0x70)],_0x2e9f43[_0x1f59a9(0x87)],{'method':'POST','path':_0x1f59a9(0x6f)},_0x2e9f43[_0x1f59a9(0x77)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x1ddc2a=a57_0x574e;(function(_0x317100,_0x3ab0df){const _0x49b2b5=a57_0x574e,_0x342ae9=_0x317100();while(!![]){try{const _0x5be166=parseInt(_0x49b2b5(0x1dc))/0x1+-parseInt(_0x49b2b5(0x1e9))/0x2*(-parseInt(_0x49b2b5(0x1d9))/0x3)+parseInt(_0x49b2b5(0x1dd))/0x4+-parseInt(_0x49b2b5(0x1e7))/0x5+parseInt(_0x49b2b5(0x1d7))/0x6+-parseInt(_0x49b2b5(0x1e0))/0x7+parseInt(_0x49b2b5(0x1df))/0x8;if(_0x5be166===_0x3ab0df)break;else _0x342ae9['push'](_0x342ae9['shift']());}catch(_0x357ead){_0x342ae9['push'](_0x342ae9['shift']());}}}(a57_0x494a,0x18bab));function a57_0x494a(){const _0x1c4065=['userId','Preview:\x20remove\x20runtime\x20role\x20member','before','522610GyYdzk','after','14aIAhTt','appCode','/client/permit/user-role/update-user-list','shouldWrite','warnings','user-remove','167724tzmztD','role','48321XLIrHl','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','body','105784UgOUxO','538636lUMhIu','build','210744zGloTq','1411732uUiUgL','roleList','POST','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.'];a57_0x494a=function(){return _0x1c4065;};return a57_0x494a();}function a57_0x574e(_0x54e88e,_0x2ee4be){_0x54e88e=_0x54e88e-0x1d2;const _0x494a3e=a57_0x494a();let _0x574efb=_0x494a3e[_0x54e88e];return _0x574efb;}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':a57_0x1ddc2a(0x1d8),'command':a57_0x1ddc2a(0x1d6),'description':a57_0x1ddc2a(0x1da),'risk':'high-risk-write','confirmationDescription':a57_0x1ddc2a(0x1e3),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x55986f){const _0x2fc44c=a57_0x1ddc2a,_0x4c84ee=await prepareRuntimeMemberMutation(_0x55986f,_0x2fc44c(0x1d6));return dryRun(_0x2fc44c(0x1e2),'/client/permit/user-role/update-user-list')[_0x2fc44c(0x1db)]({'appCode':_0x55986f['appCode'],'roleList':_0x4c84ee[_0x2fc44c(0x1e1)]})['description'](_0x4c84ee[_0x2fc44c(0x1d4)]?_0x2fc44c(0x1e5):_0x4c84ee[_0x2fc44c(0x1d5)][0x0])[_0x2fc44c(0x1de)]();},async 'execute'(_0x438cc2){const _0x2173a4=a57_0x1ddc2a,_0x3070cf=await prepareRuntimeMemberMutation(_0x438cc2,_0x2173a4(0x1d6));return _0x3070cf['shouldWrite']&&await updateRuntimeRoleUsers(_0x438cc2[_0x2173a4(0x1d2)],_0x3070cf[_0x2173a4(0x1e1)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x2173a4(0x1d6),{'roleId':_0x3070cf[_0x2173a4(0x1d8)]['id'],'userId':_0x3070cf[_0x2173a4(0x1e4)]},_0x3070cf[_0x2173a4(0x1e6)],_0x3070cf[_0x2173a4(0x1e8)],{'method':'POST','path':_0x2173a4(0x1d3)},_0x3070cf[_0x2173a4(0x1d5)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0x8ea6ef=a58_0x39bc;(function(_0x5df6b3,_0x3a2cff){const _0x56c18c=a58_0x39bc,_0x2e249c=_0x5df6b3();while(!![]){try{const _0x3021c3=parseInt(_0x56c18c(0x164))/0x1+-parseInt(_0x56c18c(0x1a2))/0x2+parseInt(_0x56c18c(0x199))/0x3+-parseInt(_0x56c18c(0x178))/0x4+-parseInt(_0x56c18c(0x1a0))/0x5*(parseInt(_0x56c18c(0x197))/0x6)+-parseInt(_0x56c18c(0x19f))/0x7+parseInt(_0x56c18c(0x19b))/0x8*(parseInt(_0x56c18c(0x15d))/0x9);if(_0x3021c3===_0x3a2cff)break;else _0x2e249c['push'](_0x2e249c['shift']());}catch(_0x111262){_0x2e249c['push'](_0x2e249c['shift']());}}}(a58_0x1825,0x55506));function a58_0x1825(){const _0x2ee764=['detail','Preview:\x20run\x20schedule\x20','18kfkJfL','Page\x20size\x20from\x201\x20to\x20100','990093PDAVjS','cursor','2715112Onpppv','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','1389878YYQHcS','797315kVLKmn','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','228230PDSXAC','model','run','POST','high-risk-write','9YrDFOJ','Deleted\x20schedule\x20','read','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','/run','UTC','591721VrCNqm','isSafeInteger','/schedules','taskId','str','Show\x20one\x20schedule\x20by\x20schedule\x20ID','delete','Created\x20','appCode','prompt','cron','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','CRON','create','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','description','validation','Preview:\x20delete\x20schedule\x20','schedule-id','kind','482548UOEZTK','scheduleId','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','Queued\x20Task\x20','ONCE','limit','build','Schedule\x20input\x20is\x20valid','schedule','body','trim','validate','Preview:\x20create\x20an\x20Agent\x20schedule','/api/harness/apps/','Schedule\x20UUID','\x20from\x20schedule\x20','\x20schedule\x20','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','deepseek-v4-flash-0731','scheduled-at','string','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','DELETE','deepseek-v4-pro-0813','--title\x20must\x20not\x20be\x20blank.','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','number','Schedule\x20kind:\x20CRON\x20or\x20ONCE'];a58_0x1825=function(){return _0x2ee764;};return a58_0x1825();}import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a58_0x39bc(_0x585bb5,_0x2bf706){_0x585bb5=_0x585bb5-0x15b;const _0x1825f4=a58_0x1825();let _0x39bc5e=_0x1825f4[_0x585bb5];return _0x39bc5e;}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':a58_0x8ea6ef(0x177),'type':a58_0x8ea6ef(0x18c),'required':!![],'enum':['CRON',a58_0x8ea6ef(0x17c)],'description':a58_0x8ea6ef(0x194)},CRON_FLAG={'name':a58_0x8ea6ef(0x16e),'type':a58_0x8ea6ef(0x18c),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a58_0x8ea6ef(0x18b),'type':a58_0x8ea6ef(0x18c),'description':a58_0x8ea6ef(0x189)},TITLE_FLAG={'name':'title','type':a58_0x8ea6ef(0x18c),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a58_0x8ea6ef(0x16d),'type':'string','required':!![],'description':a58_0x8ea6ef(0x18e)},MODEL_FLAG={'name':a58_0x8ea6ef(0x1a3),'type':a58_0x8ea6ef(0x18c),'enum':['kimi/k3',a58_0x8ea6ef(0x18a),a58_0x8ea6ef(0x190)],'default':a58_0x8ea6ef(0x18a),'description':a58_0x8ea6ef(0x19d)},SCHEDULE_ID_FLAG={'name':a58_0x8ea6ef(0x176),'type':'string','required':!![],'description':a58_0x8ea6ef(0x186),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0x8ea6ef(0x19c)}},LIMIT_FLAG={'name':a58_0x8ea6ef(0x17d),'type':a58_0x8ea6ef(0x193),'default':0x14,'description':a58_0x8ea6ef(0x198)},CURSOR_FLAG={'name':a58_0x8ea6ef(0x19a),'type':a58_0x8ea6ef(0x18c),'description':a58_0x8ea6ef(0x160)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x3e8a27){const _0xf1ff07=a58_0x8ea6ef,_0x36beb4=_0x3e8a27[_0xf1ff07(0x168)](_0xf1ff07(0x177)),_0x164a65=_0x3e8a27['str']('title')[_0xf1ff07(0x182)](),_0x142347=_0x3e8a27[_0xf1ff07(0x168)](_0xf1ff07(0x16d))[_0xf1ff07(0x182)](),_0x1c5d24=_0x3e8a27[_0xf1ff07(0x168)](_0xf1ff07(0x1a3)),_0x10b0f2=_0x3e8a27[_0xf1ff07(0x168)](_0xf1ff07(0x16e)),_0x293976=_0x3e8a27[_0xf1ff07(0x168)](_0xf1ff07(0x18b));if(!_0x164a65)throw CliErrors[_0xf1ff07(0x174)](_0xf1ff07(0x191));if(!_0x142347)throw CliErrors[_0xf1ff07(0x174)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x36beb4===_0xf1ff07(0x170)){if(!_0x10b0f2||_0x293976)throw CliErrors['validation'](_0xf1ff07(0x172));return{'kind':_0x36beb4,'timezone':'UTC','cron':_0x10b0f2,'title':_0x164a65,'prompt':_0x142347,'model':_0x1c5d24};}if(_0x36beb4===_0xf1ff07(0x17c)){if(!_0x293976||_0x10b0f2)throw CliErrors['validation'](_0xf1ff07(0x192));return{'kind':_0x36beb4,'timezone':_0xf1ff07(0x163),'scheduledAt':_0x293976,'title':_0x164a65,'prompt':_0x142347,'model':_0x1c5d24};}throw CliErrors[_0xf1ff07(0x174)](_0xf1ff07(0x17a));}function scheduleCollectionPath(_0x4589be){const _0x1a8145=a58_0x8ea6ef;return _0x1a8145(0x185)+encodeURIComponent(_0x4589be)+_0x1a8145(0x166);}function scheduleItemPath(_0x2adb6d,_0x1034b4){return scheduleCollectionPath(_0x2adb6d)+'/'+encodeURIComponent(_0x1034b4);}const scheduleValidate={'service':'schedule','command':a58_0x8ea6ef(0x183),'description':a58_0x8ea6ef(0x18d),'risk':a58_0x8ea6ef(0x15f),'flags':INPUT_FLAGS,async 'validate'(_0x5c7d29){readScheduleInput(_0x5c7d29);},async 'execute'(_0x340121){const _0x538964=a58_0x8ea6ef,_0x3fe397=readScheduleInput(_0x340121),_0x536e5f=await validateRuntimeSchedule(_0x340121[_0x538964(0x16c)],_0x3fe397);return{'ok':!![],'data':_0x536e5f,'message':_0x538964(0x17f)};}},scheduleCreate={'service':a58_0x8ea6ef(0x180),'command':a58_0x8ea6ef(0x171),'description':a58_0x8ea6ef(0x161),'risk':a58_0x8ea6ef(0x15c),'confirmationDescription':a58_0x8ea6ef(0x19e),'flags':INPUT_FLAGS,async 'validate'(_0x148cfd){readScheduleInput(_0x148cfd);},async 'execute'(_0x394553){const _0x536556=a58_0x8ea6ef,_0x13c2b8=readScheduleInput(_0x394553),_0x35d641=await validateRuntimeSchedule(_0x394553[_0x536556(0x16c)],_0x13c2b8),_0x4088d5=await createRuntimeSchedule(_0x394553[_0x536556(0x16c)],_0x35d641);return{'ok':!![],'data':_0x4088d5,'message':_0x536556(0x16b)+_0x4088d5[_0x536556(0x177)]+_0x536556(0x188)+_0x4088d5[_0x536556(0x179)]};},async 'dryRun'(_0xfa1242){const _0x3e51f5=a58_0x8ea6ef,_0x41d856=readScheduleInput(_0xfa1242);return dryRun(_0x3e51f5(0x15b),scheduleCollectionPath(_0xfa1242['appCode']))[_0x3e51f5(0x181)](_0x41d856)[_0x3e51f5(0x173)](_0x3e51f5(0x184))['build']();}},scheduleList={'service':a58_0x8ea6ef(0x180),'command':'list','description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a58_0x8ea6ef(0x15f),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x5e308c){const _0x346748=a58_0x8ea6ef,_0x21a610=_0x5e308c['num'](_0x346748(0x17d));if(!Number[_0x346748(0x165)](_0x21a610)||_0x21a610<0x1||_0x21a610>0x64)throw CliErrors[_0x346748(0x174)](_0x346748(0x16f));const _0xc7aaa3=_0x5e308c[_0x346748(0x168)]('cursor');if(_0xc7aaa3&&(_0xc7aaa3['length']>0x400||_0xc7aaa3[_0x346748(0x182)]()!==_0xc7aaa3))throw CliErrors[_0x346748(0x174)]('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x4adb71){const _0x456da7=a58_0x8ea6ef,_0x38cdd3=_0x4adb71[_0x456da7(0x168)](_0x456da7(0x19a)),_0x57e506=await listRuntimeSchedules(_0x4adb71[_0x456da7(0x16c)],{'kind':_0x4adb71[_0x456da7(0x168)](_0x456da7(0x177)),'limit':_0x4adb71['num'](_0x456da7(0x17d)),..._0x38cdd3?{'cursor':_0x38cdd3}:{}});return{'ok':!![],'data':_0x57e506};}},scheduleDetail={'service':'schedule','command':a58_0x8ea6ef(0x195),'description':a58_0x8ea6ef(0x169),'risk':a58_0x8ea6ef(0x15f),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2d3288){const _0x53fa3c=a58_0x8ea6ef,_0x469ca3=await getRuntimeSchedule(_0x2d3288['appCode'],_0x2d3288[_0x53fa3c(0x168)]('schedule-id'));return{'ok':!![],'data':_0x469ca3};}},scheduleRun={'service':a58_0x8ea6ef(0x180),'command':a58_0x8ea6ef(0x1a4),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a58_0x8ea6ef(0x15c),'confirmationDescription':'Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x35dec0){const _0x513917=a58_0x8ea6ef,_0x1e8c8b=_0x35dec0[_0x513917(0x168)]('schedule-id'),_0x40e478=await runRuntimeSchedule(_0x35dec0[_0x513917(0x16c)],_0x1e8c8b);return{'ok':!![],'data':_0x40e478,'message':_0x513917(0x17b)+_0x40e478[_0x513917(0x167)]+_0x513917(0x187)+_0x1e8c8b};},async 'dryRun'(_0x27df8f){const _0x3e642e=a58_0x8ea6ef,_0x495251=_0x27df8f[_0x3e642e(0x168)]('schedule-id');return dryRun('POST',scheduleItemPath(_0x27df8f[_0x3e642e(0x16c)],_0x495251)+_0x3e642e(0x162))[_0x3e642e(0x173)](_0x3e642e(0x196)+_0x495251+'\x20immediately')[_0x3e642e(0x17e)]();}},scheduleDelete={'service':a58_0x8ea6ef(0x180),'command':a58_0x8ea6ef(0x16a),'description':a58_0x8ea6ef(0x1a1),'risk':'high-risk-write','confirmationDescription':'Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xee65e){const _0x84bde2=a58_0x8ea6ef,_0x5000df=_0xee65e['str'](_0x84bde2(0x176)),_0x4f497d=await deleteRuntimeSchedule(_0xee65e[_0x84bde2(0x16c)],_0x5000df);return{'ok':!![],'data':_0x4f497d,'message':_0x84bde2(0x15e)+_0x5000df};},async 'dryRun'(_0x4606ef){const _0xaa0736=a58_0x8ea6ef,_0x39f3c8=_0x4606ef['str']('schedule-id');return dryRun(_0xaa0736(0x18f),scheduleItemPath(_0x4606ef['appCode'],_0x39f3c8))['description'](_0xaa0736(0x175)+_0x39f3c8)['build']();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
const a58_0x3ac958=a58_0x565f;(function(_0x43e758,_0x488e28){const _0x42410f=a58_0x565f,_0x4a567c=_0x43e758();while(!![]){try{const _0xfd4f9d=-parseInt(_0x42410f(0x1be))/0x1+parseInt(_0x42410f(0x1d0))/0x2*(-parseInt(_0x42410f(0x1ce))/0x3)+parseInt(_0x42410f(0x1b9))/0x4*(-parseInt(_0x42410f(0x19c))/0x5)+-parseInt(_0x42410f(0x1b8))/0x6*(-parseInt(_0x42410f(0x1ae))/0x7)+parseInt(_0x42410f(0x1d3))/0x8*(-parseInt(_0x42410f(0x1da))/0x9)+-parseInt(_0x42410f(0x1ca))/0xa*(parseInt(_0x42410f(0x1d6))/0xb)+parseInt(_0x42410f(0x1a2))/0xc*(parseInt(_0x42410f(0x1b6))/0xd);if(_0xfd4f9d===_0x488e28)break;else _0x4a567c['push'](_0x4a567c['shift']());}catch(_0xcec049){_0x4a567c['push'](_0x4a567c['shift']());}}}(a58_0x10bf,0x80e24));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':a58_0x3ac958(0x1c0),'type':a58_0x3ac958(0x191),'required':!![],'enum':[a58_0x3ac958(0x1bf),a58_0x3ac958(0x18e)],'description':a58_0x3ac958(0x19b)},CRON_FLAG={'name':a58_0x3ac958(0x1d7),'type':a58_0x3ac958(0x191),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a58_0x3ac958(0x198),'type':a58_0x3ac958(0x191),'description':a58_0x3ac958(0x19f)},TITLE_FLAG={'name':'title','type':a58_0x3ac958(0x191),'required':!![],'description':a58_0x3ac958(0x1c8)},PROMPT_FLAG={'name':a58_0x3ac958(0x192),'type':'string','required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},MODEL_FLAG={'name':a58_0x3ac958(0x1bd),'type':a58_0x3ac958(0x191),'enum':[a58_0x3ac958(0x19d),a58_0x3ac958(0x1b4),a58_0x3ac958(0x1c9)],'default':'deepseek-v4-flash-0731','description':a58_0x3ac958(0x1ba)},SCHEDULE_ID_FLAG={'name':a58_0x3ac958(0x1c2),'type':a58_0x3ac958(0x191),'required':!![],'description':a58_0x3ac958(0x1d2),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0x3ac958(0x199)}},LIMIT_FLAG={'name':a58_0x3ac958(0x19a),'type':a58_0x3ac958(0x1c4),'default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a58_0x3ac958(0x1d5),'type':a58_0x3ac958(0x191),'description':a58_0x3ac958(0x195)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0xa04429){const _0x491d0a=a58_0x3ac958,_0x45b8b6=_0xa04429[_0x491d0a(0x1ab)](_0x491d0a(0x1c0)),_0x8f26af=_0xa04429[_0x491d0a(0x1ab)](_0x491d0a(0x18d))[_0x491d0a(0x18f)](),_0x4fdc2c=_0xa04429[_0x491d0a(0x1ab)](_0x491d0a(0x192))['trim'](),_0x569e9b=_0xa04429[_0x491d0a(0x1ab)]('model'),_0x22c215=_0xa04429[_0x491d0a(0x1ab)](_0x491d0a(0x1d7)),_0x35e977=_0xa04429['str']('scheduled-at');if(!_0x8f26af)throw CliErrors[_0x491d0a(0x1a9)](_0x491d0a(0x19e));if(!_0x4fdc2c)throw CliErrors['validation'](_0x491d0a(0x1a0));if(_0x45b8b6==='CRON'){if(!_0x22c215||_0x35e977)throw CliErrors['validation'](_0x491d0a(0x190));return{'kind':_0x45b8b6,'timezone':_0x491d0a(0x1b0),'cron':_0x22c215,'title':_0x8f26af,'prompt':_0x4fdc2c,'model':_0x569e9b};}if(_0x45b8b6==='ONCE'){if(!_0x35e977||_0x22c215)throw CliErrors[_0x491d0a(0x1a9)](_0x491d0a(0x194));return{'kind':_0x45b8b6,'timezone':_0x491d0a(0x1b0),'scheduledAt':_0x35e977,'title':_0x8f26af,'prompt':_0x4fdc2c,'model':_0x569e9b};}throw CliErrors[_0x491d0a(0x1a9)]('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function a58_0x565f(_0x561ecf,_0x5bb08c){_0x561ecf=_0x561ecf-0x18b;const _0x10bf4a=a58_0x10bf();let _0x565fae=_0x10bf4a[_0x561ecf];return _0x565fae;}function scheduleCollectionPath(_0x5b2921){const _0x4f3ed1=a58_0x3ac958;return _0x4f3ed1(0x1a8)+encodeURIComponent(_0x5b2921)+_0x4f3ed1(0x1cb);}function a58_0x10bf(){const _0x14de80=['--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','title','ONCE','trim','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','string','prompt','/run','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','list','scheduled-at','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','limit','Schedule\x20kind:\x20CRON\x20or\x20ONCE','240nXLeHn','kimi/k3','--title\x20must\x20not\x20be\x20blank.','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','--prompt\x20must\x20not\x20be\x20blank.','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','701124Fbalqi','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','isSafeInteger','\x20from\x20schedule\x20','\x20schedule\x20','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','/api/harness/apps/','validation','body','str','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','Created\x20','147847NdieTc','run','UTC','Schedule\x20input\x20is\x20valid','schedule','build','deepseek-v4-flash-0731','detail','455kRoPyI','description','294cLeDCA','52872pxnAMO','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','read','model','863154hajeyP','CRON','kind','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','schedule-id','Preview:\x20run\x20schedule\x20','number','delete','Deleted\x20schedule\x20','Preview:\x20delete\x20schedule\x20','Schedule\x20title','deepseek-v4-pro-0813','346390QwvjNt','/schedules','validate','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','1266JsPMFH','high-risk-write','4330VCngcw','\x20immediately','Schedule\x20UUID','368EatzgS','POST','cursor','44pakpjl','cron','num','scheduleId','423dfPlAs','appCode'];a58_0x10bf=function(){return _0x14de80;};return a58_0x10bf();}function scheduleItemPath(_0x4d0fff,_0x5ab39f){return scheduleCollectionPath(_0x4d0fff)+'/'+encodeURIComponent(_0x5ab39f);}const scheduleValidate={'service':a58_0x3ac958(0x1b2),'command':a58_0x3ac958(0x1cc),'description':a58_0x3ac958(0x1a7),'risk':a58_0x3ac958(0x1bc),'flags':INPUT_FLAGS,async 'validate'(_0x447801){readScheduleInput(_0x447801);},async 'execute'(_0x2169de){const _0x5899bd=a58_0x3ac958,_0x23a461=readScheduleInput(_0x2169de),_0x238ef9=await validateRuntimeSchedule(_0x2169de[_0x5899bd(0x18b)],_0x23a461);return{'ok':!![],'data':_0x238ef9,'message':_0x5899bd(0x1b1)};}},scheduleCreate={'service':a58_0x3ac958(0x1b2),'command':'create','description':a58_0x3ac958(0x1c1),'risk':a58_0x3ac958(0x1cf),'confirmationDescription':a58_0x3ac958(0x196),'flags':INPUT_FLAGS,async 'validate'(_0x43be78){readScheduleInput(_0x43be78);},async 'execute'(_0xa93362){const _0x32359b=a58_0x3ac958,_0x1b2cd2=readScheduleInput(_0xa93362),_0x10178d=await validateRuntimeSchedule(_0xa93362[_0x32359b(0x18b)],_0x1b2cd2),_0x5bfdff=await createRuntimeSchedule(_0xa93362[_0x32359b(0x18b)],_0x10178d);return{'ok':!![],'data':_0x5bfdff,'message':_0x32359b(0x1ad)+_0x5bfdff[_0x32359b(0x1c0)]+_0x32359b(0x1a6)+_0x5bfdff[_0x32359b(0x1d9)]};},async 'dryRun'(_0x4919e7){const _0x398e95=a58_0x3ac958,_0x1c4053=readScheduleInput(_0x4919e7);return dryRun(_0x398e95(0x1d4),scheduleCollectionPath(_0x4919e7['appCode']))[_0x398e95(0x1aa)](_0x1c4053)[_0x398e95(0x1b7)]('Preview:\x20create\x20an\x20Agent\x20schedule')[_0x398e95(0x1b3)]();}},scheduleList={'service':a58_0x3ac958(0x1b2),'command':a58_0x3ac958(0x197),'description':a58_0x3ac958(0x1bb),'risk':a58_0x3ac958(0x1bc),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x19e438){const _0x3da083=a58_0x3ac958,_0x3aa66e=_0x19e438[_0x3da083(0x1d8)](_0x3da083(0x19a));if(!Number[_0x3da083(0x1a4)](_0x3aa66e)||_0x3aa66e<0x1||_0x3aa66e>0x64)throw CliErrors[_0x3da083(0x1a9)](_0x3da083(0x1cd));const _0x354ad1=_0x19e438[_0x3da083(0x1ab)](_0x3da083(0x1d5));if(_0x354ad1&&(_0x354ad1['length']>0x400||_0x354ad1[_0x3da083(0x18f)]()!==_0x354ad1))throw CliErrors['validation'](_0x3da083(0x18c));},async 'execute'(_0x45880f){const _0x3a57e6=a58_0x3ac958,_0x3c43d8=_0x45880f[_0x3a57e6(0x1ab)](_0x3a57e6(0x1d5)),_0x2bc553=await listRuntimeSchedules(_0x45880f[_0x3a57e6(0x18b)],{'kind':_0x45880f['str'](_0x3a57e6(0x1c0)),'limit':_0x45880f[_0x3a57e6(0x1d8)](_0x3a57e6(0x19a)),..._0x3c43d8?{'cursor':_0x3c43d8}:{}});return{'ok':!![],'data':_0x2bc553};}},scheduleDetail={'service':a58_0x3ac958(0x1b2),'command':a58_0x3ac958(0x1b5),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a58_0x3ac958(0x1bc),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x32657c){const _0x3d2f76=a58_0x3ac958,_0xcaaf26=await getRuntimeSchedule(_0x32657c[_0x3d2f76(0x18b)],_0x32657c[_0x3d2f76(0x1ab)]('schedule-id'));return{'ok':!![],'data':_0xcaaf26};}},scheduleRun={'service':a58_0x3ac958(0x1b2),'command':a58_0x3ac958(0x1af),'description':a58_0x3ac958(0x1a1),'risk':a58_0x3ac958(0x1cf),'confirmationDescription':a58_0x3ac958(0x1ac),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x20430b){const _0x9da15c=a58_0x3ac958,_0x23e20a=_0x20430b[_0x9da15c(0x1ab)](_0x9da15c(0x1c2)),_0x3ccf76=await runRuntimeSchedule(_0x20430b[_0x9da15c(0x18b)],_0x23e20a);return{'ok':!![],'data':_0x3ccf76,'message':'Queued\x20Task\x20'+_0x3ccf76['taskId']+_0x9da15c(0x1a5)+_0x23e20a};},async 'dryRun'(_0x264a80){const _0x9ba161=a58_0x3ac958,_0xaa56e7=_0x264a80[_0x9ba161(0x1ab)](_0x9ba161(0x1c2));return dryRun('POST',scheduleItemPath(_0x264a80[_0x9ba161(0x18b)],_0xaa56e7)+_0x9ba161(0x193))[_0x9ba161(0x1b7)](_0x9ba161(0x1c3)+_0xaa56e7+_0x9ba161(0x1d1))[_0x9ba161(0x1b3)]();}},scheduleDelete={'service':'schedule','command':a58_0x3ac958(0x1c5),'description':a58_0x3ac958(0x1a3),'risk':a58_0x3ac958(0x1cf),'confirmationDescription':'Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x257858){const _0x5068bc=a58_0x3ac958,_0xc38156=_0x257858[_0x5068bc(0x1ab)]('schedule-id'),_0xb37f53=await deleteRuntimeSchedule(_0x257858[_0x5068bc(0x18b)],_0xc38156);return{'ok':!![],'data':_0xb37f53,'message':_0x5068bc(0x1c6)+_0xc38156};},async 'dryRun'(_0xf589f5){const _0x14727d=a58_0x3ac958,_0x484e0d=_0xf589f5[_0x14727d(0x1ab)](_0x14727d(0x1c2));return dryRun('DELETE',scheduleItemPath(_0xf589f5[_0x14727d(0x18b)],_0x484e0d))[_0x14727d(0x1b7)](_0x14727d(0x1c7)+_0x484e0d)[_0x14727d(0x1b3)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x3113cd=a59_0x1041;(function(_0x248aa5,_0x130e6b){const _0x9ab485=a59_0x1041,_0x50d989=_0x248aa5();while(!![]){try{const _0x5a4a37=-parseInt(_0x9ab485(0x13b))/0x1*(-parseInt(_0x9ab485(0x13a))/0x2)+-parseInt(_0x9ab485(0x135))/0x3+parseInt(_0x9ab485(0x137))/0x4*(-parseInt(_0x9ab485(0x132))/0x5)+parseInt(_0x9ab485(0x133))/0x6+-parseInt(_0x9ab485(0x13c))/0x7+parseInt(_0x9ab485(0x130))/0x8*(parseInt(_0x9ab485(0x139))/0x9)+parseInt(_0x9ab485(0x134))/0xa;if(_0x5a4a37===_0x130e6b)break;else _0x50d989['push'](_0x50d989['shift']());}catch(_0x2148c9){_0x50d989['push'](_0x50d989['shift']());}}}(a59_0x3bc5,0x9bd3b));import{buildSchemaPayload}from'../framework/schema-export.js';function a59_0x1041(_0x3419bf,_0x34264e){_0x3419bf=_0x3419bf-0x130;const _0x3bc599=a59_0x3bc5();let _0x104163=_0x3bc599[_0x3419bf];return _0x104163;}function a59_0x3bc5(){const _0x33eaaa=['1BcCBSJ','4870348Vswuqq','88lBcmTB','read','10JiQXRQ','4329288eMIAgl','15703110ajzfnJ','3592302LdForL','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1723688cFityx','export','315531fKdSrp','1431602FbgImF'];a59_0x3bc5=function(){return _0x33eaaa;};return a59_0x3bc5();}async function execute(_0x27d466){const _0x2f1e95=await buildSchemaPayload();return{'ok':!![],'data':_0x2f1e95};}export const schemaDefinition={'service':'schema','command':a59_0x3113cd(0x138),'description':a59_0x3113cd(0x136),'risk':a59_0x3113cd(0x131),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5ccff1,_0x4d2f61){const _0x50bfad=a60_0x1eb2,_0x4967dd=_0x5ccff1();while(!![]){try{const _0x197142=-parseInt(_0x50bfad(0x1ad))/0x1+parseInt(_0x50bfad(0x1c0))/0x2*(parseInt(_0x50bfad(0x1f7))/0x3)+-parseInt(_0x50bfad(0x1df))/0x4+-parseInt(_0x50bfad(0x1d0))/0x5*(parseInt(_0x50bfad(0x1a6))/0x6)+parseInt(_0x50bfad(0x1c4))/0x7*(parseInt(_0x50bfad(0x1d4))/0x8)+parseInt(_0x50bfad(0x1de))/0x9*(-parseInt(_0x50bfad(0x1a2))/0xa)+parseInt(_0x50bfad(0x1c1))/0xb;if(_0x197142===_0x4d2f61)break;else _0x4967dd['push'](_0x4967dd['shift']());}catch(_0xd78a0f){_0x4967dd['push'](_0x4967dd['shift']());}}}(a60_0x5016,0x514a0));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';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x1b090a,_0x15c9cf){const _0x2f3344=a60_0x1eb2,_0x33fabf=listLocalServiceTrees();let _0xe310b9;for(const _0x1ec4cc of _0x33fabf){const _0x2cfc40=matchServiceTreeCommand(_0x1ec4cc,_0x1b090a);if(!_0x2cfc40)continue;(!_0xe310b9||_0x2cfc40[_0x2f3344(0x1c3)][_0x2f3344(0x1c8)]['length']>_0xe310b9[_0x2f3344(0x1c3)][_0x2f3344(0x1c8)]['length'])&&(_0xe310b9={'tree':_0x1ec4cc,'command':_0x2cfc40['command'],'remainingArgs':_0x2cfc40[_0x2f3344(0x1e1)]});}if(!_0xe310b9)return undefined;const _0x2f255c={..._0x15c9cf};return applyAppBinding(_0xe310b9[_0x2f3344(0x1e0)],_0xe310b9[_0x2f3344(0x1c3)],_0x2f255c),{'definition':buildDynamicCommandDefinition(_0xe310b9[_0x2f3344(0x1e0)],_0xe310b9[_0x2f3344(0x1c3)]),'args':_0xe310b9[_0x2f3344(0x1e1)],'flags':_0x2f255c,'tree':_0xe310b9[_0x2f3344(0x1e0)],'command':_0xe310b9[_0x2f3344(0x1c3)]};}export function generateDynamicServiceHelp(_0x3b4efb){const _0x529bde=a60_0x1eb2,_0x202d2f=listLocalServiceTrees()[_0x529bde(0x1e9)](_0x26d4c9=>_0x26d4c9[_0x529bde(0x1d1)]['code']===_0x3b4efb);if(!_0x202d2f)return undefined;const _0x1e0c5a=[CLI_BIN_NAME+'\x20'+_0x3b4efb+_0x529bde(0x1c6),'',_0x202d2f[_0x529bde(0x1d1)]['name']||_0x3b4efb,_0x202d2f['service'][_0x529bde(0x1b5)]?'\x20\x20'+_0x202d2f[_0x529bde(0x1d1)]['description']:'','','Commands:',..._0x202d2f[_0x529bde(0x198)]['map'](_0x5a458e=>{const _0x5a16b0=_0x529bde,_0x3803f7=_0x5a458e[_0x5a16b0(0x1c8)][_0x5a16b0(0x1e5)](0x1)['join']('\x20'),_0x3b0a03=_0x5a458e['risk']===_0x5a16b0(0x1bc)?'':'\x20['+_0x5a458e[_0x5a16b0(0x1ee)]+']';return'\x20\x20'+_0x3803f7[_0x5a16b0(0x1f0)](0x18)+'\x20'+(_0x5a458e['description']||'')+_0x3b0a03;}),'','Use\x20`'+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x3b4efb+_0x529bde(0x1c9)][_0x529bde(0x1ae)](Boolean);return _0x1e0c5a[_0x529bde(0x19b)]('\x0a');}export function listDynamicServiceEntries(){const _0x2b303d=a60_0x1eb2;return listLocalServices()[_0x2b303d(0x1d7)](_0x2107de=>{const _0x20b691=_0x2b303d,_0x223078=_0x2107de['normalizedManifest'];return{'service':_0x223078[_0x20b691(0x1d1)][_0x20b691(0x1cc)],'label':_0x223078['service']['name']||_0x223078[_0x20b691(0x1d1)]['code'],'commands':_0x223078[_0x20b691(0x198)][_0x20b691(0x1d7)](_0x54f6f1=>({'command':dynamicCommandName(_0x54f6f1),'description':_0x54f6f1[_0x20b691(0x1b5)]||_0x20b691(0x1d8)+_0x54f6f1['cliPath'],'tag':riskTag(_0x54f6f1[_0x20b691(0x1ee)])}))};});}export function getDynamicServiceEntry(_0x129454){const _0x2b3080=a60_0x1eb2;return listDynamicServiceEntries()['find'](_0x53844f=>_0x53844f[_0x2b3080(0x1d1)]===_0x129454);}export function listDynamicServiceDefinitions(_0x228fba){const _0xc9d8b6=a60_0x1eb2;return listLocalServiceTrees()['filter'](_0x13dcd2=>!_0x228fba||_0x13dcd2[_0xc9d8b6(0x1d1)][_0xc9d8b6(0x1cc)]===_0x228fba)[_0xc9d8b6(0x1d3)](_0x4e1bd3=>_0x4e1bd3[_0xc9d8b6(0x198)][_0xc9d8b6(0x1d7)](_0x650806=>buildDynamicCommandDefinition(_0x4e1bd3,_0x650806)));}export function getDynamicServiceDefinitions(_0x29ea63){const _0x3a7e1a=a60_0x1eb2,_0x235ec4=listDynamicServiceDefinitions(_0x29ea63);return _0x235ec4[_0x3a7e1a(0x1e4)]>0x0?_0x235ec4:undefined;}export function findDynamicServiceDefinition(_0x3b5e9c,_0x37d958){const _0x17eb0a=a60_0x1eb2;return listDynamicServiceDefinitions(_0x3b5e9c)[_0x17eb0a(0x1e9)](_0x1b58de=>_0x1b58de[_0x17eb0a(0x1c3)]===_0x37d958);}export function buildDynamicCommandDefinition(_0x1967cf,_0x564ca0){const _0x47e62e=a60_0x1eb2;return{'service':_0x1967cf[_0x47e62e(0x1d1)]['code'],'command':dynamicCommandName(_0x564ca0),'description':_0x564ca0['description']||_0x47e62e(0x1d8)+_0x564ca0[_0x47e62e(0x19a)],'risk':_0x564ca0['risk'],..._0x564ca0[_0x47e62e(0x1ee)]===_0x47e62e(0x1bc)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x564ca0)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x564ca0[_0x47e62e(0x1fb)]['map'](_0x35ca8a=>({'name':_0x35ca8a[_0x47e62e(0x1ca)],'description':_0x35ca8a[_0x47e62e(0x1b5)]||_0x35ca8a[_0x47e62e(0x1ca)],'required':_0x35ca8a[_0x47e62e(0x1ce)]})),'flags':_0x564ca0['flags'][_0x47e62e(0x1d7)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x564ca0),async 'dryRun'(_0x54f342){const _0xa076b=_0x47e62e,_0x2c3200=await compilePlan(_0x564ca0,_0x54f342);return{'method':'SERVICE_TREE','url':_0x564ca0[_0xa076b(0x19a)],'body':{'target':targetPreview(_0x2c3200),'params':_0x2c3200['params']},'description':_0xa076b(0x1f1)+_0x564ca0[_0xa076b(0x19a)]};},async 'execute'(_0x6df5e8){const _0x3b245b=_0x47e62e,_0x3502d2=await compilePlan(_0x564ca0,_0x6df5e8),_0x3fe7d5=Date[_0x3b245b(0x1d5)](),_0x108938=await executePlan(_0x3502d2,_0x564ca0,_0x6df5e8),_0xc9aefe=Date[_0x3b245b(0x1d5)]()-_0x3fe7d5;return{'ok':!![],'data':{'service':_0x1967cf[_0x3b245b(0x1d1)],'command':_0x564ca0[_0x3b245b(0x19a)],'target':targetPreview(_0x3502d2),'result':_0x108938,'elapsed':_0xc9aefe},'message':_0x3b245b(0x1f2)+_0x564ca0[_0x3b245b(0x19a)]+_0x3b245b(0x1d2)+_0xc9aefe+'ms'};}};}function buildDynamicConfirmationDescription(_0x3eb6b1){const _0x5dbccc=a60_0x1eb2,_0x23a7d9=_0x3eb6b1['description']||_0x3eb6b1[_0x5dbccc(0x19a)],_0x2a202e=_0x3eb6b1[_0x5dbccc(0x1ee)]===_0x5dbccc(0x1aa)?_0x5dbccc(0x1eb):_0x5dbccc(0x1b7);return _0x5dbccc(0x1a8)+_0x23a7d9+_0x5dbccc(0x1a4)+_0x2a202e;}function a60_0x5016(){const _0x3688b2=['64LKZdyU','now','cliName','map','Run\x20service\x20command\x20','enum','trim','appcode','string','fromEntries','5460201pEgMsG','2189240LSwWgS','tree','remainingArgs','scriptName','bff','length','slice','appRef','\x20\x20\x20\x20datasetCode:\x20','kind','find','json','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','params','employeeId','risk','target','padEnd','Preview\x20dynamic\x20service\x20command:\x20','Service\x20command\x20','sqlCode','\x20requires\x20target.functionName.','validation','userId','1641rayRMu','Cannot\x20resolve\x20datatable\x20\x22','userName','boolean','args','nickName','appCode','number','tableName','source','commands','app','cliPath','join','rawFlags','Unknown\x20appRef\x20\x22','\x20\x20SERVICE\x20TREE\x20TARGET','tenantCode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','push','10MGLGsE','data','\x22.\x20','some','1289982AVZYuR','sql','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','type','high-risk-write','\x20\x20\x20\x20','Unsupported\x20service\x20target\x20kind:\x20','536671DOcNAZ','filter','ctx.','username','env','nickname','envName','bffCode','description','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','bffId','context.','entries','datasetCode','read','default','\x20\x20\x20\x20functionName:\x20','datatable','1778sybaQX','17289360NXrWos','operator','command','158011vJjLwG','\x20\x20\x20\x20sqlCode:\x20','\x20<command>\x20[flags]','\x20\x20\x20\x20datatable:\x20','fullPath','`\x20to\x20inspect\x20the\x20manifest.','name','startsWith','code','mapTo','required','dbtableConfig','5hYyZwN','service','\x20completed\x20in\x20','flatMap'];a60_0x5016=function(){return _0x3688b2;};return a60_0x5016();}function dynamicCommandName(_0x2017a4){const _0x36b016=a60_0x1eb2;return _0x2017a4[_0x36b016(0x1c8)][_0x36b016(0x1e5)](0x1)[_0x36b016(0x19b)]('\x20');}function riskTag(_0x5ce970){const _0x2ef1b1=a60_0x1eb2;return _0x5ce970===_0x2ef1b1(0x1bc)?'':'\x20\x20['+_0x5ce970+']';}function flagToCommandFlag(_0x4c9742){const _0x1a8333=a60_0x1eb2;return{'name':_0x4c9742[_0x1a8333(0x1d6)],'type':_0x4c9742[_0x1a8333(0x1a9)]===_0x1a8333(0x1ea)?_0x1a8333(0x1dc):_0x4c9742['type'],'description':_0x4c9742[_0x1a8333(0x1b5)]||_0x4c9742[_0x1a8333(0x1ca)],'required':_0x4c9742['required'],'default':isPrimitiveFlagDefault(_0x4c9742[_0x1a8333(0x1bd)])?_0x4c9742[_0x1a8333(0x1bd)]:undefined,'enum':_0x4c9742[_0x1a8333(0x1d9)]};}async function compilePlan(_0x23b828,_0x34c8d8){const _0xb947ad=a60_0x1eb2;return compileServiceTreeCommand(_0x23b828,{'flags':_0x34c8d8[_0xb947ad(0x19c)],'args':_0x34c8d8['args'],'context':await buildServiceContext(_0x23b828,_0x34c8d8)});}async function buildServiceContext(_0xaa5e55,_0x580af2){const _0x361e4e=a60_0x1eb2,_0xd01f84={'appCode':_0x580af2[_0x361e4e(0x194)],'env':_0x580af2[_0x361e4e(0x1b3)],'envName':_0x580af2[_0x361e4e(0x1b3)]};if(!usesRuntimeContext(_0xaa5e55))return _0xd01f84;const _0x3648af=await getLoginUserInfo(),_0x3553b3=pickFirst(_0x3648af[_0x361e4e(0x1f6)],_0x3648af['id']);return{..._0xd01f84,'user':_0x3648af,'userId':_0x3553b3,'id':_0x3648af['id'],'username':pickFirst(_0x3648af[_0x361e4e(0x1b0)],_0x3648af['userName'],_0x3648af['loginName']),'userName':_0x3648af[_0x361e4e(0x1f9)],'nickname':pickFirst(_0x3648af[_0x361e4e(0x1b2)],_0x3648af['nickName']),'nickName':_0x3648af[_0x361e4e(0x1fc)],'tenantCode':_0x3648af[_0x361e4e(0x19f)],'employeeId':_0x3648af[_0x361e4e(0x1ed)]};}function usesRuntimeContext(_0x5e1f67){const _0x1b06be=a60_0x1eb2;return _0x5e1f67[_0x1b06be(0x1cd)][_0x1b06be(0x1a5)](_0x5b8bbc=>typeof _0x5b8bbc['source']===_0x1b06be(0x1dc)&&(_0x5b8bbc['source'][_0x1b06be(0x1cb)](_0x1b06be(0x1b9))||_0x5b8bbc[_0x1b06be(0x197)][_0x1b06be(0x1cb)](_0x1b06be(0x1af))));}function pickFirst(..._0x24efa8){return _0x24efa8['find'](_0x510120=>_0x510120!==undefined&&_0x510120!==null);}async function executePlan(_0x27c58f,_0xa94b1f,_0x59d268){const _0x5f51ff=a60_0x1eb2;if(_0x27c58f[_0x5f51ff(0x1e8)]===_0x5f51ff(0x1a3)){const _0x3a8e0a=await resolveDatasetCode(_0x27c58f,_0xa94b1f,_0x59d268);return executeData(_0x3a8e0a,_0x27c58f[_0x5f51ff(0x1c3)],_0x27c58f[_0x5f51ff(0x1ec)]);}if(_0x27c58f[_0x5f51ff(0x1e8)]===_0x5f51ff(0x1a7)){if(!_0x27c58f[_0x5f51ff(0x1f3)])throw CliErrors['validation'](_0x5f51ff(0x1f2)+_0xa94b1f[_0x5f51ff(0x19a)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x27c58f[_0x5f51ff(0x1f3)],normalizeScalarParams(_0x27c58f[_0x5f51ff(0x1ec)]));}if(_0x27c58f[_0x5f51ff(0x1e8)]===_0x5f51ff(0x1e3)){const _0x185c3e=_0x27c58f[_0x5f51ff(0x1e2)]||_0x27c58f[_0x5f51ff(0x1b4)]||(_0x27c58f[_0x5f51ff(0x1b8)]==null?'':String(_0x27c58f[_0x5f51ff(0x1b8)]));if(!_0x185c3e)throw CliErrors[_0x5f51ff(0x1f5)]('Service\x20command\x20'+_0xa94b1f[_0x5f51ff(0x19a)]+_0x5f51ff(0x1f4));return executeSdkBff(_0x185c3e,_0x27c58f[_0x5f51ff(0x1ec)]);}throw CliErrors[_0x5f51ff(0x1f5)](_0x5f51ff(0x1ac)+_0x27c58f[_0x5f51ff(0x1e8)]);}async function resolveDatasetCode(_0x5365d5,_0x4bd7df,_0x3e12be){const _0x381275=a60_0x1eb2;if(_0x5365d5[_0x381275(0x1bb)])return _0x5365d5['datasetCode'];if(!_0x5365d5[_0x381275(0x1bf)])throw CliErrors[_0x381275(0x1f5)](_0x381275(0x1f2)+_0x4bd7df[_0x381275(0x19a)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x1f0b31=await listDatasets(_0x3e12be[_0x381275(0x194)]),_0x4b3382=_0x1f0b31[_0x381275(0x1e9)](_0x3ec853=>_0x3ec853[_0x381275(0x1cf)]?.[_0x381275(0x196)]===_0x5365d5[_0x381275(0x1bf)]);if(!_0x4b3382?.[_0x381275(0x1cc)])throw CliErrors[_0x381275(0x1f5)](_0x381275(0x1f8)+_0x5365d5['datatable']+_0x381275(0x1a0)+_0x3e12be[_0x381275(0x194)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x4b3382[_0x381275(0x1cc)];}function a60_0x1eb2(_0x4b67d2,_0x2e93e2){_0x4b67d2=_0x4b67d2-0x194;const _0x501623=a60_0x5016();let _0x1eb20d=_0x501623[_0x4b67d2];return _0x1eb20d;}function applyAppBinding(_0x444d92,_0x3d4400,_0x1d00f8){const _0x2a4538=a60_0x1eb2,_0x1fd2f5=_0x3d4400['target']['appRef'];if(!_0x1fd2f5)return;const _0x17336b=_0x444d92['appBindings'][_0x1fd2f5];if(!_0x17336b)throw CliErrors[_0x2a4538(0x1f5)](_0x2a4538(0x19d)+_0x1fd2f5+'\x22\x20in\x20service\x20command\x20'+_0x3d4400[_0x2a4538(0x19a)]+'.',_0x2a4538(0x1b6));const _0x10dbbf=_0x17336b[_0x2a4538(0x1db)]||_0x17336b[_0x2a4538(0x194)];_0x10dbbf&&!hasText(_0x1d00f8[_0x2a4538(0x1db)])&&(_0x1d00f8[_0x2a4538(0x1db)]=_0x10dbbf),_0x17336b['app']&&!hasText(_0x1d00f8[_0x2a4538(0x199)])&&!hasText(_0x1d00f8[_0x2a4538(0x1db)])&&(_0x1d00f8[_0x2a4538(0x199)]=_0x17336b[_0x2a4538(0x199)]),_0x17336b['env']&&!hasText(_0x1d00f8[_0x2a4538(0x1b1)])&&(_0x1d00f8['env']=_0x17336b[_0x2a4538(0x1b1)]);}function renderDynamicCommandHelp(_0x51e3d4){const _0x4ba8c7=a60_0x1eb2,_0x521485=[_0x4ba8c7(0x19e),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1e8)],'\x20\x20\x20\x20command:\x20'+_0x51e3d4['target'][_0x4ba8c7(0x1c3)]];if(_0x51e3d4[_0x4ba8c7(0x1ef)]['datasetCode'])_0x521485['push'](_0x4ba8c7(0x1e7)+_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1bb)]);if(_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1bf)])_0x521485[_0x4ba8c7(0x1a1)](_0x4ba8c7(0x1c7)+_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1bf)]);if(_0x51e3d4['target'][_0x4ba8c7(0x1f3)])_0x521485[_0x4ba8c7(0x1a1)](_0x4ba8c7(0x1c5)+_0x51e3d4['target'][_0x4ba8c7(0x1f3)]);if(_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1e2)])_0x521485['push'](_0x4ba8c7(0x1be)+_0x51e3d4[_0x4ba8c7(0x1ef)][_0x4ba8c7(0x1e2)]);if(_0x51e3d4[_0x4ba8c7(0x1cd)][_0x4ba8c7(0x1e4)]>0x0){_0x521485['push']('','\x20\x20MAP\x20TO');for(const _0x34da40 of _0x51e3d4[_0x4ba8c7(0x1cd)]){_0x521485[_0x4ba8c7(0x1a1)](_0x4ba8c7(0x1ab)+(_0x34da40['source']||'const')+'\x20->\x20'+_0x34da40['target']+(_0x34da40[_0x4ba8c7(0x1c2)]?'.'+_0x34da40[_0x4ba8c7(0x1c2)]:''));}}return _0x521485[_0x4ba8c7(0x19b)]('\x0a');}function targetPreview(_0x11ad3d){const _0x1340dd=a60_0x1eb2;return{'kind':_0x11ad3d[_0x1340dd(0x1e8)],'command':_0x11ad3d[_0x1340dd(0x1c3)],'appRef':_0x11ad3d[_0x1340dd(0x1e6)],'datasetCode':_0x11ad3d[_0x1340dd(0x1bb)],'datatable':_0x11ad3d[_0x1340dd(0x1bf)],'sqlCode':_0x11ad3d[_0x1340dd(0x1f3)],'bffCode':_0x11ad3d[_0x1340dd(0x1b4)],'bffId':_0x11ad3d[_0x1340dd(0x1b8)],'functionName':_0x11ad3d[_0x1340dd(0x1e2)]};}function normalizeScalarParams(_0x22ea30){const _0x1e12fd=a60_0x1eb2;return Object[_0x1e12fd(0x1dd)](Object[_0x1e12fd(0x1ba)](_0x22ea30)[_0x1e12fd(0x1ae)](([,_0x5b8153])=>typeof _0x5b8153===_0x1e12fd(0x1dc)||typeof _0x5b8153===_0x1e12fd(0x195)));}function hasText(_0x2144ae){const _0x5219bd=a60_0x1eb2;return typeof _0x2144ae==='string'&&_0x2144ae[_0x5219bd(0x1da)]()[_0x5219bd(0x1e4)]>0x0;}function isPrimitiveFlagDefault(_0x4e9b20){const _0x17fdf4=a60_0x1eb2;return _0x4e9b20===undefined||typeof _0x4e9b20===_0x17fdf4(0x1dc)||typeof _0x4e9b20===_0x17fdf4(0x195)||typeof _0x4e9b20===_0x17fdf4(0x1fa);}
|
|
1
|
+
(function(_0x23113e,_0x566df8){const _0x118dc3=a60_0x4439,_0x5e46a7=_0x23113e();while(!![]){try{const _0x3cd29b=parseInt(_0x118dc3(0x136))/0x1*(parseInt(_0x118dc3(0x148))/0x2)+-parseInt(_0x118dc3(0x13e))/0x3+-parseInt(_0x118dc3(0x172))/0x4*(parseInt(_0x118dc3(0x109))/0x5)+parseInt(_0x118dc3(0x15f))/0x6*(-parseInt(_0x118dc3(0x127))/0x7)+-parseInt(_0x118dc3(0x16f))/0x8+-parseInt(_0x118dc3(0x121))/0x9+parseInt(_0x118dc3(0x107))/0xa*(parseInt(_0x118dc3(0x105))/0xb);if(_0x3cd29b===_0x566df8)break;else _0x5e46a7['push'](_0x5e46a7['shift']());}catch(_0x265f7e){_0x5e46a7['push'](_0x5e46a7['shift']());}}}(a60_0x4567,0x72517));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';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x5d91bb,_0xa14498){const _0x34c97e=a60_0x4439,_0x4dcbe1=listLocalServiceTrees();let _0xe4fd91;for(const _0xa95dca of _0x4dcbe1){const _0x546dfe=matchServiceTreeCommand(_0xa95dca,_0x5d91bb);if(!_0x546dfe)continue;(!_0xe4fd91||_0x546dfe[_0x34c97e(0x152)][_0x34c97e(0x156)][_0x34c97e(0x165)]>_0xe4fd91[_0x34c97e(0x152)]['fullPath'][_0x34c97e(0x165)])&&(_0xe4fd91={'tree':_0xa95dca,'command':_0x546dfe['command'],'remainingArgs':_0x546dfe[_0x34c97e(0x14d)]});}if(!_0xe4fd91)return undefined;const _0x33aa1c={..._0xa14498};return applyAppBinding(_0xe4fd91[_0x34c97e(0x11f)],_0xe4fd91[_0x34c97e(0x152)],_0x33aa1c),{'definition':buildDynamicCommandDefinition(_0xe4fd91[_0x34c97e(0x11f)],_0xe4fd91[_0x34c97e(0x152)]),'args':_0xe4fd91['remainingArgs'],'flags':_0x33aa1c,'tree':_0xe4fd91[_0x34c97e(0x11f)],'command':_0xe4fd91[_0x34c97e(0x152)]};}export function generateDynamicServiceHelp(_0x23d6c5){const _0x2dcd0b=a60_0x4439,_0xbd56a9=listLocalServiceTrees()['find'](_0x1f46c2=>_0x1f46c2[_0x2dcd0b(0x159)][_0x2dcd0b(0x162)]===_0x23d6c5);if(!_0xbd56a9)return undefined;const _0x6d0930=[CLI_BIN_NAME+'\x20'+_0x23d6c5+'\x20<command>\x20[flags]','',_0xbd56a9[_0x2dcd0b(0x159)]['name']||_0x23d6c5,_0xbd56a9[_0x2dcd0b(0x159)][_0x2dcd0b(0x168)]?'\x20\x20'+_0xbd56a9[_0x2dcd0b(0x159)][_0x2dcd0b(0x168)]:'','',_0x2dcd0b(0x12e),..._0xbd56a9[_0x2dcd0b(0x13f)][_0x2dcd0b(0x14e)](_0x574c24=>{const _0x20d61d=_0x2dcd0b,_0x1bae59=_0x574c24[_0x20d61d(0x156)]['slice'](0x1)[_0x20d61d(0x16a)]('\x20'),_0x44f4c5=_0x574c24[_0x20d61d(0x119)]==='read'?'':'\x20['+_0x574c24[_0x20d61d(0x119)]+']';return'\x20\x20'+_0x1bae59[_0x20d61d(0x132)](0x18)+'\x20'+(_0x574c24['description']||'')+_0x44f4c5;}),'',_0x2dcd0b(0x173)+CLI_BIN_NAME+_0x2dcd0b(0x11c)+_0x23d6c5+_0x2dcd0b(0x13a)][_0x2dcd0b(0x104)](Boolean);return _0x6d0930[_0x2dcd0b(0x16a)]('\x0a');}export function listDynamicServiceEntries(){const _0x3e6401=a60_0x4439;return listLocalServices()[_0x3e6401(0x14e)](_0x160bed=>{const _0x298040=_0x3e6401,_0xf2225d=_0x160bed[_0x298040(0x10e)];return{'service':_0xf2225d[_0x298040(0x159)]['code'],'label':_0xf2225d[_0x298040(0x159)]['name']||_0xf2225d['service']['code'],'commands':_0xf2225d[_0x298040(0x13f)]['map'](_0x20b617=>({'command':dynamicCommandName(_0x20b617),'description':_0x20b617[_0x298040(0x168)]||'Run\x20service\x20command\x20'+_0x20b617[_0x298040(0x139)],'tag':riskTag(_0x20b617['risk'])}))};});}export function getDynamicServiceEntry(_0x29809a){const _0x44eb7c=a60_0x4439;return listDynamicServiceEntries()[_0x44eb7c(0x142)](_0x15fc73=>_0x15fc73['service']===_0x29809a);}export function listDynamicServiceDefinitions(_0x21891a){const _0x45a475=a60_0x4439;return listLocalServiceTrees()[_0x45a475(0x104)](_0x4bd95e=>!_0x21891a||_0x4bd95e[_0x45a475(0x159)]['code']===_0x21891a)[_0x45a475(0x10c)](_0x6a735f=>_0x6a735f['commands']['map'](_0x2373f3=>buildDynamicCommandDefinition(_0x6a735f,_0x2373f3)));}export function getDynamicServiceDefinitions(_0x5c9699){const _0x7775d6=a60_0x4439,_0x2f1802=listDynamicServiceDefinitions(_0x5c9699);return _0x2f1802[_0x7775d6(0x165)]>0x0?_0x2f1802:undefined;}export function findDynamicServiceDefinition(_0x4edbfe,_0x3726f9){return listDynamicServiceDefinitions(_0x4edbfe)['find'](_0x4e3eee=>_0x4e3eee['command']===_0x3726f9);}export function buildDynamicCommandDefinition(_0x4b5d47,_0x36ba9e){const _0x10daf1=a60_0x4439;return{'service':_0x4b5d47[_0x10daf1(0x159)][_0x10daf1(0x162)],'command':dynamicCommandName(_0x36ba9e),'description':_0x36ba9e[_0x10daf1(0x168)]||_0x10daf1(0x171)+_0x36ba9e[_0x10daf1(0x139)],'risk':_0x36ba9e[_0x10daf1(0x119)],..._0x36ba9e[_0x10daf1(0x119)]===_0x10daf1(0x157)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x36ba9e)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x36ba9e['args'][_0x10daf1(0x14e)](_0x42b10d=>({'name':_0x42b10d[_0x10daf1(0x11d)],'description':_0x42b10d[_0x10daf1(0x168)]||_0x42b10d['name'],'required':_0x42b10d[_0x10daf1(0x116)]})),'flags':_0x36ba9e[_0x10daf1(0x118)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x36ba9e),async 'dryRun'(_0x517c97){const _0x334a85=_0x10daf1,_0x747a15=await compilePlan(_0x36ba9e,_0x517c97);return{'method':_0x334a85(0x138),'url':_0x36ba9e[_0x334a85(0x139)],'body':{'target':targetPreview(_0x747a15),'params':_0x747a15['params']},'description':_0x334a85(0x123)+_0x36ba9e['cliPath']};},async 'execute'(_0x51ab01){const _0x1094ae=_0x10daf1,_0x1d84f8=await compilePlan(_0x36ba9e,_0x51ab01),_0x3d0264=Date[_0x1094ae(0x163)](),_0x896172=await executePlan(_0x1d84f8,_0x36ba9e,_0x51ab01),_0x3f9d23=Date[_0x1094ae(0x163)]()-_0x3d0264;return{'ok':!![],'data':{'service':_0x4b5d47[_0x1094ae(0x159)],'command':_0x36ba9e['cliPath'],'target':targetPreview(_0x1d84f8),'result':_0x896172,'elapsed':_0x3f9d23},'message':_0x1094ae(0x160)+_0x36ba9e[_0x1094ae(0x139)]+_0x1094ae(0x145)+_0x3f9d23+'ms'};}};}function buildDynamicConfirmationDescription(_0x5d8244){const _0x5c8700=a60_0x4439,_0x4d682f=_0x5d8244[_0x5c8700(0x168)]||_0x5d8244[_0x5c8700(0x139)],_0x3c38c8=_0x5d8244[_0x5c8700(0x119)]===_0x5c8700(0x155)?_0x5c8700(0x13b):_0x5c8700(0x12f);return _0x5c8700(0x158)+_0x4d682f+'\x22.\x20'+_0x3c38c8;}function dynamicCommandName(_0x57de6f){const _0x333d80=a60_0x4439;return _0x57de6f[_0x333d80(0x156)][_0x333d80(0x13c)](0x1)[_0x333d80(0x16a)]('\x20');}function riskTag(_0x42dd2c){const _0x4bdc16=a60_0x4439;return _0x42dd2c==='read'?'':_0x4bdc16(0x164)+_0x42dd2c+']';}function flagToCommandFlag(_0x20088d){const _0x157476=a60_0x4439;return{'name':_0x20088d[_0x157476(0x11a)],'type':_0x20088d[_0x157476(0x114)]===_0x157476(0x147)?_0x157476(0x133):_0x20088d[_0x157476(0x114)],'description':_0x20088d[_0x157476(0x168)]||_0x20088d[_0x157476(0x11d)],'required':_0x20088d['required'],'default':isPrimitiveFlagDefault(_0x20088d[_0x157476(0x170)])?_0x20088d[_0x157476(0x170)]:undefined,'enum':_0x20088d[_0x157476(0x14c)]};}async function compilePlan(_0x1113e7,_0x1388bc){const _0x5be40b=a60_0x4439;return compileServiceTreeCommand(_0x1113e7,{'flags':_0x1388bc[_0x5be40b(0x15c)],'args':_0x1388bc[_0x5be40b(0x169)],'context':await buildServiceContext(_0x1113e7,_0x1388bc)});}async function buildServiceContext(_0x24539d,_0x440e3f){const _0x40f962=a60_0x4439,_0x17bd08={'appCode':_0x440e3f['appCode'],'env':_0x440e3f[_0x40f962(0x14a)],'envName':_0x440e3f[_0x40f962(0x14a)]};if(!usesRuntimeContext(_0x24539d))return _0x17bd08;const _0x13bd06=await getLoginUserInfo(),_0x2094f6=pickFirst(_0x13bd06[_0x40f962(0x108)],_0x13bd06['id']);return{..._0x17bd08,'user':_0x13bd06,'userId':_0x2094f6,'id':_0x13bd06['id'],'username':pickFirst(_0x13bd06[_0x40f962(0x134)],_0x13bd06[_0x40f962(0x15d)],_0x13bd06['loginName']),'userName':_0x13bd06[_0x40f962(0x15d)],'nickname':pickFirst(_0x13bd06[_0x40f962(0x130)],_0x13bd06[_0x40f962(0x10d)]),'nickName':_0x13bd06[_0x40f962(0x10d)],'tenantCode':_0x13bd06[_0x40f962(0x12b)],'employeeId':_0x13bd06[_0x40f962(0x141)]};}function usesRuntimeContext(_0x48a56f){const _0x32fcec=a60_0x4439;return _0x48a56f[_0x32fcec(0x131)][_0x32fcec(0x11b)](_0x499e10=>typeof _0x499e10[_0x32fcec(0x166)]===_0x32fcec(0x133)&&(_0x499e10['source'][_0x32fcec(0x13d)]('context.')||_0x499e10[_0x32fcec(0x166)][_0x32fcec(0x13d)](_0x32fcec(0x115))));}function pickFirst(..._0x3d7944){const _0x28be49=a60_0x4439;return _0x3d7944[_0x28be49(0x142)](_0x567d29=>_0x567d29!==undefined&&_0x567d29!==null);}async function executePlan(_0x1bdfd0,_0x4b6793,_0x426d81){const _0x5a7711=a60_0x4439;if(_0x1bdfd0[_0x5a7711(0x15b)]===_0x5a7711(0x151)){const _0x39846c=await resolveDatasetCode(_0x1bdfd0,_0x4b6793,_0x426d81);return executeData(_0x39846c,_0x1bdfd0[_0x5a7711(0x152)],_0x1bdfd0[_0x5a7711(0x16e)]);}if(_0x1bdfd0['kind']===_0x5a7711(0x146)){if(!_0x1bdfd0[_0x5a7711(0x111)])throw CliErrors['validation'](_0x5a7711(0x160)+_0x4b6793['cliPath']+_0x5a7711(0x15e));return executeSdkSql(_0x1bdfd0[_0x5a7711(0x111)],normalizeScalarParams(_0x1bdfd0[_0x5a7711(0x16e)]));}if(_0x1bdfd0[_0x5a7711(0x15b)]==='bff'){const _0x184af8=_0x1bdfd0['scriptName']||_0x1bdfd0[_0x5a7711(0x10b)]||(_0x1bdfd0[_0x5a7711(0x149)]==null?'':String(_0x1bdfd0['bffId']));if(!_0x184af8)throw CliErrors[_0x5a7711(0x137)](_0x5a7711(0x160)+_0x4b6793['cliPath']+_0x5a7711(0x14b));return executeSdkBff(_0x184af8,_0x1bdfd0['params']);}throw CliErrors[_0x5a7711(0x137)](_0x5a7711(0x167)+_0x1bdfd0[_0x5a7711(0x15b)]);}async function resolveDatasetCode(_0x1b44fb,_0x28e437,_0x4e374e){const _0x2a912e=a60_0x4439;if(_0x1b44fb[_0x2a912e(0x120)])return _0x1b44fb[_0x2a912e(0x120)];if(!_0x1b44fb[_0x2a912e(0x135)])throw CliErrors['validation'](_0x2a912e(0x160)+_0x28e437[_0x2a912e(0x139)]+_0x2a912e(0x125));const _0x171632=await listDatasets(_0x4e374e[_0x2a912e(0x106)]),_0x41b10d=_0x171632[_0x2a912e(0x142)](_0x4d042a=>_0x4d042a[_0x2a912e(0x16c)]?.[_0x2a912e(0x144)]===_0x1b44fb[_0x2a912e(0x135)]);if(!_0x41b10d?.['code'])throw CliErrors[_0x2a912e(0x137)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x1b44fb[_0x2a912e(0x135)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4e374e[_0x2a912e(0x106)]+'.',_0x2a912e(0x12c));return _0x41b10d[_0x2a912e(0x162)];}function applyAppBinding(_0x4db296,_0x3f54f5,_0x118670){const _0x102c8a=a60_0x4439,_0x448c2f=_0x3f54f5[_0x102c8a(0x128)]['appRef'];if(!_0x448c2f)return;const _0x269067=_0x4db296[_0x102c8a(0x14f)][_0x448c2f];if(!_0x269067)throw CliErrors[_0x102c8a(0x137)](_0x102c8a(0x10f)+_0x448c2f+_0x102c8a(0x112)+_0x3f54f5[_0x102c8a(0x139)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x5ebb84=_0x269067[_0x102c8a(0x16b)]||_0x269067[_0x102c8a(0x106)];_0x5ebb84&&!hasText(_0x118670[_0x102c8a(0x16b)])&&(_0x118670[_0x102c8a(0x16b)]=_0x5ebb84),_0x269067[_0x102c8a(0x113)]&&!hasText(_0x118670[_0x102c8a(0x113)])&&!hasText(_0x118670[_0x102c8a(0x16b)])&&(_0x118670[_0x102c8a(0x113)]=_0x269067[_0x102c8a(0x113)]),_0x269067['env']&&!hasText(_0x118670['env'])&&(_0x118670[_0x102c8a(0x124)]=_0x269067['env']);}function renderDynamicCommandHelp(_0x5577b5){const _0x54a3e1=a60_0x4439,_0x3f4fe5=[_0x54a3e1(0x143),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x15b)],_0x54a3e1(0x122)+_0x5577b5['target']['command']];if(_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x120)])_0x3f4fe5['push'](_0x54a3e1(0x154)+_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x120)]);if(_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x135)])_0x3f4fe5[_0x54a3e1(0x10a)](_0x54a3e1(0x12d)+_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x135)]);if(_0x5577b5[_0x54a3e1(0x128)]['sqlCode'])_0x3f4fe5['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x111)]);if(_0x5577b5[_0x54a3e1(0x128)][_0x54a3e1(0x110)])_0x3f4fe5[_0x54a3e1(0x10a)](_0x54a3e1(0x15a)+_0x5577b5['target']['scriptName']);if(_0x5577b5[_0x54a3e1(0x131)]['length']>0x0){_0x3f4fe5[_0x54a3e1(0x10a)]('',_0x54a3e1(0x140));for(const _0xa9a9d5 of _0x5577b5[_0x54a3e1(0x131)]){_0x3f4fe5['push'](_0x54a3e1(0x117)+(_0xa9a9d5[_0x54a3e1(0x166)]||_0x54a3e1(0x161))+_0x54a3e1(0x129)+_0xa9a9d5['target']+(_0xa9a9d5[_0x54a3e1(0x16d)]?'.'+_0xa9a9d5[_0x54a3e1(0x16d)]:''));}}return _0x3f4fe5[_0x54a3e1(0x16a)]('\x0a');}function targetPreview(_0x373a54){const _0x1f2495=a60_0x4439;return{'kind':_0x373a54['kind'],'command':_0x373a54[_0x1f2495(0x152)],'appRef':_0x373a54[_0x1f2495(0x11e)],'datasetCode':_0x373a54[_0x1f2495(0x120)],'datatable':_0x373a54['datatable'],'sqlCode':_0x373a54[_0x1f2495(0x111)],'bffCode':_0x373a54[_0x1f2495(0x10b)],'bffId':_0x373a54[_0x1f2495(0x149)],'functionName':_0x373a54[_0x1f2495(0x110)]};}function normalizeScalarParams(_0x2d205c){const _0x297444=a60_0x4439;return Object[_0x297444(0x150)](Object['entries'](_0x2d205c)[_0x297444(0x104)](([,_0x12252c])=>typeof _0x12252c===_0x297444(0x133)||typeof _0x12252c===_0x297444(0x12a)));}function hasText(_0x5cdde5){const _0x5482d6=a60_0x4439;return typeof _0x5cdde5==='string'&&_0x5cdde5[_0x5482d6(0x153)]()[_0x5482d6(0x165)]>0x0;}function a60_0x4567(){const _0x4edc0b=['cliPath','`\x20to\x20inspect\x20the\x20manifest.','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','slice','startsWith','1707918oQsAnP','commands','\x20\x20MAP\x20TO','employeeId','find','\x20\x20SERVICE\x20TREE\x20TARGET','tableName','\x20completed\x20in\x20','sql','json','761638cVyCgX','bffId','envName','\x20requires\x20target.functionName.','enum','remainingArgs','map','appBindings','fromEntries','data','command','trim','\x20\x20\x20\x20datasetCode:\x20','high-risk-write','fullPath','read','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','service','\x20\x20\x20\x20functionName:\x20','kind','rawFlags','userName','\x20requires\x20target.sqlCode.','1313430sCrRYO','Service\x20command\x20','const','code','now','\x20\x20[','length','source','Unsupported\x20service\x20target\x20kind:\x20','description','args','join','appcode','dbtableConfig','operator','params','1066792etFcuf','default','Run\x20service\x20command\x20','8792syclLz','Use\x20`','filter','429GLjYxX','appCode','264230ZJgdfQ','userId','115mNORAd','push','bffCode','flatMap','nickName','normalizedManifest','Unknown\x20appRef\x20\x22','scriptName','sqlCode','\x22\x20in\x20service\x20command\x20','app','type','ctx.','required','\x20\x20\x20\x20','flags','risk','cliName','some','\x20service\x20detail\x20--service\x20','name','appRef','tree','datasetCode','3165966ZNdnlf','\x20\x20\x20\x20command:\x20','Preview\x20dynamic\x20service\x20command:\x20','env','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','boolean','7EHMlYT','target','\x20->\x20','number','tenantCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20\x20\x20\x20datatable:\x20','Commands:','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','nickname','mapTo','padEnd','string','username','datatable','2fDnzVP','validation','SERVICE_TREE'];a60_0x4567=function(){return _0x4edc0b;};return a60_0x4567();}function a60_0x4439(_0x33f0ee,_0x595ad5){_0x33f0ee=_0x33f0ee-0x104;const _0x456760=a60_0x4567();let _0x4439ea=_0x456760[_0x33f0ee];return _0x4439ea;}function isPrimitiveFlagDefault(_0x1f5caa){const _0x1a9140=a60_0x4439;return _0x1f5caa===undefined||typeof _0x1f5caa===_0x1a9140(0x133)||typeof _0x1f5caa===_0x1a9140(0x12a)||typeof _0x1f5caa===_0x1a9140(0x126);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ce978,_0x4b5480){const _0x5c13c7=a61_0xa602,_0x3dcb65=_0x4ce978();while(!![]){try{const _0x159930=parseInt(_0x5c13c7(0xac))/0x1+parseInt(_0x5c13c7(0x9a))/0x2*(-parseInt(_0x5c13c7(0xa4))/0x3)+parseInt(_0x5c13c7(0xb0))/0x4+-parseInt(_0x5c13c7(0xa6))/0x5+-parseInt(_0x5c13c7(0xaf))/0x6+-parseInt(_0x5c13c7(0xab))/0x7*(-parseInt(_0x5c13c7(0xae))/0x8)+parseInt(_0x5c13c7(0x9b))/0x9;if(_0x159930===_0x4b5480)break;else _0x3dcb65['push'](_0x3dcb65['shift']());}catch(_0x5d39b8){_0x3dcb65['push'](_0x3dcb65['shift']());}}}(a61_0x4b56,0x7bacd));function a61_0x4b56(){const _0x54061c=['commands','string','functionName','entries','$.resources','push','bff','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','isArray','.functionName','target','scriptName','4066POCzwZ','10074870eSaBZf','actions','bff.exec','.resources','call','map','prototype','].target','forEach','1002pladEW','resources','615885SWGRSR','kind','error','fromEntries','.target','1251831iKlVuV','458235yQWWFA','action','24rgcpfa','5685324TyOERI','568648AYJHlc'];a61_0x4b56=function(){return _0x54061c;};return a61_0x4b56();}export function adaptServiceTreeManifestForLegacyFramework(_0x235a02){const _0x346fcc=a61_0xa602,_0x4fb82e=cloneJsonValue(_0x235a02),_0x409623=[];if(!isObjectRecord(_0x4fb82e))return{'manifest':_0x4fb82e,'errors':_0x409623};return Array[_0x346fcc(0xb9)](_0x4fb82e[_0x346fcc(0xb1)])&&_0x4fb82e[_0x346fcc(0xb1)][_0x346fcc(0xa3)]((_0x2a4fe3,_0x156c79)=>{const _0x241cfc=_0x346fcc;if(!isObjectRecord(_0x2a4fe3))return;adaptBffTarget(_0x2a4fe3['target'],'$.commands['+_0x156c79+_0x241cfc(0xa2),_0x409623);}),adaptResources(_0x4fb82e[_0x346fcc(0xa5)],_0x346fcc(0xb5),_0x409623),{'manifest':_0x4fb82e,'errors':_0x409623};}export function toPublicServiceTreeTarget(_0x3cddaf){const _0x5297c6=a61_0xa602,{scriptName:_0x52ef04,..._0x56f639}=_0x3cddaf;return typeof _0x52ef04===_0x5297c6(0xb2)&&_0x52ef04['trim']()&&(_0x56f639[_0x5297c6(0xb3)]=_0x52ef04),_0x56f639;}export function toPublicNormalizedServiceTree(_0x140840){const _0x26094e=a61_0xa602;return{..._0x140840,'commands':_0x140840[_0x26094e(0xb1)][_0x26094e(0xa0)](_0x444688=>({..._0x444688,'target':toPublicServiceTreeTarget(_0x444688[_0x26094e(0x98)])}))};}function a61_0xa602(_0x248481,_0x3a42ef){_0x248481=_0x248481-0x98;const _0x4b5600=a61_0x4b56();let _0xa60267=_0x4b5600[_0x248481];return _0xa60267;}function adaptResources(_0x252df5,_0x26ddb6,_0x552625){const _0x2e84aa=a61_0xa602;if(!isObjectRecord(_0x252df5))return;for(const [_0x13f343,_0x27858c]of Object['entries'](_0x252df5)){if(!isObjectRecord(_0x27858c))continue;const _0x9dfba8=_0x26ddb6+'.'+_0x13f343;if(isObjectRecord(_0x27858c[_0x2e84aa(0x9c)]))for(const [_0x4c0a0a,_0x5899b5]of Object[_0x2e84aa(0xb4)](_0x27858c[_0x2e84aa(0x9c)])){if(!isObjectRecord(_0x5899b5))continue;const _0x101543=_0x9dfba8+'.actions.'+_0x4c0a0a,_0x56315f=isObjectRecord(_0x5899b5[_0x2e84aa(0x98)])&&_0x5899b5[_0x2e84aa(0x98)]['kind']==='bff';adaptBffTarget(_0x5899b5[_0x2e84aa(0x98)],_0x101543+_0x2e84aa(0xaa),_0x552625),(_0x56315f||isBffAction(_0x5899b5))&&adaptFunctionNameField(_0x5899b5,_0x101543,_0x552625);}adaptResources(_0x27858c[_0x2e84aa(0xa5)],_0x9dfba8+_0x2e84aa(0x9e),_0x552625);}}function adaptBffTarget(_0x4646ac,_0x2b2461,_0x55aac8){const _0x5203f1=a61_0xa602;if(!isObjectRecord(_0x4646ac)||_0x4646ac['kind']!==_0x5203f1(0xb7))return;adaptFunctionNameField(_0x4646ac,_0x2b2461,_0x55aac8);}function adaptFunctionNameField(_0x36ea46,_0x2bc953,_0x30aa0d){const _0x557ce3=a61_0xa602;Object['prototype']['hasOwnProperty']['call'](_0x36ea46,_0x557ce3(0x99))&&_0x30aa0d['push']({'level':_0x557ce3(0xa8),'path':_0x2bc953+'.scriptName','message':_0x557ce3(0xb8)});if(Object[_0x557ce3(0xa1)]['hasOwnProperty'][_0x557ce3(0x9f)](_0x36ea46,_0x557ce3(0xb3))){if(typeof _0x36ea46[_0x557ce3(0xb3)]!==_0x557ce3(0xb2)||!_0x36ea46[_0x557ce3(0xb3)]['trim']()){_0x30aa0d[_0x557ce3(0xb6)]({'level':_0x557ce3(0xa8),'path':_0x2bc953+_0x557ce3(0xba),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x36ea46[_0x557ce3(0xb3)];return;}_0x36ea46[_0x557ce3(0x99)]=_0x36ea46[_0x557ce3(0xb3)],delete _0x36ea46[_0x557ce3(0xb3)];}}function isBffAction(_0x3e59b4){const _0x1cf731=a61_0xa602;return _0x3e59b4[_0x1cf731(0xa7)]===_0x1cf731(0xb7)||_0x3e59b4[_0x1cf731(0xad)]===_0x1cf731(0x9d)||_0x3e59b4[_0x1cf731(0x98)]==='bff.exec';}function cloneJsonValue(_0x9ad92b){const _0x5dfa54=a61_0xa602;if(Array[_0x5dfa54(0xb9)](_0x9ad92b))return _0x9ad92b['map'](_0x16d1ed=>cloneJsonValue(_0x16d1ed));if(isObjectRecord(_0x9ad92b))return Object[_0x5dfa54(0xa9)](Object[_0x5dfa54(0xb4)](_0x9ad92b)['map'](([_0x5ee89c,_0xd1d32c])=>[_0x5ee89c,cloneJsonValue(_0xd1d32c)]));return _0x9ad92b;}function isObjectRecord(_0x5a6eca){return Boolean(_0x5a6eca)&&typeof _0x5a6eca==='object'&&!Array['isArray'](_0x5a6eca);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x49e01e=a62_0xaaa5;function a62_0x34d3(){const _0x5ab5fc=['registryIndex','map','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.','registry','updated','errors','manifests','read','replaced','service','manifest','serviceCount','entries','validate','4389912CuMCqx','target','str','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','version','Updated','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','kind','registryPath','import','Service\x20manifest\x20validation\x20passed.','24bhvbom','60MTmtHd','serviceCode','240680danucF','Service\x20Tree\x20manifest\x20file\x20path','43546GfNFlF','Local\x20service\x20not\x20found:\x20','importedAt','report','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','source','commands','Exported\x20service\x20','detail','length','824292pSVYwh','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','write','normalizedManifest','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','registryServiceCode','export','entry','string','type','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','WRITE','name','hash','\x20service(s).','176250QqbrFQ','43SKardB','reduce','remove','\x20service(s),\x20updated\x20','warnings','description','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','4311180rtqRXo','imported','cliName','3023025DttvMW','\x20service\x20','Imported','Local\x20service\x20code,\x20for\x20example\x20crm','risk','Removed\x20service\x20','required','file','filePath','list','24jofBTV'];a62_0x34d3=function(){return _0x5ab5fc;};return a62_0x34d3();}(function(_0x17921e,_0x1153df){const _0x4f4d8e=a62_0xaaa5,_0x341b44=_0x17921e();while(!![]){try{const _0x4609b7=-parseInt(_0x4f4d8e(0xc7))/0x1*(-parseInt(_0x4f4d8e(0xfa))/0x2)+-parseInt(_0x4f4d8e(0xc6))/0x3*(parseInt(_0x4f4d8e(0xdb))/0x4)+-parseInt(_0x4f4d8e(0xd1))/0x5+-parseInt(_0x4f4d8e(0xf5))/0x6*(-parseInt(_0x4f4d8e(0x106))/0x7)+parseInt(_0x4f4d8e(0xea))/0x8+-parseInt(_0x4f4d8e(0xce))/0x9+-parseInt(_0x4f4d8e(0xf6))/0xa*(-parseInt(_0x4f4d8e(0xf8))/0xb);if(_0x4609b7===_0x1153df)break;else _0x341b44['push'](_0x341b44['shift']());}catch(_0x558695){_0x341b44['push'](_0x341b44['shift']());}}}(a62_0x34d3,0x9ef95));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':a62_0x49e01e(0xd8),'type':'string','required':!![],'description':a62_0x49e01e(0xf9)},SERVICE_FLAG={'name':a62_0x49e01e(0xe5),'type':a62_0x49e01e(0xbf),'required':!![],'description':a62_0x49e01e(0xd4),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x1acda9){const _0x25ebc9=a62_0x49e01e;return{'serviceCode':_0x1acda9['serviceCode'],'name':_0x1acda9['normalizedManifest'][_0x25ebc9(0xe5)][_0x25ebc9(0xc3)],'version':_0x1acda9[_0x25ebc9(0xee)],'importedAt':_0x1acda9[_0x25ebc9(0xfc)],'source':_0x1acda9[_0x25ebc9(0x101)],'commandCount':_0x1acda9['normalizedManifest'][_0x25ebc9(0x102)][_0x25ebc9(0x105)],'commands':_0x1acda9[_0x25ebc9(0x10a)]['commands'][_0x25ebc9(0xdd)](_0x58b628=>({'path':_0x58b628['cliPath'],'description':_0x58b628[_0x25ebc9(0xcc)],'risk':_0x58b628['risk'],'target':toPublicServiceTreeTarget(_0x58b628['target']),'flags':_0x58b628['flags'][_0x25ebc9(0xdd)](_0x14bdb1=>({'name':_0x14bdb1[_0x25ebc9(0xc3)],'cliName':_0x14bdb1[_0x25ebc9(0xd0)],'type':_0x14bdb1[_0x25ebc9(0xc0)],'required':_0x14bdb1[_0x25ebc9(0xd7)]===!![]}))}))};}function a62_0xaaa5(_0x38843c,_0xf0ab31){_0x38843c=_0x38843c-0xbc;const _0x34d36d=a62_0x34d3();let _0xaaa5b5=_0x34d36d[_0x38843c];return _0xaaa5b5;}function summarizeLoadedManifest(_0x3cb8aa){const _0x5f390b=a62_0x49e01e;return{'service':_0x3cb8aa[_0x5f390b(0x10a)]?.[_0x5f390b(0xe5)],'version':_0x3cb8aa[_0x5f390b(0x10a)]?.[_0x5f390b(0xee)],'commandCount':_0x3cb8aa[_0x5f390b(0x10a)]?.[_0x5f390b(0x102)][_0x5f390b(0x105)]??0x0,'commands':_0x3cb8aa[_0x5f390b(0x10a)]?.['commands']['map'](_0x45b95=>({'path':_0x45b95['cliPath'],'risk':_0x45b95[_0x5f390b(0xd5)],'target':toPublicServiceTreeTarget(_0x45b95[_0x5f390b(0xeb)])}))??[],'registryIndex':_0x3cb8aa[_0x5f390b(0xdc)],'registryServiceCode':_0x3cb8aa[_0x5f390b(0xbc)],'errors':_0x3cb8aa[_0x5f390b(0xfd)]['errors'],'warnings':_0x3cb8aa[_0x5f390b(0xfd)][_0x5f390b(0xcb)]};}export const serviceDefinitions=[{'service':a62_0x49e01e(0xe5),'command':a62_0x49e01e(0xe9),'description':a62_0x49e01e(0xfe),'risk':a62_0x49e01e(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x13f53c){const _0xcaa28a=a62_0x49e01e,_0x3b54eb=loadServiceManifestFromFile(_0x13f53c[_0xcaa28a(0xec)](_0xcaa28a(0xd8)));if(!_0x3b54eb['report']['ok'])return{'ok':![],'data':{'file':_0x3b54eb[_0xcaa28a(0xd9)],'hash':_0x3b54eb['hash'],'kind':_0x3b54eb[_0xcaa28a(0xf1)],'serviceCount':_0x3b54eb[_0xcaa28a(0xe2)][_0xcaa28a(0x105)],'services':_0x3b54eb[_0xcaa28a(0xe2)][_0xcaa28a(0xdd)](summarizeLoadedManifest),'errors':_0x3b54eb[_0xcaa28a(0xfd)][_0xcaa28a(0xe1)],'warnings':_0x3b54eb['report'][_0xcaa28a(0xcb)]},'message':formatValidationFailure(_0x3b54eb[_0xcaa28a(0xfd)])};if(_0x3b54eb[_0xcaa28a(0xf1)]===_0xcaa28a(0xdf)||_0x3b54eb[_0xcaa28a(0xe2)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x3b54eb[_0xcaa28a(0xd9)],'hash':_0x3b54eb[_0xcaa28a(0xc4)],'kind':_0x3b54eb['kind'],'serviceCount':_0x3b54eb['manifests'][_0xcaa28a(0x105)],'commandCount':_0x3b54eb['manifests'][_0xcaa28a(0xc8)]((_0x1beccf,_0x445b00)=>_0x1beccf+(_0x445b00[_0xcaa28a(0x10a)]?.[_0xcaa28a(0x102)][_0xcaa28a(0x105)]??0x0),0x0),'services':_0x3b54eb['manifests'][_0xcaa28a(0xdd)](summarizeLoadedManifest),'warnings':_0x3b54eb[_0xcaa28a(0xfd)][_0xcaa28a(0xcb)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x3b54eb[_0xcaa28a(0xd9)],'hash':_0x3b54eb[_0xcaa28a(0xc4)],'kind':_0x3b54eb[_0xcaa28a(0xf1)],'service':_0x3b54eb[_0xcaa28a(0x10a)]?.[_0xcaa28a(0xe5)],'version':_0x3b54eb[_0xcaa28a(0x10a)]?.[_0xcaa28a(0xee)],'commandCount':_0x3b54eb[_0xcaa28a(0x10a)]?.['commands'][_0xcaa28a(0x105)]??0x0,'commands':_0x3b54eb['normalizedManifest']?.[_0xcaa28a(0x102)]['map'](_0x3fa1a8=>({'path':_0x3fa1a8['cliPath'],'risk':_0x3fa1a8[_0xcaa28a(0xd5)],'target':toPublicServiceTreeTarget(_0x3fa1a8['target'])})),'warnings':_0x3b54eb[_0xcaa28a(0xfd)][_0xcaa28a(0xcb)]},'message':_0xcaa28a(0xf4)};}},{'service':a62_0x49e01e(0xe5),'command':a62_0x49e01e(0xf3),'description':a62_0x49e01e(0x10b),'risk':a62_0x49e01e(0x109),'confirmationDescription':a62_0x49e01e(0xde),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1ba5c5){const _0x5ddd94=a62_0x49e01e,_0x43864e=loadServiceManifestFromFile(_0x1ba5c5['str'](_0x5ddd94(0xd8)));return{'method':_0x5ddd94(0xc2),'url':getServiceRegistryPath(),'body':{'file':_0x43864e[_0x5ddd94(0xd9)],'hash':_0x43864e[_0x5ddd94(0xc4)],'kind':_0x43864e['kind'],'ok':_0x43864e['report']['ok'],'service':_0x43864e[_0x5ddd94(0x10a)]?.[_0x5ddd94(0xe5)],'version':_0x43864e[_0x5ddd94(0x10a)]?.[_0x5ddd94(0xee)],'serviceCount':_0x43864e[_0x5ddd94(0xe2)][_0x5ddd94(0x105)],'services':_0x43864e['manifests']['map'](_0xca8f19=>({'service':_0xca8f19[_0x5ddd94(0x10a)]?.[_0x5ddd94(0xe5)],'version':_0xca8f19[_0x5ddd94(0x10a)]?.['version'],'commandCount':_0xca8f19[_0x5ddd94(0x10a)]?.[_0x5ddd94(0x102)][_0x5ddd94(0x105)]??0x0,'errors':_0xca8f19['report']['errors']})),'errors':_0x43864e['report'][_0x5ddd94(0xe1)],'commandCount':_0x43864e[_0x5ddd94(0x10a)]?.[_0x5ddd94(0x102)][_0x5ddd94(0x105)]??0x0},'description':_0x5ddd94(0xcd)};},async 'execute'(_0x30015c){const _0x3f3b5a=a62_0x49e01e,_0x1cccaa=importServiceManifest(_0x30015c[_0x3f3b5a(0xec)]('file'));if(_0x1cccaa[_0x3f3b5a(0xe8)][_0x3f3b5a(0x105)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1cccaa[_0x3f3b5a(0xf2)],'imported':_0x1cccaa['imported'],'updated':_0x1cccaa[_0x3f3b5a(0xe0)],'serviceCount':_0x1cccaa[_0x3f3b5a(0xe7)],'services':_0x1cccaa['entries'][_0x3f3b5a(0xdd)](summarizeService)},'message':'Imported\x20'+_0x1cccaa[_0x3f3b5a(0xcf)]+_0x3f3b5a(0xca)+_0x1cccaa['updated']+_0x3f3b5a(0xc5)};return{'ok':!![],'data':{'registryPath':_0x1cccaa['registryPath'],'replaced':_0x1cccaa[_0x3f3b5a(0xe4)],'imported':_0x1cccaa[_0x3f3b5a(0xcf)],'updated':_0x1cccaa[_0x3f3b5a(0xe0)],'serviceCount':_0x1cccaa[_0x3f3b5a(0xe7)],'service':summarizeService(_0x1cccaa[_0x3f3b5a(0xbe)])},'message':(_0x1cccaa[_0x3f3b5a(0xe4)]?_0x3f3b5a(0xef):_0x3f3b5a(0xd3))+_0x3f3b5a(0xd2)+_0x1cccaa['entry'][_0x3f3b5a(0xf7)]+'.'};}},{'service':a62_0x49e01e(0xe5),'command':a62_0x49e01e(0xbd),'description':a62_0x49e01e(0xc1),'risk':a62_0x49e01e(0x109),'confirmationDescription':'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.','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x1b7d0d){const _0x1fdef6=a62_0x49e01e,_0x4f1510=getLocalServiceEntry(_0x1b7d0d['str'](_0x1fdef6(0xe5)));return{'method':_0x1fdef6(0xc2),'url':_0x1b7d0d['str']('file'),'body':{'service':_0x1b7d0d['str'](_0x1fdef6(0xe5)),'found':Boolean(_0x4f1510),'version':_0x4f1510?.[_0x1fdef6(0xee)],'source':_0x4f1510?.['source']},'description':_0x1fdef6(0xf0)};},async 'execute'(_0x1b1999){const _0x1a141c=a62_0x49e01e,_0x30b118=exportServiceManifest(_0x1b1999['str']('service'),_0x1b1999[_0x1a141c(0xec)](_0x1a141c(0xd8)));return{'ok':!![],'data':{'registryPath':_0x30b118['registryPath'],'file':_0x30b118[_0x1a141c(0xd9)],'service':summarizeService(_0x30b118[_0x1a141c(0xbe)])},'message':_0x1a141c(0x103)+_0x30b118[_0x1a141c(0xbe)][_0x1a141c(0xf7)]+'.'};}},{'service':'service','command':a62_0x49e01e(0xda),'description':a62_0x49e01e(0xff),'risk':a62_0x49e01e(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x127da5=a62_0x49e01e,_0x19dbc1=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x19dbc1[_0x127da5(0x105)],'services':_0x19dbc1[_0x127da5(0xdd)](summarizeService)}};}},{'service':a62_0x49e01e(0xe5),'command':a62_0x49e01e(0xc9),'description':a62_0x49e01e(0x100),'risk':a62_0x49e01e(0x109),'confirmationDescription':a62_0x49e01e(0xed),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3a35a0){const _0x27f0f4=a62_0x49e01e,_0x4d1867=getLocalServiceEntry(_0x3a35a0[_0x27f0f4(0xec)](_0x27f0f4(0xe5)));return{'method':_0x27f0f4(0xc2),'url':getServiceRegistryPath(),'body':{'service':_0x3a35a0['str']('service'),'found':Boolean(_0x4d1867),'version':_0x4d1867?.[_0x27f0f4(0xee)],'source':_0x4d1867?.['source']},'description':_0x27f0f4(0x108)};},async 'execute'(_0x3c5bbf){const _0x1bca06=a62_0x49e01e,_0x32cb50=removeServiceManifest(_0x3c5bbf[_0x1bca06(0xec)](_0x1bca06(0xe5)));return{'ok':!![],'data':{'registryPath':_0x32cb50[_0x1bca06(0xf2)],'serviceCount':_0x32cb50['serviceCount'],'service':summarizeService(_0x32cb50[_0x1bca06(0xbe)])},'message':_0x1bca06(0xd6)+_0x32cb50[_0x1bca06(0xbe)][_0x1bca06(0xf7)]+'.'};}},{'service':a62_0x49e01e(0xe5),'command':a62_0x49e01e(0x104),'description':a62_0x49e01e(0x107),'risk':a62_0x49e01e(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x173c91){const _0x43c7a2=a62_0x49e01e,_0x50f793=getLocalServiceEntry(_0x173c91[_0x43c7a2(0xec)]('service'));if(!_0x50f793)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x173c91[_0x43c7a2(0xec)]('service')},'message':_0x43c7a2(0xfb)+_0x173c91[_0x43c7a2(0xec)](_0x43c7a2(0xe5))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x50f793),'manifest':_0x50f793[_0x43c7a2(0xe6)],'normalizedManifest':toPublicNormalizedServiceTree(_0x50f793['normalizedManifest'])}};}}];
|
|
1
|
+
const a62_0x63ec0=a62_0x5eb3;function a62_0x5eb3(_0x1ff043,_0x40d282){_0x1ff043=_0x1ff043-0x120;const _0x3bbc6a=a62_0x3bbc();let _0x5eb383=_0x3bbc6a[_0x1ff043];return _0x5eb383;}(function(_0x19b672,_0x10c2ca){const _0x102b2c=a62_0x5eb3,_0x142d97=_0x19b672();while(!![]){try{const _0x2040dc=-parseInt(_0x102b2c(0x130))/0x1*(-parseInt(_0x102b2c(0x156))/0x2)+parseInt(_0x102b2c(0x154))/0x3*(parseInt(_0x102b2c(0x12f))/0x4)+parseInt(_0x102b2c(0x149))/0x5+parseInt(_0x102b2c(0x14d))/0x6+parseInt(_0x102b2c(0x123))/0x7+-parseInt(_0x102b2c(0x15c))/0x8+-parseInt(_0x102b2c(0x121))/0x9;if(_0x2040dc===_0x10c2ca)break;else _0x142d97['push'](_0x142d97['shift']());}catch(_0x2c455a){_0x142d97['push'](_0x142d97['shift']());}}}(a62_0x3bbc,0x2e2a8));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':a62_0x63ec0(0x157),'type':a62_0x63ec0(0x12d),'required':!![],'description':a62_0x63ec0(0x165)},SERVICE_FLAG={'name':a62_0x63ec0(0x14b),'type':'string','required':!![],'description':a62_0x63ec0(0x14a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x63ec0(0x15f)}};function summarizeService(_0x4ae76c){const _0x4b66b4=a62_0x63ec0;return{'serviceCode':_0x4ae76c['serviceCode'],'name':_0x4ae76c[_0x4b66b4(0x14e)][_0x4b66b4(0x14b)][_0x4b66b4(0x161)],'version':_0x4ae76c[_0x4b66b4(0x12b)],'importedAt':_0x4ae76c[_0x4b66b4(0x128)],'source':_0x4ae76c[_0x4b66b4(0x124)],'commandCount':_0x4ae76c[_0x4b66b4(0x14e)][_0x4b66b4(0x13e)][_0x4b66b4(0x153)],'commands':_0x4ae76c[_0x4b66b4(0x14e)][_0x4b66b4(0x13e)][_0x4b66b4(0x131)](_0x5213d3=>({'path':_0x5213d3[_0x4b66b4(0x155)],'description':_0x5213d3['description'],'risk':_0x5213d3[_0x4b66b4(0x15d)],'target':toPublicServiceTreeTarget(_0x5213d3[_0x4b66b4(0x143)]),'flags':_0x5213d3[_0x4b66b4(0x142)][_0x4b66b4(0x131)](_0x24f87b=>({'name':_0x24f87b[_0x4b66b4(0x161)],'cliName':_0x24f87b[_0x4b66b4(0x164)],'type':_0x24f87b['type'],'required':_0x24f87b['required']===!![]}))}))};}function summarizeLoadedManifest(_0x558f25){const _0xd48134=a62_0x63ec0;return{'service':_0x558f25[_0xd48134(0x14e)]?.['service'],'version':_0x558f25[_0xd48134(0x14e)]?.['version'],'commandCount':_0x558f25[_0xd48134(0x14e)]?.[_0xd48134(0x13e)]['length']??0x0,'commands':_0x558f25['normalizedManifest']?.[_0xd48134(0x13e)][_0xd48134(0x131)](_0x20633c=>({'path':_0x20633c['cliPath'],'risk':_0x20633c[_0xd48134(0x15d)],'target':toPublicServiceTreeTarget(_0x20633c[_0xd48134(0x143)])}))??[],'registryIndex':_0x558f25[_0xd48134(0x14f)],'registryServiceCode':_0x558f25[_0xd48134(0x160)],'errors':_0x558f25[_0xd48134(0x137)][_0xd48134(0x145)],'warnings':_0x558f25[_0xd48134(0x137)]['warnings']};}export const serviceDefinitions=[{'service':a62_0x63ec0(0x14b),'command':a62_0x63ec0(0x134),'description':a62_0x63ec0(0x140),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x62a3ab){const _0x536536=a62_0x63ec0,_0x365152=loadServiceManifestFromFile(_0x62a3ab[_0x536536(0x158)](_0x536536(0x157)));if(!_0x365152[_0x536536(0x137)]['ok'])return{'ok':![],'data':{'file':_0x365152[_0x536536(0x15e)],'hash':_0x365152['hash'],'kind':_0x365152[_0x536536(0x132)],'serviceCount':_0x365152['manifests'][_0x536536(0x153)],'services':_0x365152['manifests'][_0x536536(0x131)](summarizeLoadedManifest),'errors':_0x365152[_0x536536(0x137)][_0x536536(0x145)],'warnings':_0x365152[_0x536536(0x137)][_0x536536(0x141)]},'message':formatValidationFailure(_0x365152[_0x536536(0x137)])};if(_0x365152['kind']===_0x536536(0x163)||_0x365152[_0x536536(0x120)][_0x536536(0x153)]!==0x1)return{'ok':!![],'data':{'file':_0x365152[_0x536536(0x15e)],'hash':_0x365152['hash'],'kind':_0x365152['kind'],'serviceCount':_0x365152[_0x536536(0x120)][_0x536536(0x153)],'commandCount':_0x365152[_0x536536(0x120)][_0x536536(0x136)]((_0x31dfd0,_0x113216)=>_0x31dfd0+(_0x113216[_0x536536(0x14e)]?.[_0x536536(0x13e)]['length']??0x0),0x0),'services':_0x365152[_0x536536(0x120)][_0x536536(0x131)](summarizeLoadedManifest),'warnings':_0x365152['report'][_0x536536(0x141)]},'message':_0x536536(0x122)};return{'ok':!![],'data':{'file':_0x365152[_0x536536(0x15e)],'hash':_0x365152[_0x536536(0x150)],'kind':_0x365152[_0x536536(0x132)],'service':_0x365152[_0x536536(0x14e)]?.[_0x536536(0x14b)],'version':_0x365152[_0x536536(0x14e)]?.['version'],'commandCount':_0x365152['normalizedManifest']?.[_0x536536(0x13e)]['length']??0x0,'commands':_0x365152[_0x536536(0x14e)]?.[_0x536536(0x13e)]['map'](_0x539529=>({'path':_0x539529[_0x536536(0x155)],'risk':_0x539529[_0x536536(0x15d)],'target':toPublicServiceTreeTarget(_0x539529['target'])})),'warnings':_0x365152[_0x536536(0x137)][_0x536536(0x141)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a62_0x63ec0(0x14b),'command':a62_0x63ec0(0x146),'description':a62_0x63ec0(0x166),'risk':'write','confirmationDescription':a62_0x63ec0(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x39a015){const _0x4def23=a62_0x63ec0,_0x4cc3b5=loadServiceManifestFromFile(_0x39a015['str']('file'));return{'method':_0x4def23(0x135),'url':getServiceRegistryPath(),'body':{'file':_0x4cc3b5[_0x4def23(0x15e)],'hash':_0x4cc3b5[_0x4def23(0x150)],'kind':_0x4cc3b5[_0x4def23(0x132)],'ok':_0x4cc3b5[_0x4def23(0x137)]['ok'],'service':_0x4cc3b5[_0x4def23(0x14e)]?.[_0x4def23(0x14b)],'version':_0x4cc3b5['normalizedManifest']?.[_0x4def23(0x12b)],'serviceCount':_0x4cc3b5['manifests'][_0x4def23(0x153)],'services':_0x4cc3b5[_0x4def23(0x120)][_0x4def23(0x131)](_0x1e9667=>({'service':_0x1e9667['normalizedManifest']?.['service'],'version':_0x1e9667['normalizedManifest']?.['version'],'commandCount':_0x1e9667[_0x4def23(0x14e)]?.[_0x4def23(0x13e)][_0x4def23(0x153)]??0x0,'errors':_0x1e9667[_0x4def23(0x137)][_0x4def23(0x145)]})),'errors':_0x4cc3b5[_0x4def23(0x137)][_0x4def23(0x145)],'commandCount':_0x4cc3b5[_0x4def23(0x14e)]?.[_0x4def23(0x13e)][_0x4def23(0x153)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x4af084){const _0x1de25a=a62_0x63ec0,_0x4593f0=importServiceManifest(_0x4af084['str'](_0x1de25a(0x157)));if(_0x4593f0['entries'][_0x1de25a(0x153)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4593f0[_0x1de25a(0x15b)],'imported':_0x4593f0['imported'],'updated':_0x4593f0[_0x1de25a(0x13f)],'serviceCount':_0x4593f0[_0x1de25a(0x13a)],'services':_0x4593f0[_0x1de25a(0x15a)]['map'](summarizeService)},'message':_0x1de25a(0x12a)+_0x4593f0[_0x1de25a(0x138)]+'\x20service(s),\x20updated\x20'+_0x4593f0[_0x1de25a(0x13f)]+_0x1de25a(0x13c)};return{'ok':!![],'data':{'registryPath':_0x4593f0[_0x1de25a(0x15b)],'replaced':_0x4593f0[_0x1de25a(0x133)],'imported':_0x4593f0[_0x1de25a(0x138)],'updated':_0x4593f0[_0x1de25a(0x13f)],'serviceCount':_0x4593f0['serviceCount'],'service':summarizeService(_0x4593f0['entry'])},'message':(_0x4593f0[_0x1de25a(0x133)]?'Updated':_0x1de25a(0x125))+_0x1de25a(0x152)+_0x4593f0['entry']['serviceCode']+'.'};}},{'service':a62_0x63ec0(0x14b),'command':a62_0x63ec0(0x151),'description':'Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a62_0x63ec0(0x159),'confirmationDescription':'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.','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x774c1e){const _0x1ec636=a62_0x63ec0,_0x41935e=getLocalServiceEntry(_0x774c1e['str']('service'));return{'method':_0x1ec636(0x135),'url':_0x774c1e['str'](_0x1ec636(0x157)),'body':{'service':_0x774c1e[_0x1ec636(0x158)](_0x1ec636(0x14b)),'found':Boolean(_0x41935e),'version':_0x41935e?.[_0x1ec636(0x12b)],'source':_0x41935e?.[_0x1ec636(0x124)]},'description':_0x1ec636(0x12c)};},async 'execute'(_0x52fc9f){const _0x9c1e91=a62_0x63ec0,_0x5afb55=exportServiceManifest(_0x52fc9f[_0x9c1e91(0x158)](_0x9c1e91(0x14b)),_0x52fc9f[_0x9c1e91(0x158)](_0x9c1e91(0x157)));return{'ok':!![],'data':{'registryPath':_0x5afb55[_0x9c1e91(0x15b)],'file':_0x5afb55[_0x9c1e91(0x15e)],'service':summarizeService(_0x5afb55[_0x9c1e91(0x127)])},'message':_0x9c1e91(0x13d)+_0x5afb55[_0x9c1e91(0x127)]['serviceCode']+'.'};}},{'service':'service','command':a62_0x63ec0(0x139),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a62_0x63ec0(0x13b),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x459747=a62_0x63ec0,_0x31d6ed=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x31d6ed[_0x459747(0x153)],'services':_0x31d6ed[_0x459747(0x131)](summarizeService)}};}},{'service':'service','command':a62_0x63ec0(0x144),'description':'Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','risk':a62_0x63ec0(0x159),'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'(_0x5cf143){const _0x562ad7=a62_0x63ec0,_0x16651c=getLocalServiceEntry(_0x5cf143[_0x562ad7(0x158)](_0x562ad7(0x14b)));return{'method':_0x562ad7(0x135),'url':getServiceRegistryPath(),'body':{'service':_0x5cf143['str'](_0x562ad7(0x14b)),'found':Boolean(_0x16651c),'version':_0x16651c?.['version'],'source':_0x16651c?.[_0x562ad7(0x124)]},'description':_0x562ad7(0x129)};},async 'execute'(_0x382d5b){const _0x1e8c57=a62_0x63ec0,_0x564434=removeServiceManifest(_0x382d5b['str'](_0x1e8c57(0x14b)));return{'ok':!![],'data':{'registryPath':_0x564434['registryPath'],'serviceCount':_0x564434[_0x1e8c57(0x13a)],'service':summarizeService(_0x564434['entry'])},'message':'Removed\x20service\x20'+_0x564434['entry'][_0x1e8c57(0x126)]+'.'};}},{'service':a62_0x63ec0(0x14b),'command':a62_0x63ec0(0x14c),'description':a62_0x63ec0(0x12e),'risk':a62_0x63ec0(0x13b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x38e4b7){const _0x894a7d=a62_0x63ec0,_0x567881=getLocalServiceEntry(_0x38e4b7[_0x894a7d(0x158)](_0x894a7d(0x14b)));if(!_0x567881)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x38e4b7['str'](_0x894a7d(0x14b))},'message':_0x894a7d(0x162)+_0x38e4b7[_0x894a7d(0x158)](_0x894a7d(0x14b))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x567881),'manifest':_0x567881[_0x894a7d(0x148)],'normalizedManifest':toPublicNormalizedServiceTree(_0x567881['normalizedManifest'])}};}}];function a62_0x3bbc(){const _0x475ea5=['Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Imported\x20','version','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','string','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','116JFHlTh','5fqzMPl','map','kind','replaced','validate','WRITE','reduce','report','imported','list','serviceCount','read','\x20service(s).','Exported\x20service\x20','commands','updated','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','warnings','flags','target','remove','errors','import','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.','manifest','329285ltJgwJ','Local\x20service\x20code,\x20for\x20example\x20crm','service','detail','458706OBeOpJ','normalizedManifest','registryIndex','hash','export','\x20service\x20','length','33519xvwNhT','cliPath','116806lAbOVD','file','str','write','entries','registryPath','2545752PBwyat','risk','filePath','lower\x20kebab-case\x20service\x20code','registryServiceCode','name','Local\x20service\x20not\x20found:\x20','registry','cliName','Service\x20Tree\x20manifest\x20file\x20path','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','manifests','3409713PPpwMo','Service\x20registry\x20validation\x20passed.','894824NttCYf','source','Imported','serviceCode','entry','importedAt'];a62_0x3bbc=function(){return _0x475ea5;};return a62_0x3bbc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xcee1cf,_0x209672){const _0xab134=a63_0x1dd3,_0x50e572=_0xcee1cf();while(!![]){try{const _0x2407ad=-parseInt(_0xab134(0xf8))/0x1+parseInt(_0xab134(0xe9))/0x2+-parseInt(_0xab134(0x111))/0x3*(parseInt(_0xab134(0xdd))/0x4)+parseInt(_0xab134(0xee))/0x5*(-parseInt(_0xab134(0xdc))/0x6)+parseInt(_0xab134(0x114))/0x7*(parseInt(_0xab134(0x105))/0x8)+parseInt(_0xab134(0x10e))/0x9*(parseInt(_0xab134(0xd8))/0xa)+parseInt(_0xab134(0x10a))/0xb*(parseInt(_0xab134(0xfb))/0xc);if(_0x2407ad===_0x209672)break;else _0x50e572['push'](_0x50e572['shift']());}catch(_0x4406f0){_0x50e572['push'](_0x50e572['shift']());}}}(a63_0x4c78,0xec18f));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 a63_0x4c78(){const _0x304363=['25rpYRlf','Local\x20service\x20not\x20found:\x20','empty','trim','startsWith','length','CliError','].manifest','Unsupported\x20service\x20registry\x20schemaVersion:\x20','cliPath','1141755fSeuMU','path','description','24EweMBD','findIndex','slice','sort','stringify','reduce','message','homeDirName','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','6907144EfBEbM','normalizedManifest','string','service','name','1334509HKBEXU','utf8','parse','push','567mHEhCm','digest','code','2316HzMuXe','$.services[','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','7XYHzcT','find','services','invalid','object','validation','serviceCode','isArray','splice','update','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Service\x20manifest\x20validation\x20failed:\x0a','Service\x20manifest\x20file\x20not\x20found:\x20','Invalid\x20service\x20registry\x20JSON:\x20','report','map','missing','259660Ndndaf','flatMap','homeDir','version','168408dScyXM','5288EpYdKy','Remove\x20or\x20migrate\x20','updatedAt','errors','now','kind','toISOString','source','manifest','schemaVersion','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','1055690cOtZGk','commandCount','target','registryIndex','manifests'];a63_0x4c78=function(){return _0x304363;};return a63_0x4c78();}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 a63_0x1dd3(_0x5556a3,_0xdbee6b){_0x5556a3=_0x5556a3-0xcd;const _0x4c78df=a63_0x4c78();let _0x1dd39e=_0x4c78df[_0x5556a3];return _0x1dd39e;}export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0xc62a0b={}){const _0x35a767=a63_0x1dd3;return resolve(_0xc62a0b[_0x35a767(0xda)]??homedir(),PRODUCT_CONFIG[_0x35a767(0x102)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x16cbf5={}){const _0x54ed99=a63_0x1dd3,_0x281a1b=getServiceRegistryPath(_0x16cbf5);if(!existsSync(_0x281a1b))return emptyServiceRegistry();try{const _0x53eba8=readFileSync(_0x281a1b,_0x54ed99(0x10b));if(!_0x53eba8[_0x54ed99(0xf1)]())return emptyServiceRegistry();const _0x472683=JSON[_0x54ed99(0x10c)](_0x53eba8);if(_0x472683[_0x54ed99(0xe6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x54ed99(0xf6)+String(_0x472683['schemaVersion']),_0x54ed99(0xde)+_0x281a1b+'.');if(!Array[_0x54ed99(0xce)](_0x472683['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x472683[_0x54ed99(0xdf)],'services':_0x472683[_0x54ed99(0x116)]};}catch(_0x14cc71){if(_0x14cc71 instanceof Error&&_0x14cc71[_0x54ed99(0x109)]===_0x54ed99(0xf4))throw _0x14cc71;throw CliErrors[_0x54ed99(0x119)](_0x54ed99(0xd4)+_0x281a1b,_0x54ed99(0xd1));}}export function writeServiceRegistry(_0x58ade4,_0x4d1e9d={}){const _0x51bcb3=a63_0x1dd3,_0x541a3b=getServiceRegistryPath(_0x4d1e9d),_0x1593ee=dirname(_0x541a3b);!existsSync(_0x1593ee)&&mkdirSync(_0x1593ee,{'recursive':!![]});const _0x2b8d01=_0x541a3b+'.tmp';try{writeFileSync(_0x2b8d01,JSON['stringify'](_0x58ade4,null,0x2)+'\x0a',{'encoding':_0x51bcb3(0x10b),'mode':0x180}),renameSync(_0x2b8d01,_0x541a3b);}catch(_0xa06f58){try{unlinkSync(_0x2b8d01);}catch{}if(_0xa06f58?.['code']==='ENOENT')throw CliErrors[_0x51bcb3(0x119)]('Cannot\x20write\x20service\x20registry:\x20'+_0x541a3b);throw _0xa06f58;}return _0x541a3b;}export function loadServiceManifestFromFile(_0x292542){const _0x48f0cc=a63_0x1dd3,_0x408e2e=resolve(_0x292542);if(!existsSync(_0x408e2e))throw CliErrors['validation'](_0x48f0cc(0xd3)+_0x292542);let _0x585021;const _0x406614=readFileSync(_0x408e2e,_0x48f0cc(0x10b));try{_0x585021=JSON[_0x48f0cc(0x10c)](_0x406614);}catch{throw CliErrors[_0x48f0cc(0x119)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x292542,_0x48f0cc(0x103));}const _0x7c4fe4=sha256(_0x406614),_0x20910a=extractLoadedServiceManifests(_0x585021,_0x7c4fe4),_0x10df4a=aggregateValidationReports(_0x20910a),_0x5e72a8=_0x20910a[0x0];return{'filePath':_0x408e2e,'hash':_0x7c4fe4,'kind':isServiceRegistryLike(_0x585021)?'registry':'manifest','manifest':_0x5e72a8?.[_0x48f0cc(0xe5)]??_0x585021,'report':_0x10df4a,'normalizedManifest':_0x20910a[_0x48f0cc(0xf3)]===0x1?_0x5e72a8?.['normalizedManifest']:undefined,'manifests':_0x20910a};}export function importServiceManifest(_0x1a492e,_0x33c35c={}){const _0x29e300=a63_0x1dd3,_0xe602f1=loadServiceManifestFromFile(_0x1a492e);if(!_0xe602f1[_0x29e300(0xd5)]['ok'])throw CliErrors[_0x29e300(0x119)](formatValidationFailure(_0xe602f1['report']),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0xe602f1[_0x29e300(0xed)][_0x29e300(0xf3)]===0x0)throw CliErrors['validation'](_0x29e300(0xe7),_0x29e300(0x113));const _0x36f186=readServiceRegistry(_0x33c35c),_0x1357ed=(_0x33c35c[_0x29e300(0xe1)]??(()=>new Date()))()['toISOString'](),_0x33df05=[];let _0x438658=0x0,_0x4f33a9=0x0;for(const _0x3ad0ca of _0xe602f1[_0x29e300(0xed)]){if(!_0x3ad0ca[_0x29e300(0x106)])continue;const _0x3ff77f=_0x3ad0ca['normalizedManifest']['service'][_0x29e300(0x110)],_0xbe868c={'serviceCode':_0x3ff77f,'version':_0x3ad0ca['normalizedManifest']['version'],'importedAt':_0x1357ed,'source':{'type':'file','path':_0xe602f1['filePath'],'hash':_0x3ad0ca['sourceHash']},'manifest':_0x3ad0ca[_0x29e300(0xe5)],'normalizedManifest':_0x3ad0ca['normalizedManifest']},_0x565542=_0x36f186[_0x29e300(0x116)][_0x29e300(0xfc)](_0x40a1d8=>_0x40a1d8['serviceCode']===_0x3ff77f);_0x565542>=0x0?(_0x36f186[_0x29e300(0x116)][_0x565542]=_0xbe868c,_0x4f33a9++):(_0x36f186['services'][_0x29e300(0x10d)](_0xbe868c),_0x438658++),_0x33df05[_0x29e300(0x10d)](_0xbe868c);}_0x36f186[_0x29e300(0x116)][_0x29e300(0xfe)]((_0x2c0388,_0x2cd419)=>_0x2c0388[_0x29e300(0xcd)]['localeCompare'](_0x2cd419[_0x29e300(0xcd)])),_0x36f186[_0x29e300(0xdf)]=_0x1357ed;const _0x4d178c=writeServiceRegistry(_0x36f186,_0x33c35c);return{'registryPath':_0x4d178c,'entry':_0x33df05[0x0],'replaced':_0x33df05['length']===0x1?_0x4f33a9===0x1:_0x4f33a9>0x0,'entries':_0x33df05,'imported':_0x438658,'updated':_0x4f33a9,'serviceCount':_0x36f186['services'][_0x29e300(0xf3)]};}export function exportServiceManifest(_0x5b0b4e,_0x566343,_0x4780d0={}){const _0x46801d=a63_0x1dd3,_0x19423a=getServiceRegistryPath(_0x4780d0),_0x14e910=getLocalServiceEntry(_0x5b0b4e,_0x4780d0);if(!_0x14e910)throw CliErrors[_0x46801d(0x119)](_0x46801d(0xef)+_0x5b0b4e,_0x46801d(0x104));const _0x4e7224=resolve(_0x566343),_0x4b2fa7=dirname(_0x4e7224);return!existsSync(_0x4b2fa7)&&mkdirSync(_0x4b2fa7,{'recursive':!![]}),writeFileSync(_0x4e7224,JSON[_0x46801d(0xff)](_0x14e910[_0x46801d(0xe5)],null,0x2)+'\x0a',{'encoding':_0x46801d(0x10b),'mode':0x180}),{'registryPath':_0x19423a,'filePath':_0x4e7224,'entry':_0x14e910};}export function removeServiceManifest(_0x5085fd,_0x162499={}){const _0x3e47f4=a63_0x1dd3,_0x1a401a=readServiceRegistry(_0x162499),_0x4bc3b7=_0x5085fd['trim'](),_0x1d5366=_0x1a401a['services']['findIndex'](_0x26c130=>_0x26c130[_0x3e47f4(0xcd)]===_0x4bc3b7);if(_0x1d5366<0x0)throw CliErrors[_0x3e47f4(0x119)](_0x3e47f4(0xef)+_0x4bc3b7,_0x3e47f4(0x104));const [_0x5e626a]=_0x1a401a[_0x3e47f4(0x116)][_0x3e47f4(0xcf)](_0x1d5366,0x1),_0x5d99d6=(_0x162499[_0x3e47f4(0xe1)]??(()=>new Date()))()[_0x3e47f4(0xe3)]();_0x1a401a[_0x3e47f4(0xdf)]=_0x5d99d6;const _0xe5f209=writeServiceRegistry(_0x1a401a,_0x162499);return{'registryPath':_0xe5f209,'entry':_0x5e626a,'serviceCount':_0x1a401a['services']['length']};}export function listLocalServices(_0x278eee={}){const _0xf608ca=a63_0x1dd3;return readServiceRegistry(_0x278eee)[_0xf608ca(0x116)];}export function getLocalServiceEntry(_0x146adf,_0x102dcf={}){const _0x122da5=a63_0x1dd3;return readServiceRegistry(_0x102dcf)[_0x122da5(0x116)][_0x122da5(0x115)](_0x73b5f2=>_0x73b5f2[_0x122da5(0xcd)]===_0x146adf[_0x122da5(0xf1)]());}export function listLocalServiceTrees(_0xe90520={}){const _0x5de59a=a63_0x1dd3;return readServiceRegistry(_0xe90520)[_0x5de59a(0x116)][_0x5de59a(0xd6)](_0x5efe1d=>_0x5efe1d[_0x5de59a(0x106)]);}export function inspectServiceRegistry(_0x54ba3d={}){const _0x4dccec=a63_0x1dd3,_0x379048=getServiceRegistryPath(_0x54ba3d);if(!existsSync(_0x379048))return emptyServiceRegistryInspection(_0x379048,_0x4dccec(0xd7),![]);try{const _0x3c1087=readFileSync(_0x379048,_0x4dccec(0x10b));if(!_0x3c1087[_0x4dccec(0xf1)]())return emptyServiceRegistryInspection(_0x379048,_0x4dccec(0xf0),!![]);const _0x2df91c=JSON['parse'](_0x3c1087);if(_0x2df91c[_0x4dccec(0xe6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x379048,_0x4dccec(0x117),!![]),'schemaVersion':_0x2df91c[_0x4dccec(0xe6)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x2df91c['schemaVersion'])};if(!Array[_0x4dccec(0xce)](_0x2df91c[_0x4dccec(0x116)]))return{...emptyServiceRegistryInspection(_0x379048,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2df91c['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x3c372d=_0x2df91c['services'][_0x4dccec(0xd6)](summarizeLocalServiceEntry);return{'registryPath':_0x379048,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2df91c[_0x4dccec(0xdf)],'serviceCount':_0x3c372d['length'],'commandCount':_0x3c372d[_0x4dccec(0x100)]((_0x4da529,_0x2d4b92)=>_0x4da529+_0x2d4b92[_0x4dccec(0xea)],0x0),'services':_0x3c372d};}catch(_0x501e2a){return{...emptyServiceRegistryInspection(_0x379048,'invalid',!![]),'message':_0x501e2a instanceof Error?_0x501e2a[_0x4dccec(0x101)]:String(_0x501e2a)};}}export function formatValidationFailure(_0x462e44){const _0x500728=a63_0x1dd3,_0x2bee7a=_0x462e44['errors'][_0x500728(0xd6)](_0x390e81=>_0x390e81[_0x500728(0xf9)]+':\x20'+_0x390e81[_0x500728(0x101)]);return _0x500728(0xd2)+_0x2bee7a['join']('\x0a');}function extractLoadedServiceManifests(_0x25846b,_0xdfc14a){const _0x526bff=a63_0x1dd3;if(!isServiceRegistryLike(_0x25846b)){const _0x51caa7=_0x25846b,{manifest:_0x18bb0d,errors:_0x26cab5}=adaptServiceTreeManifestForLegacyFramework(_0x51caa7),_0x5696e0=validateServiceTreeManifest(_0x18bb0d),_0x2990ef=mergeValidationErrors(_0x5696e0,_0x26cab5);return[{'manifest':_0x51caa7,'report':_0x2990ef,'normalizedManifest':_0x2990ef['ok']?normalizeServiceTreeManifest(_0x18bb0d):undefined,'sourceHash':_0xdfc14a}];}return _0x25846b[_0x526bff(0x116)]['map']((_0x48d99c,_0x5dac6f)=>{const _0x264e2f=_0x526bff,_0xc71b7a=isObjectRecord(_0x48d99c)?_0x48d99c[_0x264e2f(0xe5)]:undefined,{manifest:_0x3243de,errors:_0x51271e}=adaptServiceTreeManifestForLegacyFramework(_0xc71b7a),_0x2aeb09=validateServiceTreeManifest(_0x3243de),_0xdbd27c=mergeValidationErrors(_0x2aeb09,_0x51271e),_0x68ccc=isObjectRecord(_0x48d99c)&&typeof _0x48d99c[_0x264e2f(0xcd)]===_0x264e2f(0x107)?_0x48d99c[_0x264e2f(0xcd)]:undefined;return{'manifest':_0xc71b7a,'report':_0xdbd27c,'normalizedManifest':_0xdbd27c['ok']?normalizeServiceTreeManifest(_0x3243de):undefined,'sourceHash':sha256(JSON[_0x264e2f(0xff)](_0xc71b7a,null,0x2)+'\x0a'),'registryIndex':_0x5dac6f,'registryServiceCode':_0x68ccc};});}function mergeValidationErrors(_0x12e252,_0x10c168){const _0x24c702=a63_0x1dd3,_0x27e7e4=_0x12e252[_0x24c702(0xe0)]['map'](_0x4ab168=>_0x4ab168[_0x24c702(0x101)]===_0x24c702(0xe8)?{..._0x4ab168,'message':'bff\x20target\x20requires\x20functionName.'}:_0x4ab168),_0x125f64=[..._0x10c168,..._0x27e7e4];return{'ok':_0x125f64['length']===0x0,'errors':_0x125f64,'warnings':_0x12e252['warnings']};}function aggregateValidationReports(_0x4436d1){const _0x5f1ddf=a63_0x1dd3,_0xe6690b=_0x4436d1['flatMap'](_0x331db8=>_0x331db8[_0x5f1ddf(0xec)]===undefined?_0x331db8['report'][_0x5f1ddf(0xe0)]:_0x331db8['report'][_0x5f1ddf(0xe0)][_0x5f1ddf(0xd6)](_0x555595=>({..._0x555595,'path':prefixRegistryIssuePath(_0x331db8['registryIndex'],_0x555595[_0x5f1ddf(0xf9)])}))),_0x291a2d=_0x4436d1[_0x5f1ddf(0xd9)](_0x101ec6=>_0x101ec6[_0x5f1ddf(0xec)]===undefined?_0x101ec6[_0x5f1ddf(0xd5)]['warnings']:_0x101ec6[_0x5f1ddf(0xd5)]['warnings'][_0x5f1ddf(0xd6)](_0x30e350=>({..._0x30e350,'path':prefixRegistryIssuePath(_0x101ec6[_0x5f1ddf(0xec)],_0x30e350[_0x5f1ddf(0xf9)])})));return{'ok':_0xe6690b[_0x5f1ddf(0xf3)]===0x0,'errors':_0xe6690b,'warnings':_0x291a2d};}function prefixRegistryIssuePath(_0x563298,_0x528bdc){const _0x3c940c=a63_0x1dd3;if(_0x528bdc==='$')return _0x3c940c(0x112)+_0x563298+_0x3c940c(0xf5);if(_0x528bdc['startsWith']('$.'))return'$.services['+_0x563298+_0x3c940c(0xf5)+_0x528bdc[_0x3c940c(0xfd)](0x1);if(_0x528bdc[_0x3c940c(0xf2)]('$['))return _0x3c940c(0x112)+_0x563298+_0x3c940c(0xf5)+_0x528bdc[_0x3c940c(0xfd)](0x1);return'$.services['+_0x563298+'].manifest.'+_0x528bdc;}function isServiceRegistryLike(_0x549fcf){const _0x18aab5=a63_0x1dd3;return isObjectRecord(_0x549fcf)&&_0x549fcf['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x18aab5(0xce)](_0x549fcf[_0x18aab5(0x116)]);}function isObjectRecord(_0x9fbdc5){const _0x31a2b3=a63_0x1dd3;return Boolean(_0x9fbdc5)&&typeof _0x9fbdc5===_0x31a2b3(0x118)&&!Array[_0x31a2b3(0xce)](_0x9fbdc5);}function emptyServiceRegistryInspection(_0x44a51f,_0x3fb250,_0x134a76){return{'registryPath':_0x44a51f,'exists':_0x134a76,'status':_0x3fb250,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x30a9d7){const _0x2c6566=a63_0x1dd3,_0x572d62=_0x30a9d7[_0x2c6566(0x106)],_0x5c2c28=_0x572d62['commands'][_0x2c6566(0xd6)](_0x69e054=>({'path':_0x69e054[_0x2c6566(0xf7)],'description':_0x69e054[_0x2c6566(0xfa)],'risk':_0x69e054['risk'],'targetKind':_0x69e054[_0x2c6566(0xeb)][_0x2c6566(0xe2)],'targetCommand':_0x69e054[_0x2c6566(0xeb)]['command']}));return{'serviceCode':_0x30a9d7[_0x2c6566(0xcd)],'name':_0x572d62['service'][_0x2c6566(0x109)],'description':_0x572d62[_0x2c6566(0x108)][_0x2c6566(0xfa)],'version':_0x30a9d7[_0x2c6566(0xdb)],'importedAt':_0x30a9d7['importedAt'],'source':_0x30a9d7[_0x2c6566(0xe4)],'commandCount':_0x5c2c28['length'],'commands':_0x5c2c28};}function sha256(_0x2c5bc4){const _0x48bf50=a63_0x1dd3;return createHash('sha256')[_0x48bf50(0xd0)](_0x2c5bc4)[_0x48bf50(0x10f)]('hex');}
|
|
1
|
+
const a63_0x4b0ef9=a63_0x28dd;(function(_0x1d5bd1,_0x136924){const _0x3de752=a63_0x28dd,_0x47c959=_0x1d5bd1();while(!![]){try{const _0x6032a8=-parseInt(_0x3de752(0x1ff))/0x1+-parseInt(_0x3de752(0x1f7))/0x2+-parseInt(_0x3de752(0x1e8))/0x3*(-parseInt(_0x3de752(0x1de))/0x4)+parseInt(_0x3de752(0x208))/0x5+parseInt(_0x3de752(0x1df))/0x6*(-parseInt(_0x3de752(0x213))/0x7)+-parseInt(_0x3de752(0x1e5))/0x8*(-parseInt(_0x3de752(0x21c))/0x9)+-parseInt(_0x3de752(0x224))/0xa;if(_0x6032a8===_0x136924)break;else _0x47c959['push'](_0x47c959['shift']());}catch(_0x4b501f){_0x47c959['push'](_0x47c959['shift']());}}}(a63_0x3f07,0x51dfb));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a63_0x28dd(_0x1675e1,_0x2a039e){_0x1675e1=_0x1675e1-0x1d5;const _0x3f0790=a63_0x3f07();let _0x28dd7e=_0x3f0790[_0x1675e1];return _0x28dd7e;}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 a63_0x3f07(){const _0x58ddc7=['normalizedManifest','commands','command','isArray','report','104293WbTlYH','invalid','reduce','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','.tmp','service.json','join','cliPath','utf8','2464940PnszYY','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','].manifest','manifests','Local\x20service\x20not\x20found:\x20','sha256','Service\x20manifest\x20validation\x20failed:\x0a','length','parse','Invalid\x20service\x20manifest\x20JSON:\x20','warnings','77cVAbYv','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','services\x20must\x20be\x20an\x20array','now','version','stringify','object','push','risk','6255pECVgj','Invalid\x20service\x20registry\x20JSON:\x20','slice','path','Unsupported\x20service\x20registry\x20schemaVersion:\x20','findIndex','flatMap','startsWith','5494140tsgxHd','validation','message','name','description','Unsupported\x20schemaVersion:\x20','find','registry','errors','splice','Cannot\x20write\x20service\x20registry:\x20','serviceCode','updatedAt','sort','target','4FSibxA','241446ZYmelR','service','code','registryIndex','toISOString','$.services[','5072cTqFYI','commandCount','].manifest.','1762728kDzKNo','sourceHash','schemaVersion','importedAt','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','manifest','empty','map','kind','file','missing','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','services','CliError','localeCompare','178962cxjHdJ','Service\x20manifest\x20file\x20not\x20found:\x20','trim'];a63_0x3f07=function(){return _0x58ddc7;};return a63_0x3f07();}export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a63_0x4b0ef9(0x204);export function getServiceRegistryPath(_0x1e8a1c={}){return resolve(_0x1e8a1c['homeDir']??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x117ac7={}){const _0x2d34e6=a63_0x4b0ef9,_0x1e50c7=getServiceRegistryPath(_0x117ac7);if(!existsSync(_0x1e50c7))return emptyServiceRegistry();try{const _0x2d1f06=readFileSync(_0x1e50c7,_0x2d34e6(0x207));if(!_0x2d1f06['trim']())return emptyServiceRegistry();const _0x42acaf=JSON[_0x2d34e6(0x210)](_0x2d1f06);if(_0x42acaf['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x2d34e6(0x225)](_0x2d34e6(0x220)+String(_0x42acaf[_0x2d34e6(0x1ea)]),'Remove\x20or\x20migrate\x20'+_0x1e50c7+'.');if(!Array[_0x2d34e6(0x1fd)](_0x42acaf[_0x2d34e6(0x1f4)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x42acaf[_0x2d34e6(0x1db)],'services':_0x42acaf[_0x2d34e6(0x1f4)]};}catch(_0x311b27){if(_0x311b27 instanceof Error&&_0x311b27['name']===_0x2d34e6(0x1f5))throw _0x311b27;throw CliErrors['validation'](_0x2d34e6(0x21d)+_0x1e50c7,_0x2d34e6(0x209));}}export function writeServiceRegistry(_0x474be4,_0x41e01c={}){const _0x22ae92=a63_0x4b0ef9,_0x4aeb84=getServiceRegistryPath(_0x41e01c),_0x190502=dirname(_0x4aeb84);!existsSync(_0x190502)&&mkdirSync(_0x190502,{'recursive':!![]});const _0x462be5=_0x4aeb84+_0x22ae92(0x203);try{writeFileSync(_0x462be5,JSON[_0x22ae92(0x218)](_0x474be4,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x462be5,_0x4aeb84);}catch(_0x3d0612){try{unlinkSync(_0x462be5);}catch{}if(_0x3d0612?.[_0x22ae92(0x1e1)]==='ENOENT')throw CliErrors['validation'](_0x22ae92(0x1d9)+_0x4aeb84);throw _0x3d0612;}return _0x4aeb84;}export function loadServiceManifestFromFile(_0x257012){const _0xca1aac=a63_0x4b0ef9,_0x5023ec=resolve(_0x257012);if(!existsSync(_0x5023ec))throw CliErrors['validation'](_0xca1aac(0x1f8)+_0x257012);let _0x367cfd;const _0x6d498a=readFileSync(_0x5023ec,'utf8');try{_0x367cfd=JSON[_0xca1aac(0x210)](_0x6d498a);}catch{throw CliErrors[_0xca1aac(0x225)](_0xca1aac(0x211)+_0x257012,_0xca1aac(0x1f3));}const _0xb195=sha256(_0x6d498a),_0x322751=extractLoadedServiceManifests(_0x367cfd,_0xb195),_0x830c5d=aggregateValidationReports(_0x322751),_0x3de326=_0x322751[0x0];return{'filePath':_0x5023ec,'hash':_0xb195,'kind':isServiceRegistryLike(_0x367cfd)?_0xca1aac(0x1d6):_0xca1aac(0x1ed),'manifest':_0x3de326?.[_0xca1aac(0x1ed)]??_0x367cfd,'report':_0x830c5d,'normalizedManifest':_0x322751[_0xca1aac(0x20f)]===0x1?_0x3de326?.[_0xca1aac(0x1fa)]:undefined,'manifests':_0x322751};}export function importServiceManifest(_0x491db4,_0x205254={}){const _0x5581f4=a63_0x4b0ef9,_0x1ed751=loadServiceManifestFromFile(_0x491db4);if(!_0x1ed751[_0x5581f4(0x1fe)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x1ed751[_0x5581f4(0x1fe)]),_0x5581f4(0x202));if(_0x1ed751[_0x5581f4(0x20b)][_0x5581f4(0x20f)]===0x0)throw CliErrors['validation']('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x5581f4(0x1ec));const _0x2611ba=readServiceRegistry(_0x205254),_0x17fa62=(_0x205254[_0x5581f4(0x216)]??(()=>new Date()))()[_0x5581f4(0x1e3)](),_0x4166b2=[];let _0x370f8f=0x0,_0x25d760=0x0;for(const _0x5c2618 of _0x1ed751[_0x5581f4(0x20b)]){if(!_0x5c2618[_0x5581f4(0x1fa)])continue;const _0x1b023b=_0x5c2618[_0x5581f4(0x1fa)][_0x5581f4(0x1e0)][_0x5581f4(0x1e1)],_0x2c9309={'serviceCode':_0x1b023b,'version':_0x5c2618[_0x5581f4(0x1fa)]['version'],'importedAt':_0x17fa62,'source':{'type':_0x5581f4(0x1f1),'path':_0x1ed751['filePath'],'hash':_0x5c2618[_0x5581f4(0x1e9)]},'manifest':_0x5c2618['manifest'],'normalizedManifest':_0x5c2618[_0x5581f4(0x1fa)]},_0x38f48d=_0x2611ba[_0x5581f4(0x1f4)][_0x5581f4(0x221)](_0x320877=>_0x320877[_0x5581f4(0x1da)]===_0x1b023b);_0x38f48d>=0x0?(_0x2611ba[_0x5581f4(0x1f4)][_0x38f48d]=_0x2c9309,_0x25d760++):(_0x2611ba[_0x5581f4(0x1f4)][_0x5581f4(0x21a)](_0x2c9309),_0x370f8f++),_0x4166b2['push'](_0x2c9309);}_0x2611ba[_0x5581f4(0x1f4)][_0x5581f4(0x1dc)]((_0x27cd62,_0x38705d)=>_0x27cd62['serviceCode'][_0x5581f4(0x1f6)](_0x38705d[_0x5581f4(0x1da)])),_0x2611ba[_0x5581f4(0x1db)]=_0x17fa62;const _0x1ea517=writeServiceRegistry(_0x2611ba,_0x205254);return{'registryPath':_0x1ea517,'entry':_0x4166b2[0x0],'replaced':_0x4166b2[_0x5581f4(0x20f)]===0x1?_0x25d760===0x1:_0x25d760>0x0,'entries':_0x4166b2,'imported':_0x370f8f,'updated':_0x25d760,'serviceCount':_0x2611ba['services'][_0x5581f4(0x20f)]};}export function exportServiceManifest(_0x5db004,_0xf79577,_0x467e07={}){const _0x2dab8a=a63_0x4b0ef9,_0x5de3d3=getServiceRegistryPath(_0x467e07),_0x543ff5=getLocalServiceEntry(_0x5db004,_0x467e07);if(!_0x543ff5)throw CliErrors[_0x2dab8a(0x225)](_0x2dab8a(0x20c)+_0x5db004,_0x2dab8a(0x214));const _0x53dd1c=resolve(_0xf79577),_0x385a6d=dirname(_0x53dd1c);return!existsSync(_0x385a6d)&&mkdirSync(_0x385a6d,{'recursive':!![]}),writeFileSync(_0x53dd1c,JSON['stringify'](_0x543ff5[_0x2dab8a(0x1ed)],null,0x2)+'\x0a',{'encoding':_0x2dab8a(0x207),'mode':0x180}),{'registryPath':_0x5de3d3,'filePath':_0x53dd1c,'entry':_0x543ff5};}export function removeServiceManifest(_0x38b3de,_0xb02f2={}){const _0x2f7194=a63_0x4b0ef9,_0x1318ce=readServiceRegistry(_0xb02f2),_0x3fa0f5=_0x38b3de[_0x2f7194(0x1f9)](),_0x3b69f9=_0x1318ce['services'][_0x2f7194(0x221)](_0x4a49f2=>_0x4a49f2[_0x2f7194(0x1da)]===_0x3fa0f5);if(_0x3b69f9<0x0)throw CliErrors[_0x2f7194(0x225)](_0x2f7194(0x20c)+_0x3fa0f5,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x229246]=_0x1318ce[_0x2f7194(0x1f4)][_0x2f7194(0x1d8)](_0x3b69f9,0x1),_0x5d4208=(_0xb02f2[_0x2f7194(0x216)]??(()=>new Date()))()[_0x2f7194(0x1e3)]();_0x1318ce['updatedAt']=_0x5d4208;const _0x3f365d=writeServiceRegistry(_0x1318ce,_0xb02f2);return{'registryPath':_0x3f365d,'entry':_0x229246,'serviceCount':_0x1318ce[_0x2f7194(0x1f4)][_0x2f7194(0x20f)]};}export function listLocalServices(_0x3f8e47={}){const _0x5c1456=a63_0x4b0ef9;return readServiceRegistry(_0x3f8e47)[_0x5c1456(0x1f4)];}export function getLocalServiceEntry(_0x5bfe1e,_0x5bc4d7={}){const _0x115061=a63_0x4b0ef9;return readServiceRegistry(_0x5bc4d7)['services'][_0x115061(0x1d5)](_0x4f75c1=>_0x4f75c1[_0x115061(0x1da)]===_0x5bfe1e[_0x115061(0x1f9)]());}export function listLocalServiceTrees(_0x52796d={}){const _0x3a0483=a63_0x4b0ef9;return readServiceRegistry(_0x52796d)[_0x3a0483(0x1f4)][_0x3a0483(0x1ef)](_0x35ba06=>_0x35ba06['normalizedManifest']);}export function inspectServiceRegistry(_0x5f0d8a={}){const _0xd9dade=a63_0x4b0ef9,_0x21eff9=getServiceRegistryPath(_0x5f0d8a);if(!existsSync(_0x21eff9))return emptyServiceRegistryInspection(_0x21eff9,_0xd9dade(0x1f2),![]);try{const _0x206f59=readFileSync(_0x21eff9,_0xd9dade(0x207));if(!_0x206f59[_0xd9dade(0x1f9)]())return emptyServiceRegistryInspection(_0x21eff9,_0xd9dade(0x1ee),!![]);const _0x5b9f7f=JSON[_0xd9dade(0x210)](_0x206f59);if(_0x5b9f7f[_0xd9dade(0x1ea)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x21eff9,_0xd9dade(0x200),!![]),'schemaVersion':_0x5b9f7f[_0xd9dade(0x1ea)],'message':_0xd9dade(0x229)+String(_0x5b9f7f[_0xd9dade(0x1ea)])};if(!Array['isArray'](_0x5b9f7f[_0xd9dade(0x1f4)]))return{...emptyServiceRegistryInspection(_0x21eff9,_0xd9dade(0x200),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5b9f7f[_0xd9dade(0x1db)],'message':_0xd9dade(0x215)};const _0x4dd4ae=_0x5b9f7f['services'][_0xd9dade(0x1ef)](summarizeLocalServiceEntry);return{'registryPath':_0x21eff9,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5b9f7f[_0xd9dade(0x1db)],'serviceCount':_0x4dd4ae[_0xd9dade(0x20f)],'commandCount':_0x4dd4ae[_0xd9dade(0x201)]((_0x3494b0,_0x551324)=>_0x3494b0+_0x551324[_0xd9dade(0x1e6)],0x0),'services':_0x4dd4ae};}catch(_0xa2b056){return{...emptyServiceRegistryInspection(_0x21eff9,_0xd9dade(0x200),!![]),'message':_0xa2b056 instanceof Error?_0xa2b056[_0xd9dade(0x226)]:String(_0xa2b056)};}}export function formatValidationFailure(_0x38c341){const _0x1eb1fa=a63_0x4b0ef9,_0x55974f=_0x38c341[_0x1eb1fa(0x1d7)][_0x1eb1fa(0x1ef)](_0x29a3e6=>_0x29a3e6[_0x1eb1fa(0x21f)]+':\x20'+_0x29a3e6[_0x1eb1fa(0x226)]);return _0x1eb1fa(0x20e)+_0x55974f[_0x1eb1fa(0x205)]('\x0a');}function extractLoadedServiceManifests(_0x4c2b0e,_0xac0df6){const _0x303b0a=a63_0x4b0ef9;if(!isServiceRegistryLike(_0x4c2b0e)){const _0x595dfd=_0x4c2b0e,{manifest:_0x11a4c5,errors:_0x18fd76}=adaptServiceTreeManifestForLegacyFramework(_0x595dfd),_0xaedc71=validateServiceTreeManifest(_0x11a4c5),_0x3d1e37=mergeValidationErrors(_0xaedc71,_0x18fd76);return[{'manifest':_0x595dfd,'report':_0x3d1e37,'normalizedManifest':_0x3d1e37['ok']?normalizeServiceTreeManifest(_0x11a4c5):undefined,'sourceHash':_0xac0df6}];}return _0x4c2b0e[_0x303b0a(0x1f4)][_0x303b0a(0x1ef)]((_0x43f50e,_0x1ba94b)=>{const _0x3b496e=_0x303b0a,_0x4a0d72=isObjectRecord(_0x43f50e)?_0x43f50e[_0x3b496e(0x1ed)]:undefined,{manifest:_0x505d9d,errors:_0x5e40be}=adaptServiceTreeManifestForLegacyFramework(_0x4a0d72),_0x32cf7f=validateServiceTreeManifest(_0x505d9d),_0x4e8d9a=mergeValidationErrors(_0x32cf7f,_0x5e40be),_0x550ff3=isObjectRecord(_0x43f50e)&&typeof _0x43f50e[_0x3b496e(0x1da)]==='string'?_0x43f50e[_0x3b496e(0x1da)]:undefined;return{'manifest':_0x4a0d72,'report':_0x4e8d9a,'normalizedManifest':_0x4e8d9a['ok']?normalizeServiceTreeManifest(_0x505d9d):undefined,'sourceHash':sha256(JSON[_0x3b496e(0x218)](_0x4a0d72,null,0x2)+'\x0a'),'registryIndex':_0x1ba94b,'registryServiceCode':_0x550ff3};});}function mergeValidationErrors(_0x10845e,_0x44be1b){const _0x140807=a63_0x4b0ef9,_0x3da25d=_0x10845e['errors'][_0x140807(0x1ef)](_0x5d0c45=>_0x5d0c45[_0x140807(0x226)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x5d0c45,'message':'bff\x20target\x20requires\x20functionName.'}:_0x5d0c45),_0x473b74=[..._0x44be1b,..._0x3da25d];return{'ok':_0x473b74[_0x140807(0x20f)]===0x0,'errors':_0x473b74,'warnings':_0x10845e[_0x140807(0x212)]};}function aggregateValidationReports(_0xfa66a3){const _0x41152f=a63_0x4b0ef9,_0x244f4e=_0xfa66a3[_0x41152f(0x222)](_0xbb4500=>_0xbb4500['registryIndex']===undefined?_0xbb4500[_0x41152f(0x1fe)][_0x41152f(0x1d7)]:_0xbb4500[_0x41152f(0x1fe)][_0x41152f(0x1d7)]['map'](_0x56d0d0=>({..._0x56d0d0,'path':prefixRegistryIssuePath(_0xbb4500[_0x41152f(0x1e2)],_0x56d0d0[_0x41152f(0x21f)])}))),_0x3860cd=_0xfa66a3[_0x41152f(0x222)](_0x855c25=>_0x855c25[_0x41152f(0x1e2)]===undefined?_0x855c25[_0x41152f(0x1fe)]['warnings']:_0x855c25[_0x41152f(0x1fe)][_0x41152f(0x212)]['map'](_0x571661=>({..._0x571661,'path':prefixRegistryIssuePath(_0x855c25[_0x41152f(0x1e2)],_0x571661[_0x41152f(0x21f)])})));return{'ok':_0x244f4e[_0x41152f(0x20f)]===0x0,'errors':_0x244f4e,'warnings':_0x3860cd};}function prefixRegistryIssuePath(_0x977f09,_0x1ab41a){const _0x181286=a63_0x4b0ef9;if(_0x1ab41a==='$')return'$.services['+_0x977f09+_0x181286(0x20a);if(_0x1ab41a[_0x181286(0x223)]('$.'))return _0x181286(0x1e4)+_0x977f09+'].manifest'+_0x1ab41a[_0x181286(0x21e)](0x1);if(_0x1ab41a[_0x181286(0x223)]('$['))return _0x181286(0x1e4)+_0x977f09+_0x181286(0x20a)+_0x1ab41a[_0x181286(0x21e)](0x1);return _0x181286(0x1e4)+_0x977f09+_0x181286(0x1e7)+_0x1ab41a;}function isServiceRegistryLike(_0x406659){const _0x5e75e5=a63_0x4b0ef9;return isObjectRecord(_0x406659)&&_0x406659[_0x5e75e5(0x1ea)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x5e75e5(0x1fd)](_0x406659[_0x5e75e5(0x1f4)]);}function isObjectRecord(_0x22af71){const _0x4ee277=a63_0x4b0ef9;return Boolean(_0x22af71)&&typeof _0x22af71===_0x4ee277(0x219)&&!Array['isArray'](_0x22af71);}function emptyServiceRegistryInspection(_0x6f6971,_0xb3387c,_0x2ff586){return{'registryPath':_0x6f6971,'exists':_0x2ff586,'status':_0xb3387c,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xabeb4b){const _0xb6f245=a63_0x4b0ef9,_0x5d5637=_0xabeb4b['normalizedManifest'],_0x7d52a4=_0x5d5637[_0xb6f245(0x1fb)][_0xb6f245(0x1ef)](_0x69ae64=>({'path':_0x69ae64[_0xb6f245(0x206)],'description':_0x69ae64['description'],'risk':_0x69ae64[_0xb6f245(0x21b)],'targetKind':_0x69ae64['target'][_0xb6f245(0x1f0)],'targetCommand':_0x69ae64[_0xb6f245(0x1dd)][_0xb6f245(0x1fc)]}));return{'serviceCode':_0xabeb4b[_0xb6f245(0x1da)],'name':_0x5d5637[_0xb6f245(0x1e0)][_0xb6f245(0x227)],'description':_0x5d5637[_0xb6f245(0x1e0)][_0xb6f245(0x228)],'version':_0xabeb4b[_0xb6f245(0x217)],'importedAt':_0xabeb4b[_0xb6f245(0x1eb)],'source':_0xabeb4b['source'],'commandCount':_0x7d52a4[_0xb6f245(0x20f)],'commands':_0x7d52a4};}function sha256(_0x3d2b48){const _0x36831f=a63_0x4b0ef9;return createHash(_0x36831f(0x20d))['update'](_0x3d2b48)['digest']('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x15136c=a64_0x33d3;(function(_0x2dc266,_0x282844){const _0x3b6796=a64_0x33d3,_0x2840eb=_0x2dc266();while(!![]){try{const _0x956509=-parseInt(_0x3b6796(0xf8))/0x1*(-parseInt(_0x3b6796(0x101))/0x2)+parseInt(_0x3b6796(0x105))/0x3*(parseInt(_0x3b6796(0x10a))/0x4)+-parseInt(_0x3b6796(0x100))/0x5*(-parseInt(_0x3b6796(0xf5))/0x6)+parseInt(_0x3b6796(0xfe))/0x7+-parseInt(_0x3b6796(0x108))/0x8+-parseInt(_0x3b6796(0x10c))/0x9*(-parseInt(_0x3b6796(0xfd))/0xa)+-parseInt(_0x3b6796(0xfa))/0xb*(parseInt(_0x3b6796(0x111))/0xc);if(_0x956509===_0x282844)break;else _0x2840eb['push'](_0x2840eb['shift']());}catch(_0x5f1c83){_0x2840eb['push'](_0x2840eb['shift']());}}}(a64_0x1f7f,0xb8157));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a64_0x1f7f(){const _0x2d6272=['51108pclABz','utf8','target','bool','isDirectory','isSymbolicLink','path','6eFaQLk','skillDir','trim','3518ZHXRQp','files','9383seEhip','Skill\x20directory\x20already\x20exists:\x20','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','13210VRFfPG','5873952OEyVFP','str','2929445UmRiSq','824prHJPX','Created\x20local\x20Skill\x20draft\x20','WRITE','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','33ndznTV','map','rendered','7154248vifXhA','type','353996tuTSfV','skill','9765poeQWg','name','validation','create','skillName'];a64_0x1f7f=function(){return _0x2d6272;};return a64_0x1f7f();}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';function a64_0x33d3(_0x5bc4a6,_0x245471){_0x5bc4a6=_0x5bc4a6-0xf2;const _0x1f7f02=a64_0x1f7f();let _0x33d3a6=_0x1f7f02[_0x5bc4a6];return _0x33d3a6;}export const createCommand={'service':a64_0x15136c(0x10b),'command':a64_0x15136c(0x10f),'description':a64_0x15136c(0x104),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x48ba51){const _0x2680bd=a64_0x15136c,_0x125ff7=buildSkillCreatePlan(_0x48ba51[_0x2680bd(0xff)](_0x2680bd(0x10d)),_0x48ba51[_0x2680bd(0xff)](_0x2680bd(0x109)),_0x48ba51[_0x2680bd(0xff)](_0x2680bd(0x113)));return{'method':_0x2680bd(0x103),'url':_0x125ff7[_0x2680bd(0xf6)],'body':{'skillName':_0x125ff7['rendered'][_0x2680bd(0x110)],'type':_0x125ff7['rendered'][_0x2680bd(0x109)],'selfContained':!![],'files':_0x125ff7['rendered'][_0x2680bd(0xf9)]['map'](_0x845f50=>_0x845f50['path'])},'description':'Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'};},async 'execute'(_0x53ff97){const _0x1bea8c=a64_0x15136c,_0x17fee1=buildSkillCreatePlan(_0x53ff97[_0x1bea8c(0xff)](_0x1bea8c(0x10d)),_0x53ff97[_0x1bea8c(0xff)](_0x1bea8c(0x109)),_0x53ff97[_0x1bea8c(0xff)]('target'));return writeSkillDraft(_0x17fee1,_0x53ff97[_0x1bea8c(0x114)]('force')),{'ok':!![],'data':{'skillName':_0x17fee1['rendered'][_0x1bea8c(0x110)],'type':_0x17fee1['rendered'][_0x1bea8c(0x109)],'dir':_0x17fee1['skillDir'],'files':_0x17fee1[_0x1bea8c(0x107)]['files'][_0x1bea8c(0x106)](_0x1cb15=>_0x1cb15[_0x1bea8c(0xf4)])},'message':_0x1bea8c(0x102)+_0x17fee1[_0x1bea8c(0x107)][_0x1bea8c(0x110)]};}};function buildSkillCreatePlan(_0x2fa502,_0x3f6f66,_0x2f488f){const _0x58c415=a64_0x15136c,_0x5ef8ba=_0x3f6f66[_0x58c415(0xf7)](),_0x1941f1=renderSkillTemplate({'skillName':_0x2fa502,'type':_0x5ef8ba});!_0x5ef8ba&&writeCliSideChannelLine(_0x58c415(0xfc));const _0x41187c=resolve(normalizeSkillTarget(_0x2f488f));return{'rendered':_0x1941f1,'targetRoot':_0x41187c,'skillDir':resolve(_0x41187c,_0x1941f1[_0x58c415(0x110)])};}function normalizeSkillTarget(_0x5192ef){return(_0x5192ef||DEFAULT_SKILL_TARGET)['trim']()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0xb165ad,_0x50cff9){const _0x2473bd=a64_0x15136c;if(existsSync(_0xb165ad['skillDir'])){const _0x3162c1=lstatSync(_0xb165ad[_0x2473bd(0xf6)]);if(!_0x3162c1[_0x2473bd(0xf2)]()||_0x3162c1[_0x2473bd(0xf3)]())throw CliErrors['validation']('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0xb165ad[_0x2473bd(0xf6)]);if(!_0x50cff9)throw CliErrors[_0x2473bd(0x10e)](_0x2473bd(0xfb)+_0xb165ad[_0x2473bd(0xf6)],'Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.');}for(const _0x4d65c5 of _0xb165ad[_0x2473bd(0x107)][_0x2473bd(0xf9)]){const _0x2fc4fe=resolve(_0xb165ad[_0x2473bd(0xf6)],_0x4d65c5[_0x2473bd(0xf4)]),_0xadad4a=dirname(_0x2fc4fe);mkdirSync(_0xadad4a,{'recursive':!![]});if(existsSync(_0x2fc4fe)&&lstatSync(_0x2fc4fe)[_0x2473bd(0xf3)]())throw CliErrors[_0x2473bd(0x10e)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0x2fc4fe);writeFileSync(_0x2fc4fe,_0x4d65c5['content'],_0x2473bd(0x112));}}
|