@lovrabet/lovrabet-cli 2.3.7-beta.1 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.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-management-client.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/access-error.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/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.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/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x1a1c23=a55_0x17b4;(function(_0xbab4ad,_0x570217){const _0x5880a1=a55_0x17b4,_0x3cf748=_0xbab4ad();while(!![]){try{const _0x3e649a=parseInt(_0x5880a1(0x1e7))/0x1+parseInt(_0x5880a1(0x1e9))/0x2+parseInt(_0x5880a1(0x206))/0x3*(-parseInt(_0x5880a1(0x201))/0x4)+parseInt(_0x5880a1(0x1f9))/0x5+parseInt(_0x5880a1(0x205))/0x6*(-parseInt(_0x5880a1(0x1e6))/0x7)+-parseInt(_0x5880a1(0x1ed))/0x8*(-parseInt(_0x5880a1(0x202))/0x9)+parseInt(_0x5880a1(0x1f4))/0xa*(-parseInt(_0x5880a1(0x204))/0xb);if(_0x3e649a===_0x570217)break;else _0x3cf748['push'](_0x3cf748['shift']());}catch(_0xf29986){_0x3cf748['push'](_0x3cf748['shift']());}}}(a55_0x8f24,0x29c66));import{listRuntimeAppRoles}from'../../core/api-client.js';function a55_0x17b4(_0x51dcdc,_0x447427){_0x51dcdc=_0x51dcdc-0x1e4;const _0x8f24c0=a55_0x8f24();let _0x17b475=_0x8f24c0[_0x51dcdc];return _0x17b475;}import{CliErrors}from'../../errors.js';function a55_0x8f24(){const _0x4e355c=['slice','Invalid\x20runtime\x20role\x20type:\x20','appCode','884670zfTSEY','string','role','runtime','pagesize','1110530ygHcos','str','trim','filter','List\x20runtime\x20roles\x20for\x20the\x20current\x20app','number','isSafeInteger','--page\x20must\x20be\x20a\x20positive\x20integer.','20NEyTRB','9DfzoMf','type','55ZNJFAR','7194jPOhcQ','162543Zjskme','--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','includes','roleType','page','validation','1162jeLFVu','206291NKMRKn','Page\x20number','633132sYeIZC','name','Page\x20size\x20from\x201\x20to\x20100','num','2707368OgiWAJ','toUpperCase','map','list'];a55_0x8f24=function(){return _0x4e355c;};return a55_0x8f24();}import{listAllRuntimeRoles,projectRuntimeRole,RUNTIME_ROLE_TYPES}from'../../commands/role/shared.js';export const roleList={'service':a55_0x1a1c23(0x1f6),'command':a55_0x1a1c23(0x1f0),'description':a55_0x1a1c23(0x1fd),'risk':'read','flags':[{'name':'type','type':a55_0x1a1c23(0x1f5),'enum':RUNTIME_ROLE_TYPES,'description':'Runtime\x20role\x20type'},{'name':a55_0x1a1c23(0x1ea),'type':a55_0x1a1c23(0x1f5),'description':'Fuzzy\x20role-name\x20filter'},{'name':a55_0x1a1c23(0x1e4),'type':a55_0x1a1c23(0x1fe),'default':0x1,'description':a55_0x1a1c23(0x1e8)},{'name':a55_0x1a1c23(0x1f8),'type':a55_0x1a1c23(0x1fe),'default':0x64,'description':a55_0x1a1c23(0x1eb)}],async 'validate'(_0x38e597){const _0x38f168=a55_0x1a1c23,_0x21b6d5=_0x38e597[_0x38f168(0x1fa)](_0x38f168(0x203))[_0x38f168(0x1ee)]();if(_0x21b6d5&&!RUNTIME_ROLE_TYPES[_0x38f168(0x208)](_0x21b6d5))throw CliErrors[_0x38f168(0x1e5)](_0x38f168(0x1f2)+_0x21b6d5+'.');const _0x2817e6=_0x38e597['num'](_0x38f168(0x1e4),0x1),_0x1e05ed=_0x38e597[_0x38f168(0x1ec)]('pagesize',0x64);if(!Number[_0x38f168(0x1ff)](_0x2817e6)||_0x2817e6<0x1)throw CliErrors[_0x38f168(0x1e5)](_0x38f168(0x200));if(!Number['isSafeInteger'](_0x1e05ed)||_0x1e05ed<0x1||_0x1e05ed>0x64)throw CliErrors[_0x38f168(0x1e5)](_0x38f168(0x207));},async 'execute'(_0x30997d){const _0x5d1e48=a55_0x1a1c23,_0x28f137=_0x30997d['str']('type')[_0x5d1e48(0x1ee)](),_0x2ed327=_0x30997d[_0x5d1e48(0x1fa)](_0x5d1e48(0x1ea))[_0x5d1e48(0x1fb)](),_0x512e27=_0x30997d[_0x5d1e48(0x1ec)]('page',0x1),_0x14f485=_0x30997d[_0x5d1e48(0x1ec)](_0x5d1e48(0x1f8),0x64);if(_0x28f137){const _0x345e1a=(await listAllRuntimeRoles(_0x30997d[_0x5d1e48(0x1f3)],{..._0x2ed327?{'roleName':_0x2ed327}:{}}))[_0x5d1e48(0x1fc)](_0x47c11a=>_0x47c11a[_0x5d1e48(0x209)]===_0x28f137),_0x29f8ff=(_0x512e27-0x1)*_0x14f485;return{'ok':!![],'data':{'scope':_0x5d1e48(0x1f7),'roles':_0x345e1a[_0x5d1e48(0x1f1)](_0x29f8ff,_0x29f8ff+_0x14f485)['map'](projectRuntimeRole),'paging':{'currentPage':_0x512e27,'pageSize':_0x14f485,'totalCount':_0x345e1a['length']}}};}const _0x3231b8=await listRuntimeAppRoles(_0x30997d[_0x5d1e48(0x1f3)],{..._0x2ed327?{'roleName':_0x2ed327}:{},'currentPage':_0x512e27,'pageSize':_0x14f485});return{'ok':!![],'data':{'scope':_0x5d1e48(0x1f7),'roles':_0x3231b8['items'][_0x5d1e48(0x1ef)](projectRuntimeRole),'paging':_0x3231b8['paging']}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a56_0x21a27b=a56_0x5291;(function(_0x4d8923,_0x1c528b){const _0x56cd36=a56_0x5291,_0xf690e8=_0x4d8923();while(!![]){try{const _0xb4ff13=-parseInt(_0x56cd36(0xb3))/0x1*(parseInt(_0x56cd36(0x74))/0x2)+parseInt(_0x56cd36(0x78))/0x3*(parseInt(_0x56cd36(0xad))/0x4)+parseInt(_0x56cd36(0xb9))/0x5*(parseInt(_0x56cd36(0xab))/0x6)+parseInt(_0x56cd36(0x88))/0x7+parseInt(_0x56cd36(0xae))/0x8*(parseInt(_0x56cd36(0x8c))/0x9)+parseInt(_0x56cd36(0x70))/0xa*(-parseInt(_0x56cd36(0x82))/0xb)+-parseInt(_0x56cd36(0x7e))/0xc*(parseInt(_0x56cd36(0xb7))/0xd);if(_0xb4ff13===_0x1c528b)break;else _0xf690e8['push'](_0xf690e8['shift']());}catch(_0x243cb6){_0xf690e8['push'](_0xf690e8['shift']());}}}(a56_0x1bd3,0xda3ad));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{normalizePositiveSafeInteger}from'../../utils/positive-safe-integer.js';export const RUNTIME_ROLE_TYPES=[a56_0x21a27b(0xb5),'USER',a56_0x21a27b(0x77),'CUSTOM'];const BUILTIN_ROLE_TYPES=[a56_0x21a27b(0xb5),a56_0x21a27b(0x90),'OWNER'];export const ROLE_ID_FLAG={'name':'id','type':a56_0x21a27b(0x97),'required':!![],'description':a56_0x21a27b(0x83)};export const ROLE_REF_FLAG={'name':'role','type':'string','required':!![],'description':a56_0x21a27b(0xb0)};export const ROLE_CODE_FLAG={'name':a56_0x21a27b(0x6e),'type':'string','description':'Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)'};export const USER_ID_FLAG={'name':a56_0x21a27b(0x81),'type':a56_0x21a27b(0xa5),'required':!![],'description':'Runtime\x20numeric\x20userId'};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a56_0x21a27b(0x97),'description':a56_0x21a27b(0x7b)};export function isBuiltinRuntimeRole(_0x4c39a5){return BUILTIN_ROLE_TYPES['includes'](_0x4c39a5);}export function assertCustomRuntimeRole(_0x4c0bf3,_0x110c53){const _0x2a526e=a56_0x21a27b;if(_0x4c0bf3['roleType']!==_0x2a526e(0x95))throw CliErrors[_0x2a526e(0x7a)](_0x2a526e(0xa9)+_0x110c53+'\x20built-in\x20runtime\x20role\x20'+_0x4c0bf3[_0x2a526e(0x79)]+'\x20('+_0x4c0bf3[_0x2a526e(0x7f)]+').',_0x2a526e(0x9b));}export function projectRuntimeRole(_0x2b2488){const _0x3e39f8=a56_0x21a27b;return{'id':_0x2b2488['id'],'roleCode':_0x2b2488['roleCode'],'roleName':_0x2b2488[_0x3e39f8(0x79)],'roleType':_0x2b2488[_0x3e39f8(0x7f)],'remark':_0x2b2488[_0x3e39f8(0x8a)],'userCount':_0x2b2488['userCount']??0x0,'permitCount':_0x2b2488[_0x3e39f8(0xb1)]??0x0,'builtin':isBuiltinRuntimeRole(_0x2b2488['roleType'])};}export function readOptionalRuntimeRoleCode(_0x528564){const _0x57c611=a56_0x21a27b,_0x33c8e9=_0x528564[_0x57c611(0x8b)](_0x57c611(0x6e));if(_0x33c8e9===undefined||_0x33c8e9===null)return undefined;const _0xb5f4ab=String(_0x33c8e9)[_0x57c611(0x8e)]();if(!_0xb5f4ab)throw CliErrors[_0x57c611(0x7a)](_0x57c611(0xa1));if(_0xb5f4ab[_0x57c611(0x8d)]>0x40)throw CliErrors[_0x57c611(0x7a)](_0x57c611(0xa0));return _0xb5f4ab;}export async function getRuntimeRoleById(_0x2956f0,_0x34e30c){const _0x2f9756=a56_0x21a27b;if(!Number['isSafeInteger'](_0x34e30c)||_0x34e30c<=0x0)throw CliErrors[_0x2f9756(0x7a)](_0x2f9756(0x91));const _0x1662f2=(await listAllRuntimeRoles(_0x2956f0))[_0x2f9756(0x76)](_0xb1adde=>_0xb1adde['id']===_0x34e30c&&(!_0xb1adde[_0x2f9756(0x73)]||_0xb1adde[_0x2f9756(0x73)]===_0x2956f0));if(_0x1662f2[_0x2f9756(0x8d)]!==0x1)throw CliErrors[_0x2f9756(0x7a)]('Runtime\x20role\x20id\x20'+_0x34e30c+_0x2f9756(0xb2)+_0x2956f0+'.',_0x2f9756(0xb4));return _0x1662f2[0x0];}function a56_0x1bd3(){const _0x5b1024=['Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','runtime','Runtime\x20role\x20','--role-code\x20cannot\x20exceed\x2064\x20characters.','--role-code\x20must\x20not\x20be\x20blank.','map','\x20is\x20already\x20in\x20runtime\x20role\x20','isSafeInteger','string','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','\x22\x20was\x20not\x20found\x20in\x20app\x20','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','Cannot\x20','totalCount','5478DQyCWj','user-add','56940swLqxA','57048dxaHFV','role','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','permitCount','\x20was\x20not\x20found\x20in\x20app\x20','106906OIxnqM','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','ADMIN','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','529867uBBDJZ','\x20is\x20not\x20in\x20runtime\x20role\x20','7075cNGnRN','\x22\x20is\x20ambiguous.','role-code','userId','54050yqyRIB','push','userList','appCode','16FbyOrZ','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','filter','OWNER','351bjLBWe','roleName','validation','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','paging','Runtime\x20role\x20name\x20\x22','516OPafrm','roleType','str','user','2519bmIcrM','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','find',',\x20found\x20','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','userName','544600upapxy','User\x20','remark','flag','2151JGUVPa','length','trim','code','USER','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','Pass\x20one\x20role\x20ID:\x20','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','CUSTOM','test','number','expect-user-count','applyUserList','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.'];a56_0x1bd3=function(){return _0x5b1024;};return a56_0x1bd3();}export async function listAllRuntimeRoles(_0x1dbfcb,_0x222e08={}){const _0x15021e=a56_0x21a27b,_0x347cf0=0x64,_0x2a593c=[];for(let _0x1c5450=0x1;;_0x1c5450+=0x1){const _0x37c641=await listRuntimeAppRoles(_0x1dbfcb,{..._0x222e08[_0x15021e(0x79)]?{'roleName':_0x222e08[_0x15021e(0x79)]}:{},'currentPage':_0x1c5450,'pageSize':_0x347cf0});_0x2a593c[_0x15021e(0x71)](..._0x37c641['items']);if(_0x37c641['items'][_0x15021e(0x8d)]<_0x347cf0||_0x37c641[_0x15021e(0x7c)]&&_0x2a593c['length']>=_0x37c641[_0x15021e(0x7c)][_0x15021e(0xaa)])return _0x2a593c;}}export async function resolveRuntimeRoleRef(_0x21819a,_0x3080ae){const _0x2205ae=a56_0x21a27b,_0x1e09e9=_0x3080ae[_0x2205ae(0x8e)]();if(!_0x1e09e9)throw CliErrors[_0x2205ae(0x7a)]('Missing\x20runtime\x20role\x20reference.','Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x2205ae(0x96)](_0x1e09e9))return getRuntimeRoleById(_0x21819a,Number(_0x1e09e9));const _0x852b13=(await listAllRuntimeRoles(_0x21819a))[_0x2205ae(0x76)](_0x4e86d2=>_0x4e86d2[_0x2205ae(0x79)]===_0x1e09e9);if(_0x852b13['length']===0x0)throw CliErrors[_0x2205ae(0x7a)](_0x2205ae(0x7d)+_0x1e09e9+_0x2205ae(0xa7)+_0x21819a+'.',_0x2205ae(0xa8));if(_0x852b13[_0x2205ae(0x8d)]>0x1)throw CliErrors[_0x2205ae(0x7a)]('Runtime\x20role\x20name\x20\x22'+_0x1e09e9+_0x2205ae(0xba),_0x2205ae(0x93)+_0x852b13[_0x2205ae(0xa2)](_0x973ee9=>_0x973ee9['id'])['join'](',\x20')+'.');return _0x852b13[0x0];}function parseRuntimeUserId(_0x297ba1){const _0x1ae58c=a56_0x21a27b,_0x16245b=_0x297ba1[_0x1ae58c(0x8e)](),_0x2393b4=normalizePositiveSafeInteger(_0x16245b);if(_0x2393b4===undefined)throw CliErrors[_0x1ae58c(0x7a)](_0x1ae58c(0x75),_0x1ae58c(0x94));return _0x2393b4;}export async function prepareRuntimeMemberMutation(_0x51b28e,_0x146194){const _0x932f67=a56_0x21a27b,_0x10c62c=await resolveRuntimeRoleRef(_0x51b28e[_0x932f67(0x73)],_0x51b28e[_0x932f67(0x80)](_0x932f67(0xaf)));if(_0x10c62c[_0x932f67(0x7f)]===_0x932f67(0x77))throw CliErrors[_0x932f67(0x7a)](_0x932f67(0x9c),_0x932f67(0x9a));const _0x1c87af=parseRuntimeUserId(_0x51b28e[_0x932f67(0x80)]('user')),_0x1ff4ce=(await listRuntimeRoleUsers(_0x51b28e['appCode']))[_0x932f67(0xa2)](_0x58f455=>({..._0x58f455,'userList':[..._0x58f455[_0x932f67(0x72)]??[]],'applyUserList':[..._0x58f455[_0x932f67(0x99)]??[]]})),_0x48a54a=_0x1ff4ce[_0x932f67(0x84)](_0x119cca=>_0x119cca['id']===_0x10c62c['id']);if(!_0x48a54a)throw CliErrors['validation'](_0x932f67(0x9f)+_0x10c62c['id']+'\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.',_0x932f67(0x9d));const _0x78d433=_0x48a54a[_0x932f67(0x72)][_0x932f67(0xa2)](_0x17d983=>_0x17d983[_0x932f67(0x6f)]),_0x5a954b=_0x51b28e[_0x932f67(0x8b)](_0x932f67(0x98));if(_0x5a954b!==undefined&&_0x5a954b!==null&&_0x5a954b!==''){const _0x4c9933=_0x51b28e['num'](_0x932f67(0x98));if(!Number[_0x932f67(0xa4)](_0x4c9933)||_0x4c9933<0x0)throw CliErrors[_0x932f67(0x7a)](_0x932f67(0x86));if(_0x78d433[_0x932f67(0x8d)]!==_0x4c9933)throw CliErrors[_0x932f67(0x7a)](_0x932f67(0xb6)+_0x4c9933+_0x932f67(0x85)+_0x78d433[_0x932f67(0x8d)]+'.',_0x932f67(0xa6));}const _0x1f860c=_0x78d433['includes'](_0x1c87af),_0x5e8c67=[];let _0x29e3f6=!![];if(_0x146194===_0x932f67(0xac)){const _0x5ebc40=await listRuntimeAppUsers(_0x51b28e[_0x932f67(0x73)]),_0x2610ab=_0x5ebc40[_0x932f67(0x76)](_0x592e41=>Number(_0x592e41[_0x932f67(0x8f)])===_0x1c87af);if(_0x2610ab['length']!==0x1||!_0x2610ab[0x0][_0x932f67(0x87)]?.[_0x932f67(0x8e)]())throw CliErrors[_0x932f67(0x7a)]('Runtime\x20user\x20'+_0x1c87af+_0x932f67(0xb2)+_0x51b28e[_0x932f67(0x73)]+'.',_0x932f67(0x92));_0x1f860c?(_0x29e3f6=![],_0x5e8c67[_0x932f67(0x71)](_0x932f67(0x89)+_0x1c87af+_0x932f67(0xa3)+_0x10c62c['id']+'.')):_0x48a54a['userList'][_0x932f67(0x71)]({'userId':_0x1c87af,'username':_0x2610ab[0x0]['userName']});}else!_0x1f860c?(_0x29e3f6=![],_0x5e8c67[_0x932f67(0x71)](_0x932f67(0x89)+_0x1c87af+_0x932f67(0xb8)+_0x10c62c['id']+'.')):_0x48a54a['userList']=_0x48a54a[_0x932f67(0x72)][_0x932f67(0x76)](_0x3f06ab=>_0x3f06ab['userId']!==_0x1c87af);return{'role':_0x10c62c,'userId':_0x1c87af,'roleList':_0x1ff4ce,'before':{'userIds':_0x78d433},'after':{'userIds':_0x48a54a['userList'][_0x932f67(0xa2)](_0x2e421a=>_0x2e421a[_0x932f67(0x6f)])},'shouldWrite':_0x29e3f6,'warnings':_0x5e8c67};}function a56_0x5291(_0x3a3c43,_0x34741d){_0x3a3c43=_0x3a3c43-0x6e;const _0x1bd310=a56_0x1bd3();let _0x529153=_0x1bd310[_0x3a3c43];return _0x529153;}export function runtimeRoleWriteResult(_0x48eed9,_0x5b9959,_0x132381,_0x1eb4fd,_0x264015,_0x41689b=[]){const _0x46e38c=a56_0x21a27b;return{'operation':_0x48eed9,'scope':_0x46e38c(0x9e),'selector':_0x5b9959,'before':_0x132381,'after':_0x1eb4fd,'dryRun':![],'backend':_0x264015,'warnings':_0x41689b};}
|
|
1
|
+
function a56_0x20a9(){const _0x127ae2=['find','userCount','1889577psZkqY','flag','str','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','role','Missing\x20runtime\x20role\x20reference.','validation','8CqZkyA','\x22\x20was\x20not\x20found\x20in\x20app\x20','includes','paging','applyUserList','userList','user','3824968pKTHhf','roleName','OWNER','totalCount','15595GMmIDW','1007835BQWMcQ','Globally\x20unique\x20roleCode\x20(maximum\x2064\x20characters)','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list',',\x20found\x20','CUSTOM','Runtime\x20role\x20id\x20','items','Runtime\x20user\x20','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','join','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','runtime','userId','6260210qieoEK','isSafeInteger','\x20was\x20not\x20found\x20in\x20app\x20','trim','USER','User\x20','filter','length','Runtime\x20role\x20','permitCount','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','133941RmLgWp','map','--role-code\x20cannot\x20exceed\x2064\x20characters.','expect-user-count','\x20is\x20not\x20in\x20runtime\x20role\x20','role-code','appCode','roleCode','28goHfbS','user-add','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','userName','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','Runtime\x20role\x20name\x20\x22','3656724zxUtMJ','Runtime\x20numeric\x20userId','string','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','ADMIN','number','push','40Jtbtbc','\x20built-in\x20runtime\x20role\x20','roleType'];a56_0x20a9=function(){return _0x127ae2;};return a56_0x20a9();}const a56_0x3a8702=a56_0x2e65;(function(_0xa132e5,_0x263cad){const _0x470484=a56_0x2e65,_0x10e930=_0xa132e5();while(!![]){try{const _0x176cec=parseInt(_0x470484(0x232))/0x1*(-parseInt(_0x470484(0x20e))/0x2)+parseInt(_0x470484(0x206))/0x3*(parseInt(_0x470484(0x21b))/0x4)+-parseInt(_0x470484(0x233))/0x5+-parseInt(_0x470484(0x214))/0x6+parseInt(_0x470484(0x22e))/0x7+-parseInt(_0x470484(0x227))/0x8*(parseInt(_0x470484(0x220))/0x9)+parseInt(_0x470484(0x1fb))/0xa;if(_0x176cec===_0x263cad)break;else _0x10e930['push'](_0x10e930['shift']());}catch(_0x23512f){_0x10e930['push'](_0x10e930['shift']());}}}(a56_0x20a9,0x5cadb));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{normalizePositiveSafeInteger}from'../../utils/positive-safe-integer.js';export const RUNTIME_ROLE_TYPES=[a56_0x3a8702(0x218),a56_0x3a8702(0x1ff),a56_0x3a8702(0x230),a56_0x3a8702(0x238)];const BUILTIN_ROLE_TYPES=[a56_0x3a8702(0x218),'USER',a56_0x3a8702(0x230)];export const ROLE_ID_FLAG={'name':'id','type':a56_0x3a8702(0x219),'required':!![],'description':a56_0x3a8702(0x236)};export const ROLE_REF_FLAG={'name':a56_0x3a8702(0x224),'type':a56_0x3a8702(0x216),'required':!![],'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'};export const ROLE_CODE_FLAG={'name':a56_0x3a8702(0x20b),'type':a56_0x3a8702(0x216),'description':a56_0x3a8702(0x234)};export const USER_ID_FLAG={'name':a56_0x3a8702(0x22d),'type':'string','required':!![],'description':a56_0x3a8702(0x215)};export const EXPECT_USER_COUNT_FLAG={'name':'expect-user-count','type':a56_0x3a8702(0x219),'description':a56_0x3a8702(0x205)};export function isBuiltinRuntimeRole(_0x544d98){const _0x10b986=a56_0x3a8702;return BUILTIN_ROLE_TYPES[_0x10b986(0x229)](_0x544d98);}export function assertCustomRuntimeRole(_0x7b9d13,_0x2e00f8){const _0x273b5f=a56_0x3a8702;if(_0x7b9d13[_0x273b5f(0x21d)]!==_0x273b5f(0x238))throw CliErrors['validation']('Cannot\x20'+_0x2e00f8+_0x273b5f(0x21c)+_0x7b9d13[_0x273b5f(0x22f)]+'\x20('+_0x7b9d13[_0x273b5f(0x21d)]+').','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRuntimeRole(_0x2cf4e3){const _0x164663=a56_0x3a8702;return{'id':_0x2cf4e3['id'],'roleCode':_0x2cf4e3[_0x164663(0x20d)],'roleName':_0x2cf4e3[_0x164663(0x22f)],'roleType':_0x2cf4e3[_0x164663(0x21d)],'remark':_0x2cf4e3['remark'],'userCount':_0x2cf4e3[_0x164663(0x21f)]??0x0,'permitCount':_0x2cf4e3[_0x164663(0x204)]??0x0,'builtin':isBuiltinRuntimeRole(_0x2cf4e3[_0x164663(0x21d)])};}export function readOptionalRuntimeRoleCode(_0x187303){const _0x549604=a56_0x3a8702,_0x3a3d54=_0x187303['flag'](_0x549604(0x20b));if(_0x3a3d54===undefined||_0x3a3d54===null)return undefined;const _0x17d761=String(_0x3a3d54)[_0x549604(0x1fe)]();if(!_0x17d761)throw CliErrors[_0x549604(0x226)]('--role-code\x20must\x20not\x20be\x20blank.');if(_0x17d761['length']>0x40)throw CliErrors[_0x549604(0x226)](_0x549604(0x208));return _0x17d761;}export async function getRuntimeRoleById(_0x96f8f4,_0x1f657c){const _0x5f19ad=a56_0x3a8702;if(!Number[_0x5f19ad(0x1fc)](_0x1f657c)||_0x1f657c<=0x0)throw CliErrors[_0x5f19ad(0x226)](_0x5f19ad(0x223));const _0x285365=(await listAllRuntimeRoles(_0x96f8f4))['filter'](_0x142b98=>_0x142b98['id']===_0x1f657c&&(!_0x142b98[_0x5f19ad(0x20c)]||_0x142b98[_0x5f19ad(0x20c)]===_0x96f8f4));if(_0x285365['length']!==0x1)throw CliErrors[_0x5f19ad(0x226)](_0x5f19ad(0x1f3)+_0x1f657c+_0x5f19ad(0x1fd)+_0x96f8f4+'.',_0x5f19ad(0x217));return _0x285365[0x0];}export async function listAllRuntimeRoles(_0x20c68b,_0x2e446b={}){const _0xd6e2c7=a56_0x3a8702,_0x1e1b6f=0x64,_0x2586cb=[];for(let _0x1c547c=0x1;;_0x1c547c+=0x1){const _0x180bac=await listRuntimeAppRoles(_0x20c68b,{..._0x2e446b[_0xd6e2c7(0x22f)]?{'roleName':_0x2e446b['roleName']}:{},'currentPage':_0x1c547c,'pageSize':_0x1e1b6f});_0x2586cb['push'](..._0x180bac['items']);if(_0x180bac[_0xd6e2c7(0x1f4)][_0xd6e2c7(0x202)]<_0x1e1b6f||_0x180bac[_0xd6e2c7(0x22a)]&&_0x2586cb[_0xd6e2c7(0x202)]>=_0x180bac[_0xd6e2c7(0x22a)][_0xd6e2c7(0x231)])return _0x2586cb;}}export async function resolveRuntimeRoleRef(_0x3c5cdc,_0xc0e496){const _0x3e1a43=a56_0x3a8702,_0x28ecb8=_0xc0e496[_0x3e1a43(0x1fe)]();if(!_0x28ecb8)throw CliErrors['validation'](_0x3e1a43(0x225),'Pass\x20--role\x20<id|name>.');if(/^\d+$/['test'](_0x28ecb8))return getRuntimeRoleById(_0x3c5cdc,Number(_0x28ecb8));const _0xa7b1fa=(await listAllRuntimeRoles(_0x3c5cdc))['filter'](_0x177ee4=>_0x177ee4['roleName']===_0x28ecb8);if(_0xa7b1fa[_0x3e1a43(0x202)]===0x0)throw CliErrors[_0x3e1a43(0x226)](_0x3e1a43(0x213)+_0x28ecb8+_0x3e1a43(0x228)+_0x3c5cdc+'.',_0x3e1a43(0x210));if(_0xa7b1fa[_0x3e1a43(0x202)]>0x1)throw CliErrors['validation'](_0x3e1a43(0x213)+_0x28ecb8+'\x22\x20is\x20ambiguous.','Pass\x20one\x20role\x20ID:\x20'+_0xa7b1fa[_0x3e1a43(0x207)](_0x353e70=>_0x353e70['id'])[_0x3e1a43(0x1f7)](',\x20')+'.');return _0xa7b1fa[0x0];}function parseRuntimeUserId(_0x3e203e){const _0x57daea=a56_0x3a8702,_0x3ad4b9=_0x3e203e[_0x57daea(0x1fe)](),_0x36ec4e=normalizePositiveSafeInteger(_0x3ad4b9);if(_0x36ec4e===undefined)throw CliErrors['validation']('Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.');return _0x36ec4e;}export async function prepareRuntimeMemberMutation(_0x43f7b3,_0x4625fe){const _0x569ca0=a56_0x3a8702,_0x487260=await resolveRuntimeRoleRef(_0x43f7b3['appCode'],_0x43f7b3['str'](_0x569ca0(0x224)));if(_0x487260[_0x569ca0(0x21d)]===_0x569ca0(0x230))throw CliErrors[_0x569ca0(0x226)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.');const _0x559e5e=parseRuntimeUserId(_0x43f7b3[_0x569ca0(0x222)]('user')),_0x17866c=(await listRuntimeRoleUsers(_0x43f7b3[_0x569ca0(0x20c)]))[_0x569ca0(0x207)](_0x48efa6=>({..._0x48efa6,'userList':[..._0x48efa6[_0x569ca0(0x22c)]??[]],'applyUserList':[..._0x48efa6[_0x569ca0(0x22b)]??[]]})),_0x485e0f=_0x17866c[_0x569ca0(0x21e)](_0x46ce5d=>_0x46ce5d['id']===_0x487260['id']);if(!_0x485e0f)throw CliErrors[_0x569ca0(0x226)](_0x569ca0(0x203)+_0x487260['id']+'\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.');const _0x25dd50=_0x485e0f[_0x569ca0(0x22c)][_0x569ca0(0x207)](_0x31f395=>_0x31f395[_0x569ca0(0x1fa)]),_0x48b693=_0x43f7b3[_0x569ca0(0x221)](_0x569ca0(0x209));if(_0x48b693!==undefined&&_0x48b693!==null&&_0x48b693!==''){const _0x40501a=_0x43f7b3['num']('expect-user-count');if(!Number[_0x569ca0(0x1fc)](_0x40501a)||_0x40501a<0x0)throw CliErrors['validation'](_0x569ca0(0x235));if(_0x25dd50[_0x569ca0(0x202)]!==_0x40501a)throw CliErrors[_0x569ca0(0x226)](_0x569ca0(0x1f8)+_0x40501a+_0x569ca0(0x237)+_0x25dd50[_0x569ca0(0x202)]+'.',_0x569ca0(0x1f6));}const _0x90e5e4=_0x25dd50[_0x569ca0(0x229)](_0x559e5e),_0x430fe4=[];let _0x5f4852=!![];if(_0x4625fe===_0x569ca0(0x20f)){const _0x2de7b8=await listRuntimeAppUsers(_0x43f7b3[_0x569ca0(0x20c)]),_0xe8bf1a=_0x2de7b8[_0x569ca0(0x201)](_0x107292=>Number(_0x107292['code'])===_0x559e5e);if(_0xe8bf1a[_0x569ca0(0x202)]!==0x1||!_0xe8bf1a[0x0][_0x569ca0(0x211)]?.[_0x569ca0(0x1fe)]())throw CliErrors[_0x569ca0(0x226)](_0x569ca0(0x1f5)+_0x559e5e+_0x569ca0(0x1fd)+_0x43f7b3[_0x569ca0(0x20c)]+'.',_0x569ca0(0x212));_0x90e5e4?(_0x5f4852=![],_0x430fe4[_0x569ca0(0x21a)](_0x569ca0(0x200)+_0x559e5e+'\x20is\x20already\x20in\x20runtime\x20role\x20'+_0x487260['id']+'.')):_0x485e0f[_0x569ca0(0x22c)][_0x569ca0(0x21a)]({'userId':_0x559e5e,'username':_0xe8bf1a[0x0][_0x569ca0(0x211)]});}else!_0x90e5e4?(_0x5f4852=![],_0x430fe4['push'](_0x569ca0(0x200)+_0x559e5e+_0x569ca0(0x20a)+_0x487260['id']+'.')):_0x485e0f[_0x569ca0(0x22c)]=_0x485e0f[_0x569ca0(0x22c)][_0x569ca0(0x201)](_0x3780d5=>_0x3780d5[_0x569ca0(0x1fa)]!==_0x559e5e);return{'role':_0x487260,'userId':_0x559e5e,'roleList':_0x17866c,'before':{'userIds':_0x25dd50},'after':{'userIds':_0x485e0f[_0x569ca0(0x22c)][_0x569ca0(0x207)](_0x31238e=>_0x31238e['userId'])},'shouldWrite':_0x5f4852,'warnings':_0x430fe4};}function a56_0x2e65(_0x2ab54c,_0x1898ba){_0x2ab54c=_0x2ab54c-0x1f3;const _0x20a961=a56_0x20a9();let _0x2e6577=_0x20a961[_0x2ab54c];return _0x2e6577;}export function runtimeRoleWriteResult(_0x593e7e,_0x15afcd,_0x273aa0,_0x7dc370,_0x5e33a4,_0x195bc9=[]){const _0x2b97f6=a56_0x3a8702;return{'operation':_0x593e7e,'scope':_0x2b97f6(0x1f9),'selector':_0x15afcd,'before':_0x273aa0,'after':_0x7dc370,'dryRun':![],'backend':_0x5e33a4,'warnings':_0x195bc9};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a57_0x1754(){const _0x19296c=['44722850XsCMWG','--name\x20must\x20not\x20be\x20blank.','17321IJgbyX','flag','update','91BpHltu','string','444JBtFzI','/client/permit/role/update','New\x20role\x20name','12677472fdUvUx','--remark\x20must\x20not\x20be\x20blank.','Pass\x20--role-code,\x20--name,\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','Update\x20a\x20runtime\x20CUSTOM\x20role\x27s\x20code,\x20name,\x20or\x20remark','POST','49506GqlnAU','138uzcpHR','58435NZjtrX','role','5940232zGlksL','trim','validation','3028881njSUgo','build','str','remark','appCode','New\x20non-empty\x20role\x20remark','name'];a57_0x1754=function(){return _0x19296c;};return a57_0x1754();}const a57_0x1941a3=a57_0x4268;(function(_0xfec45e,_0x49d497){const _0x4e7a06=a57_0x4268,_0x347794=_0xfec45e();while(!![]){try{const _0x55d7e9=-parseInt(_0x4e7a06(0xc0))/0x1*(parseInt(_0x4e7a06(0xce))/0x2)+parseInt(_0x4e7a06(0xd4))/0x3+-parseInt(_0x4e7a06(0xc5))/0x4*(parseInt(_0x4e7a06(0xcf))/0x5)+-parseInt(_0x4e7a06(0xcd))/0x6*(parseInt(_0x4e7a06(0xc3))/0x7)+-parseInt(_0x4e7a06(0xd1))/0x8+-parseInt(_0x4e7a06(0xc8))/0x9+parseInt(_0x4e7a06(0xbe))/0xa;if(_0x55d7e9===_0x49d497)break;else _0x347794['push'](_0x347794['shift']());}catch(_0x169642){_0x347794['push'](_0x347794['shift']());}}}(a57_0x1754,0xb27e2));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(_0x2bb213){const _0x2284d3=a57_0x4268,_0x484790=_0x2bb213[_0x2284d3(0xc1)]('role-code')!==undefined,_0x4ac60c=_0x2bb213[_0x2284d3(0xc1)](_0x2284d3(0xbd))!==undefined,_0x3fae3f=_0x2bb213['flag'](_0x2284d3(0xba))!==undefined;if(!_0x484790&&!_0x4ac60c&&!_0x3fae3f)throw CliErrors[_0x2284d3(0xd3)](_0x2284d3(0xca));const _0x229ce9=readOptionalRuntimeRoleCode(_0x2bb213),_0x4571bb=_0x2bb213[_0x2284d3(0xb9)](_0x2284d3(0xbd))['trim'](),_0x3f014d=_0x2bb213[_0x2284d3(0xb9)](_0x2284d3(0xba))[_0x2284d3(0xd2)]();if(_0x4ac60c&&!_0x4571bb)throw CliErrors[_0x2284d3(0xd3)](_0x2284d3(0xbf));if(_0x3fae3f&&!_0x3f014d)throw CliErrors[_0x2284d3(0xd3)](_0x2284d3(0xc9),'The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.');return{..._0x229ce9?{'roleCode':_0x229ce9}:{},..._0x4ac60c?{'roleName':_0x4571bb}:{},..._0x3fae3f?{'remark':_0x3f014d}:{}};}function a57_0x4268(_0x86527,_0x149c23){_0x86527=_0x86527-0xb8;const _0x175452=a57_0x1754();let _0x42685b=_0x175452[_0x86527];return _0x42685b;}async function prepare(_0x2c2e1a){const _0x511c37=a57_0x4268,_0x608451=await getRuntimeRoleById(_0x2c2e1a[_0x511c37(0xbb)],_0x2c2e1a['num']('id'));return assertCustomRuntimeRole(_0x608451,_0x511c37(0xc2)),{'role':_0x608451,'body':{'id':_0x608451['id'],'appCode':_0x2c2e1a[_0x511c37(0xbb)],...updateFields(_0x2c2e1a)}};}export const roleUpdate={'service':a57_0x1941a3(0xd0),'command':a57_0x1941a3(0xc2),'description':a57_0x1941a3(0xcb),'risk':'high-risk-write','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':a57_0x1941a3(0xbd),'type':'string','description':a57_0x1941a3(0xc7)},{'name':'remark','type':a57_0x1941a3(0xc4),'description':a57_0x1941a3(0xbc)}],async 'validate'(_0x557948){updateFields(_0x557948);},async 'dryRun'(_0x49cae9){const _0x42c400=a57_0x1941a3,{body:_0x3052fd}=await prepare(_0x49cae9);return dryRun(_0x42c400(0xcc),_0x42c400(0xc6))['body'](_0x3052fd)['description']('Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role')[_0x42c400(0xb8)]();},async 'execute'(_0x3e1b86){const _0x3a56d1=a57_0x1941a3,{role:_0x11e540,body:_0x326b6c}=await prepare(_0x3e1b86),_0x40286d=await updateRuntimeAppRole(_0x326b6c);return{'ok':!![],'data':runtimeRoleWriteResult(_0x3a56d1(0xc2),{'roleId':_0x11e540['id']},projectRuntimeRole(_0x11e540),projectRuntimeRole(_0x40286d),{'method':_0x3a56d1(0xcc),'path':_0x3a56d1(0xc6)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a58_0x3bd7(_0x4f60c4,_0x1d545d){_0x4f60c4=_0x4f60c4-0xc6;const _0x40f479=a58_0x40f4();let _0x3bd71d=_0x40f479[_0x4f60c4];return _0x3bd71d;}const a58_0x52fcaa=a58_0x3bd7;(function(_0x4aa93b,_0x4022eb){const _0x22af2a=a58_0x3bd7,_0x4e039b=_0x4aa93b();while(!![]){try{const _0x6a74ea=-parseInt(_0x22af2a(0xdb))/0x1+parseInt(_0x22af2a(0xd0))/0x2+-parseInt(_0x22af2a(0xd2))/0x3*(-parseInt(_0x22af2a(0xdc))/0x4)+-parseInt(_0x22af2a(0xd7))/0x5*(parseInt(_0x22af2a(0xcd))/0x6)+-parseInt(_0x22af2a(0xcc))/0x7*(-parseInt(_0x22af2a(0xd1))/0x8)+-parseInt(_0x22af2a(0xdd))/0x9+parseInt(_0x22af2a(0xc9))/0xa;if(_0x6a74ea===_0x4022eb)break;else _0x4e039b['push'](_0x4e039b['shift']());}catch(_0x41979e){_0x4e039b['push'](_0x4e039b['shift']());}}}(a58_0x40f4,0x625a4));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';function a58_0x40f4(){const _0x590eac=['12NOfCFP','appCode','user-add','1054020nFhSKR','320VZMZfr','147InYwDe','description','body','Adds\x20the\x20given\x20runtime\x20user\x20to\x20the\x20target\x20role.\x20The\x20user\x20receives\x20the\x20permissions\x20of\x20that\x20role.','POST','1710275MeZtYb','role','build','warnings','236921zEjfpQ','32408BJoYqr','4502349QhyFVi','roleList','high-risk-write','after','shouldWrite','2591760hMwuTA','/client/permit/user-role/update-user-list','userId','112168EeSSzQ'];a58_0x40f4=function(){return _0x590eac;};return a58_0x40f4();}export const roleUserAdd={'service':'role','command':'user-add','description':'Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','risk':a58_0x52fcaa(0xc6),'confirmationDescription':a58_0x52fcaa(0xd5),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x2e9184){const _0x423373=a58_0x52fcaa,_0x6a8142=await prepareRuntimeMemberMutation(_0x2e9184,_0x423373(0xcf));return dryRun(_0x423373(0xd6),_0x423373(0xca))[_0x423373(0xd4)]({'appCode':_0x2e9184[_0x423373(0xce)],'roleList':_0x6a8142[_0x423373(0xde)]})[_0x423373(0xd3)](_0x6a8142[_0x423373(0xc8)]?'Preview:\x20add\x20runtime\x20role\x20member':_0x6a8142[_0x423373(0xda)][0x0])[_0x423373(0xd9)]();},async 'execute'(_0x49ae4b){const _0x1a93bb=a58_0x52fcaa,_0x88b336=await prepareRuntimeMemberMutation(_0x49ae4b,_0x1a93bb(0xcf));return _0x88b336[_0x1a93bb(0xc8)]&&await updateRuntimeRoleUsers(_0x49ae4b[_0x1a93bb(0xce)],_0x88b336[_0x1a93bb(0xde)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x1a93bb(0xcf),{'roleId':_0x88b336[_0x1a93bb(0xd8)]['id'],'userId':_0x88b336[_0x1a93bb(0xcb)]},_0x88b336['before'],_0x88b336[_0x1a93bb(0xc7)],{'method':_0x1a93bb(0xd6),'path':_0x1a93bb(0xca)},_0x88b336[_0x1a93bb(0xda)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x46c87c=a59_0x1673;(function(_0x45f6f1,_0x19cfae){const _0x5b4cd5=a59_0x1673,_0x29b462=_0x45f6f1();while(!![]){try{const _0x972316=-parseInt(_0x5b4cd5(0x166))/0x1*(parseInt(_0x5b4cd5(0x16a))/0x2)+parseInt(_0x5b4cd5(0x16b))/0x3+-parseInt(_0x5b4cd5(0x170))/0x4+parseInt(_0x5b4cd5(0x177))/0x5*(parseInt(_0x5b4cd5(0x161))/0x6)+parseInt(_0x5b4cd5(0x173))/0x7*(-parseInt(_0x5b4cd5(0x164))/0x8)+-parseInt(_0x5b4cd5(0x16e))/0x9+parseInt(_0x5b4cd5(0x168))/0xa;if(_0x972316===_0x19cfae)break;else _0x29b462['push'](_0x29b462['shift']());}catch(_0x3c75c7){_0x29b462['push'](_0x29b462['shift']());}}}(a59_0x4e3a,0xa7443));function a59_0x1673(_0x5a1d0f,_0x582ec3){_0x5a1d0f=_0x5a1d0f-0x161;const _0x4e3a28=a59_0x4e3a();let _0x167383=_0x4e3a28[_0x5a1d0f];return _0x167383;}import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a59_0x4e3a(){const _0x367a17=['4596iyssSV','role','after','2021368GfORkQ','before','1dfeybP','Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','30478190PuclFW','shouldWrite','1573244NfZiyV','3399837ENSRsF','body','roleList','9175041petVEI','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','4283020vqfKAk','warnings','user-remove','35YFqCLu','POST','/client/permit/user-role/update-user-list','appCode','4205XocDil'];a59_0x4e3a=function(){return _0x367a17;};return a59_0x4e3a();}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a59_0x46c87c(0x162),'command':a59_0x46c87c(0x172),'description':a59_0x46c87c(0x16f),'risk':'high-risk-write','confirmationDescription':a59_0x46c87c(0x167),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x3ccb87){const _0x1e9a7e=a59_0x46c87c,_0x1429e9=await prepareRuntimeMemberMutation(_0x3ccb87,'user-remove');return dryRun(_0x1e9a7e(0x174),_0x1e9a7e(0x175))[_0x1e9a7e(0x16c)]({'appCode':_0x3ccb87[_0x1e9a7e(0x176)],'roleList':_0x1429e9['roleList']})['description'](_0x1429e9[_0x1e9a7e(0x169)]?'Preview:\x20remove\x20runtime\x20role\x20member':_0x1429e9[_0x1e9a7e(0x171)][0x0])['build']();},async 'execute'(_0x4a34c8){const _0x57c1a3=a59_0x46c87c,_0x1f14ee=await prepareRuntimeMemberMutation(_0x4a34c8,_0x57c1a3(0x172));return _0x1f14ee[_0x57c1a3(0x169)]&&await updateRuntimeRoleUsers(_0x4a34c8['appCode'],_0x1f14ee[_0x57c1a3(0x16d)]),{'ok':!![],'data':runtimeRoleWriteResult('user-remove',{'roleId':_0x1f14ee[_0x57c1a3(0x162)]['id'],'userId':_0x1f14ee['userId']},_0x1f14ee[_0x57c1a3(0x165)],_0x1f14ee[_0x57c1a3(0x163)],{'method':_0x57c1a3(0x174),'path':_0x57c1a3(0x175)},_0x1f14ee['warnings'])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a60_0x532a0f=a60_0x1423;(function(_0x56d215,_0x1e32ec){const _0x32ef27=a60_0x1423,_0x5b3897=_0x56d215();while(!![]){try{const _0x1b12dd=-parseInt(_0x32ef27(0x1a7))/0x1*(-parseInt(_0x32ef27(0x186))/0x2)+parseInt(_0x32ef27(0x185))/0x3+parseInt(_0x32ef27(0x199))/0x4*(-parseInt(_0x32ef27(0x1bd))/0x5)+-parseInt(_0x32ef27(0x19f))/0x6*(-parseInt(_0x32ef27(0x1c3))/0x7)+parseInt(_0x32ef27(0x187))/0x8+-parseInt(_0x32ef27(0x1bc))/0x9*(-parseInt(_0x32ef27(0x1c7))/0xa)+parseInt(_0x32ef27(0x1b8))/0xb*(-parseInt(_0x32ef27(0x1c6))/0xc);if(_0x1b12dd===_0x1e32ec)break;else _0x5b3897['push'](_0x5b3897['shift']());}catch(_0x105700){_0x5b3897['push'](_0x5b3897['shift']());}}}(a60_0x4a56,0x2196d));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':a60_0x532a0f(0x18f),'type':'string','required':!![],'enum':[a60_0x532a0f(0x1bb),a60_0x532a0f(0x184)],'description':a60_0x532a0f(0x1c1)},CRON_FLAG={'name':'cron','type':'string','description':a60_0x532a0f(0x197)},SCHEDULED_AT_FLAG={'name':a60_0x532a0f(0x198),'type':a60_0x532a0f(0x1a8),'description':a60_0x532a0f(0x1ad)},TITLE_FLAG={'name':a60_0x532a0f(0x1a4),'type':a60_0x532a0f(0x1a8),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a60_0x532a0f(0x194),'type':'string','required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},MODEL_FLAG={'name':a60_0x532a0f(0x1b5),'type':a60_0x532a0f(0x1a8),'enum':[a60_0x532a0f(0x1be),'deepseek-v4-flash-0731',a60_0x532a0f(0x1b6)],'default':a60_0x532a0f(0x19b),'description':a60_0x532a0f(0x196)},SCHEDULE_ID_FLAG={'name':a60_0x532a0f(0x1b3),'type':'string','required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a60_0x532a0f(0x18b)}},LIMIT_FLAG={'name':a60_0x532a0f(0x1ac),'type':a60_0x532a0f(0x1ab),'default':0x14,'description':a60_0x532a0f(0x1a0)},CURSOR_FLAG={'name':a60_0x532a0f(0x188),'type':a60_0x532a0f(0x1a8),'description':a60_0x532a0f(0x19d)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x4a9e77){const _0x2a0ad9=a60_0x532a0f,_0x46599f=_0x4a9e77['str'](_0x2a0ad9(0x18f)),_0x4bb315=_0x4a9e77[_0x2a0ad9(0x1b0)](_0x2a0ad9(0x1a4))[_0x2a0ad9(0x1a6)](),_0x2a4455=_0x4a9e77[_0x2a0ad9(0x1b0)](_0x2a0ad9(0x194))['trim'](),_0xf10420=_0x4a9e77[_0x2a0ad9(0x1b0)](_0x2a0ad9(0x1b5)),_0x236aec=_0x4a9e77[_0x2a0ad9(0x1b0)](_0x2a0ad9(0x1c8)),_0x5bf53b=_0x4a9e77[_0x2a0ad9(0x1b0)](_0x2a0ad9(0x198));if(!_0x4bb315)throw CliErrors[_0x2a0ad9(0x1c9)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x2a4455)throw CliErrors[_0x2a0ad9(0x1c9)](_0x2a0ad9(0x1ae));if(_0x46599f===_0x2a0ad9(0x1bb)){if(!_0x236aec||_0x5bf53b)throw CliErrors[_0x2a0ad9(0x1c9)]('CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.');return{'kind':_0x46599f,'timezone':_0x2a0ad9(0x18a),'cron':_0x236aec,'title':_0x4bb315,'prompt':_0x2a4455,'model':_0xf10420};}if(_0x46599f===_0x2a0ad9(0x184)){if(!_0x5bf53b||_0x236aec)throw CliErrors[_0x2a0ad9(0x1c9)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x46599f,'timezone':_0x2a0ad9(0x18a),'scheduledAt':_0x5bf53b,'title':_0x4bb315,'prompt':_0x2a4455,'model':_0xf10420};}throw CliErrors['validation']('--kind\x20must\x20be\x20CRON\x20or\x20ONCE.');}function scheduleCollectionPath(_0x543e2f){const _0xb036fb=a60_0x532a0f;return _0xb036fb(0x192)+encodeURIComponent(_0x543e2f)+'/schedules';}function scheduleItemPath(_0x1a76c3,_0x468c89){return scheduleCollectionPath(_0x1a76c3)+'/'+encodeURIComponent(_0x468c89);}function a60_0x1423(_0x2997da,_0xb77524){_0x2997da=_0x2997da-0x182;const _0x4a568f=a60_0x4a56();let _0x1423ef=_0x4a568f[_0x2997da];return _0x1423ef;}const scheduleValidate={'service':a60_0x532a0f(0x195),'command':a60_0x532a0f(0x1b2),'description':a60_0x532a0f(0x1ba),'risk':a60_0x532a0f(0x1b4),'flags':INPUT_FLAGS,async 'validate'(_0x3c4bd5){readScheduleInput(_0x3c4bd5);},async 'execute'(_0xa04b15){const _0x2bbb32=a60_0x532a0f,_0x5e1dd7=readScheduleInput(_0xa04b15),_0x2e7efd=await validateRuntimeSchedule(_0xa04b15['appCode'],_0x5e1dd7);return{'ok':!![],'data':_0x2e7efd,'message':_0x2bbb32(0x18c)};}},scheduleCreate={'service':a60_0x532a0f(0x195),'command':a60_0x532a0f(0x1b1),'description':'Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','risk':a60_0x532a0f(0x18d),'confirmationDescription':a60_0x532a0f(0x19c),'flags':INPUT_FLAGS,async 'validate'(_0x2a394f){readScheduleInput(_0x2a394f);},async 'execute'(_0x51620d){const _0x251e7b=a60_0x532a0f,_0x9329dc=readScheduleInput(_0x51620d),_0x46a541=await validateRuntimeSchedule(_0x51620d[_0x251e7b(0x1a3)],_0x9329dc),_0x1d1cbc=await createRuntimeSchedule(_0x51620d[_0x251e7b(0x1a3)],_0x46a541);return{'ok':!![],'data':_0x1d1cbc,'message':'Created\x20'+_0x1d1cbc[_0x251e7b(0x18f)]+_0x251e7b(0x1a1)+_0x1d1cbc[_0x251e7b(0x183)]};},async 'dryRun'(_0x19bf73){const _0x47549c=a60_0x532a0f,_0x4290fc=readScheduleInput(_0x19bf73);return dryRun(_0x47549c(0x1c5),scheduleCollectionPath(_0x19bf73[_0x47549c(0x1a3)]))[_0x47549c(0x189)](_0x4290fc)['description'](_0x47549c(0x1a5))[_0x47549c(0x1bf)]();}},scheduleList={'service':a60_0x532a0f(0x195),'command':'list','description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':'read','flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x48bc7b){const _0x587ca3=a60_0x532a0f,_0x33912e=_0x48bc7b[_0x587ca3(0x193)](_0x587ca3(0x1ac));if(!Number['isSafeInteger'](_0x33912e)||_0x33912e<0x1||_0x33912e>0x64)throw CliErrors[_0x587ca3(0x1c9)](_0x587ca3(0x1aa));const _0x4feb66=_0x48bc7b[_0x587ca3(0x1b0)](_0x587ca3(0x188));if(_0x4feb66&&(_0x4feb66['length']>0x400||_0x4feb66[_0x587ca3(0x1a6)]()!==_0x4feb66))throw CliErrors[_0x587ca3(0x1c9)](_0x587ca3(0x190));},async 'execute'(_0x41cf12){const _0x18dd21=a60_0x532a0f,_0x1113c3=_0x41cf12[_0x18dd21(0x1b0)]('cursor'),_0x487b52=await listRuntimeSchedules(_0x41cf12[_0x18dd21(0x1a3)],{'kind':_0x41cf12[_0x18dd21(0x1b0)](_0x18dd21(0x18f)),'limit':_0x41cf12[_0x18dd21(0x193)](_0x18dd21(0x1ac)),..._0x1113c3?{'cursor':_0x1113c3}:{}});return{'ok':!![],'data':_0x487b52};}},scheduleDetail={'service':a60_0x532a0f(0x195),'command':a60_0x532a0f(0x18e),'description':a60_0x532a0f(0x1c4),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3f7985){const _0x17793c=a60_0x532a0f,_0x5e0faa=await getRuntimeSchedule(_0x3f7985[_0x17793c(0x1a3)],_0x3f7985[_0x17793c(0x1b0)](_0x17793c(0x1b3)));return{'ok':!![],'data':_0x5e0faa};}},scheduleRun={'service':a60_0x532a0f(0x195),'command':a60_0x532a0f(0x1b7),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':'high-risk-write','confirmationDescription':a60_0x532a0f(0x1b9),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xbc40c7){const _0x475dd7=a60_0x532a0f,_0x10043a=_0xbc40c7[_0x475dd7(0x1b0)]('schedule-id'),_0x41c35d=await runRuntimeSchedule(_0xbc40c7[_0x475dd7(0x1a3)],_0x10043a);return{'ok':!![],'data':_0x41c35d,'message':_0x475dd7(0x1c0)+_0x41c35d[_0x475dd7(0x19a)]+_0x475dd7(0x19e)+_0x10043a};},async 'dryRun'(_0x2021e3){const _0x2057bb=a60_0x532a0f,_0xe205=_0x2021e3[_0x2057bb(0x1b0)]('schedule-id');return dryRun(_0x2057bb(0x1c5),scheduleItemPath(_0x2021e3['appCode'],_0xe205)+_0x2057bb(0x1c2))[_0x2057bb(0x1a9)](_0x2057bb(0x1a2)+_0xe205+_0x2057bb(0x1ca))['build']();}},scheduleDelete={'service':a60_0x532a0f(0x195),'command':a60_0x532a0f(0x1af),'description':'Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','risk':a60_0x532a0f(0x18d),'confirmationDescription':'Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x294ff7){const _0x38a19e=a60_0x532a0f,_0x371ab5=_0x294ff7[_0x38a19e(0x1b0)]('schedule-id'),_0x3181fe=await deleteRuntimeSchedule(_0x294ff7[_0x38a19e(0x1a3)],_0x371ab5);return{'ok':!![],'data':_0x3181fe,'message':'Deleted\x20schedule\x20'+_0x371ab5};},async 'dryRun'(_0x7d45b6){const _0xc541f8=a60_0x532a0f,_0x52e313=_0x7d45b6[_0xc541f8(0x1b0)](_0xc541f8(0x1b3));return dryRun(_0xc541f8(0x182),scheduleItemPath(_0x7d45b6[_0xc541f8(0x1a3)],_0x52e313))[_0xc541f8(0x1a9)](_0xc541f8(0x191)+_0x52e313)[_0xc541f8(0x1bf)]();}};function a60_0x4a56(){const _0x58e1fe=['POST','12CVmJik','45930JjtKDq','cron','validation','\x20immediately','DELETE','scheduleId','ONCE','569517XWunnv','86VgCLAc','393080ccIfqO','cursor','body','UTC','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Schedule\x20input\x20is\x20valid','high-risk-write','detail','kind','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Preview:\x20delete\x20schedule\x20','/api/harness/apps/','num','prompt','schedule','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','scheduled-at','10004fTomzL','taskId','deepseek-v4-flash-0731','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','\x20from\x20schedule\x20','999678UskeTi','Page\x20size\x20from\x201\x20to\x20100','\x20schedule\x20','Preview:\x20run\x20schedule\x20','appCode','title','Preview:\x20create\x20an\x20Agent\x20schedule','trim','1921BSqERe','string','description','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','number','limit','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','--prompt\x20must\x20not\x20be\x20blank.','delete','str','create','validate','schedule-id','read','model','deepseek-v4-pro-0813','run','5387437qhbsYe','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','CRON','405cTucKu','135TtDOcp','kimi/k3','build','Queued\x20Task\x20','Schedule\x20kind:\x20CRON\x20or\x20ONCE','/run','7vvpOvQ','Show\x20one\x20schedule\x20by\x20schedule\x20ID'];a60_0x4a56=function(){return _0x58e1fe;};return a60_0x4a56();}export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
const a60_0x5ab897=a60_0x2e8b;function a60_0x4e96(){const _0x3337b8=['/api/harness/apps/','trim','Deleted\x20schedule\x20','schedule-id','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','list','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','schedule','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','1485033RMouvm','Preview:\x20run\x20schedule\x20','high-risk-write','read','Preview:\x20create\x20an\x20Agent\x20schedule','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','CRON','model','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','delete','taskId','14506504zmbPBs','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','Schedule\x20UUID','1155368ZuMGIK','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','body','84qmKVUr','/schedules','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','num','Schedule\x20title','str','2015500TmVFwY','detail','159278eprBXd','title','prompt','validation','cursor','/run','951308aGVMSV','deepseek-v4-pro-0813','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','DELETE','\x20immediately','build','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','--prompt\x20must\x20not\x20be\x20blank.','description','Schedule\x20input\x20is\x20valid','9VqmvDp','Queued\x20Task\x20','Show\x20one\x20schedule\x20by\x20schedule\x20ID','isSafeInteger','cron','Preview:\x20delete\x20schedule\x20','appCode','UTC','string','POST','Prompt\x20sent\x20to\x20the\x20Agent\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.','Page\x20size\x20from\x201\x20to\x20100','kind','limit','validate','--title\x20must\x20not\x20be\x20blank.','Created\x20','691170eEfzqj','scheduleId','ONCE','Schedule\x20kind:\x20CRON\x20or\x20ONCE','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','run','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','scheduled-at','kimi/k3','\x20schedule\x20'];a60_0x4e96=function(){return _0x3337b8;};return a60_0x4e96();}(function(_0x59f5ee,_0x5280ca){const _0x4e7eb7=a60_0x2e8b,_0x830e18=_0x59f5ee();while(!![]){try{const _0x2d3b5e=parseInt(_0x4e7eb7(0x16e))/0x1+parseInt(_0x4e7eb7(0x18f))/0x2+parseInt(_0x4e7eb7(0x181))/0x3+-parseInt(_0x4e7eb7(0x1a0))/0x4+parseInt(_0x4e7eb7(0x198))/0x5+parseInt(_0x4e7eb7(0x192))/0x6*(parseInt(_0x4e7eb7(0x19a))/0x7)+-parseInt(_0x4e7eb7(0x18c))/0x8*(parseInt(_0x4e7eb7(0x15c))/0x9);if(_0x2d3b5e===_0x5280ca)break;else _0x830e18['push'](_0x830e18['shift']());}catch(_0x34480a){_0x830e18['push'](_0x830e18['shift']());}}}(a60_0x4e96,0x6a0cd));function a60_0x2e8b(_0x3e6eaa,_0x204c9e){_0x3e6eaa=_0x3e6eaa-0x15b;const _0x4e96d3=a60_0x4e96();let _0x2e8b86=_0x4e96d3[_0x3e6eaa];return _0x2e8b86;}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':a60_0x5ab897(0x169),'type':a60_0x5ab897(0x164),'required':!![],'enum':[a60_0x5ab897(0x187),a60_0x5ab897(0x170)],'description':a60_0x5ab897(0x171)},CRON_FLAG={'name':a60_0x5ab897(0x160),'type':'string','description':a60_0x5ab897(0x18d)},SCHEDULED_AT_FLAG={'name':'scheduled-at','type':a60_0x5ab897(0x164),'description':a60_0x5ab897(0x180)},TITLE_FLAG={'name':a60_0x5ab897(0x19b),'type':a60_0x5ab897(0x164),'required':!![],'description':a60_0x5ab897(0x196)},PROMPT_FLAG={'name':'prompt','type':a60_0x5ab897(0x164),'required':!![],'description':a60_0x5ab897(0x166)},MODEL_FLAG={'name':'model','type':a60_0x5ab897(0x164),'enum':[a60_0x5ab897(0x176),'deepseek-v4-flash-0731',a60_0x5ab897(0x1a1)],'default':'deepseek-v4-flash-0731','description':a60_0x5ab897(0x17e)},SCHEDULE_ID_FLAG={'name':a60_0x5ab897(0x17b),'type':'string','required':!![],'description':a60_0x5ab897(0x18e),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a60_0x5ab897(0x190)}},LIMIT_FLAG={'name':a60_0x5ab897(0x16a),'type':'number','default':0x14,'description':a60_0x5ab897(0x168)},CURSOR_FLAG={'name':a60_0x5ab897(0x19e),'type':a60_0x5ab897(0x164),'description':a60_0x5ab897(0x194)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0xed3e6c){const _0x624597=a60_0x5ab897,_0x303dd1=_0xed3e6c[_0x624597(0x197)](_0x624597(0x169)),_0x38832a=_0xed3e6c[_0x624597(0x197)](_0x624597(0x19b))[_0x624597(0x179)](),_0x5d54af=_0xed3e6c[_0x624597(0x197)](_0x624597(0x19c))['trim'](),_0x58fdb8=_0xed3e6c[_0x624597(0x197)](_0x624597(0x188)),_0x582d16=_0xed3e6c['str'](_0x624597(0x160)),_0x1e2d72=_0xed3e6c['str'](_0x624597(0x175));if(!_0x38832a)throw CliErrors['validation'](_0x624597(0x16c));if(!_0x5d54af)throw CliErrors[_0x624597(0x19d)](_0x624597(0x1a9));if(_0x303dd1===_0x624597(0x187)){if(!_0x582d16||_0x1e2d72)throw CliErrors['validation'](_0x624597(0x17c));return{'kind':_0x303dd1,'timezone':_0x624597(0x163),'cron':_0x582d16,'title':_0x38832a,'prompt':_0x5d54af,'model':_0x58fdb8};}if(_0x303dd1===_0x624597(0x170)){if(!_0x1e2d72||_0x582d16)throw CliErrors[_0x624597(0x19d)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x303dd1,'timezone':_0x624597(0x163),'scheduledAt':_0x1e2d72,'title':_0x38832a,'prompt':_0x5d54af,'model':_0x58fdb8};}throw CliErrors['validation'](_0x624597(0x189));}function scheduleCollectionPath(_0x489d57){const _0x17929a=a60_0x5ab897;return _0x17929a(0x178)+encodeURIComponent(_0x489d57)+_0x17929a(0x193);}function scheduleItemPath(_0x2b1d42,_0x32fa1a){return scheduleCollectionPath(_0x2b1d42)+'/'+encodeURIComponent(_0x32fa1a);}const scheduleValidate={'service':'schedule','command':a60_0x5ab897(0x16b),'description':'Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','risk':a60_0x5ab897(0x184),'flags':INPUT_FLAGS,async 'validate'(_0x35cde8){readScheduleInput(_0x35cde8);},async 'execute'(_0x26b2ce){const _0x27d39d=a60_0x5ab897,_0x381f42=readScheduleInput(_0x26b2ce),_0x3cc83f=await validateRuntimeSchedule(_0x26b2ce[_0x27d39d(0x162)],_0x381f42);return{'ok':!![],'data':_0x3cc83f,'message':_0x27d39d(0x15b)};}},scheduleCreate={'service':a60_0x5ab897(0x17f),'command':'create','description':a60_0x5ab897(0x1a3),'risk':a60_0x5ab897(0x183),'confirmationDescription':a60_0x5ab897(0x167),'flags':INPUT_FLAGS,async 'validate'(_0x4be33b){readScheduleInput(_0x4be33b);},async 'execute'(_0x17f8df){const _0x1fd740=a60_0x5ab897,_0x1c07fe=readScheduleInput(_0x17f8df),_0x19a448=await validateRuntimeSchedule(_0x17f8df[_0x1fd740(0x162)],_0x1c07fe),_0x5823d0=await createRuntimeSchedule(_0x17f8df[_0x1fd740(0x162)],_0x19a448);return{'ok':!![],'data':_0x5823d0,'message':_0x1fd740(0x16d)+_0x5823d0[_0x1fd740(0x169)]+_0x1fd740(0x177)+_0x5823d0[_0x1fd740(0x16f)]};},async 'dryRun'(_0xecbf28){const _0x3113c2=a60_0x5ab897,_0x35460e=readScheduleInput(_0xecbf28);return dryRun('POST',scheduleCollectionPath(_0xecbf28[_0x3113c2(0x162)]))[_0x3113c2(0x191)](_0x35460e)[_0x3113c2(0x1aa)](_0x3113c2(0x185))[_0x3113c2(0x1a7)]();}},scheduleList={'service':a60_0x5ab897(0x17f),'command':a60_0x5ab897(0x17d),'description':a60_0x5ab897(0x1a2),'risk':'read','flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x4b2812){const _0x2425ec=a60_0x5ab897,_0x262065=_0x4b2812[_0x2425ec(0x195)]('limit');if(!Number[_0x2425ec(0x15f)](_0x262065)||_0x262065<0x1||_0x262065>0x64)throw CliErrors[_0x2425ec(0x19d)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x599763=_0x4b2812[_0x2425ec(0x197)]('cursor');if(_0x599763&&(_0x599763['length']>0x400||_0x599763['trim']()!==_0x599763))throw CliErrors[_0x2425ec(0x19d)](_0x2425ec(0x1a4));},async 'execute'(_0x56b129){const _0xeece40=a60_0x5ab897,_0x15e6c0=_0x56b129[_0xeece40(0x197)](_0xeece40(0x19e)),_0x7bf165=await listRuntimeSchedules(_0x56b129[_0xeece40(0x162)],{'kind':_0x56b129[_0xeece40(0x197)]('kind'),'limit':_0x56b129[_0xeece40(0x195)]('limit'),..._0x15e6c0?{'cursor':_0x15e6c0}:{}});return{'ok':!![],'data':_0x7bf165};}},scheduleDetail={'service':a60_0x5ab897(0x17f),'command':a60_0x5ab897(0x199),'description':a60_0x5ab897(0x15e),'risk':a60_0x5ab897(0x184),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x42d102){const _0x49c2d7=a60_0x5ab897,_0x1cbe55=await getRuntimeSchedule(_0x42d102['appCode'],_0x42d102[_0x49c2d7(0x197)](_0x49c2d7(0x17b)));return{'ok':!![],'data':_0x1cbe55};}},scheduleRun={'service':a60_0x5ab897(0x17f),'command':a60_0x5ab897(0x173),'description':a60_0x5ab897(0x186),'risk':a60_0x5ab897(0x183),'confirmationDescription':a60_0x5ab897(0x174),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x38cc1a){const _0x4bfe60=a60_0x5ab897,_0xb8c540=_0x38cc1a[_0x4bfe60(0x197)](_0x4bfe60(0x17b)),_0x54a06f=await runRuntimeSchedule(_0x38cc1a['appCode'],_0xb8c540);return{'ok':!![],'data':_0x54a06f,'message':_0x4bfe60(0x15d)+_0x54a06f[_0x4bfe60(0x18b)]+'\x20from\x20schedule\x20'+_0xb8c540};},async 'dryRun'(_0x10936c){const _0x2cd4b7=a60_0x5ab897,_0x5a3c56=_0x10936c[_0x2cd4b7(0x197)](_0x2cd4b7(0x17b));return dryRun(_0x2cd4b7(0x165),scheduleItemPath(_0x10936c[_0x2cd4b7(0x162)],_0x5a3c56)+_0x2cd4b7(0x19f))[_0x2cd4b7(0x1aa)](_0x2cd4b7(0x182)+_0x5a3c56+_0x2cd4b7(0x1a6))[_0x2cd4b7(0x1a7)]();}},scheduleDelete={'service':'schedule','command':a60_0x5ab897(0x18a),'description':a60_0x5ab897(0x1a8),'risk':a60_0x5ab897(0x183),'confirmationDescription':a60_0x5ab897(0x172),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x39936d){const _0x4d53bd=a60_0x5ab897,_0x29d9d3=_0x39936d['str'](_0x4d53bd(0x17b)),_0x1f18ec=await deleteRuntimeSchedule(_0x39936d[_0x4d53bd(0x162)],_0x29d9d3);return{'ok':!![],'data':_0x1f18ec,'message':_0x4d53bd(0x17a)+_0x29d9d3};},async 'dryRun'(_0x935668){const _0x2a1463=a60_0x5ab897,_0x397d3a=_0x935668[_0x2a1463(0x197)]('schedule-id');return dryRun(_0x2a1463(0x1a5),scheduleItemPath(_0x935668[_0x2a1463(0x162)],_0x397d3a))[_0x2a1463(0x1aa)](_0x2a1463(0x161)+_0x397d3a)[_0x2a1463(0x1a7)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a61_0xc849(_0x2707a9,_0xcd831c){_0x2707a9=_0x2707a9-0x1e9;const _0x414e1d=a61_0x414e();let _0xc849d3=_0x414e1d[_0x2707a9];return _0xc849d3;}const a61_0x2fa544=a61_0xc849;function a61_0x414e(){const _0x63cc14=['577599SraQBN','10JIaGom','2968APdipa','schema','8664481ALjqTI','3698972Tpqvfy','Export\x20machine-readable\x20command\x20schema\x20(JSON)','125289pVpXwk','5855760rNwudo','715194IqDoeb','export','3551380PodiYz','read'];a61_0x414e=function(){return _0x63cc14;};return a61_0x414e();}(function(_0x38ed77,_0x3fed82){const _0x5a6a29=a61_0xc849,_0x12df5=_0x38ed77();while(!![]){try{const _0x41c243=-parseInt(_0x5a6a29(0x1f1))/0x1+-parseInt(_0x5a6a29(0x1ef))/0x2+parseInt(_0x5a6a29(0x1ed))/0x3+parseInt(_0x5a6a29(0x1e9))/0x4*(-parseInt(_0x5a6a29(0x1f2))/0x5)+parseInt(_0x5a6a29(0x1ec))/0x6+-parseInt(_0x5a6a29(0x1f5))/0x7+parseInt(_0x5a6a29(0x1f3))/0x8*(parseInt(_0x5a6a29(0x1eb))/0x9);if(_0x41c243===_0x3fed82)break;else _0x12df5['push'](_0x12df5['shift']());}catch(_0x1f8820){_0x12df5['push'](_0x12df5['shift']());}}}(a61_0x414e,0xe51fb));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x28d229){const _0x498d65=await buildSchemaPayload();return{'ok':!![],'data':_0x498d65};}export const schemaDefinition={'service':a61_0x2fa544(0x1f4),'command':a61_0x2fa544(0x1ee),'description':a61_0x2fa544(0x1ea),'risk':a61_0x2fa544(0x1f0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1e5a81,_0x144116){const _0x586ad0=a62_0x49d8,_0x57c390=_0x1e5a81();while(!![]){try{const _0x1fb39a=-parseInt(_0x586ad0(0x172))/0x1*(-parseInt(_0x586ad0(0x1a7))/0x2)+parseInt(_0x586ad0(0x14e))/0x3*(parseInt(_0x586ad0(0x17b))/0x4)+-parseInt(_0x586ad0(0x1a2))/0x5*(-parseInt(_0x586ad0(0x1a6))/0x6)+parseInt(_0x586ad0(0x14c))/0x7*(-parseInt(_0x586ad0(0x152))/0x8)+parseInt(_0x586ad0(0x162))/0x9*(-parseInt(_0x586ad0(0x170))/0xa)+parseInt(_0x586ad0(0x16e))/0xb*(-parseInt(_0x586ad0(0x177))/0xc)+parseInt(_0x586ad0(0x1a8))/0xd;if(_0x1fb39a===_0x144116)break;else _0x57c390['push'](_0x57c390['shift']());}catch(_0x8d9eb0){_0x57c390['push'](_0x57c390['shift']());}}}(a62_0x34ef,0xcbf59));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(_0x19483d,_0x447120){const _0x2948c3=a62_0x49d8,_0x27500f=listLocalServiceTrees();let _0x58db01;for(const _0x32ac3e of _0x27500f){const _0x2b67ef=matchServiceTreeCommand(_0x32ac3e,_0x19483d);if(!_0x2b67ef)continue;(!_0x58db01||_0x2b67ef[_0x2948c3(0x16a)][_0x2948c3(0x15f)][_0x2948c3(0x17d)]>_0x58db01[_0x2948c3(0x16a)][_0x2948c3(0x15f)][_0x2948c3(0x17d)])&&(_0x58db01={'tree':_0x32ac3e,'command':_0x2b67ef['command'],'remainingArgs':_0x2b67ef['remainingArgs']});}if(!_0x58db01)return undefined;const _0x2b58ea={..._0x447120};return applyAppBinding(_0x58db01[_0x2948c3(0x191)],_0x58db01[_0x2948c3(0x16a)],_0x2b58ea),{'definition':buildDynamicCommandDefinition(_0x58db01[_0x2948c3(0x191)],_0x58db01[_0x2948c3(0x16a)]),'args':_0x58db01[_0x2948c3(0x156)],'flags':_0x2b58ea,'tree':_0x58db01[_0x2948c3(0x191)],'command':_0x58db01[_0x2948c3(0x16a)]};}export function generateDynamicServiceHelp(_0x4dbf4f){const _0x7f47ab=a62_0x49d8,_0x276b38=listLocalServiceTrees()['find'](_0x95b270=>_0x95b270[_0x7f47ab(0x1a4)][_0x7f47ab(0x168)]===_0x4dbf4f);if(!_0x276b38)return undefined;const _0x228ccd=[CLI_BIN_NAME+'\x20'+_0x4dbf4f+_0x7f47ab(0x189),'',_0x276b38[_0x7f47ab(0x1a4)][_0x7f47ab(0x193)]||_0x4dbf4f,_0x276b38[_0x7f47ab(0x1a4)][_0x7f47ab(0x179)]?'\x20\x20'+_0x276b38[_0x7f47ab(0x1a4)][_0x7f47ab(0x179)]:'','','Commands:',..._0x276b38[_0x7f47ab(0x158)][_0x7f47ab(0x184)](_0x4f57ab=>{const _0x297cdf=_0x7f47ab,_0x7a4206=_0x4f57ab[_0x297cdf(0x15f)]['slice'](0x1)[_0x297cdf(0x14b)]('\x20'),_0x1fc04d=_0x4f57ab[_0x297cdf(0x142)]===_0x297cdf(0x1a9)?'':'\x20['+_0x4f57ab[_0x297cdf(0x142)]+']';return'\x20\x20'+_0x7a4206[_0x297cdf(0x1a5)](0x18)+'\x20'+(_0x4f57ab['description']||'')+_0x1fc04d;}),'','Use\x20`'+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x4dbf4f+_0x7f47ab(0x18f)][_0x7f47ab(0x154)](Boolean);return _0x228ccd[_0x7f47ab(0x14b)]('\x0a');}export function listDynamicServiceEntries(){const _0x4426a2=a62_0x49d8;return listLocalServices()[_0x4426a2(0x184)](_0x475a1c=>{const _0x285cd8=_0x4426a2,_0x3f6c94=_0x475a1c[_0x285cd8(0x181)];return{'service':_0x3f6c94[_0x285cd8(0x1a4)][_0x285cd8(0x168)],'label':_0x3f6c94[_0x285cd8(0x1a4)][_0x285cd8(0x193)]||_0x3f6c94[_0x285cd8(0x1a4)][_0x285cd8(0x168)],'commands':_0x3f6c94[_0x285cd8(0x158)][_0x285cd8(0x184)](_0xa652f2=>({'command':dynamicCommandName(_0xa652f2),'description':_0xa652f2[_0x285cd8(0x179)]||'Run\x20service\x20command\x20'+_0xa652f2[_0x285cd8(0x180)],'tag':riskTag(_0xa652f2[_0x285cd8(0x142)])}))};});}export function getDynamicServiceEntry(_0x3c5d3c){const _0x2b8428=a62_0x49d8;return listDynamicServiceEntries()[_0x2b8428(0x18c)](_0x1e9616=>_0x1e9616[_0x2b8428(0x1a4)]===_0x3c5d3c);}export function listDynamicServiceDefinitions(_0x6608c1){const _0x46273e=a62_0x49d8;return listLocalServiceTrees()['filter'](_0x174efc=>!_0x6608c1||_0x174efc[_0x46273e(0x1a4)]['code']===_0x6608c1)[_0x46273e(0x173)](_0x38bb3b=>_0x38bb3b['commands'][_0x46273e(0x184)](_0x432dfe=>buildDynamicCommandDefinition(_0x38bb3b,_0x432dfe)));}function a62_0x34ef(){const _0x445334=['dbtableConfig','join','7LhwztR','Run\x20service\x20command\x20','1416642PIrEwI','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','appBindings','app','4078288qUxaAw','\x20\x20MAP\x20TO','filter','\x20->\x20','remainingArgs','SERVICE_TREE','commands','Service\x20command\x20','kind','\x22\x20in\x20service\x20command\x20','scriptName','envName','Preview\x20dynamic\x20service\x20command:\x20','fullPath','enum','\x20\x20\x20\x20sqlCode:\x20','13202073qxpFXB','\x20\x20\x20\x20datasetCode:\x20','default','bff','string','sqlCode','code','cliName','command','appRef','Unsupported\x20service\x20target\x20kind:\x20','now','143uyVANd','\x20\x20\x20\x20datatable:\x20','10ZRziWS','required','54uREAML','flatMap','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','tableName','boolean','557724BQyCto','bffId','description','high-risk-write','12kRRwHV','\x20\x20\x20\x20command:\x20','length','employeeId','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','cliPath','normalizedManifest','\x22.\x20','appcode','map','nickname','entries','userName','type','\x20<command>\x20[flags]','args','\x20\x20\x20\x20kind:\x20\x20\x20\x20','find','userId','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','`\x20to\x20inspect\x20the\x20manifest.','\x20\x20\x20\x20functionName:\x20','tree','datatable','name','data','push','\x20requires\x20target.functionName.','\x20requires\x20target.sqlCode.','\x20\x20SERVICE\x20TREE\x20TARGET','mapTo','appCode','operator','validation','trim','datasetCode','context.','bffCode','fromEntries','5ZCAplu','\x20completed\x20in\x20','service','padEnd','8940588OpOnNO','17540YNWmnF','467753XwAedN','read','username','env','source','risk','ctx.','Unknown\x20appRef\x20\x22','sql','number','params','nickName','target'];a62_0x34ef=function(){return _0x445334;};return a62_0x34ef();}export function getDynamicServiceDefinitions(_0x1edbff){const _0x2f8ceb=listDynamicServiceDefinitions(_0x1edbff);return _0x2f8ceb['length']>0x0?_0x2f8ceb:undefined;}export function findDynamicServiceDefinition(_0x294193,_0x3093d6){const _0x5c4acb=a62_0x49d8;return listDynamicServiceDefinitions(_0x294193)[_0x5c4acb(0x18c)](_0x437a53=>_0x437a53[_0x5c4acb(0x16a)]===_0x3093d6);}export function buildDynamicCommandDefinition(_0x335934,_0x586ab5){const _0x3a6425=a62_0x49d8;return{'service':_0x335934['service'][_0x3a6425(0x168)],'command':dynamicCommandName(_0x586ab5),'description':_0x586ab5[_0x3a6425(0x179)]||_0x3a6425(0x14d)+_0x586ab5['cliPath'],'risk':_0x586ab5['risk'],..._0x586ab5[_0x3a6425(0x142)]==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x586ab5)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x586ab5[_0x3a6425(0x18a)]['map'](_0x3691d3=>({'name':_0x3691d3['name'],'description':_0x3691d3[_0x3a6425(0x179)]||_0x3691d3[_0x3a6425(0x193)],'required':_0x3691d3[_0x3a6425(0x171)]})),'flags':_0x586ab5['flags'][_0x3a6425(0x184)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x586ab5),async 'dryRun'(_0x48b3e2){const _0x3c580c=_0x3a6425,_0x39e2cc=await compilePlan(_0x586ab5,_0x48b3e2);return{'method':_0x3c580c(0x157),'url':_0x586ab5[_0x3c580c(0x180)],'body':{'target':targetPreview(_0x39e2cc),'params':_0x39e2cc[_0x3c580c(0x147)]},'description':_0x3c580c(0x15e)+_0x586ab5[_0x3c580c(0x180)]};},async 'execute'(_0x995dcd){const _0x13bf11=_0x3a6425,_0x4e77b9=await compilePlan(_0x586ab5,_0x995dcd),_0x2ee081=Date[_0x13bf11(0x16d)](),_0x1ffe52=await executePlan(_0x4e77b9,_0x586ab5,_0x995dcd),_0x36b6b7=Date[_0x13bf11(0x16d)]()-_0x2ee081;return{'ok':!![],'data':{'service':_0x335934[_0x13bf11(0x1a4)],'command':_0x586ab5[_0x13bf11(0x180)],'target':targetPreview(_0x4e77b9),'result':_0x1ffe52,'elapsed':_0x36b6b7},'message':_0x13bf11(0x159)+_0x586ab5['cliPath']+_0x13bf11(0x1a3)+_0x36b6b7+'ms'};}};}function buildDynamicConfirmationDescription(_0x446bc2){const _0x8c2421=a62_0x49d8,_0x2cde91=_0x446bc2[_0x8c2421(0x179)]||_0x446bc2[_0x8c2421(0x180)],_0x5e9c4e=_0x446bc2[_0x8c2421(0x142)]===_0x8c2421(0x17a)?_0x8c2421(0x17f):'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.';return _0x8c2421(0x18e)+_0x2cde91+_0x8c2421(0x182)+_0x5e9c4e;}function dynamicCommandName(_0x2b86c9){const _0x4c47ac=a62_0x49d8;return _0x2b86c9[_0x4c47ac(0x15f)]['slice'](0x1)[_0x4c47ac(0x14b)]('\x20');}function riskTag(_0xe6a0f7){const _0x4029bd=a62_0x49d8;return _0xe6a0f7===_0x4029bd(0x1a9)?'':'\x20\x20['+_0xe6a0f7+']';}function flagToCommandFlag(_0x41d247){const _0x5918c5=a62_0x49d8;return{'name':_0x41d247[_0x5918c5(0x169)],'type':_0x41d247[_0x5918c5(0x188)]==='json'?_0x5918c5(0x166):_0x41d247['type'],'description':_0x41d247[_0x5918c5(0x179)]||_0x41d247[_0x5918c5(0x193)],'required':_0x41d247['required'],'default':isPrimitiveFlagDefault(_0x41d247['default'])?_0x41d247[_0x5918c5(0x164)]:undefined,'enum':_0x41d247[_0x5918c5(0x160)]};}async function compilePlan(_0x5624b1,_0x3fcdbf){const _0x3bf23e=a62_0x49d8;return compileServiceTreeCommand(_0x5624b1,{'flags':_0x3fcdbf['rawFlags'],'args':_0x3fcdbf[_0x3bf23e(0x18a)],'context':await buildServiceContext(_0x5624b1,_0x3fcdbf)});}async function buildServiceContext(_0x2d5ded,_0x4166c2){const _0x1cd2be=a62_0x49d8,_0x54006e={'appCode':_0x4166c2[_0x1cd2be(0x19a)],'env':_0x4166c2[_0x1cd2be(0x15d)],'envName':_0x4166c2[_0x1cd2be(0x15d)]};if(!usesRuntimeContext(_0x2d5ded))return _0x54006e;const _0x2a98f3=await getLoginUserInfo(),_0x420f18=pickFirst(_0x2a98f3[_0x1cd2be(0x18d)],_0x2a98f3['id']);return{..._0x54006e,'user':_0x2a98f3,'userId':_0x420f18,'id':_0x2a98f3['id'],'username':pickFirst(_0x2a98f3[_0x1cd2be(0x13f)],_0x2a98f3[_0x1cd2be(0x187)],_0x2a98f3['loginName']),'userName':_0x2a98f3[_0x1cd2be(0x187)],'nickname':pickFirst(_0x2a98f3[_0x1cd2be(0x185)],_0x2a98f3[_0x1cd2be(0x148)]),'nickName':_0x2a98f3[_0x1cd2be(0x148)],'tenantCode':_0x2a98f3['tenantCode'],'employeeId':_0x2a98f3[_0x1cd2be(0x17e)]};}function usesRuntimeContext(_0x4ca577){const _0x539318=a62_0x49d8;return _0x4ca577[_0x539318(0x199)]['some'](_0x3f6b81=>typeof _0x3f6b81[_0x539318(0x141)]==='string'&&(_0x3f6b81['source']['startsWith'](_0x539318(0x19f))||_0x3f6b81[_0x539318(0x141)]['startsWith'](_0x539318(0x143))));}function pickFirst(..._0x3f7e8b){const _0x20eb36=a62_0x49d8;return _0x3f7e8b[_0x20eb36(0x18c)](_0x4ff5ba=>_0x4ff5ba!==undefined&&_0x4ff5ba!==null);}async function executePlan(_0x19cf01,_0x32c65b,_0x2b08f2){const _0x479fa7=a62_0x49d8;if(_0x19cf01['kind']===_0x479fa7(0x194)){const _0x3b21d3=await resolveDatasetCode(_0x19cf01,_0x32c65b,_0x2b08f2);return executeData(_0x3b21d3,_0x19cf01[_0x479fa7(0x16a)],_0x19cf01[_0x479fa7(0x147)]);}if(_0x19cf01[_0x479fa7(0x15a)]===_0x479fa7(0x145)){if(!_0x19cf01[_0x479fa7(0x167)])throw CliErrors[_0x479fa7(0x19c)]('Service\x20command\x20'+_0x32c65b['cliPath']+_0x479fa7(0x197));return executeSdkSql(_0x19cf01[_0x479fa7(0x167)],normalizeScalarParams(_0x19cf01['params']));}if(_0x19cf01[_0x479fa7(0x15a)]===_0x479fa7(0x165)){const _0x5c35cb=_0x19cf01[_0x479fa7(0x15c)]||_0x19cf01[_0x479fa7(0x1a0)]||(_0x19cf01['bffId']==null?'':String(_0x19cf01[_0x479fa7(0x178)]));if(!_0x5c35cb)throw CliErrors[_0x479fa7(0x19c)](_0x479fa7(0x159)+_0x32c65b[_0x479fa7(0x180)]+_0x479fa7(0x196));return executeSdkBff(_0x5c35cb,_0x19cf01[_0x479fa7(0x147)]);}throw CliErrors[_0x479fa7(0x19c)](_0x479fa7(0x16c)+_0x19cf01['kind']);}async function resolveDatasetCode(_0x24d4b5,_0x7b70e5,_0x3dc543){const _0x3f8262=a62_0x49d8;if(_0x24d4b5[_0x3f8262(0x19e)])return _0x24d4b5[_0x3f8262(0x19e)];if(!_0x24d4b5['datatable'])throw CliErrors['validation'](_0x3f8262(0x159)+_0x7b70e5[_0x3f8262(0x180)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x75579a=await listDatasets(_0x3dc543['appCode']),_0x4afc18=_0x75579a[_0x3f8262(0x18c)](_0x1cd310=>_0x1cd310[_0x3f8262(0x14a)]?.[_0x3f8262(0x175)]===_0x24d4b5[_0x3f8262(0x192)]);if(!_0x4afc18?.[_0x3f8262(0x168)])throw CliErrors[_0x3f8262(0x19c)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x24d4b5[_0x3f8262(0x192)]+_0x3f8262(0x14f)+_0x3dc543[_0x3f8262(0x19a)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x4afc18[_0x3f8262(0x168)];}function applyAppBinding(_0x337576,_0x5ce013,_0x49b1c9){const _0x5f3f65=a62_0x49d8,_0x2df1a3=_0x5ce013[_0x5f3f65(0x149)][_0x5f3f65(0x16b)];if(!_0x2df1a3)return;const _0x165124=_0x337576[_0x5f3f65(0x150)][_0x2df1a3];if(!_0x165124)throw CliErrors[_0x5f3f65(0x19c)](_0x5f3f65(0x144)+_0x2df1a3+_0x5f3f65(0x15b)+_0x5ce013[_0x5f3f65(0x180)]+'.',_0x5f3f65(0x174));const _0x4d00fe=_0x165124[_0x5f3f65(0x183)]||_0x165124[_0x5f3f65(0x19a)];_0x4d00fe&&!hasText(_0x49b1c9[_0x5f3f65(0x183)])&&(_0x49b1c9[_0x5f3f65(0x183)]=_0x4d00fe),_0x165124[_0x5f3f65(0x151)]&&!hasText(_0x49b1c9[_0x5f3f65(0x151)])&&!hasText(_0x49b1c9['appcode'])&&(_0x49b1c9['app']=_0x165124[_0x5f3f65(0x151)]),_0x165124[_0x5f3f65(0x140)]&&!hasText(_0x49b1c9[_0x5f3f65(0x140)])&&(_0x49b1c9[_0x5f3f65(0x140)]=_0x165124[_0x5f3f65(0x140)]);}function renderDynamicCommandHelp(_0x3e38b8){const _0x7864c5=a62_0x49d8,_0x4ce862=[_0x7864c5(0x198),_0x7864c5(0x18b)+_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x15a)],_0x7864c5(0x17c)+_0x3e38b8['target']['command']];if(_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x19e)])_0x4ce862[_0x7864c5(0x195)](_0x7864c5(0x163)+_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x19e)]);if(_0x3e38b8['target']['datatable'])_0x4ce862[_0x7864c5(0x195)](_0x7864c5(0x16f)+_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x192)]);if(_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x167)])_0x4ce862[_0x7864c5(0x195)](_0x7864c5(0x161)+_0x3e38b8[_0x7864c5(0x149)]['sqlCode']);if(_0x3e38b8[_0x7864c5(0x149)][_0x7864c5(0x15c)])_0x4ce862[_0x7864c5(0x195)](_0x7864c5(0x190)+_0x3e38b8['target'][_0x7864c5(0x15c)]);if(_0x3e38b8[_0x7864c5(0x199)]['length']>0x0){_0x4ce862[_0x7864c5(0x195)]('',_0x7864c5(0x153));for(const _0x51e016 of _0x3e38b8[_0x7864c5(0x199)]){_0x4ce862['push']('\x20\x20\x20\x20'+(_0x51e016[_0x7864c5(0x141)]||'const')+_0x7864c5(0x155)+_0x51e016[_0x7864c5(0x149)]+(_0x51e016[_0x7864c5(0x19b)]?'.'+_0x51e016['operator']:''));}}return _0x4ce862[_0x7864c5(0x14b)]('\x0a');}function targetPreview(_0x391dba){const _0x5c7052=a62_0x49d8;return{'kind':_0x391dba[_0x5c7052(0x15a)],'command':_0x391dba[_0x5c7052(0x16a)],'appRef':_0x391dba[_0x5c7052(0x16b)],'datasetCode':_0x391dba['datasetCode'],'datatable':_0x391dba[_0x5c7052(0x192)],'sqlCode':_0x391dba[_0x5c7052(0x167)],'bffCode':_0x391dba['bffCode'],'bffId':_0x391dba[_0x5c7052(0x178)],'functionName':_0x391dba[_0x5c7052(0x15c)]};}function a62_0x49d8(_0x332764,_0x358e11){_0x332764=_0x332764-0x13f;const _0x34ef23=a62_0x34ef();let _0x49d8cd=_0x34ef23[_0x332764];return _0x49d8cd;}function normalizeScalarParams(_0x11b1a9){const _0xbb3e8f=a62_0x49d8;return Object[_0xbb3e8f(0x1a1)](Object[_0xbb3e8f(0x186)](_0x11b1a9)[_0xbb3e8f(0x154)](([,_0x4a584b])=>typeof _0x4a584b===_0xbb3e8f(0x166)||typeof _0x4a584b===_0xbb3e8f(0x146)));}function hasText(_0x39f48c){const _0x4ddae0=a62_0x49d8;return typeof _0x39f48c==='string'&&_0x39f48c[_0x4ddae0(0x19d)]()[_0x4ddae0(0x17d)]>0x0;}function isPrimitiveFlagDefault(_0x46a629){const _0x57a5b3=a62_0x49d8;return _0x46a629===undefined||typeof _0x46a629===_0x57a5b3(0x166)||typeof _0x46a629===_0x57a5b3(0x146)||typeof _0x46a629===_0x57a5b3(0x176);}
|
|
1
|
+
(function(_0x2b0b26,_0x23982e){const _0x5b0870=a62_0x36d5,_0x271b0f=_0x2b0b26();while(!![]){try{const _0x20509f=-parseInt(_0x5b0870(0x219))/0x1+parseInt(_0x5b0870(0x222))/0x2*(parseInt(_0x5b0870(0x213))/0x3)+parseInt(_0x5b0870(0x23c))/0x4*(parseInt(_0x5b0870(0x243))/0x5)+-parseInt(_0x5b0870(0x201))/0x6+parseInt(_0x5b0870(0x21b))/0x7*(-parseInt(_0x5b0870(0x238))/0x8)+-parseInt(_0x5b0870(0x246))/0x9+parseInt(_0x5b0870(0x24d))/0xa;if(_0x20509f===_0x23982e)break;else _0x271b0f['push'](_0x271b0f['shift']());}catch(_0x12994b){_0x271b0f['push'](_0x271b0f['shift']());}}}(a62_0x3cf5,0x2e6d6));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';function a62_0x36d5(_0x210ca3,_0xe8b7d0){_0x210ca3=_0x210ca3-0x1e9;const _0x3cf5e1=a62_0x3cf5();let _0x36d5d4=_0x3cf5e1[_0x210ca3];return _0x36d5d4;}export function resolveDynamicServiceCommand(_0x545d6e,_0x582a52){const _0x7afc55=a62_0x36d5,_0x4f6052=listLocalServiceTrees();let _0x4c642c;for(const _0x468492 of _0x4f6052){const _0x3ff606=matchServiceTreeCommand(_0x468492,_0x545d6e);if(!_0x3ff606)continue;(!_0x4c642c||_0x3ff606['command']['fullPath'][_0x7afc55(0x1f2)]>_0x4c642c[_0x7afc55(0x23d)][_0x7afc55(0x214)][_0x7afc55(0x1f2)])&&(_0x4c642c={'tree':_0x468492,'command':_0x3ff606[_0x7afc55(0x23d)],'remainingArgs':_0x3ff606[_0x7afc55(0x208)]});}if(!_0x4c642c)return undefined;const _0x344245={..._0x582a52};return applyAppBinding(_0x4c642c['tree'],_0x4c642c[_0x7afc55(0x23d)],_0x344245),{'definition':buildDynamicCommandDefinition(_0x4c642c[_0x7afc55(0x23f)],_0x4c642c[_0x7afc55(0x23d)]),'args':_0x4c642c[_0x7afc55(0x208)],'flags':_0x344245,'tree':_0x4c642c['tree'],'command':_0x4c642c[_0x7afc55(0x23d)]};}export function generateDynamicServiceHelp(_0xc25478){const _0x52325b=a62_0x36d5,_0x257776=listLocalServiceTrees()[_0x52325b(0x206)](_0x552ed9=>_0x552ed9[_0x52325b(0x1ec)]['code']===_0xc25478);if(!_0x257776)return undefined;const _0x325b1f=[CLI_BIN_NAME+'\x20'+_0xc25478+_0x52325b(0x1fa),'',_0x257776['service'][_0x52325b(0x20d)]||_0xc25478,_0x257776[_0x52325b(0x1ec)][_0x52325b(0x226)]?'\x20\x20'+_0x257776[_0x52325b(0x1ec)][_0x52325b(0x226)]:'','',_0x52325b(0x1f4),..._0x257776[_0x52325b(0x1f9)]['map'](_0x341380=>{const _0x46be61=_0x52325b,_0x5deccf=_0x341380[_0x46be61(0x214)]['slice'](0x1)['join']('\x20'),_0x307003=_0x341380['risk']===_0x46be61(0x1f0)?'':'\x20['+_0x341380[_0x46be61(0x20e)]+']';return'\x20\x20'+_0x5deccf[_0x46be61(0x1f5)](0x18)+'\x20'+(_0x341380[_0x46be61(0x226)]||'')+_0x307003;}),'',_0x52325b(0x221)+CLI_BIN_NAME+_0x52325b(0x1f1)+_0xc25478+_0x52325b(0x236)][_0x52325b(0x230)](Boolean);return _0x325b1f[_0x52325b(0x1eb)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x2cfb21=>{const _0x1978fb=a62_0x36d5,_0x176af3=_0x2cfb21[_0x1978fb(0x21a)];return{'service':_0x176af3[_0x1978fb(0x1ec)][_0x1978fb(0x21d)],'label':_0x176af3['service']['name']||_0x176af3[_0x1978fb(0x1ec)][_0x1978fb(0x21d)],'commands':_0x176af3[_0x1978fb(0x1f9)]['map'](_0x12708e=>({'command':dynamicCommandName(_0x12708e),'description':_0x12708e[_0x1978fb(0x226)]||'Run\x20service\x20command\x20'+_0x12708e[_0x1978fb(0x1ea)],'tag':riskTag(_0x12708e[_0x1978fb(0x20e)])}))};});}export function getDynamicServiceEntry(_0x51a904){const _0xe1fb34=a62_0x36d5;return listDynamicServiceEntries()[_0xe1fb34(0x206)](_0x11bd16=>_0x11bd16[_0xe1fb34(0x1ec)]===_0x51a904);}export function listDynamicServiceDefinitions(_0x47e6f5){const _0x215396=a62_0x36d5;return listLocalServiceTrees()[_0x215396(0x230)](_0x4de03d=>!_0x47e6f5||_0x4de03d[_0x215396(0x1ec)][_0x215396(0x21d)]===_0x47e6f5)['flatMap'](_0x2eb376=>_0x2eb376[_0x215396(0x1f9)][_0x215396(0x1fe)](_0xa61325=>buildDynamicCommandDefinition(_0x2eb376,_0xa61325)));}export function getDynamicServiceDefinitions(_0x1c3fc7){const _0x144f3b=a62_0x36d5,_0x108fbc=listDynamicServiceDefinitions(_0x1c3fc7);return _0x108fbc[_0x144f3b(0x1f2)]>0x0?_0x108fbc:undefined;}export function findDynamicServiceDefinition(_0x407d4b,_0xf79564){const _0x4a92ff=a62_0x36d5;return listDynamicServiceDefinitions(_0x407d4b)[_0x4a92ff(0x206)](_0x3593be=>_0x3593be[_0x4a92ff(0x23d)]===_0xf79564);}export function buildDynamicCommandDefinition(_0x18aa51,_0x4bceb2){const _0x1eb6d9=a62_0x36d5;return{'service':_0x18aa51[_0x1eb6d9(0x1ec)][_0x1eb6d9(0x21d)],'command':dynamicCommandName(_0x4bceb2),'description':_0x4bceb2['description']||_0x1eb6d9(0x205)+_0x4bceb2['cliPath'],'risk':_0x4bceb2[_0x1eb6d9(0x20e)],..._0x4bceb2['risk']===_0x1eb6d9(0x1f0)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x4bceb2)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4bceb2[_0x1eb6d9(0x1f8)][_0x1eb6d9(0x1fe)](_0x71243d=>({'name':_0x71243d[_0x1eb6d9(0x20d)],'description':_0x71243d['description']||_0x71243d[_0x1eb6d9(0x20d)],'required':_0x71243d[_0x1eb6d9(0x1ef)]})),'flags':_0x4bceb2['flags'][_0x1eb6d9(0x1fe)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4bceb2),async 'dryRun'(_0x5dd38e){const _0x376cae=_0x1eb6d9,_0x290757=await compilePlan(_0x4bceb2,_0x5dd38e);return{'method':_0x376cae(0x212),'url':_0x4bceb2['cliPath'],'body':{'target':targetPreview(_0x290757),'params':_0x290757['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x4bceb2[_0x376cae(0x1ea)]};},async 'execute'(_0x24a3ce){const _0x520ac1=_0x1eb6d9,_0x72e079=await compilePlan(_0x4bceb2,_0x24a3ce),_0x2b43c5=Date[_0x520ac1(0x24e)](),_0x23a81e=await executePlan(_0x72e079,_0x4bceb2,_0x24a3ce),_0x2d3970=Date['now']()-_0x2b43c5;return{'ok':!![],'data':{'service':_0x18aa51[_0x520ac1(0x1ec)],'command':_0x4bceb2[_0x520ac1(0x1ea)],'target':targetPreview(_0x72e079),'result':_0x23a81e,'elapsed':_0x2d3970},'message':_0x520ac1(0x1ee)+_0x4bceb2[_0x520ac1(0x1ea)]+'\x20completed\x20in\x20'+_0x2d3970+'ms'};}};}function buildDynamicConfirmationDescription(_0x5b568d){const _0x27fc7e=a62_0x36d5,_0x5b7232=_0x5b568d[_0x27fc7e(0x226)]||_0x5b568d[_0x27fc7e(0x1ea)],_0x40860a=_0x5b568d['risk']==='high-risk-write'?_0x27fc7e(0x229):_0x27fc7e(0x21c);return _0x27fc7e(0x1e9)+_0x5b7232+_0x27fc7e(0x203)+_0x40860a;}function dynamicCommandName(_0x53b6c9){const _0x79df40=a62_0x36d5;return _0x53b6c9['fullPath'][_0x79df40(0x244)](0x1)[_0x79df40(0x1eb)]('\x20');}function riskTag(_0x725836){const _0x48f819=a62_0x36d5;return _0x725836===_0x48f819(0x1f0)?'':_0x48f819(0x233)+_0x725836+']';}function flagToCommandFlag(_0x3a5ee6){const _0x672ba9=a62_0x36d5;return{'name':_0x3a5ee6[_0x672ba9(0x215)],'type':_0x3a5ee6[_0x672ba9(0x232)]===_0x672ba9(0x220)?_0x672ba9(0x237):_0x3a5ee6[_0x672ba9(0x232)],'description':_0x3a5ee6['description']||_0x3a5ee6[_0x672ba9(0x20d)],'required':_0x3a5ee6[_0x672ba9(0x1ef)],'default':isPrimitiveFlagDefault(_0x3a5ee6[_0x672ba9(0x22f)])?_0x3a5ee6[_0x672ba9(0x22f)]:undefined,'enum':_0x3a5ee6[_0x672ba9(0x24b)]};}async function compilePlan(_0x147de3,_0x9fcb93){const _0x2f928c=a62_0x36d5;return compileServiceTreeCommand(_0x147de3,{'flags':_0x9fcb93[_0x2f928c(0x1fb)],'args':_0x9fcb93['args'],'context':await buildServiceContext(_0x147de3,_0x9fcb93)});}async function buildServiceContext(_0x1213f0,_0x40706b){const _0x464d07=a62_0x36d5,_0x31174c={'appCode':_0x40706b[_0x464d07(0x202)],'env':_0x40706b[_0x464d07(0x1ff)],'envName':_0x40706b[_0x464d07(0x1ff)]};if(!usesRuntimeContext(_0x1213f0))return _0x31174c;const _0x2d5b9f=await getLoginUserInfo(),_0x4b5064=pickFirst(_0x2d5b9f['userId'],_0x2d5b9f['id']);return{..._0x31174c,'user':_0x2d5b9f,'userId':_0x4b5064,'id':_0x2d5b9f['id'],'username':pickFirst(_0x2d5b9f[_0x464d07(0x1ed)],_0x2d5b9f['userName'],_0x2d5b9f['loginName']),'userName':_0x2d5b9f['userName'],'nickname':pickFirst(_0x2d5b9f[_0x464d07(0x235)],_0x2d5b9f[_0x464d07(0x245)]),'nickName':_0x2d5b9f[_0x464d07(0x245)],'tenantCode':_0x2d5b9f[_0x464d07(0x22c)],'employeeId':_0x2d5b9f[_0x464d07(0x241)]};}function usesRuntimeContext(_0x1da327){const _0x3d5ba4=a62_0x36d5;return _0x1da327['mapTo']['some'](_0x27a99b=>typeof _0x27a99b[_0x3d5ba4(0x200)]===_0x3d5ba4(0x237)&&(_0x27a99b[_0x3d5ba4(0x200)][_0x3d5ba4(0x1f6)](_0x3d5ba4(0x228))||_0x27a99b[_0x3d5ba4(0x200)][_0x3d5ba4(0x1f6)](_0x3d5ba4(0x23e))));}function pickFirst(..._0x33df54){const _0x2222ba=a62_0x36d5;return _0x33df54[_0x2222ba(0x206)](_0x36f4f3=>_0x36f4f3!==undefined&&_0x36f4f3!==null);}function a62_0x3cf5(){const _0x2805da=['bffId','env','default','filter','target','type','\x20\x20[','appRef','nickname','`\x20to\x20inspect\x20the\x20manifest.','string','16HWnLDp','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','datatable','\x20\x20MAP\x20TO','3052HryaPD','command','ctx.','tree','data','employeeId','number','2210zKpRfK','slice','nickName','2085849upftoD','sql','appcode','\x20requires\x20target.functionName.','datasetCode','enum','\x20\x20SERVICE\x20TREE\x20TARGET','8545500IYvcIs','now','scriptName','\x20\x20\x20\x20','params','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','cliPath','join','service','username','Service\x20command\x20','required','read','\x20service\x20detail\x20--service\x20','length','bffCode','Commands:','padEnd','startsWith','\x20\x20\x20\x20sqlCode:\x20','args','commands','\x20<command>\x20[flags]','rawFlags','\x20\x20\x20\x20datasetCode:\x20','trim','map','envName','source','1494096YAvMFc','appCode','\x22.\x20','bff','Run\x20service\x20command\x20','find','sqlCode','remainingArgs','appBindings','tableName','kind','fromEntries','name','risk','\x20requires\x20target.sqlCode.','mapTo','Cannot\x20resolve\x20datatable\x20\x22','SERVICE_TREE','138Zkxvrx','fullPath','cliName','\x20\x20\x20\x20command:\x20','app','push','278473YhGulY','normalizedManifest','972783iGSVOZ','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','code','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','json','Use\x20`','1546bWwQDO','operator','Unsupported\x20service\x20target\x20kind:\x20','Unknown\x20appRef\x20\x22','description','boolean','context.','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.','validation','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','tenantCode'];a62_0x3cf5=function(){return _0x2805da;};return a62_0x3cf5();}async function executePlan(_0x5bfdab,_0x1435db,_0x1ed369){const _0x481d89=a62_0x36d5;if(_0x5bfdab[_0x481d89(0x20b)]===_0x481d89(0x240)){const _0x43ec14=await resolveDatasetCode(_0x5bfdab,_0x1435db,_0x1ed369);return executeData(_0x43ec14,_0x5bfdab['command'],_0x5bfdab[_0x481d89(0x251)]);}if(_0x5bfdab[_0x481d89(0x20b)]===_0x481d89(0x247)){if(!_0x5bfdab[_0x481d89(0x207)])throw CliErrors['validation'](_0x481d89(0x1ee)+_0x1435db[_0x481d89(0x1ea)]+_0x481d89(0x20f));return executeSdkSql(_0x5bfdab[_0x481d89(0x207)],normalizeScalarParams(_0x5bfdab[_0x481d89(0x251)]));}if(_0x5bfdab[_0x481d89(0x20b)]===_0x481d89(0x204)){const _0x36ce1f=_0x5bfdab['scriptName']||_0x5bfdab[_0x481d89(0x1f3)]||(_0x5bfdab['bffId']==null?'':String(_0x5bfdab['bffId']));if(!_0x36ce1f)throw CliErrors[_0x481d89(0x22a)](_0x481d89(0x1ee)+_0x1435db[_0x481d89(0x1ea)]+_0x481d89(0x249));return executeSdkBff(_0x36ce1f,_0x5bfdab[_0x481d89(0x251)]);}throw CliErrors['validation'](_0x481d89(0x224)+_0x5bfdab[_0x481d89(0x20b)]);}async function resolveDatasetCode(_0x27a63d,_0x32f150,_0x1f1fa0){const _0x245c48=a62_0x36d5;if(_0x27a63d[_0x245c48(0x24a)])return _0x27a63d[_0x245c48(0x24a)];if(!_0x27a63d[_0x245c48(0x23a)])throw CliErrors[_0x245c48(0x22a)](_0x245c48(0x1ee)+_0x32f150[_0x245c48(0x1ea)]+_0x245c48(0x239));const _0x2e9aca=await listDatasets(_0x1f1fa0[_0x245c48(0x202)]),_0x16a9d4=_0x2e9aca[_0x245c48(0x206)](_0x20f41e=>_0x20f41e['dbtableConfig']?.[_0x245c48(0x20a)]===_0x27a63d['datatable']);if(!_0x16a9d4?.['code'])throw CliErrors[_0x245c48(0x22a)](_0x245c48(0x211)+_0x27a63d[_0x245c48(0x23a)]+_0x245c48(0x21e)+_0x1f1fa0['appCode']+'.',_0x245c48(0x21f));return _0x16a9d4[_0x245c48(0x21d)];}function applyAppBinding(_0x54d35f,_0x25825f,_0x457fc5){const _0x5424a7=a62_0x36d5,_0x266eaa=_0x25825f[_0x5424a7(0x231)][_0x5424a7(0x234)];if(!_0x266eaa)return;const _0x55ce68=_0x54d35f[_0x5424a7(0x209)][_0x266eaa];if(!_0x55ce68)throw CliErrors[_0x5424a7(0x22a)](_0x5424a7(0x225)+_0x266eaa+'\x22\x20in\x20service\x20command\x20'+_0x25825f[_0x5424a7(0x1ea)]+'.',_0x5424a7(0x22b));const _0x123fbb=_0x55ce68[_0x5424a7(0x248)]||_0x55ce68[_0x5424a7(0x202)];_0x123fbb&&!hasText(_0x457fc5[_0x5424a7(0x248)])&&(_0x457fc5['appcode']=_0x123fbb),_0x55ce68[_0x5424a7(0x217)]&&!hasText(_0x457fc5[_0x5424a7(0x217)])&&!hasText(_0x457fc5[_0x5424a7(0x248)])&&(_0x457fc5['app']=_0x55ce68[_0x5424a7(0x217)]),_0x55ce68['env']&&!hasText(_0x457fc5['env'])&&(_0x457fc5[_0x5424a7(0x22e)]=_0x55ce68[_0x5424a7(0x22e)]);}function renderDynamicCommandHelp(_0x29bbf5){const _0x78d3e5=a62_0x36d5,_0x38e80a=[_0x78d3e5(0x24c),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x29bbf5[_0x78d3e5(0x231)][_0x78d3e5(0x20b)],_0x78d3e5(0x216)+_0x29bbf5[_0x78d3e5(0x231)][_0x78d3e5(0x23d)]];if(_0x29bbf5[_0x78d3e5(0x231)][_0x78d3e5(0x24a)])_0x38e80a[_0x78d3e5(0x218)](_0x78d3e5(0x1fc)+_0x29bbf5['target'][_0x78d3e5(0x24a)]);if(_0x29bbf5[_0x78d3e5(0x231)]['datatable'])_0x38e80a['push']('\x20\x20\x20\x20datatable:\x20'+_0x29bbf5[_0x78d3e5(0x231)][_0x78d3e5(0x23a)]);if(_0x29bbf5[_0x78d3e5(0x231)]['sqlCode'])_0x38e80a[_0x78d3e5(0x218)](_0x78d3e5(0x1f7)+_0x29bbf5['target']['sqlCode']);if(_0x29bbf5['target'][_0x78d3e5(0x24f)])_0x38e80a[_0x78d3e5(0x218)]('\x20\x20\x20\x20functionName:\x20'+_0x29bbf5[_0x78d3e5(0x231)][_0x78d3e5(0x24f)]);if(_0x29bbf5[_0x78d3e5(0x210)][_0x78d3e5(0x1f2)]>0x0){_0x38e80a[_0x78d3e5(0x218)]('',_0x78d3e5(0x23b));for(const _0x3efd61 of _0x29bbf5[_0x78d3e5(0x210)]){_0x38e80a[_0x78d3e5(0x218)](_0x78d3e5(0x250)+(_0x3efd61[_0x78d3e5(0x200)]||'const')+'\x20->\x20'+_0x3efd61[_0x78d3e5(0x231)]+(_0x3efd61[_0x78d3e5(0x223)]?'.'+_0x3efd61['operator']:''));}}return _0x38e80a[_0x78d3e5(0x1eb)]('\x0a');}function targetPreview(_0x4401f8){const _0x33b365=a62_0x36d5;return{'kind':_0x4401f8[_0x33b365(0x20b)],'command':_0x4401f8['command'],'appRef':_0x4401f8[_0x33b365(0x234)],'datasetCode':_0x4401f8['datasetCode'],'datatable':_0x4401f8['datatable'],'sqlCode':_0x4401f8['sqlCode'],'bffCode':_0x4401f8[_0x33b365(0x1f3)],'bffId':_0x4401f8[_0x33b365(0x22d)],'functionName':_0x4401f8['scriptName']};}function normalizeScalarParams(_0x2fb6e0){const _0x210faf=a62_0x36d5;return Object[_0x210faf(0x20c)](Object['entries'](_0x2fb6e0)[_0x210faf(0x230)](([,_0x38c56e])=>typeof _0x38c56e==='string'||typeof _0x38c56e==='number'));}function hasText(_0x5139cf){const _0x38796f=a62_0x36d5;return typeof _0x5139cf==='string'&&_0x5139cf[_0x38796f(0x1fd)]()[_0x38796f(0x1f2)]>0x0;}function isPrimitiveFlagDefault(_0x4dded0){const _0x2e249d=a62_0x36d5;return _0x4dded0===undefined||typeof _0x4dded0===_0x2e249d(0x237)||typeof _0x4dded0===_0x2e249d(0x242)||typeof _0x4dded0===_0x2e249d(0x227);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a63_0x2e9a(){const _0xe818eb=['.actions.','commands','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','target','.scriptName','bff','.functionName','scriptName','340604HJobcK','88NUmlMe','call','string','2016804cINWbY','actions','2123415hUHQyQ','functionName','.resources','hasOwnProperty','5812710snbniK','].target','581623cyJKmj','13482351TTtFgB','map','fromEntries','85szxVNo','trim','isArray','entries','957966YSbLQa','bff.exec','4lrHaAA','object','8pDkilX','.target','resources','action','$.resources','10cyrOXe','push','kind','functionName\x20must\x20be\x20a\x20non-empty\x20string.','prototype'];a63_0x2e9a=function(){return _0xe818eb;};return a63_0x2e9a();}(function(_0x1c9230,_0x39b251){const _0x554c6b=a63_0x1b0c,_0x3d88e5=_0x1c9230();while(!![]){try{const _0x57147d=parseInt(_0x554c6b(0x1aa))/0x1+-parseInt(_0x554c6b(0x1b4))/0x2*(parseInt(_0x554c6b(0x1b2))/0x3)+-parseInt(_0x554c6b(0x1c8))/0x4*(-parseInt(_0x554c6b(0x1ae))/0x5)+-parseInt(_0x554c6b(0x1a8))/0x6+-parseInt(_0x554c6b(0x1ce))/0x7*(-parseInt(_0x554c6b(0x1b6))/0x8)+parseInt(_0x554c6b(0x1ab))/0x9*(parseInt(_0x554c6b(0x1bb))/0xa)+parseInt(_0x554c6b(0x1c9))/0xb*(-parseInt(_0x554c6b(0x1cc))/0xc);if(_0x57147d===_0x39b251)break;else _0x3d88e5['push'](_0x3d88e5['shift']());}catch(_0x5339c2){_0x3d88e5['push'](_0x3d88e5['shift']());}}}(a63_0x2e9a,0xd6811));export function adaptServiceTreeManifestForLegacyFramework(_0x511405){const _0x5e594e=a63_0x1b0c,_0x598ad9=cloneJsonValue(_0x511405),_0x438ae2=[];if(!isObjectRecord(_0x598ad9))return{'manifest':_0x598ad9,'errors':_0x438ae2};return Array[_0x5e594e(0x1b0)](_0x598ad9['commands'])&&_0x598ad9[_0x5e594e(0x1c1)]['forEach']((_0x2f486e,_0x5a902b)=>{const _0x42e053=_0x5e594e;if(!isObjectRecord(_0x2f486e))return;adaptBffTarget(_0x2f486e[_0x42e053(0x1c3)],'$.commands['+_0x5a902b+_0x42e053(0x1a9),_0x438ae2);}),adaptResources(_0x598ad9['resources'],_0x5e594e(0x1ba),_0x438ae2),{'manifest':_0x598ad9,'errors':_0x438ae2};}export function toPublicServiceTreeTarget(_0x391e26){const _0x16d2b4=a63_0x1b0c,{scriptName:_0x5f07fa,..._0x4b3fd1}=_0x391e26;return typeof _0x5f07fa===_0x16d2b4(0x1cb)&&_0x5f07fa['trim']()&&(_0x4b3fd1[_0x16d2b4(0x1cf)]=_0x5f07fa),_0x4b3fd1;}export function toPublicNormalizedServiceTree(_0x5035db){const _0x437439=a63_0x1b0c;return{..._0x5035db,'commands':_0x5035db['commands'][_0x437439(0x1ac)](_0x4821b0=>({..._0x4821b0,'target':toPublicServiceTreeTarget(_0x4821b0[_0x437439(0x1c3)])}))};}function adaptResources(_0x4b8bb5,_0x42f2d3,_0x491f79){const _0x23a18e=a63_0x1b0c;if(!isObjectRecord(_0x4b8bb5))return;for(const [_0x39a7a6,_0x4bfc5f]of Object[_0x23a18e(0x1b1)](_0x4b8bb5)){if(!isObjectRecord(_0x4bfc5f))continue;const _0x101587=_0x42f2d3+'.'+_0x39a7a6;if(isObjectRecord(_0x4bfc5f[_0x23a18e(0x1cd)]))for(const [_0x4de4e8,_0x3ac282]of Object['entries'](_0x4bfc5f[_0x23a18e(0x1cd)])){if(!isObjectRecord(_0x3ac282))continue;const _0x4f71c6=_0x101587+_0x23a18e(0x1c0)+_0x4de4e8,_0x231c98=isObjectRecord(_0x3ac282[_0x23a18e(0x1c3)])&&_0x3ac282[_0x23a18e(0x1c3)][_0x23a18e(0x1bd)]==='bff';adaptBffTarget(_0x3ac282['target'],_0x4f71c6+_0x23a18e(0x1b7),_0x491f79),(_0x231c98||isBffAction(_0x3ac282))&&adaptFunctionNameField(_0x3ac282,_0x4f71c6,_0x491f79);}adaptResources(_0x4bfc5f[_0x23a18e(0x1b8)],_0x101587+_0x23a18e(0x1d0),_0x491f79);}}function adaptBffTarget(_0x230dc5,_0xcc9602,_0x12ce09){const _0x2413bf=a63_0x1b0c;if(!isObjectRecord(_0x230dc5)||_0x230dc5['kind']!==_0x2413bf(0x1c5))return;adaptFunctionNameField(_0x230dc5,_0xcc9602,_0x12ce09);}function adaptFunctionNameField(_0x3a5bc6,_0x5d2e19,_0x45339b){const _0x132edf=a63_0x1b0c;Object[_0x132edf(0x1bf)][_0x132edf(0x1d1)]['call'](_0x3a5bc6,_0x132edf(0x1c7))&&_0x45339b[_0x132edf(0x1bc)]({'level':'error','path':_0x5d2e19+_0x132edf(0x1c4),'message':_0x132edf(0x1c2)});if(Object['prototype'][_0x132edf(0x1d1)][_0x132edf(0x1ca)](_0x3a5bc6,'functionName')){if(typeof _0x3a5bc6[_0x132edf(0x1cf)]!==_0x132edf(0x1cb)||!_0x3a5bc6['functionName'][_0x132edf(0x1af)]()){_0x45339b[_0x132edf(0x1bc)]({'level':'error','path':_0x5d2e19+_0x132edf(0x1c6),'message':_0x132edf(0x1be)}),delete _0x3a5bc6[_0x132edf(0x1cf)];return;}_0x3a5bc6[_0x132edf(0x1c7)]=_0x3a5bc6[_0x132edf(0x1cf)],delete _0x3a5bc6['functionName'];}}function isBffAction(_0x5a3769){const _0x52ba65=a63_0x1b0c;return _0x5a3769['kind']===_0x52ba65(0x1c5)||_0x5a3769[_0x52ba65(0x1b9)]===_0x52ba65(0x1b3)||_0x5a3769[_0x52ba65(0x1c3)]===_0x52ba65(0x1b3);}function cloneJsonValue(_0x16e41e){const _0x2feda9=a63_0x1b0c;if(Array['isArray'](_0x16e41e))return _0x16e41e[_0x2feda9(0x1ac)](_0x239b2d=>cloneJsonValue(_0x239b2d));if(isObjectRecord(_0x16e41e))return Object[_0x2feda9(0x1ad)](Object[_0x2feda9(0x1b1)](_0x16e41e)[_0x2feda9(0x1ac)](([_0x4b1ad1,_0x41250c])=>[_0x4b1ad1,cloneJsonValue(_0x41250c)]));return _0x16e41e;}function a63_0x1b0c(_0xfa5861,_0x155ec6){_0xfa5861=_0xfa5861-0x1a8;const _0x2e9a03=a63_0x2e9a();let _0x1b0ca9=_0x2e9a03[_0xfa5861];return _0x1b0ca9;}function isObjectRecord(_0xa9bb8b){const _0x156ff5=a63_0x1b0c;return Boolean(_0xa9bb8b)&&typeof _0xa9bb8b===_0x156ff5(0x1b5)&&!Array[_0x156ff5(0x1b0)](_0xa9bb8b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a64_0x3b44(_0x21394b,_0x2dd800){_0x21394b=_0x21394b-0xd5;const _0x243df0=a64_0x243d();let _0x3b443f=_0x243df0[_0x21394b];return _0x3b443f;}const a64_0x23d976=a64_0x3b44;(function(_0x58e919,_0x248cc9){const _0x365376=a64_0x3b44,_0x461cbd=_0x58e919();while(!![]){try{const _0x341f83=-parseInt(_0x365376(0x111))/0x1*(-parseInt(_0x365376(0xd8))/0x2)+-parseInt(_0x365376(0xdf))/0x3+-parseInt(_0x365376(0x10d))/0x4+-parseInt(_0x365376(0xd7))/0x5*(parseInt(_0x365376(0xf8))/0x6)+parseInt(_0x365376(0xe0))/0x7+-parseInt(_0x365376(0x117))/0x8*(-parseInt(_0x365376(0xfa))/0x9)+-parseInt(_0x365376(0xf3))/0xa;if(_0x341f83===_0x248cc9)break;else _0x461cbd['push'](_0x461cbd['shift']());}catch(_0x4c1198){_0x461cbd['push'](_0x461cbd['shift']());}}}(a64_0x243d,0x6e087));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a64_0x243d(){const _0xf0b9ee=['76734vtkCPA','source','string','write','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Local\x20service\x20not\x20found:\x20','map','registryPath','Removed\x20service\x20','Updated','serviceCount','remove','name','updated','hash','import','target','imported','1991068EGdEiV','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','version','16846rEWcCG','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','str','Local\x20service\x20code,\x20for\x20example\x20crm','service','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.','776gMKGMw','kind','normalizedManifest','cliPath','length','list','flags','Service\x20manifest\x20validation\x20passed.','importedAt','5IHSaBz','106FcITpA','Imported','Service\x20Tree\x20manifest\x20file\x20path','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','serviceCode','\x20service\x20','manifest','726861KypPbt','2712549BnrZzy','manifests','WRITE','risk','filePath','cliName','registry','reduce','\x20service(s).','report','replaced','description','validate','lower\x20kebab-case\x20service\x20code','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','commands','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','file','errors','2877350rjcUvP','entry','registryIndex','warnings','export','3773298CYwzOJ','read'];a64_0x243d=function(){return _0xf0b9ee;};return a64_0x243d();}const FILE_FLAG={'name':'file','type':a64_0x23d976(0xfc),'required':!![],'description':a64_0x23d976(0xda)},SERVICE_FLAG={'name':a64_0x23d976(0x115),'type':a64_0x23d976(0xfc),'required':!![],'description':a64_0x23d976(0x114),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a64_0x23d976(0xed)}};function summarizeService(_0x2a6193){const _0x4df913=a64_0x23d976;return{'serviceCode':_0x2a6193['serviceCode'],'name':_0x2a6193[_0x4df913(0x119)][_0x4df913(0x115)][_0x4df913(0x107)],'version':_0x2a6193[_0x4df913(0x110)],'importedAt':_0x2a6193[_0x4df913(0xd6)],'source':_0x2a6193[_0x4df913(0xfb)],'commandCount':_0x2a6193[_0x4df913(0x119)]['commands'][_0x4df913(0x11b)],'commands':_0x2a6193[_0x4df913(0x119)][_0x4df913(0xef)][_0x4df913(0x101)](_0xfcd507=>({'path':_0xfcd507[_0x4df913(0x11a)],'description':_0xfcd507[_0x4df913(0xeb)],'risk':_0xfcd507['risk'],'target':toPublicServiceTreeTarget(_0xfcd507[_0x4df913(0x10b)]),'flags':_0xfcd507[_0x4df913(0x11d)][_0x4df913(0x101)](_0x34c32c=>({'name':_0x34c32c[_0x4df913(0x107)],'cliName':_0x34c32c[_0x4df913(0xe5)],'type':_0x34c32c['type'],'required':_0x34c32c['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5a29ff){const _0x59eabf=a64_0x23d976;return{'service':_0x5a29ff[_0x59eabf(0x119)]?.[_0x59eabf(0x115)],'version':_0x5a29ff['normalizedManifest']?.[_0x59eabf(0x110)],'commandCount':_0x5a29ff[_0x59eabf(0x119)]?.[_0x59eabf(0xef)][_0x59eabf(0x11b)]??0x0,'commands':_0x5a29ff[_0x59eabf(0x119)]?.[_0x59eabf(0xef)][_0x59eabf(0x101)](_0x5479ce=>({'path':_0x5479ce[_0x59eabf(0x11a)],'risk':_0x5479ce[_0x59eabf(0xe3)],'target':toPublicServiceTreeTarget(_0x5479ce[_0x59eabf(0x10b)])}))??[],'registryIndex':_0x5a29ff[_0x59eabf(0xf5)],'registryServiceCode':_0x5a29ff['registryServiceCode'],'errors':_0x5a29ff['report'][_0x59eabf(0xf2)],'warnings':_0x5a29ff[_0x59eabf(0xe9)][_0x59eabf(0xf6)]};}export const serviceDefinitions=[{'service':a64_0x23d976(0x115),'command':a64_0x23d976(0xec),'description':a64_0x23d976(0x10f),'risk':a64_0x23d976(0xf9),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0xe0062e){const _0xcd4ed6=a64_0x23d976,_0x3f8f0f=loadServiceManifestFromFile(_0xe0062e[_0xcd4ed6(0x113)](_0xcd4ed6(0xf1)));if(!_0x3f8f0f[_0xcd4ed6(0xe9)]['ok'])return{'ok':![],'data':{'file':_0x3f8f0f[_0xcd4ed6(0xe4)],'hash':_0x3f8f0f[_0xcd4ed6(0x109)],'kind':_0x3f8f0f[_0xcd4ed6(0x118)],'serviceCount':_0x3f8f0f[_0xcd4ed6(0xe1)][_0xcd4ed6(0x11b)],'services':_0x3f8f0f[_0xcd4ed6(0xe1)][_0xcd4ed6(0x101)](summarizeLoadedManifest),'errors':_0x3f8f0f['report']['errors'],'warnings':_0x3f8f0f[_0xcd4ed6(0xe9)]['warnings']},'message':formatValidationFailure(_0x3f8f0f[_0xcd4ed6(0xe9)])};if(_0x3f8f0f[_0xcd4ed6(0x118)]===_0xcd4ed6(0xe6)||_0x3f8f0f['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x3f8f0f[_0xcd4ed6(0xe4)],'hash':_0x3f8f0f[_0xcd4ed6(0x109)],'kind':_0x3f8f0f[_0xcd4ed6(0x118)],'serviceCount':_0x3f8f0f[_0xcd4ed6(0xe1)][_0xcd4ed6(0x11b)],'commandCount':_0x3f8f0f[_0xcd4ed6(0xe1)][_0xcd4ed6(0xe7)]((_0x408102,_0x393c80)=>_0x408102+(_0x393c80[_0xcd4ed6(0x119)]?.[_0xcd4ed6(0xef)][_0xcd4ed6(0x11b)]??0x0),0x0),'services':_0x3f8f0f[_0xcd4ed6(0xe1)]['map'](summarizeLoadedManifest),'warnings':_0x3f8f0f[_0xcd4ed6(0xe9)][_0xcd4ed6(0xf6)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x3f8f0f[_0xcd4ed6(0xe4)],'hash':_0x3f8f0f[_0xcd4ed6(0x109)],'kind':_0x3f8f0f[_0xcd4ed6(0x118)],'service':_0x3f8f0f[_0xcd4ed6(0x119)]?.[_0xcd4ed6(0x115)],'version':_0x3f8f0f['normalizedManifest']?.['version'],'commandCount':_0x3f8f0f[_0xcd4ed6(0x119)]?.[_0xcd4ed6(0xef)][_0xcd4ed6(0x11b)]??0x0,'commands':_0x3f8f0f[_0xcd4ed6(0x119)]?.[_0xcd4ed6(0xef)][_0xcd4ed6(0x101)](_0x4022c3=>({'path':_0x4022c3[_0xcd4ed6(0x11a)],'risk':_0x4022c3[_0xcd4ed6(0xe3)],'target':toPublicServiceTreeTarget(_0x4022c3['target'])})),'warnings':_0x3f8f0f[_0xcd4ed6(0xe9)][_0xcd4ed6(0xf6)]},'message':_0xcd4ed6(0xd5)};}},{'service':'service','command':a64_0x23d976(0x10a),'description':a64_0x23d976(0xff),'risk':a64_0x23d976(0xfd),'confirmationDescription':'Reads\x20the\x20given\x20manifest\x20into\x20the\x20local\x20Service\x20Tree\x20registry.\x20An\x20existing\x20manifest\x20with\x20the\x20same\x20service\x20code\x20is\x20updated.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20local\x20file\x20paths.','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x58efa6){const _0x2d7dbb=a64_0x23d976,_0x36392e=loadServiceManifestFromFile(_0x58efa6[_0x2d7dbb(0x113)](_0x2d7dbb(0xf1)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x36392e[_0x2d7dbb(0xe4)],'hash':_0x36392e[_0x2d7dbb(0x109)],'kind':_0x36392e[_0x2d7dbb(0x118)],'ok':_0x36392e[_0x2d7dbb(0xe9)]['ok'],'service':_0x36392e[_0x2d7dbb(0x119)]?.[_0x2d7dbb(0x115)],'version':_0x36392e[_0x2d7dbb(0x119)]?.[_0x2d7dbb(0x110)],'serviceCount':_0x36392e['manifests'][_0x2d7dbb(0x11b)],'services':_0x36392e[_0x2d7dbb(0xe1)]['map'](_0x550bcd=>({'service':_0x550bcd['normalizedManifest']?.[_0x2d7dbb(0x115)],'version':_0x550bcd[_0x2d7dbb(0x119)]?.['version'],'commandCount':_0x550bcd[_0x2d7dbb(0x119)]?.['commands'][_0x2d7dbb(0x11b)]??0x0,'errors':_0x550bcd[_0x2d7dbb(0xe9)][_0x2d7dbb(0xf2)]})),'errors':_0x36392e[_0x2d7dbb(0xe9)][_0x2d7dbb(0xf2)],'commandCount':_0x36392e[_0x2d7dbb(0x119)]?.['commands'][_0x2d7dbb(0x11b)]??0x0},'description':_0x2d7dbb(0xfe)};},async 'execute'(_0x1fdea4){const _0x47e795=a64_0x23d976,_0x1c3bee=importServiceManifest(_0x1fdea4[_0x47e795(0x113)](_0x47e795(0xf1)));if(_0x1c3bee['entries'][_0x47e795(0x11b)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1c3bee[_0x47e795(0x102)],'imported':_0x1c3bee[_0x47e795(0x10c)],'updated':_0x1c3bee['updated'],'serviceCount':_0x1c3bee['serviceCount'],'services':_0x1c3bee['entries'][_0x47e795(0x101)](summarizeService)},'message':'Imported\x20'+_0x1c3bee[_0x47e795(0x10c)]+'\x20service(s),\x20updated\x20'+_0x1c3bee[_0x47e795(0x108)]+_0x47e795(0xe8)};return{'ok':!![],'data':{'registryPath':_0x1c3bee['registryPath'],'replaced':_0x1c3bee[_0x47e795(0xea)],'imported':_0x1c3bee[_0x47e795(0x10c)],'updated':_0x1c3bee['updated'],'serviceCount':_0x1c3bee[_0x47e795(0x105)],'service':summarizeService(_0x1c3bee[_0x47e795(0xf4)])},'message':(_0x1c3bee['replaced']?_0x47e795(0x104):_0x47e795(0xd9))+_0x47e795(0xdd)+_0x1c3bee['entry'][_0x47e795(0xdc)]+'.'};}},{'service':'service','command':a64_0x23d976(0xf7),'description':a64_0x23d976(0x10e),'risk':a64_0x23d976(0xfd),'confirmationDescription':a64_0x23d976(0x116),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x2908f5){const _0x5e1197=a64_0x23d976,_0x1c7162=getLocalServiceEntry(_0x2908f5['str'](_0x5e1197(0x115)));return{'method':_0x5e1197(0xe2),'url':_0x2908f5[_0x5e1197(0x113)](_0x5e1197(0xf1)),'body':{'service':_0x2908f5['str'](_0x5e1197(0x115)),'found':Boolean(_0x1c7162),'version':_0x1c7162?.[_0x5e1197(0x110)],'source':_0x1c7162?.[_0x5e1197(0xfb)]},'description':_0x5e1197(0xf0)};},async 'execute'(_0x310e20){const _0x2edf73=a64_0x23d976,_0x5893f6=exportServiceManifest(_0x310e20[_0x2edf73(0x113)]('service'),_0x310e20[_0x2edf73(0x113)](_0x2edf73(0xf1)));return{'ok':!![],'data':{'registryPath':_0x5893f6[_0x2edf73(0x102)],'file':_0x5893f6[_0x2edf73(0xe4)],'service':summarizeService(_0x5893f6[_0x2edf73(0xf4)])},'message':'Exported\x20service\x20'+_0x5893f6[_0x2edf73(0xf4)][_0x2edf73(0xdc)]+'.'};}},{'service':a64_0x23d976(0x115),'command':a64_0x23d976(0x11c),'description':a64_0x23d976(0xee),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xeab832=a64_0x23d976,_0x45b1b3=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x45b1b3['length'],'services':_0x45b1b3[_0xeab832(0x101)](summarizeService)}};}},{'service':a64_0x23d976(0x115),'command':a64_0x23d976(0x106),'description':'Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','risk':a64_0x23d976(0xfd),'confirmationDescription':a64_0x23d976(0x112),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x181bd7){const _0x53f0cb=a64_0x23d976,_0x32db55=getLocalServiceEntry(_0x181bd7[_0x53f0cb(0x113)](_0x53f0cb(0x115)));return{'method':_0x53f0cb(0xe2),'url':getServiceRegistryPath(),'body':{'service':_0x181bd7[_0x53f0cb(0x113)]('service'),'found':Boolean(_0x32db55),'version':_0x32db55?.[_0x53f0cb(0x110)],'source':_0x32db55?.[_0x53f0cb(0xfb)]},'description':_0x53f0cb(0xdb)};},async 'execute'(_0x11820a){const _0x4861c9=a64_0x23d976,_0x43e3c=removeServiceManifest(_0x11820a['str']('service'));return{'ok':!![],'data':{'registryPath':_0x43e3c[_0x4861c9(0x102)],'serviceCount':_0x43e3c['serviceCount'],'service':summarizeService(_0x43e3c[_0x4861c9(0xf4)])},'message':_0x4861c9(0x103)+_0x43e3c[_0x4861c9(0xf4)][_0x4861c9(0xdc)]+'.'};}},{'service':a64_0x23d976(0x115),'command':'detail','description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':a64_0x23d976(0xf9),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xb54223){const _0x345ebc=a64_0x23d976,_0x500ee8=getLocalServiceEntry(_0xb54223['str'](_0x345ebc(0x115)));if(!_0x500ee8)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xb54223[_0x345ebc(0x113)](_0x345ebc(0x115))},'message':_0x345ebc(0x100)+_0xb54223[_0x345ebc(0x113)](_0x345ebc(0x115))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x500ee8),'manifest':_0x500ee8[_0x345ebc(0xde)],'normalizedManifest':toPublicNormalizedServiceTree(_0x500ee8['normalizedManifest'])}};}}];
|
|
1
|
+
function a64_0x111a(_0x4c288f,_0xfd19b7){_0x4c288f=_0x4c288f-0x125;const _0x42a996=a64_0x42a9();let _0x111aec=_0x42a996[_0x4c288f];return _0x111aec;}const a64_0x1b7497=a64_0x111a;(function(_0x1ca502,_0x3ad779){const _0x24fae1=a64_0x111a,_0x279096=_0x1ca502();while(!![]){try{const _0x2c5b57=-parseInt(_0x24fae1(0x153))/0x1*(-parseInt(_0x24fae1(0x12a))/0x2)+-parseInt(_0x24fae1(0x133))/0x3*(parseInt(_0x24fae1(0x132))/0x4)+-parseInt(_0x24fae1(0x125))/0x5+-parseInt(_0x24fae1(0x16c))/0x6+parseInt(_0x24fae1(0x14f))/0x7*(-parseInt(_0x24fae1(0x15e))/0x8)+-parseInt(_0x24fae1(0x163))/0x9+-parseInt(_0x24fae1(0x135))/0xa*(-parseInt(_0x24fae1(0x13e))/0xb);if(_0x2c5b57===_0x3ad779)break;else _0x279096['push'](_0x279096['shift']());}catch(_0x13ba09){_0x279096['push'](_0x279096['shift']());}}}(a64_0x42a9,0x1acd1));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a64_0x42a9(){const _0x42da10=['importedAt','manifests','list','string','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','target','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','registryServiceCode','Local\x20service\x20not\x20found:\x20','Exported\x20service\x20','496300kyDWLC','cliName','Local\x20service\x20code,\x20for\x20example\x20crm','reduce','2uZxevg','version','\x20service(s),\x20updated\x20','Imported\x20','source','Service\x20registry\x20validation\x20passed.','length','risk','Service\x20manifest\x20validation\x20passed.','cliPath','\x20service(s).','8rYngsg','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.','Updated','file','imported','1786500vvgxhY','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','detail','description','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','import','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','registryPath','replaced','932340lbsyBz','173845ArpwSz','entries','Imported','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','updated','171556RsMwwP','type','\x20service\x20','serviceCode','normalizedManifest','entry','map','serviceCount','1532DfjPQW','633NKwPpw','service','4785930XKdqEB','str','errors','WRITE','registryIndex','kind','hash','name','read','11islOrJ','filePath','commands','warnings','report','required','write'];a64_0x42a9=function(){return _0x42da10;};return a64_0x42a9();}const FILE_FLAG={'name':a64_0x1b7497(0x161),'type':a64_0x1b7497(0x148),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a64_0x1b7497(0x134),'type':a64_0x1b7497(0x148),'required':!![],'description':a64_0x1b7497(0x151),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x406209){const _0x58bdd8=a64_0x1b7497;return{'serviceCode':_0x406209[_0x58bdd8(0x12d)],'name':_0x406209[_0x58bdd8(0x12e)][_0x58bdd8(0x134)][_0x58bdd8(0x13c)],'version':_0x406209[_0x58bdd8(0x154)],'importedAt':_0x406209[_0x58bdd8(0x145)],'source':_0x406209[_0x58bdd8(0x157)],'commandCount':_0x406209['normalizedManifest']['commands']['length'],'commands':_0x406209[_0x58bdd8(0x12e)][_0x58bdd8(0x140)][_0x58bdd8(0x130)](_0x190fbd=>({'path':_0x190fbd['cliPath'],'description':_0x190fbd[_0x58bdd8(0x166)],'risk':_0x190fbd[_0x58bdd8(0x15a)],'target':toPublicServiceTreeTarget(_0x190fbd['target']),'flags':_0x190fbd['flags'][_0x58bdd8(0x130)](_0x32665c=>({'name':_0x32665c['name'],'cliName':_0x32665c[_0x58bdd8(0x150)],'type':_0x32665c[_0x58bdd8(0x12b)],'required':_0x32665c[_0x58bdd8(0x143)]===!![]}))}))};}function summarizeLoadedManifest(_0x5e3bee){const _0x24ed66=a64_0x1b7497;return{'service':_0x5e3bee['normalizedManifest']?.[_0x24ed66(0x134)],'version':_0x5e3bee['normalizedManifest']?.[_0x24ed66(0x154)],'commandCount':_0x5e3bee[_0x24ed66(0x12e)]?.['commands']['length']??0x0,'commands':_0x5e3bee[_0x24ed66(0x12e)]?.[_0x24ed66(0x140)][_0x24ed66(0x130)](_0x1b47d9=>({'path':_0x1b47d9[_0x24ed66(0x15c)],'risk':_0x1b47d9[_0x24ed66(0x15a)],'target':toPublicServiceTreeTarget(_0x1b47d9['target'])}))??[],'registryIndex':_0x5e3bee[_0x24ed66(0x139)],'registryServiceCode':_0x5e3bee[_0x24ed66(0x14c)],'errors':_0x5e3bee[_0x24ed66(0x142)][_0x24ed66(0x137)],'warnings':_0x5e3bee[_0x24ed66(0x142)][_0x24ed66(0x141)]};}export const serviceDefinitions=[{'service':a64_0x1b7497(0x134),'command':'validate','description':a64_0x1b7497(0x167),'risk':a64_0x1b7497(0x13d),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5d8a27){const _0x2a8d09=a64_0x1b7497,_0x2453d5=loadServiceManifestFromFile(_0x5d8a27[_0x2a8d09(0x136)](_0x2a8d09(0x161)));if(!_0x2453d5[_0x2a8d09(0x142)]['ok'])return{'ok':![],'data':{'file':_0x2453d5[_0x2a8d09(0x13f)],'hash':_0x2453d5[_0x2a8d09(0x13b)],'kind':_0x2453d5[_0x2a8d09(0x13a)],'serviceCount':_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x159)],'services':_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x130)](summarizeLoadedManifest),'errors':_0x2453d5[_0x2a8d09(0x142)]['errors'],'warnings':_0x2453d5[_0x2a8d09(0x142)]['warnings']},'message':formatValidationFailure(_0x2453d5['report'])};if(_0x2453d5[_0x2a8d09(0x13a)]==='registry'||_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x159)]!==0x1)return{'ok':!![],'data':{'file':_0x2453d5[_0x2a8d09(0x13f)],'hash':_0x2453d5[_0x2a8d09(0x13b)],'kind':_0x2453d5[_0x2a8d09(0x13a)],'serviceCount':_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x159)],'commandCount':_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x152)]((_0x51bf0b,_0x1aede5)=>_0x51bf0b+(_0x1aede5[_0x2a8d09(0x12e)]?.[_0x2a8d09(0x140)][_0x2a8d09(0x159)]??0x0),0x0),'services':_0x2453d5[_0x2a8d09(0x146)][_0x2a8d09(0x130)](summarizeLoadedManifest),'warnings':_0x2453d5[_0x2a8d09(0x142)][_0x2a8d09(0x141)]},'message':_0x2a8d09(0x158)};return{'ok':!![],'data':{'file':_0x2453d5[_0x2a8d09(0x13f)],'hash':_0x2453d5[_0x2a8d09(0x13b)],'kind':_0x2453d5[_0x2a8d09(0x13a)],'service':_0x2453d5[_0x2a8d09(0x12e)]?.[_0x2a8d09(0x134)],'version':_0x2453d5[_0x2a8d09(0x12e)]?.[_0x2a8d09(0x154)],'commandCount':_0x2453d5['normalizedManifest']?.['commands']['length']??0x0,'commands':_0x2453d5[_0x2a8d09(0x12e)]?.[_0x2a8d09(0x140)][_0x2a8d09(0x130)](_0x35f043=>({'path':_0x35f043[_0x2a8d09(0x15c)],'risk':_0x35f043[_0x2a8d09(0x15a)],'target':toPublicServiceTreeTarget(_0x35f043[_0x2a8d09(0x14a)])})),'warnings':_0x2453d5[_0x2a8d09(0x142)][_0x2a8d09(0x141)]},'message':_0x2a8d09(0x15b)};}},{'service':a64_0x1b7497(0x134),'command':a64_0x1b7497(0x168),'description':a64_0x1b7497(0x164),'risk':a64_0x1b7497(0x144),'confirmationDescription':a64_0x1b7497(0x15f),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3b1fec){const _0x17cc63=a64_0x1b7497,_0x3282be=loadServiceManifestFromFile(_0x3b1fec[_0x17cc63(0x136)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x3282be['filePath'],'hash':_0x3282be[_0x17cc63(0x13b)],'kind':_0x3282be['kind'],'ok':_0x3282be[_0x17cc63(0x142)]['ok'],'service':_0x3282be[_0x17cc63(0x12e)]?.[_0x17cc63(0x134)],'version':_0x3282be[_0x17cc63(0x12e)]?.[_0x17cc63(0x154)],'serviceCount':_0x3282be[_0x17cc63(0x146)][_0x17cc63(0x159)],'services':_0x3282be[_0x17cc63(0x146)]['map'](_0x5a46a6=>({'service':_0x5a46a6[_0x17cc63(0x12e)]?.[_0x17cc63(0x134)],'version':_0x5a46a6[_0x17cc63(0x12e)]?.[_0x17cc63(0x154)],'commandCount':_0x5a46a6['normalizedManifest']?.[_0x17cc63(0x140)][_0x17cc63(0x159)]??0x0,'errors':_0x5a46a6[_0x17cc63(0x142)]['errors']})),'errors':_0x3282be[_0x17cc63(0x142)][_0x17cc63(0x137)],'commandCount':_0x3282be['normalizedManifest']?.[_0x17cc63(0x140)][_0x17cc63(0x159)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x2454ee){const _0x2d48b8=a64_0x1b7497,_0x59b159=importServiceManifest(_0x2454ee[_0x2d48b8(0x136)](_0x2d48b8(0x161)));if(_0x59b159[_0x2d48b8(0x126)][_0x2d48b8(0x159)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x59b159['registryPath'],'imported':_0x59b159[_0x2d48b8(0x162)],'updated':_0x59b159['updated'],'serviceCount':_0x59b159['serviceCount'],'services':_0x59b159['entries'][_0x2d48b8(0x130)](summarizeService)},'message':_0x2d48b8(0x156)+_0x59b159[_0x2d48b8(0x162)]+_0x2d48b8(0x155)+_0x59b159[_0x2d48b8(0x129)]+_0x2d48b8(0x15d)};return{'ok':!![],'data':{'registryPath':_0x59b159[_0x2d48b8(0x16a)],'replaced':_0x59b159[_0x2d48b8(0x16b)],'imported':_0x59b159['imported'],'updated':_0x59b159['updated'],'serviceCount':_0x59b159[_0x2d48b8(0x131)],'service':summarizeService(_0x59b159[_0x2d48b8(0x12f)])},'message':(_0x59b159['replaced']?_0x2d48b8(0x160):_0x2d48b8(0x127))+_0x2d48b8(0x12c)+_0x59b159[_0x2d48b8(0x12f)][_0x2d48b8(0x12d)]+'.'};}},{'service':'service','command':'export','description':'Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a64_0x1b7497(0x144),'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'(_0x1c05fa){const _0x322ae5=a64_0x1b7497,_0x29bbbb=getLocalServiceEntry(_0x1c05fa[_0x322ae5(0x136)](_0x322ae5(0x134)));return{'method':'WRITE','url':_0x1c05fa[_0x322ae5(0x136)](_0x322ae5(0x161)),'body':{'service':_0x1c05fa[_0x322ae5(0x136)](_0x322ae5(0x134)),'found':Boolean(_0x29bbbb),'version':_0x29bbbb?.[_0x322ae5(0x154)],'source':_0x29bbbb?.['source']},'description':_0x322ae5(0x169)};},async 'execute'(_0x43fc61){const _0x4f8b38=a64_0x1b7497,_0x56ab5=exportServiceManifest(_0x43fc61[_0x4f8b38(0x136)](_0x4f8b38(0x134)),_0x43fc61[_0x4f8b38(0x136)](_0x4f8b38(0x161)));return{'ok':!![],'data':{'registryPath':_0x56ab5[_0x4f8b38(0x16a)],'file':_0x56ab5[_0x4f8b38(0x13f)],'service':summarizeService(_0x56ab5[_0x4f8b38(0x12f)])},'message':_0x4f8b38(0x14e)+_0x56ab5['entry'][_0x4f8b38(0x12d)]+'.'};}},{'service':a64_0x1b7497(0x134),'command':a64_0x1b7497(0x147),'description':a64_0x1b7497(0x149),'risk':a64_0x1b7497(0x13d),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x1429be=a64_0x1b7497,_0x7e5e42=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x7e5e42[_0x1429be(0x159)],'services':_0x7e5e42['map'](summarizeService)}};}},{'service':a64_0x1b7497(0x134),'command':'remove','description':'Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','risk':a64_0x1b7497(0x144),'confirmationDescription':a64_0x1b7497(0x128),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4be9ed){const _0x454bdf=a64_0x1b7497,_0x302b12=getLocalServiceEntry(_0x4be9ed['str'](_0x454bdf(0x134)));return{'method':_0x454bdf(0x138),'url':getServiceRegistryPath(),'body':{'service':_0x4be9ed[_0x454bdf(0x136)]('service'),'found':Boolean(_0x302b12),'version':_0x302b12?.[_0x454bdf(0x154)],'source':_0x302b12?.[_0x454bdf(0x157)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0xf035b1){const _0x452443=a64_0x1b7497,_0x1afefa=removeServiceManifest(_0xf035b1[_0x452443(0x136)](_0x452443(0x134)));return{'ok':!![],'data':{'registryPath':_0x1afefa['registryPath'],'serviceCount':_0x1afefa[_0x452443(0x131)],'service':summarizeService(_0x1afefa[_0x452443(0x12f)])},'message':'Removed\x20service\x20'+_0x1afefa[_0x452443(0x12f)][_0x452443(0x12d)]+'.'};}},{'service':a64_0x1b7497(0x134),'command':a64_0x1b7497(0x165),'description':a64_0x1b7497(0x14b),'risk':a64_0x1b7497(0x13d),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2a8452){const _0x73c819=a64_0x1b7497,_0x62f21e=getLocalServiceEntry(_0x2a8452[_0x73c819(0x136)](_0x73c819(0x134)));if(!_0x62f21e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2a8452[_0x73c819(0x136)](_0x73c819(0x134))},'message':_0x73c819(0x14d)+_0x2a8452[_0x73c819(0x136)](_0x73c819(0x134))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x62f21e),'manifest':_0x62f21e['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x62f21e[_0x73c819(0x12e)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a65_0x537d7e=a65_0x5036;(function(_0x12019b,_0x121f20){const _0x23340a=a65_0x5036,_0x18fbfc=_0x12019b();while(!![]){try{const _0x56a943=-parseInt(_0x23340a(0x21f))/0x1*(parseInt(_0x23340a(0x222))/0x2)+parseInt(_0x23340a(0x1fb))/0x3*(parseInt(_0x23340a(0x1ee))/0x4)+parseInt(_0x23340a(0x201))/0x5+parseInt(_0x23340a(0x1f5))/0x6*(-parseInt(_0x23340a(0x214))/0x7)+parseInt(_0x23340a(0x1f2))/0x8+-parseInt(_0x23340a(0x1f3))/0x9+-parseInt(_0x23340a(0x212))/0xa*(-parseInt(_0x23340a(0x1e1))/0xb);if(_0x56a943===_0x121f20)break;else _0x18fbfc['push'](_0x18fbfc['shift']());}catch(_0x2d9282){_0x18fbfc['push'](_0x18fbfc['shift']());}}}(a65_0x3334,0xde1db));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a65_0x537d7e(0x1fc);export function getServiceRegistryPath(_0x2a5f96={}){const _0x45f21f=a65_0x537d7e;return resolve(_0x2a5f96['homeDir']??homedir(),PRODUCT_CONFIG[_0x45f21f(0x1e0)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}function a65_0x5036(_0xc1e5e8,_0x5e3146){_0xc1e5e8=_0xc1e5e8-0x1d7;const _0x333477=a65_0x3334();let _0x503634=_0x333477[_0xc1e5e8];return _0x503634;}export function readServiceRegistry(_0x2126ba={}){const _0x2b8918=a65_0x537d7e,_0x3c39f4=getServiceRegistryPath(_0x2126ba);if(!existsSync(_0x3c39f4))return emptyServiceRegistry();try{const _0x3ee32b=readFileSync(_0x3c39f4,_0x2b8918(0x200));if(!_0x3ee32b[_0x2b8918(0x1d7)]())return emptyServiceRegistry();const _0x460940=JSON[_0x2b8918(0x1d9)](_0x3ee32b);if(_0x460940[_0x2b8918(0x1e2)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x2b8918(0x221)+String(_0x460940[_0x2b8918(0x1e2)]),'Remove\x20or\x20migrate\x20'+_0x3c39f4+'.');if(!Array['isArray'](_0x460940['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x460940[_0x2b8918(0x1f6)],'services':_0x460940[_0x2b8918(0x1eb)]};}catch(_0x145a62){if(_0x145a62 instanceof Error&&_0x145a62['name']===_0x2b8918(0x1ea))throw _0x145a62;throw CliErrors[_0x2b8918(0x229)](_0x2b8918(0x1df)+_0x3c39f4,_0x2b8918(0x21b));}}export function writeServiceRegistry(_0x885124,_0x44381d={}){const _0x4e1721=a65_0x537d7e,_0x582892=getServiceRegistryPath(_0x44381d),_0x32f0ea=dirname(_0x582892);!existsSync(_0x32f0ea)&&mkdirSync(_0x32f0ea,{'recursive':!![]});const _0xe5f8b5=_0x582892+_0x4e1721(0x20e);try{writeFileSync(_0xe5f8b5,JSON[_0x4e1721(0x1f1)](_0x885124,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xe5f8b5,_0x582892);}catch(_0x3c36f8){try{unlinkSync(_0xe5f8b5);}catch{}if(_0x3c36f8?.[_0x4e1721(0x1da)]===_0x4e1721(0x1e4))throw CliErrors[_0x4e1721(0x229)]('Cannot\x20write\x20service\x20registry:\x20'+_0x582892);throw _0x3c36f8;}return _0x582892;}export function loadServiceManifestFromFile(_0x4566d1){const _0x135590=a65_0x537d7e,_0x5961fc=resolve(_0x4566d1);if(!existsSync(_0x5961fc))throw CliErrors[_0x135590(0x229)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x4566d1);let _0x19a967;const _0x24ade7=readFileSync(_0x5961fc,_0x135590(0x200));try{_0x19a967=JSON[_0x135590(0x1d9)](_0x24ade7);}catch{throw CliErrors[_0x135590(0x229)](_0x135590(0x205)+_0x4566d1,_0x135590(0x1fd));}const _0x2cc1da=sha256(_0x24ade7),_0x164482=extractLoadedServiceManifests(_0x19a967,_0x2cc1da),_0x4d3d8b=aggregateValidationReports(_0x164482),_0x17f7bf=_0x164482[0x0];return{'filePath':_0x5961fc,'hash':_0x2cc1da,'kind':isServiceRegistryLike(_0x19a967)?_0x135590(0x1ff):_0x135590(0x1e3),'manifest':_0x17f7bf?.[_0x135590(0x1e3)]??_0x19a967,'report':_0x4d3d8b,'normalizedManifest':_0x164482[_0x135590(0x1e8)]===0x1?_0x17f7bf?.[_0x135590(0x1db)]:undefined,'manifests':_0x164482};}export function importServiceManifest(_0x1dadf7,_0x1b09e6={}){const _0x316dd4=a65_0x537d7e,_0x630151=loadServiceManifestFromFile(_0x1dadf7);if(!_0x630151[_0x316dd4(0x226)]['ok'])throw CliErrors[_0x316dd4(0x229)](formatValidationFailure(_0x630151[_0x316dd4(0x226)]),_0x316dd4(0x223));if(_0x630151[_0x316dd4(0x1e7)][_0x316dd4(0x1e8)]===0x0)throw CliErrors[_0x316dd4(0x229)](_0x316dd4(0x219),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x43a582=readServiceRegistry(_0x1b09e6),_0x26df10=(_0x1b09e6['now']??(()=>new Date()))()[_0x316dd4(0x215)](),_0x13fa3c=[];let _0x596ac4=0x0,_0x3e2b4b=0x0;for(const _0x527b3c of _0x630151[_0x316dd4(0x1e7)]){if(!_0x527b3c[_0x316dd4(0x1db)])continue;const _0x2c21dc=_0x527b3c[_0x316dd4(0x1db)][_0x316dd4(0x1f4)][_0x316dd4(0x1da)],_0xd8d1ab={'serviceCode':_0x2c21dc,'version':_0x527b3c[_0x316dd4(0x1db)]['version'],'importedAt':_0x26df10,'source':{'type':_0x316dd4(0x208),'path':_0x630151[_0x316dd4(0x1f9)],'hash':_0x527b3c[_0x316dd4(0x1e9)]},'manifest':_0x527b3c[_0x316dd4(0x1e3)],'normalizedManifest':_0x527b3c[_0x316dd4(0x1db)]},_0x1f2a02=_0x43a582[_0x316dd4(0x1eb)][_0x316dd4(0x203)](_0x213933=>_0x213933[_0x316dd4(0x1de)]===_0x2c21dc);_0x1f2a02>=0x0?(_0x43a582['services'][_0x1f2a02]=_0xd8d1ab,_0x3e2b4b++):(_0x43a582[_0x316dd4(0x1eb)][_0x316dd4(0x1fe)](_0xd8d1ab),_0x596ac4++),_0x13fa3c[_0x316dd4(0x1fe)](_0xd8d1ab);}_0x43a582[_0x316dd4(0x1eb)]['sort']((_0x1f7c8d,_0x5f419b)=>_0x1f7c8d['serviceCode'][_0x316dd4(0x204)](_0x5f419b[_0x316dd4(0x1de)])),_0x43a582[_0x316dd4(0x1f6)]=_0x26df10;const _0x56f943=writeServiceRegistry(_0x43a582,_0x1b09e6);return{'registryPath':_0x56f943,'entry':_0x13fa3c[0x0],'replaced':_0x13fa3c[_0x316dd4(0x1e8)]===0x1?_0x3e2b4b===0x1:_0x3e2b4b>0x0,'entries':_0x13fa3c,'imported':_0x596ac4,'updated':_0x3e2b4b,'serviceCount':_0x43a582[_0x316dd4(0x1eb)]['length']};}export function exportServiceManifest(_0x410e44,_0x3559eb,_0x83de56={}){const _0x5610a2=a65_0x537d7e,_0x2f3a8d=getServiceRegistryPath(_0x83de56),_0x22c098=getLocalServiceEntry(_0x410e44,_0x83de56);if(!_0x22c098)throw CliErrors['validation']('Local\x20service\x20not\x20found:\x20'+_0x410e44,_0x5610a2(0x218));const _0x48af0f=resolve(_0x3559eb),_0x5da56e=dirname(_0x48af0f);return!existsSync(_0x5da56e)&&mkdirSync(_0x5da56e,{'recursive':!![]}),writeFileSync(_0x48af0f,JSON[_0x5610a2(0x1f1)](_0x22c098[_0x5610a2(0x1e3)],null,0x2)+'\x0a',{'encoding':_0x5610a2(0x200),'mode':0x180}),{'registryPath':_0x2f3a8d,'filePath':_0x48af0f,'entry':_0x22c098};}export function removeServiceManifest(_0x430c01,_0x46fb91={}){const _0x386d49=a65_0x537d7e,_0x2f054f=readServiceRegistry(_0x46fb91),_0x2e6003=_0x430c01[_0x386d49(0x1d7)](),_0x25abdc=_0x2f054f[_0x386d49(0x1eb)][_0x386d49(0x203)](_0x46ef03=>_0x46ef03['serviceCode']===_0x2e6003);if(_0x25abdc<0x0)throw CliErrors['validation'](_0x386d49(0x1e5)+_0x2e6003,_0x386d49(0x218));const [_0x344558]=_0x2f054f['services']['splice'](_0x25abdc,0x1),_0x2d4cf2=(_0x46fb91['now']??(()=>new Date()))()[_0x386d49(0x215)]();_0x2f054f['updatedAt']=_0x2d4cf2;const _0x404c13=writeServiceRegistry(_0x2f054f,_0x46fb91);return{'registryPath':_0x404c13,'entry':_0x344558,'serviceCount':_0x2f054f[_0x386d49(0x1eb)]['length']};}export function listLocalServices(_0x56d398={}){return readServiceRegistry(_0x56d398)['services'];}export function getLocalServiceEntry(_0x2be27b,_0x34d214={}){const _0x1eb08d=a65_0x537d7e;return readServiceRegistry(_0x34d214)[_0x1eb08d(0x1eb)][_0x1eb08d(0x202)](_0x35652e=>_0x35652e['serviceCode']===_0x2be27b[_0x1eb08d(0x1d7)]());}export function listLocalServiceTrees(_0x5e6d64={}){const _0x2cc901=a65_0x537d7e;return readServiceRegistry(_0x5e6d64)[_0x2cc901(0x1eb)][_0x2cc901(0x1ec)](_0x1f3c1f=>_0x1f3c1f[_0x2cc901(0x1db)]);}export function inspectServiceRegistry(_0x486c3e={}){const _0x20b7bc=a65_0x537d7e,_0x4c0f30=getServiceRegistryPath(_0x486c3e);if(!existsSync(_0x4c0f30))return emptyServiceRegistryInspection(_0x4c0f30,_0x20b7bc(0x210),![]);try{const _0x5d835d=readFileSync(_0x4c0f30,'utf8');if(!_0x5d835d[_0x20b7bc(0x1d7)]())return emptyServiceRegistryInspection(_0x4c0f30,_0x20b7bc(0x21a),!![]);const _0x3f1ee2=JSON[_0x20b7bc(0x1d9)](_0x5d835d);if(_0x3f1ee2[_0x20b7bc(0x1e2)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x4c0f30,'invalid',!![]),'schemaVersion':_0x3f1ee2[_0x20b7bc(0x1e2)],'message':_0x20b7bc(0x225)+String(_0x3f1ee2[_0x20b7bc(0x1e2)])};if(!Array[_0x20b7bc(0x21d)](_0x3f1ee2[_0x20b7bc(0x1eb)]))return{...emptyServiceRegistryInspection(_0x4c0f30,_0x20b7bc(0x1e6),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3f1ee2['updatedAt'],'message':_0x20b7bc(0x207)};const _0xf724a9=_0x3f1ee2['services'][_0x20b7bc(0x1ec)](summarizeLocalServiceEntry);return{'registryPath':_0x4c0f30,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3f1ee2[_0x20b7bc(0x1f6)],'serviceCount':_0xf724a9[_0x20b7bc(0x1e8)],'commandCount':_0xf724a9['reduce']((_0x3dba9b,_0xa82753)=>_0x3dba9b+_0xa82753[_0x20b7bc(0x1ef)],0x0),'services':_0xf724a9};}catch(_0x5c9cef){return{...emptyServiceRegistryInspection(_0x4c0f30,_0x20b7bc(0x1e6),!![]),'message':_0x5c9cef instanceof Error?_0x5c9cef[_0x20b7bc(0x209)]:String(_0x5c9cef)};}}export function formatValidationFailure(_0x592208){const _0x2c0fd2=a65_0x537d7e,_0x264839=_0x592208[_0x2c0fd2(0x1d8)][_0x2c0fd2(0x1ec)](_0x3696b0=>_0x3696b0[_0x2c0fd2(0x1dc)]+':\x20'+_0x3696b0[_0x2c0fd2(0x209)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x264839['join']('\x0a');}function extractLoadedServiceManifests(_0x21a53a,_0x41d7b2){if(!isServiceRegistryLike(_0x21a53a)){const _0x1c2968=_0x21a53a,{manifest:_0x2abd07,errors:_0x11cb5c}=adaptServiceTreeManifestForLegacyFramework(_0x1c2968),_0x3df54e=validateServiceTreeManifest(_0x2abd07),_0x297761=mergeValidationErrors(_0x3df54e,_0x11cb5c);return[{'manifest':_0x1c2968,'report':_0x297761,'normalizedManifest':_0x297761['ok']?normalizeServiceTreeManifest(_0x2abd07):undefined,'sourceHash':_0x41d7b2}];}return _0x21a53a['services']['map']((_0xc442b3,_0x3fedf6)=>{const _0x5786bb=a65_0x5036,_0xe03611=isObjectRecord(_0xc442b3)?_0xc442b3[_0x5786bb(0x1e3)]:undefined,{manifest:_0xe9f240,errors:_0x138f84}=adaptServiceTreeManifestForLegacyFramework(_0xe03611),_0x4c7b0f=validateServiceTreeManifest(_0xe9f240),_0x4fddc5=mergeValidationErrors(_0x4c7b0f,_0x138f84),_0x1fc264=isObjectRecord(_0xc442b3)&&typeof _0xc442b3['serviceCode']===_0x5786bb(0x211)?_0xc442b3[_0x5786bb(0x1de)]:undefined;return{'manifest':_0xe03611,'report':_0x4fddc5,'normalizedManifest':_0x4fddc5['ok']?normalizeServiceTreeManifest(_0xe9f240):undefined,'sourceHash':sha256(JSON['stringify'](_0xe03611,null,0x2)+'\x0a'),'registryIndex':_0x3fedf6,'registryServiceCode':_0x1fc264};});}function mergeValidationErrors(_0x5e5c5a,_0x3c67ec){const _0x3864af=a65_0x537d7e,_0x3cde37=_0x5e5c5a[_0x3864af(0x1d8)][_0x3864af(0x1ec)](_0x3ed703=>_0x3ed703['message']===_0x3864af(0x220)?{..._0x3ed703,'message':'bff\x20target\x20requires\x20functionName.'}:_0x3ed703),_0x480625=[..._0x3c67ec,..._0x3cde37];return{'ok':_0x480625[_0x3864af(0x1e8)]===0x0,'errors':_0x480625,'warnings':_0x5e5c5a[_0x3864af(0x21c)]};}function a65_0x3334(){const _0x1e6f78=['serviceCode','Invalid\x20service\x20registry\x20JSON:\x20','homeDirName','8953978bNqGyh','schemaVersion','manifest','ENOENT','Local\x20service\x20not\x20found:\x20','invalid','manifests','length','sourceHash','CliError','services','map','registryIndex','5916488LjEOJU','commandCount','version','stringify','3372544REjmyR','15894252dEGTcZ','service','4285422huXbWH','updatedAt','].manifest.','description','filePath','$.services[','3Jvqwrk','service.json','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','push','registry','utf8','7713810cIMHDl','find','findIndex','localeCompare','Invalid\x20service\x20manifest\x20JSON:\x20','slice','services\x20must\x20be\x20an\x20array','file','message','flatMap','startsWith','digest','hex','.tmp','].manifest','missing','string','20QKeCrE','update','7GulSMB','toISOString','commands','target','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','empty','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','warnings','isArray','sha256','1681396XRdqpx','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','2VIgbJn','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','risk','Unsupported\x20schemaVersion:\x20','report','name','cliPath','validation','importedAt','trim','errors','parse','code','normalizedManifest','path','kind'];a65_0x3334=function(){return _0x1e6f78;};return a65_0x3334();}function aggregateValidationReports(_0x3763d0){const _0x5a8074=a65_0x537d7e,_0x78b2c6=_0x3763d0[_0x5a8074(0x20a)](_0x187eef=>_0x187eef[_0x5a8074(0x1ed)]===undefined?_0x187eef[_0x5a8074(0x226)]['errors']:_0x187eef['report']['errors']['map'](_0x2e57ee=>({..._0x2e57ee,'path':prefixRegistryIssuePath(_0x187eef[_0x5a8074(0x1ed)],_0x2e57ee[_0x5a8074(0x1dc)])}))),_0x18b665=_0x3763d0[_0x5a8074(0x20a)](_0x4e4306=>_0x4e4306['registryIndex']===undefined?_0x4e4306['report'][_0x5a8074(0x21c)]:_0x4e4306['report'][_0x5a8074(0x21c)][_0x5a8074(0x1ec)](_0x552bf1=>({..._0x552bf1,'path':prefixRegistryIssuePath(_0x4e4306[_0x5a8074(0x1ed)],_0x552bf1['path'])})));return{'ok':_0x78b2c6[_0x5a8074(0x1e8)]===0x0,'errors':_0x78b2c6,'warnings':_0x18b665};}function prefixRegistryIssuePath(_0x17ef5d,_0x1e8add){const _0xa85c5c=a65_0x537d7e;if(_0x1e8add==='$')return _0xa85c5c(0x1fa)+_0x17ef5d+_0xa85c5c(0x20f);if(_0x1e8add[_0xa85c5c(0x20b)]('$.'))return _0xa85c5c(0x1fa)+_0x17ef5d+_0xa85c5c(0x20f)+_0x1e8add[_0xa85c5c(0x206)](0x1);if(_0x1e8add[_0xa85c5c(0x20b)]('$['))return _0xa85c5c(0x1fa)+_0x17ef5d+'].manifest'+_0x1e8add[_0xa85c5c(0x206)](0x1);return _0xa85c5c(0x1fa)+_0x17ef5d+_0xa85c5c(0x1f7)+_0x1e8add;}function isServiceRegistryLike(_0x49fd45){const _0x418788=a65_0x537d7e;return isObjectRecord(_0x49fd45)&&_0x49fd45[_0x418788(0x1e2)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x418788(0x21d)](_0x49fd45[_0x418788(0x1eb)]);}function isObjectRecord(_0x263b8d){const _0xc67a8d=a65_0x537d7e;return Boolean(_0x263b8d)&&typeof _0x263b8d==='object'&&!Array[_0xc67a8d(0x21d)](_0x263b8d);}function emptyServiceRegistryInspection(_0x1bf2e8,_0x4b3403,_0x362082){return{'registryPath':_0x1bf2e8,'exists':_0x362082,'status':_0x4b3403,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x1d9462){const _0x18fc94=a65_0x537d7e,_0x291c52=_0x1d9462['normalizedManifest'],_0x4afcc0=_0x291c52[_0x18fc94(0x216)]['map'](_0x3b3ab6=>({'path':_0x3b3ab6[_0x18fc94(0x228)],'description':_0x3b3ab6[_0x18fc94(0x1f8)],'risk':_0x3b3ab6[_0x18fc94(0x224)],'targetKind':_0x3b3ab6[_0x18fc94(0x217)][_0x18fc94(0x1dd)],'targetCommand':_0x3b3ab6[_0x18fc94(0x217)]['command']}));return{'serviceCode':_0x1d9462['serviceCode'],'name':_0x291c52['service'][_0x18fc94(0x227)],'description':_0x291c52[_0x18fc94(0x1f4)][_0x18fc94(0x1f8)],'version':_0x1d9462[_0x18fc94(0x1f0)],'importedAt':_0x1d9462[_0x18fc94(0x22a)],'source':_0x1d9462['source'],'commandCount':_0x4afcc0['length'],'commands':_0x4afcc0};}function sha256(_0xb070c7){const _0x331052=a65_0x537d7e;return createHash(_0x331052(0x21e))[_0x331052(0x213)](_0xb070c7)[_0x331052(0x20c)](_0x331052(0x20d));}
|
|
1
|
+
const a65_0x4b242b=a65_0x3d12;(function(_0x2eb06e,_0x980048){const _0x125bf7=a65_0x3d12,_0xdcab3c=_0x2eb06e();while(!![]){try{const _0x4c69e6=parseInt(_0x125bf7(0x20b))/0x1+parseInt(_0x125bf7(0x22e))/0x2*(parseInt(_0x125bf7(0x1fb))/0x3)+parseInt(_0x125bf7(0x1f5))/0x4+parseInt(_0x125bf7(0x204))/0x5*(-parseInt(_0x125bf7(0x225))/0x6)+parseInt(_0x125bf7(0x233))/0x7*(parseInt(_0x125bf7(0x220))/0x8)+parseInt(_0x125bf7(0x226))/0x9*(-parseInt(_0x125bf7(0x23f))/0xa)+-parseInt(_0x125bf7(0x207))/0xb;if(_0x4c69e6===_0x980048)break;else _0xdcab3c['push'](_0xdcab3c['shift']());}catch(_0x49258d){_0xdcab3c['push'](_0xdcab3c['shift']());}}}(a65_0x2168,0x1ad9b));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a65_0x4b242b(0x22d);export function getServiceRegistryPath(_0x453ddb={}){const _0x362569=a65_0x4b242b;return resolve(_0x453ddb['homeDir']??homedir(),PRODUCT_CONFIG[_0x362569(0x1f4)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x4440ea={}){const _0x64c9de=a65_0x4b242b,_0x8556e4=getServiceRegistryPath(_0x4440ea);if(!existsSync(_0x8556e4))return emptyServiceRegistry();try{const _0xe994d=readFileSync(_0x8556e4,_0x64c9de(0x23e));if(!_0xe994d['trim']())return emptyServiceRegistry();const _0x20f038=JSON[_0x64c9de(0x1f7)](_0xe994d);if(_0x20f038[_0x64c9de(0x224)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x64c9de(0x211)+String(_0x20f038[_0x64c9de(0x224)]),_0x64c9de(0x242)+_0x8556e4+'.');if(!Array[_0x64c9de(0x21e)](_0x20f038['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x20f038[_0x64c9de(0x221)],'services':_0x20f038[_0x64c9de(0x238)]};}catch(_0x47633a){if(_0x47633a instanceof Error&&_0x47633a['name']===_0x64c9de(0x23c))throw _0x47633a;throw CliErrors[_0x64c9de(0x236)](_0x64c9de(0x218)+_0x8556e4,_0x64c9de(0x1fe));}}function a65_0x2168(){const _0x5f2c2e=['startsWith','source','homeDirName','216964mjsTQV','$.services[','parse','Local\x20service\x20not\x20found:\x20','digest','push','69XxsFwv','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','serviceCode','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','sha256','length','Invalid\x20service\x20manifest\x20JSON:\x20','cliPath','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','415JdXNJW','command','registry','1711325kshaOc','stringify','flatMap','registryIndex','69510uigUlr','target','file','Cannot\x20write\x20service\x20registry:\x20','map','description','Unsupported\x20service\x20registry\x20schemaVersion:\x20','commands','kind','slice','filePath','hex','normalizedManifest','Invalid\x20service\x20registry\x20JSON:\x20','].manifest.','sort','ENOENT','now','version','isArray','splice','6136veZBCa','updatedAt','toISOString','code','schemaVersion','2148xPdryi','164277druWUb','join','bff\x20target\x20requires\x20functionName.','manifests','report','].manifest','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','service.json','1762CwxpxC','sourceHash','services\x20must\x20be\x20an\x20array','service','path','1547nqcCfg','errors','.tmp','validation','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','services','Unsupported\x20schemaVersion:\x20','manifest','Service\x20manifest\x20validation\x20failed:\x0a','CliError','findIndex','utf8','10cgeujw','warnings','find','Remove\x20or\x20migrate\x20','message','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','invalid','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','reduce','Service\x20manifest\x20file\x20not\x20found:\x20'];a65_0x2168=function(){return _0x5f2c2e;};return a65_0x2168();}export function writeServiceRegistry(_0x27d953,_0x17093e={}){const _0xc6cb34=a65_0x4b242b,_0x9904b9=getServiceRegistryPath(_0x17093e),_0x3d6b64=dirname(_0x9904b9);!existsSync(_0x3d6b64)&&mkdirSync(_0x3d6b64,{'recursive':!![]});const _0x45accf=_0x9904b9+_0xc6cb34(0x235);try{writeFileSync(_0x45accf,JSON['stringify'](_0x27d953,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x45accf,_0x9904b9);}catch(_0x16b804){try{unlinkSync(_0x45accf);}catch{}if(_0x16b804?.[_0xc6cb34(0x223)]===_0xc6cb34(0x21b))throw CliErrors[_0xc6cb34(0x236)](_0xc6cb34(0x20e)+_0x9904b9);throw _0x16b804;}return _0x9904b9;}export function loadServiceManifestFromFile(_0x307ab2){const _0x21d589=a65_0x4b242b,_0xa32e9f=resolve(_0x307ab2);if(!existsSync(_0xa32e9f))throw CliErrors[_0x21d589(0x236)](_0x21d589(0x248)+_0x307ab2);let _0x495f58;const _0x52cfae=readFileSync(_0xa32e9f,_0x21d589(0x23e));try{_0x495f58=JSON[_0x21d589(0x1f7)](_0x52cfae);}catch{throw CliErrors[_0x21d589(0x236)](_0x21d589(0x201)+_0x307ab2,_0x21d589(0x1fc));}const _0x6cf08c=sha256(_0x52cfae),_0x560d42=extractLoadedServiceManifests(_0x495f58,_0x6cf08c),_0xeaa372=aggregateValidationReports(_0x560d42),_0x1e29be=_0x560d42[0x0];return{'filePath':_0xa32e9f,'hash':_0x6cf08c,'kind':isServiceRegistryLike(_0x495f58)?_0x21d589(0x206):_0x21d589(0x23a),'manifest':_0x1e29be?.[_0x21d589(0x23a)]??_0x495f58,'report':_0xeaa372,'normalizedManifest':_0x560d42[_0x21d589(0x200)]===0x1?_0x1e29be?.[_0x21d589(0x217)]:undefined,'manifests':_0x560d42};}export function importServiceManifest(_0x55d710,_0x25670b={}){const _0x3c1040=a65_0x4b242b,_0xd8fd7=loadServiceManifestFromFile(_0x55d710);if(!_0xd8fd7[_0x3c1040(0x22a)]['ok'])throw CliErrors[_0x3c1040(0x236)](formatValidationFailure(_0xd8fd7[_0x3c1040(0x22a)]),_0x3c1040(0x203));if(_0xd8fd7[_0x3c1040(0x229)][_0x3c1040(0x200)]===0x0)throw CliErrors['validation'](_0x3c1040(0x237),_0x3c1040(0x246));const _0x1ea630=readServiceRegistry(_0x25670b),_0x169f61=(_0x25670b['now']??(()=>new Date()))()[_0x3c1040(0x222)](),_0x140192=[];let _0x444728=0x0,_0x304302=0x0;for(const _0x5cf35b of _0xd8fd7[_0x3c1040(0x229)]){if(!_0x5cf35b[_0x3c1040(0x217)])continue;const _0x496038=_0x5cf35b[_0x3c1040(0x217)]['service'][_0x3c1040(0x223)],_0x80d7d2={'serviceCode':_0x496038,'version':_0x5cf35b['normalizedManifest'][_0x3c1040(0x21d)],'importedAt':_0x169f61,'source':{'type':_0x3c1040(0x20d),'path':_0xd8fd7[_0x3c1040(0x215)],'hash':_0x5cf35b[_0x3c1040(0x22f)]},'manifest':_0x5cf35b[_0x3c1040(0x23a)],'normalizedManifest':_0x5cf35b[_0x3c1040(0x217)]},_0x4a1601=_0x1ea630[_0x3c1040(0x238)][_0x3c1040(0x23d)](_0x4996b7=>_0x4996b7[_0x3c1040(0x1fd)]===_0x496038);_0x4a1601>=0x0?(_0x1ea630[_0x3c1040(0x238)][_0x4a1601]=_0x80d7d2,_0x304302++):(_0x1ea630[_0x3c1040(0x238)][_0x3c1040(0x1fa)](_0x80d7d2),_0x444728++),_0x140192[_0x3c1040(0x1fa)](_0x80d7d2);}_0x1ea630[_0x3c1040(0x238)][_0x3c1040(0x21a)]((_0x316753,_0x4cf81f)=>_0x316753['serviceCode']['localeCompare'](_0x4cf81f['serviceCode'])),_0x1ea630[_0x3c1040(0x221)]=_0x169f61;const _0x10468b=writeServiceRegistry(_0x1ea630,_0x25670b);return{'registryPath':_0x10468b,'entry':_0x140192[0x0],'replaced':_0x140192[_0x3c1040(0x200)]===0x1?_0x304302===0x1:_0x304302>0x0,'entries':_0x140192,'imported':_0x444728,'updated':_0x304302,'serviceCount':_0x1ea630[_0x3c1040(0x238)]['length']};}export function exportServiceManifest(_0x5032e4,_0xc940f4,_0x2b30d3={}){const _0x199b51=a65_0x4b242b,_0x1f18b1=getServiceRegistryPath(_0x2b30d3),_0xc0a420=getLocalServiceEntry(_0x5032e4,_0x2b30d3);if(!_0xc0a420)throw CliErrors[_0x199b51(0x236)](_0x199b51(0x1f8)+_0x5032e4,_0x199b51(0x22c));const _0x2aa385=resolve(_0xc940f4),_0x556b99=dirname(_0x2aa385);return!existsSync(_0x556b99)&&mkdirSync(_0x556b99,{'recursive':!![]}),writeFileSync(_0x2aa385,JSON['stringify'](_0xc0a420[_0x199b51(0x23a)],null,0x2)+'\x0a',{'encoding':_0x199b51(0x23e),'mode':0x180}),{'registryPath':_0x1f18b1,'filePath':_0x2aa385,'entry':_0xc0a420};}export function removeServiceManifest(_0x3d8e82,_0x7c7c70={}){const _0x39b4cc=a65_0x4b242b,_0x423f91=readServiceRegistry(_0x7c7c70),_0x36f428=_0x3d8e82['trim'](),_0x596955=_0x423f91[_0x39b4cc(0x238)][_0x39b4cc(0x23d)](_0x1329f9=>_0x1329f9[_0x39b4cc(0x1fd)]===_0x36f428);if(_0x596955<0x0)throw CliErrors[_0x39b4cc(0x236)](_0x39b4cc(0x1f8)+_0x36f428,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x36d727]=_0x423f91[_0x39b4cc(0x238)][_0x39b4cc(0x21f)](_0x596955,0x1),_0x4f2b42=(_0x7c7c70[_0x39b4cc(0x21c)]??(()=>new Date()))()[_0x39b4cc(0x222)]();_0x423f91[_0x39b4cc(0x221)]=_0x4f2b42;const _0x19f29d=writeServiceRegistry(_0x423f91,_0x7c7c70);return{'registryPath':_0x19f29d,'entry':_0x36d727,'serviceCount':_0x423f91['services'][_0x39b4cc(0x200)]};}export function listLocalServices(_0x528db4={}){const _0x3f63ae=a65_0x4b242b;return readServiceRegistry(_0x528db4)[_0x3f63ae(0x238)];}export function getLocalServiceEntry(_0x5e42aa,_0x14cf7b={}){const _0x24be53=a65_0x4b242b;return readServiceRegistry(_0x14cf7b)['services'][_0x24be53(0x241)](_0x355a2f=>_0x355a2f[_0x24be53(0x1fd)]===_0x5e42aa['trim']());}export function listLocalServiceTrees(_0x221861={}){const _0x2504ea=a65_0x4b242b;return readServiceRegistry(_0x221861)['services'][_0x2504ea(0x20f)](_0x4e81a5=>_0x4e81a5[_0x2504ea(0x217)]);}export function inspectServiceRegistry(_0x4ece35={}){const _0x4746d4=a65_0x4b242b,_0x882e12=getServiceRegistryPath(_0x4ece35);if(!existsSync(_0x882e12))return emptyServiceRegistryInspection(_0x882e12,'missing',![]);try{const _0x20b2e7=readFileSync(_0x882e12,'utf8');if(!_0x20b2e7['trim']())return emptyServiceRegistryInspection(_0x882e12,'empty',!![]);const _0x22f38d=JSON[_0x4746d4(0x1f7)](_0x20b2e7);if(_0x22f38d['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x882e12,_0x4746d4(0x245),!![]),'schemaVersion':_0x22f38d[_0x4746d4(0x224)],'message':_0x4746d4(0x239)+String(_0x22f38d[_0x4746d4(0x224)])};if(!Array[_0x4746d4(0x21e)](_0x22f38d[_0x4746d4(0x238)]))return{...emptyServiceRegistryInspection(_0x882e12,_0x4746d4(0x245),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x22f38d[_0x4746d4(0x221)],'message':_0x4746d4(0x230)};const _0x831960=_0x22f38d[_0x4746d4(0x238)][_0x4746d4(0x20f)](summarizeLocalServiceEntry);return{'registryPath':_0x882e12,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x22f38d[_0x4746d4(0x221)],'serviceCount':_0x831960[_0x4746d4(0x200)],'commandCount':_0x831960[_0x4746d4(0x247)]((_0xdf6006,_0x56ee1b)=>_0xdf6006+_0x56ee1b['commandCount'],0x0),'services':_0x831960};}catch(_0x3d63f3){return{...emptyServiceRegistryInspection(_0x882e12,_0x4746d4(0x245),!![]),'message':_0x3d63f3 instanceof Error?_0x3d63f3[_0x4746d4(0x243)]:String(_0x3d63f3)};}}function a65_0x3d12(_0x389679,_0xbab84e){_0x389679=_0x389679-0x1f4;const _0x21684e=a65_0x2168();let _0x3d12de=_0x21684e[_0x389679];return _0x3d12de;}export function formatValidationFailure(_0x4ff236){const _0x290f81=a65_0x4b242b,_0x11b687=_0x4ff236[_0x290f81(0x234)][_0x290f81(0x20f)](_0x24cb63=>_0x24cb63['path']+':\x20'+_0x24cb63[_0x290f81(0x243)]);return _0x290f81(0x23b)+_0x11b687[_0x290f81(0x227)]('\x0a');}function extractLoadedServiceManifests(_0x4694b9,_0x52e38e){const _0x3ddc2c=a65_0x4b242b;if(!isServiceRegistryLike(_0x4694b9)){const _0x11912a=_0x4694b9,{manifest:_0x27587d,errors:_0x4b369e}=adaptServiceTreeManifestForLegacyFramework(_0x11912a),_0x267500=validateServiceTreeManifest(_0x27587d),_0x281c46=mergeValidationErrors(_0x267500,_0x4b369e);return[{'manifest':_0x11912a,'report':_0x281c46,'normalizedManifest':_0x281c46['ok']?normalizeServiceTreeManifest(_0x27587d):undefined,'sourceHash':_0x52e38e}];}return _0x4694b9[_0x3ddc2c(0x238)][_0x3ddc2c(0x20f)]((_0x53e3c1,_0x32ff9d)=>{const _0x11ecf4=_0x3ddc2c,_0x294319=isObjectRecord(_0x53e3c1)?_0x53e3c1[_0x11ecf4(0x23a)]:undefined,{manifest:_0x347b22,errors:_0x25a719}=adaptServiceTreeManifestForLegacyFramework(_0x294319),_0x5526bb=validateServiceTreeManifest(_0x347b22),_0x96f3f9=mergeValidationErrors(_0x5526bb,_0x25a719),_0x12a1c5=isObjectRecord(_0x53e3c1)&&typeof _0x53e3c1[_0x11ecf4(0x1fd)]==='string'?_0x53e3c1['serviceCode']:undefined;return{'manifest':_0x294319,'report':_0x96f3f9,'normalizedManifest':_0x96f3f9['ok']?normalizeServiceTreeManifest(_0x347b22):undefined,'sourceHash':sha256(JSON[_0x11ecf4(0x208)](_0x294319,null,0x2)+'\x0a'),'registryIndex':_0x32ff9d,'registryServiceCode':_0x12a1c5};});}function mergeValidationErrors(_0x487f4d,_0x28ac1b){const _0x279dab=a65_0x4b242b,_0x487546=_0x487f4d[_0x279dab(0x234)][_0x279dab(0x20f)](_0x38041e=>_0x38041e[_0x279dab(0x243)]===_0x279dab(0x244)?{..._0x38041e,'message':_0x279dab(0x228)}:_0x38041e),_0x2a070d=[..._0x28ac1b,..._0x487546];return{'ok':_0x2a070d[_0x279dab(0x200)]===0x0,'errors':_0x2a070d,'warnings':_0x487f4d['warnings']};}function aggregateValidationReports(_0x1d961d){const _0x128ca0=a65_0x4b242b,_0x3b43a0=_0x1d961d['flatMap'](_0x434818=>_0x434818[_0x128ca0(0x20a)]===undefined?_0x434818[_0x128ca0(0x22a)][_0x128ca0(0x234)]:_0x434818[_0x128ca0(0x22a)][_0x128ca0(0x234)][_0x128ca0(0x20f)](_0x2c784f=>({..._0x2c784f,'path':prefixRegistryIssuePath(_0x434818[_0x128ca0(0x20a)],_0x2c784f[_0x128ca0(0x232)])}))),_0xe1429a=_0x1d961d[_0x128ca0(0x209)](_0x33ed08=>_0x33ed08['registryIndex']===undefined?_0x33ed08[_0x128ca0(0x22a)]['warnings']:_0x33ed08[_0x128ca0(0x22a)][_0x128ca0(0x240)][_0x128ca0(0x20f)](_0x3ee2c8=>({..._0x3ee2c8,'path':prefixRegistryIssuePath(_0x33ed08[_0x128ca0(0x20a)],_0x3ee2c8[_0x128ca0(0x232)])})));return{'ok':_0x3b43a0[_0x128ca0(0x200)]===0x0,'errors':_0x3b43a0,'warnings':_0xe1429a};}function prefixRegistryIssuePath(_0x5f0fe1,_0x3d1400){const _0x162a4a=a65_0x4b242b;if(_0x3d1400==='$')return _0x162a4a(0x1f6)+_0x5f0fe1+_0x162a4a(0x22b);if(_0x3d1400[_0x162a4a(0x249)]('$.'))return _0x162a4a(0x1f6)+_0x5f0fe1+'].manifest'+_0x3d1400['slice'](0x1);if(_0x3d1400[_0x162a4a(0x249)]('$['))return _0x162a4a(0x1f6)+_0x5f0fe1+_0x162a4a(0x22b)+_0x3d1400[_0x162a4a(0x214)](0x1);return _0x162a4a(0x1f6)+_0x5f0fe1+_0x162a4a(0x219)+_0x3d1400;}function isServiceRegistryLike(_0x459127){const _0x576bcc=a65_0x4b242b;return isObjectRecord(_0x459127)&&_0x459127[_0x576bcc(0x224)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x576bcc(0x21e)](_0x459127[_0x576bcc(0x238)]);}function isObjectRecord(_0x107f7c){return Boolean(_0x107f7c)&&typeof _0x107f7c==='object'&&!Array['isArray'](_0x107f7c);}function emptyServiceRegistryInspection(_0x24aef3,_0x355403,_0x1e452c){return{'registryPath':_0x24aef3,'exists':_0x1e452c,'status':_0x355403,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xd49bd){const _0x5b7623=a65_0x4b242b,_0x360f2d=_0xd49bd[_0x5b7623(0x217)],_0x4148df=_0x360f2d[_0x5b7623(0x212)][_0x5b7623(0x20f)](_0x18b0e9=>({'path':_0x18b0e9[_0x5b7623(0x202)],'description':_0x18b0e9[_0x5b7623(0x210)],'risk':_0x18b0e9['risk'],'targetKind':_0x18b0e9[_0x5b7623(0x20c)][_0x5b7623(0x213)],'targetCommand':_0x18b0e9[_0x5b7623(0x20c)][_0x5b7623(0x205)]}));return{'serviceCode':_0xd49bd[_0x5b7623(0x1fd)],'name':_0x360f2d[_0x5b7623(0x231)]['name'],'description':_0x360f2d['service'][_0x5b7623(0x210)],'version':_0xd49bd['version'],'importedAt':_0xd49bd['importedAt'],'source':_0xd49bd[_0x5b7623(0x24a)],'commandCount':_0x4148df[_0x5b7623(0x200)],'commands':_0x4148df};}function sha256(_0x59e1a8){const _0x11f951=a65_0x4b242b;return createHash(_0x11f951(0x1ff))['update'](_0x59e1a8)[_0x11f951(0x1f9)](_0x11f951(0x216));}
|