@lovrabet/lovrabet-cli 2.3.0-beta.5 → 2.3.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.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.d.ts +2 -0
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.d.ts +9 -7
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a57_0x2d34e8=a57_0x1456;(function(_0x352c09,_0x123052){const _0x44c191=a57_0x1456,_0x52727e=_0x352c09();while(!![]){try{const _0x2c17c1=-parseInt(_0x44c191(0xc4))/0x1*(parseInt(_0x44c191(0xd8))/0x2)+-parseInt(_0x44c191(0xc6))/0x3+-parseInt(_0x44c191(0xc9))/0x4+parseInt(_0x44c191(0xd4))/0x5*(parseInt(_0x44c191(0xd2))/0x6)+-parseInt(_0x44c191(0xc1))/0x7+-parseInt(_0x44c191(0xcf))/0x8*(parseInt(_0x44c191(0xc8))/0x9)+parseInt(_0x44c191(0xd7))/0xa*(parseInt(_0x44c191(0xd6))/0xb);if(_0x2c17c1===_0x123052)break;else _0x52727e['push'](_0x52727e['shift']());}catch(_0x53b5d0){_0x52727e['push'](_0x52727e['shift']());}}}(a57_0x1236,0x243d9));import{updateRuntimeRoleUsers}from'../../core/api-client.js';function a57_0x1236(){const _0x2e4d38=['roleList','15FRUeSg','after','11RWrbty','9782170qpUMeg','10078HmKMEc','warnings','shouldWrite','159677SyuXNf','description','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','49BEYucl','/client/permit/user-role/update-user-list','826350cItitp','build','28332oUMZho','455036MJEpke','userId','body','POST','user-remove','role','608JtMKAW','appCode','high-risk-write','136806tTnUrF'];a57_0x1236=function(){return _0x2e4d38;};return a57_0x1236();}function a57_0x1456(_0x6a1a02,_0x4a0e17){_0x6a1a02=_0x6a1a02-0xc1;const _0x123697=a57_0x1236();let _0x1456f1=_0x123697[_0x6a1a02];return _0x1456f1;}import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':a57_0x2d34e8(0xcd),'description':a57_0x2d34e8(0xc3),'risk':a57_0x2d34e8(0xd1),'confirmationDescription':'Removes\x20the\x20given\x20runtime\x20user\x20from\x20the\x20target\x20role.\x20The\x20user\x20loses\x20permissions\x20granted\x20only\x20by\x20that\x20role.','flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x4507ec){const _0x34a1c5=a57_0x2d34e8,_0x5101b6=await prepareRuntimeMemberMutation(_0x4507ec,_0x34a1c5(0xcd));return dryRun(_0x34a1c5(0xcc),_0x34a1c5(0xc5))[_0x34a1c5(0xcb)]({'appCode':_0x4507ec[_0x34a1c5(0xd0)],'roleList':_0x5101b6['roleList']})[_0x34a1c5(0xc2)](_0x5101b6[_0x34a1c5(0xda)]?'Preview:\x20remove\x20runtime\x20role\x20member':_0x5101b6[_0x34a1c5(0xd9)][0x0])[_0x34a1c5(0xc7)]();},async 'execute'(_0x2771b9){const _0x5cedc4=a57_0x2d34e8,_0x5382fd=await prepareRuntimeMemberMutation(_0x2771b9,_0x5cedc4(0xcd));return _0x5382fd['shouldWrite']&&await updateRuntimeRoleUsers(_0x2771b9[_0x5cedc4(0xd0)],_0x5382fd[_0x5cedc4(0xd3)]),{'ok':!![],'data':runtimeRoleWriteResult('user-remove',{'roleId':_0x5382fd[_0x5cedc4(0xce)]['id'],'userId':_0x5382fd[_0x5cedc4(0xca)]},_0x5382fd['before'],_0x5382fd[_0x5cedc4(0xd5)],{'method':_0x5cedc4(0xcc),'path':_0x5cedc4(0xc5)},_0x5382fd[_0x5cedc4(0xd9)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0xf58dc8=a58_0x5a57;(function(_0x157d82,_0xe2f02a){const _0x3b4bf3=a58_0x5a57,_0x5c7f85=_0x157d82();while(!![]){try{const _0x36b5db=parseInt(_0x3b4bf3(0x1b7))/0x1*(parseInt(_0x3b4bf3(0x1da))/0x2)+parseInt(_0x3b4bf3(0x1d3))/0x3+-parseInt(_0x3b4bf3(0x1f2))/0x4+-parseInt(_0x3b4bf3(0x1e4))/0x5*(-parseInt(_0x3b4bf3(0x1b3))/0x6)+parseInt(_0x3b4bf3(0x1c7))/0x7*(-parseInt(_0x3b4bf3(0x1c5))/0x8)+-parseInt(_0x3b4bf3(0x1c1))/0x9*(parseInt(_0x3b4bf3(0x1b9))/0xa)+-parseInt(_0x3b4bf3(0x1e3))/0xb*(-parseInt(_0x3b4bf3(0x1ea))/0xc);if(_0x36b5db===_0xe2f02a)break;else _0x5c7f85['push'](_0x5c7f85['shift']());}catch(_0x167eb3){_0x5c7f85['push'](_0x5c7f85['shift']());}}}(a58_0xd195,0x1aca1));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a58_0xd195(){const _0x3cec3c=['high-risk-write','kind','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','list','Deleted\x20schedule\x20','body','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','trim','998826HDCGxe','build','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','2AaCEAs','\x20from\x20schedule\x20','6860MozUWK','create','appCode','cron','Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','UTC','Preview:\x20create\x20an\x20Agent\x20schedule','2826bJBcxJ','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Schedule\x20title','str','148216LXfrtS','Queued\x20Task\x20','49cfmPPj','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','limit','validation','Preview:\x20run\x20schedule\x20','schedule-id','taskId','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','Preview:\x20delete\x20schedule\x20','deepseek-v4-pro-0813','num','schedule','37095wFUdAG','length','Schedule\x20kind:\x20CRON\x20or\x20ONCE','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','ONCE','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','157426OapYbX','--title\x20must\x20not\x20be\x20blank.','description','DELETE','kimi/k3','read','/run','scheduleId','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','22DKTrDW','5VMNQmc','delete','prompt','Created\x20','cursor','validate','1200612QEHhrd','/api/harness/apps/','title','detail','scheduled-at','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','CRON','deepseek-v4-flash-0731','326168JIVyWL','--prompt\x20must\x20not\x20be\x20blank.','run','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','string','Schedule\x20input\x20is\x20valid'];a58_0xd195=function(){return _0x3cec3c;};return a58_0xd195();}import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a58_0xf58dc8(0x1fa),'type':a58_0xf58dc8(0x1f7),'required':!![],'enum':[a58_0xf58dc8(0x1f0),'ONCE'],'description':a58_0xf58dc8(0x1d5)},CRON_FLAG={'name':'cron','type':a58_0xf58dc8(0x1f7),'description':a58_0xf58dc8(0x1f6)},SCHEDULED_AT_FLAG={'name':a58_0xf58dc8(0x1ee),'type':a58_0xf58dc8(0x1f7),'description':a58_0xf58dc8(0x1b5)},TITLE_FLAG={'name':a58_0xf58dc8(0x1ec),'type':'string','required':!![],'description':a58_0xf58dc8(0x1c3)},PROMPT_FLAG={'name':a58_0xf58dc8(0x1e6),'type':a58_0xf58dc8(0x1f7),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},MODEL_FLAG={'name':'model','type':a58_0xf58dc8(0x1f7),'enum':[a58_0xf58dc8(0x1de),a58_0xf58dc8(0x1f1),a58_0xf58dc8(0x1d0)],'default':a58_0xf58dc8(0x1f1),'description':a58_0xf58dc8(0x1b6)},SCHEDULE_ID_FLAG={'name':a58_0xf58dc8(0x1cc),'type':'string','required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0xf58dc8(0x1c2)}},LIMIT_FLAG={'name':a58_0xf58dc8(0x1c9),'type':'number','default':0x14,'description':'Page\x20size\x20from\x201\x20to\x20100'},CURSOR_FLAG={'name':a58_0xf58dc8(0x1e8),'type':'string','description':'Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call'},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function readScheduleInput(_0x12164f){const _0x420f66=a58_0xf58dc8,_0x4083ef=_0x12164f[_0x420f66(0x1c4)](_0x420f66(0x1fa)),_0x9403e=_0x12164f['str'](_0x420f66(0x1ec))[_0x420f66(0x1b2)](),_0x6f028f=_0x12164f[_0x420f66(0x1c4)](_0x420f66(0x1e6))[_0x420f66(0x1b2)](),_0x3fe5ee=_0x12164f[_0x420f66(0x1c4)]('model'),_0x2681a7=_0x12164f[_0x420f66(0x1c4)](_0x420f66(0x1bc)),_0x5f388a=_0x12164f['str'](_0x420f66(0x1ee));if(!_0x9403e)throw CliErrors[_0x420f66(0x1ca)](_0x420f66(0x1db));if(!_0x6f028f)throw CliErrors['validation'](_0x420f66(0x1f3));if(_0x4083ef===_0x420f66(0x1f0)){if(!_0x2681a7||_0x5f388a)throw CliErrors['validation'](_0x420f66(0x1d6));return{'kind':_0x4083ef,'timezone':_0x420f66(0x1bf),'cron':_0x2681a7,'title':_0x9403e,'prompt':_0x6f028f,'model':_0x3fe5ee};}if(_0x4083ef===_0x420f66(0x1d8)){if(!_0x5f388a||_0x2681a7)throw CliErrors[_0x420f66(0x1ca)](_0x420f66(0x1f5));return{'kind':_0x4083ef,'timezone':_0x420f66(0x1bf),'scheduledAt':_0x5f388a,'title':_0x9403e,'prompt':_0x6f028f,'model':_0x3fe5ee};}throw CliErrors[_0x420f66(0x1ca)](_0x420f66(0x1b1));}function scheduleCollectionPath(_0x515dd1){const _0xb4db3f=a58_0xf58dc8;return _0xb4db3f(0x1eb)+encodeURIComponent(_0x515dd1)+'/schedules';}function scheduleItemPath(_0x2a10e6,_0x4c42a2){return scheduleCollectionPath(_0x2a10e6)+'/'+encodeURIComponent(_0x4c42a2);}const scheduleValidate={'service':'schedule','command':a58_0xf58dc8(0x1e9),'description':a58_0xf58dc8(0x1d9),'risk':a58_0xf58dc8(0x1df),'flags':INPUT_FLAGS,async 'validate'(_0x1dc133){readScheduleInput(_0x1dc133);},async 'execute'(_0x36a582){const _0x505393=a58_0xf58dc8,_0x360a2c=readScheduleInput(_0x36a582),_0x2bfea8=await validateRuntimeSchedule(_0x36a582[_0x505393(0x1bb)],_0x360a2c);return{'ok':!![],'data':_0x2bfea8,'message':_0x505393(0x1f8)};}},scheduleCreate={'service':'schedule','command':a58_0xf58dc8(0x1ba),'description':a58_0xf58dc8(0x1ef),'risk':'high-risk-write','confirmationDescription':a58_0xf58dc8(0x1fb),'flags':INPUT_FLAGS,async 'validate'(_0x3eabc1){readScheduleInput(_0x3eabc1);},async 'execute'(_0x258bcc){const _0xf0c438=a58_0xf58dc8,_0xe1b12a=readScheduleInput(_0x258bcc),_0x5198c7=await validateRuntimeSchedule(_0x258bcc[_0xf0c438(0x1bb)],_0xe1b12a),_0x545d27=await createRuntimeSchedule(_0x258bcc[_0xf0c438(0x1bb)],_0x5198c7);return{'ok':!![],'data':_0x545d27,'message':_0xf0c438(0x1e7)+_0x545d27[_0xf0c438(0x1fa)]+'\x20schedule\x20'+_0x545d27[_0xf0c438(0x1e1)]};},async 'dryRun'(_0x2d2ece){const _0xecea40=a58_0xf58dc8,_0x296ed6=readScheduleInput(_0x2d2ece);return dryRun('POST',scheduleCollectionPath(_0x2d2ece[_0xecea40(0x1bb)]))[_0xecea40(0x1b0)](_0x296ed6)[_0xecea40(0x1dc)](_0xecea40(0x1c0))[_0xecea40(0x1b4)]();}},scheduleList={'service':a58_0xf58dc8(0x1d2),'command':a58_0xf58dc8(0x1ae),'description':a58_0xf58dc8(0x1ce),'risk':a58_0xf58dc8(0x1df),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x3463eb){const _0x38fd68=a58_0xf58dc8,_0x6988f=_0x3463eb[_0x38fd68(0x1d1)](_0x38fd68(0x1c9));if(!Number['isSafeInteger'](_0x6988f)||_0x6988f<0x1||_0x6988f>0x64)throw CliErrors['validation'](_0x38fd68(0x1e2));const _0x8f64cd=_0x3463eb[_0x38fd68(0x1c4)](_0x38fd68(0x1e8));if(_0x8f64cd&&(_0x8f64cd[_0x38fd68(0x1d4)]>0x400||_0x8f64cd[_0x38fd68(0x1b2)]()!==_0x8f64cd))throw CliErrors[_0x38fd68(0x1ca)](_0x38fd68(0x1c8));},async 'execute'(_0x4f4501){const _0x5ae9ef=a58_0xf58dc8,_0x3d6abf=_0x4f4501['str']('cursor'),_0x280ad6=await listRuntimeSchedules(_0x4f4501[_0x5ae9ef(0x1bb)],{'kind':_0x4f4501[_0x5ae9ef(0x1c4)](_0x5ae9ef(0x1fa)),'limit':_0x4f4501['num'](_0x5ae9ef(0x1c9)),..._0x3d6abf?{'cursor':_0x3d6abf}:{}});return{'ok':!![],'data':_0x280ad6};}},scheduleDetail={'service':a58_0xf58dc8(0x1d2),'command':a58_0xf58dc8(0x1ed),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a58_0xf58dc8(0x1df),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x83fe29){const _0x526dc1=a58_0xf58dc8,_0x53d701=await getRuntimeSchedule(_0x83fe29['appCode'],_0x83fe29[_0x526dc1(0x1c4)](_0x526dc1(0x1cc)));return{'ok':!![],'data':_0x53d701};}},scheduleRun={'service':a58_0xf58dc8(0x1d2),'command':a58_0xf58dc8(0x1f4),'description':a58_0xf58dc8(0x1bd),'risk':a58_0xf58dc8(0x1f9),'confirmationDescription':'Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3ee2a4){const _0x27c461=a58_0xf58dc8,_0x1ef2a3=_0x3ee2a4[_0x27c461(0x1c4)](_0x27c461(0x1cc)),_0x1c0c17=await runRuntimeSchedule(_0x3ee2a4[_0x27c461(0x1bb)],_0x1ef2a3);return{'ok':!![],'data':_0x1c0c17,'message':_0x27c461(0x1c6)+_0x1c0c17[_0x27c461(0x1cd)]+_0x27c461(0x1b8)+_0x1ef2a3};},async 'dryRun'(_0xb89ba2){const _0x332a70=a58_0xf58dc8,_0x4262a2=_0xb89ba2[_0x332a70(0x1c4)](_0x332a70(0x1cc));return dryRun('POST',scheduleItemPath(_0xb89ba2[_0x332a70(0x1bb)],_0x4262a2)+_0x332a70(0x1e0))[_0x332a70(0x1dc)](_0x332a70(0x1cb)+_0x4262a2+'\x20immediately')[_0x332a70(0x1b4)]();}},scheduleDelete={'service':a58_0xf58dc8(0x1d2),'command':a58_0xf58dc8(0x1e5),'description':a58_0xf58dc8(0x1d7),'risk':a58_0xf58dc8(0x1f9),'confirmationDescription':a58_0xf58dc8(0x1be),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x278372){const _0x522641=a58_0xf58dc8,_0x316e95=_0x278372[_0x522641(0x1c4)](_0x522641(0x1cc)),_0x532dbd=await deleteRuntimeSchedule(_0x278372['appCode'],_0x316e95);return{'ok':!![],'data':_0x532dbd,'message':_0x522641(0x1af)+_0x316e95};},async 'dryRun'(_0x55fad2){const _0x4fb841=a58_0xf58dc8,_0x1c36c5=_0x55fad2[_0x4fb841(0x1c4)](_0x4fb841(0x1cc));return dryRun(_0x4fb841(0x1dd),scheduleItemPath(_0x55fad2[_0x4fb841(0x1bb)],_0x1c36c5))[_0x4fb841(0x1dc)](_0x4fb841(0x1cf)+_0x1c36c5)[_0x4fb841(0x1b4)]();}};function a58_0x5a57(_0xfd8485,_0x40a45b){_0xfd8485=_0xfd8485-0x1ae;const _0xd195b1=a58_0xd195();let _0x5a5799=_0xd195b1[_0xfd8485];return _0x5a5799;}export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
const a58_0x996ba=a58_0x5137;(function(_0x24802c,_0x1e0fc4){const _0x41c36c=a58_0x5137,_0x4d1eef=_0x24802c();while(!![]){try{const _0x153c39=parseInt(_0x41c36c(0x198))/0x1+-parseInt(_0x41c36c(0x1b1))/0x2*(parseInt(_0x41c36c(0x18f))/0x3)+-parseInt(_0x41c36c(0x195))/0x4+parseInt(_0x41c36c(0x1ad))/0x5+-parseInt(_0x41c36c(0x190))/0x6*(-parseInt(_0x41c36c(0x1b6))/0x7)+parseInt(_0x41c36c(0x1ae))/0x8*(parseInt(_0x41c36c(0x1c1))/0x9)+-parseInt(_0x41c36c(0x197))/0xa;if(_0x153c39===_0x1e0fc4)break;else _0x4d1eef['push'](_0x4d1eef['shift']());}catch(_0x5429a1){_0x4d1eef['push'](_0x4d1eef['shift']());}}}(a58_0x1601,0x1ca8f));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a58_0x5137(_0x4bfca5,_0xc0338b){_0x4bfca5=_0x4bfca5-0x17a;const _0x1601b1=a58_0x1601();let _0x5137e5=_0x1601b1[_0x4bfca5];return _0x5137e5;}import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a58_0x996ba(0x19b),'type':a58_0x996ba(0x1ac),'required':!![],'enum':[a58_0x996ba(0x17b),'ONCE'],'description':a58_0x996ba(0x1aa)},CRON_FLAG={'name':a58_0x996ba(0x18e),'type':'string','description':a58_0x996ba(0x1a3)},SCHEDULED_AT_FLAG={'name':a58_0x996ba(0x1a1),'type':a58_0x996ba(0x1ac),'description':a58_0x996ba(0x1c3)},TITLE_FLAG={'name':a58_0x996ba(0x182),'type':a58_0x996ba(0x1ac),'required':!![],'description':a58_0x996ba(0x183)},PROMPT_FLAG={'name':a58_0x996ba(0x1a4),'type':a58_0x996ba(0x1ac),'required':!![],'description':a58_0x996ba(0x17e)},MODEL_FLAG={'name':a58_0x996ba(0x187),'type':a58_0x996ba(0x1ac),'enum':[a58_0x996ba(0x18b),a58_0x996ba(0x199),a58_0x996ba(0x1b4)],'default':a58_0x996ba(0x199),'description':a58_0x996ba(0x1a7)},SCHEDULE_ID_FLAG={'name':a58_0x996ba(0x18a),'type':a58_0x996ba(0x1ac),'required':!![],'description':a58_0x996ba(0x1bd),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a58_0x996ba(0x181)}},LIMIT_FLAG={'name':a58_0x996ba(0x1c2),'type':a58_0x996ba(0x1c4),'default':0x14,'description':a58_0x996ba(0x1c0)},CURSOR_FLAG={'name':'cursor','type':'string','description':a58_0x996ba(0x1c6)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,MODEL_FLAG];function a58_0x1601(){const _0x21a256=['9CmVHZm','limit','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','number','read','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','Preview:\x20create\x20an\x20Agent\x20schedule','create','high-risk-write','Deleted\x20schedule\x20','CRON','Create\x20a\x20recurring\x20or\x20one-shot\x20Agent\x20schedule','/api/harness/apps/','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','length','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','title','Schedule\x20title','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','cursor','appCode','model','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Schedule\x20input\x20is\x20valid','schedule-id','kimi/k3','ONCE','Preview:\x20delete\x20schedule\x20','cron','6942EwZbxg','1060194ZUyFcH','detail','str','delete','\x20immediately','37356vQhqBw','UTC','4345920QxiDtW','168394WOgcfN','deepseek-v4-flash-0731','description','kind','\x20from\x20schedule\x20','Ignores\x20the\x20original\x20trigger\x20time,\x20runs\x20the\x20schedule\x20once\x20now,\x20and\x20creates\x20a\x20new\x20Agent\x20Task.','Show\x20one\x20schedule\x20by\x20schedule\x20ID','Creates\x20a\x20schedule\x20in\x20the\x20current\x20app\x20that\x20can\x20auto-trigger\x20an\x20Agent.\x20At\x20the\x20scheduled\x20time\x20a\x20Task\x20is\x20created\x20and\x20run.','Delete\x20the\x20schedule\x20and\x20stop\x20future\x20triggers','scheduled-at','scheduleId','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','prompt','validation','DELETE','Task\x20model\x20used\x20when\x20the\x20schedule\x20runs','build','POST','Schedule\x20kind:\x20CRON\x20or\x20ONCE','\x20schedule\x20','string','258755iLlMdd','1723088xOACcc','num','Queued\x20Task\x20','44AIific','list','Created\x20','deepseek-v4-pro-0813','run','7dJjHEf','--title\x20must\x20not\x20be\x20blank.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','--prompt\x20must\x20not\x20be\x20blank.','body','schedule','isSafeInteger','Schedule\x20UUID','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','trim','Page\x20size\x20from\x201\x20to\x20100'];a58_0x1601=function(){return _0x21a256;};return a58_0x1601();}function readScheduleInput(_0x966dcc){const _0x34e33f=a58_0x996ba,_0x66ee47=_0x966dcc[_0x34e33f(0x192)]('kind'),_0xb66dca=_0x966dcc[_0x34e33f(0x192)](_0x34e33f(0x182))[_0x34e33f(0x1bf)](),_0xf7dacc=_0x966dcc[_0x34e33f(0x192)](_0x34e33f(0x1a4))['trim'](),_0x273c0f=_0x966dcc[_0x34e33f(0x192)](_0x34e33f(0x187)),_0x58bcdf=_0x966dcc[_0x34e33f(0x192)]('cron'),_0x3ee051=_0x966dcc[_0x34e33f(0x192)](_0x34e33f(0x1a1));if(!_0xb66dca)throw CliErrors[_0x34e33f(0x1a5)](_0x34e33f(0x1b7));if(!_0xf7dacc)throw CliErrors[_0x34e33f(0x1a5)](_0x34e33f(0x1b9));if(_0x66ee47===_0x34e33f(0x17b)){if(!_0x58bcdf||_0x3ee051)throw CliErrors[_0x34e33f(0x1a5)](_0x34e33f(0x17f));return{'kind':_0x66ee47,'timezone':_0x34e33f(0x196),'cron':_0x58bcdf,'title':_0xb66dca,'prompt':_0xf7dacc,'model':_0x273c0f};}if(_0x66ee47===_0x34e33f(0x18c)){if(!_0x3ee051||_0x58bcdf)throw CliErrors[_0x34e33f(0x1a5)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x66ee47,'timezone':_0x34e33f(0x196),'scheduledAt':_0x3ee051,'title':_0xb66dca,'prompt':_0xf7dacc,'model':_0x273c0f};}throw CliErrors[_0x34e33f(0x1a5)](_0x34e33f(0x184));}function scheduleCollectionPath(_0x3a47bf){const _0x426ab1=a58_0x996ba;return _0x426ab1(0x17d)+encodeURIComponent(_0x3a47bf)+'/schedules';}function scheduleItemPath(_0x5c2676,_0x26b4d2){return scheduleCollectionPath(_0x5c2676)+'/'+encodeURIComponent(_0x26b4d2);}const scheduleValidate={'service':a58_0x996ba(0x1bb),'command':'validate','description':a58_0x996ba(0x1b8),'risk':a58_0x996ba(0x1c5),'flags':INPUT_FLAGS,async 'validate'(_0x458374){readScheduleInput(_0x458374);},async 'execute'(_0x5a5022){const _0x508e71=a58_0x996ba,_0xf712b1=readScheduleInput(_0x5a5022),_0x45b484=await validateRuntimeSchedule(_0x5a5022[_0x508e71(0x186)],_0xf712b1);return{'ok':!![],'data':_0x45b484,'message':_0x508e71(0x189)};}},scheduleCreate={'service':a58_0x996ba(0x1bb),'command':a58_0x996ba(0x1c8),'description':a58_0x996ba(0x17c),'risk':a58_0x996ba(0x1c9),'confirmationDescription':a58_0x996ba(0x19f),'flags':INPUT_FLAGS,async 'validate'(_0x2cc96c){readScheduleInput(_0x2cc96c);},async 'execute'(_0x243efd){const _0x3ba4b3=a58_0x996ba,_0x18c032=readScheduleInput(_0x243efd),_0x3ce4b6=await validateRuntimeSchedule(_0x243efd[_0x3ba4b3(0x186)],_0x18c032),_0x3e05b5=await createRuntimeSchedule(_0x243efd[_0x3ba4b3(0x186)],_0x3ce4b6);return{'ok':!![],'data':_0x3e05b5,'message':_0x3ba4b3(0x1b3)+_0x3e05b5[_0x3ba4b3(0x19b)]+_0x3ba4b3(0x1ab)+_0x3e05b5[_0x3ba4b3(0x1a2)]};},async 'dryRun'(_0x50ac1e){const _0x374f0d=a58_0x996ba,_0x3158f4=readScheduleInput(_0x50ac1e);return dryRun('POST',scheduleCollectionPath(_0x50ac1e['appCode']))[_0x374f0d(0x1ba)](_0x3158f4)[_0x374f0d(0x19a)](_0x374f0d(0x1c7))[_0x374f0d(0x1a8)]();}},scheduleList={'service':a58_0x996ba(0x1bb),'command':a58_0x996ba(0x1b2),'description':a58_0x996ba(0x1be),'risk':a58_0x996ba(0x1c5),'flags':[KIND_FLAG,LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x5597a6){const _0x325489=a58_0x996ba,_0x2a4644=_0x5597a6[_0x325489(0x1af)](_0x325489(0x1c2));if(!Number[_0x325489(0x1bc)](_0x2a4644)||_0x2a4644<0x1||_0x2a4644>0x64)throw CliErrors[_0x325489(0x1a5)]('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x32bbea=_0x5597a6[_0x325489(0x192)](_0x325489(0x185));if(_0x32bbea&&(_0x32bbea[_0x325489(0x180)]>0x400||_0x32bbea[_0x325489(0x1bf)]()!==_0x32bbea))throw CliErrors[_0x325489(0x1a5)](_0x325489(0x188));},async 'execute'(_0x4307e0){const _0x594485=a58_0x996ba,_0x47cf9e=_0x4307e0[_0x594485(0x192)](_0x594485(0x185)),_0x5f42b0=await listRuntimeSchedules(_0x4307e0[_0x594485(0x186)],{'kind':_0x4307e0['str'](_0x594485(0x19b)),'limit':_0x4307e0[_0x594485(0x1af)]('limit'),..._0x47cf9e?{'cursor':_0x47cf9e}:{}});return{'ok':!![],'data':_0x5f42b0};}},scheduleDetail={'service':'schedule','command':a58_0x996ba(0x191),'description':a58_0x996ba(0x19e),'risk':a58_0x996ba(0x1c5),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1ec006){const _0x1f2657=a58_0x996ba,_0x550d2e=await getRuntimeSchedule(_0x1ec006['appCode'],_0x1ec006[_0x1f2657(0x192)](_0x1f2657(0x18a)));return{'ok':!![],'data':_0x550d2e};}},scheduleRun={'service':a58_0x996ba(0x1bb),'command':a58_0x996ba(0x1b5),'description':'Run\x20the\x20schedule\x20once\x20immediately\x20and\x20create\x20a\x20Task','risk':a58_0x996ba(0x1c9),'confirmationDescription':a58_0x996ba(0x19d),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x547e52){const _0x223e46=a58_0x996ba,_0xd190ff=_0x547e52[_0x223e46(0x192)](_0x223e46(0x18a)),_0xb0b119=await runRuntimeSchedule(_0x547e52[_0x223e46(0x186)],_0xd190ff);return{'ok':!![],'data':_0xb0b119,'message':_0x223e46(0x1b0)+_0xb0b119['taskId']+_0x223e46(0x19c)+_0xd190ff};},async 'dryRun'(_0x3458ce){const _0x27a862=a58_0x996ba,_0x36d104=_0x3458ce[_0x27a862(0x192)](_0x27a862(0x18a));return dryRun(_0x27a862(0x1a9),scheduleItemPath(_0x3458ce[_0x27a862(0x186)],_0x36d104)+'/run')[_0x27a862(0x19a)]('Preview:\x20run\x20schedule\x20'+_0x36d104+_0x27a862(0x194))[_0x27a862(0x1a8)]();}},scheduleDelete={'service':a58_0x996ba(0x1bb),'command':a58_0x996ba(0x193),'description':a58_0x996ba(0x1a0),'risk':a58_0x996ba(0x1c9),'confirmationDescription':'Permanently\x20deletes\x20the\x20schedule\x20and\x20stops\x20future\x20auto-triggers.\x20Historical\x20Tasks\x20already\x20created\x20are\x20not\x20affected.','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1473b8){const _0x20862d=a58_0x996ba,_0x28cf97=_0x1473b8[_0x20862d(0x192)](_0x20862d(0x18a)),_0x4c6513=await deleteRuntimeSchedule(_0x1473b8[_0x20862d(0x186)],_0x28cf97);return{'ok':!![],'data':_0x4c6513,'message':_0x20862d(0x17a)+_0x28cf97};},async 'dryRun'(_0x167e0e){const _0x1a2d3e=a58_0x996ba,_0x1cf759=_0x167e0e[_0x1a2d3e(0x192)](_0x1a2d3e(0x18a));return dryRun(_0x1a2d3e(0x1a6),scheduleItemPath(_0x167e0e['appCode'],_0x1cf759))['description'](_0x1a2d3e(0x18d)+_0x1cf759)[_0x1a2d3e(0x1a8)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a59_0x3c8d(_0x763320,_0x2f9f0e){_0x763320=_0x763320-0x185;const _0x2415fa=a59_0x2415();let _0x3c8dc8=_0x2415fa[_0x763320];return _0x3c8dc8;}function a59_0x2415(){const _0x426a07=['52970HuKyhv','367ulcLdg','3MIDXBe','1719396dgQkln','579688lBQcYS','873BndxoR','Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','23472aOZKOM','43352gtvgxc','271640YwPdZp','schema','592fKuhHw','read'];a59_0x2415=function(){return _0x426a07;};return a59_0x2415();}const a59_0x1a4d30=a59_0x3c8d;(function(_0x534383,_0xd3812f){const _0x59465e=a59_0x3c8d,_0x5a62dc=_0x534383();while(!![]){try{const _0x2e1cbf=-parseInt(_0x59465e(0x191))/0x1*(parseInt(_0x59465e(0x18e))/0x2)+parseInt(_0x59465e(0x192))/0x3*(parseInt(_0x59465e(0x186))/0x4)+parseInt(_0x59465e(0x18c))/0x5+-parseInt(_0x59465e(0x18a))/0x6+-parseInt(_0x59465e(0x185))/0x7+parseInt(_0x59465e(0x18b))/0x8*(parseInt(_0x59465e(0x187))/0x9)+-parseInt(_0x59465e(0x190))/0xa;if(_0x2e1cbf===_0xd3812f)break;else _0x5a62dc['push'](_0x5a62dc['shift']());}catch(_0x323a37){_0x5a62dc['push'](_0x5a62dc['shift']());}}}(a59_0x2415,0x583d0));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5ea99e){const _0x4950ed=await buildSchemaPayload();return{'ok':!![],'data':_0x4950ed};}export const schemaDefinition={'service':a59_0x1a4d30(0x18d),'command':a59_0x1a4d30(0x189),'description':a59_0x1a4d30(0x188),'risk':a59_0x1a4d30(0x18f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x58f663,_0x29a7c1){const _0x409d74=a60_0xb3d3,_0x269d37=_0x58f663();while(!![]){try{const _0x2d08c9=-parseInt(_0x409d74(0xb9))/0x1*(-parseInt(_0x409d74(0xf4))/0x2)+-parseInt(_0x409d74(0xf7))/0x3*(parseInt(_0x409d74(0x108))/0x4)+-parseInt(_0x409d74(0xf6))/0x5+-parseInt(_0x409d74(0xc0))/0x6+parseInt(_0x409d74(0xff))/0x7*(-parseInt(_0x409d74(0xb6))/0x8)+-parseInt(_0x409d74(0xf8))/0x9*(parseInt(_0x409d74(0xd7))/0xa)+parseInt(_0x409d74(0xb5))/0xb;if(_0x2d08c9===_0x29a7c1)break;else _0x269d37['push'](_0x269d37['shift']());}catch(_0x3ab1f1){_0x269d37['push'](_0x269d37['shift']());}}}(a60_0xf812,0x494f5));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(_0x540f9b,_0x1347f8){const _0xb2040a=a60_0xb3d3,_0x4f1a78=listLocalServiceTrees();let _0x2c7c69;for(const _0x4db2b6 of _0x4f1a78){const _0x162e0b=matchServiceTreeCommand(_0x4db2b6,_0x540f9b);if(!_0x162e0b)continue;(!_0x2c7c69||_0x162e0b[_0xb2040a(0xdf)][_0xb2040a(0xce)][_0xb2040a(0x10a)]>_0x2c7c69['command'][_0xb2040a(0xce)][_0xb2040a(0x10a)])&&(_0x2c7c69={'tree':_0x4db2b6,'command':_0x162e0b[_0xb2040a(0xdf)],'remainingArgs':_0x162e0b[_0xb2040a(0xc2)]});}if(!_0x2c7c69)return undefined;const _0xfa770c={..._0x1347f8};return applyAppBinding(_0x2c7c69[_0xb2040a(0xd4)],_0x2c7c69[_0xb2040a(0xdf)],_0xfa770c),{'definition':buildDynamicCommandDefinition(_0x2c7c69[_0xb2040a(0xd4)],_0x2c7c69[_0xb2040a(0xdf)]),'args':_0x2c7c69[_0xb2040a(0xc2)],'flags':_0xfa770c,'tree':_0x2c7c69[_0xb2040a(0xd4)],'command':_0x2c7c69[_0xb2040a(0xdf)]};}export function generateDynamicServiceHelp(_0x3abeb8){const _0x1304ca=a60_0xb3d3,_0x1d1679=listLocalServiceTrees()[_0x1304ca(0xbf)](_0x516a34=>_0x516a34['service'][_0x1304ca(0xf9)]===_0x3abeb8);if(!_0x1d1679)return undefined;const _0x2e8c7a=[CLI_BIN_NAME+'\x20'+_0x3abeb8+_0x1304ca(0x113),'',_0x1d1679['service'][_0x1304ca(0xf0)]||_0x3abeb8,_0x1d1679[_0x1304ca(0xfd)][_0x1304ca(0xcd)]?'\x20\x20'+_0x1d1679['service'][_0x1304ca(0xcd)]:'','',_0x1304ca(0x116),..._0x1d1679['commands'][_0x1304ca(0x10f)](_0x3adfcc=>{const _0x39865=_0x1304ca,_0x4ce2a6=_0x3adfcc['fullPath'][_0x39865(0xe5)](0x1)['join']('\x20'),_0x2be5b8=_0x3adfcc[_0x39865(0x106)]===_0x39865(0xd6)?'':'\x20['+_0x3adfcc[_0x39865(0x106)]+']';return'\x20\x20'+_0x4ce2a6[_0x39865(0xb7)](0x18)+'\x20'+(_0x3adfcc['description']||'')+_0x2be5b8;}),'',_0x1304ca(0x100)+CLI_BIN_NAME+_0x1304ca(0xef)+_0x3abeb8+_0x1304ca(0xc8)][_0x1304ca(0x10e)](Boolean);return _0x2e8c7a[_0x1304ca(0xde)]('\x0a');}export function listDynamicServiceEntries(){const _0x1325c8=a60_0xb3d3;return listLocalServices()[_0x1325c8(0x10f)](_0x3c1cac=>{const _0xe01089=_0x1325c8,_0x275621=_0x3c1cac[_0xe01089(0xca)];return{'service':_0x275621[_0xe01089(0xfd)]['code'],'label':_0x275621[_0xe01089(0xfd)][_0xe01089(0xf0)]||_0x275621[_0xe01089(0xfd)][_0xe01089(0xf9)],'commands':_0x275621['commands'][_0xe01089(0x10f)](_0x5af959=>({'command':dynamicCommandName(_0x5af959),'description':_0x5af959[_0xe01089(0xcd)]||_0xe01089(0xee)+_0x5af959[_0xe01089(0x119)],'tag':riskTag(_0x5af959[_0xe01089(0x106)])}))};});}export function getDynamicServiceEntry(_0x2c8da2){return listDynamicServiceEntries()['find'](_0x595000=>_0x595000['service']===_0x2c8da2);}export function listDynamicServiceDefinitions(_0x4eacce){const _0x2bdded=a60_0xb3d3;return listLocalServiceTrees()[_0x2bdded(0x10e)](_0x480ccb=>!_0x4eacce||_0x480ccb[_0x2bdded(0xfd)][_0x2bdded(0xf9)]===_0x4eacce)[_0x2bdded(0xbd)](_0x58e73b=>_0x58e73b['commands'][_0x2bdded(0x10f)](_0x500d29=>buildDynamicCommandDefinition(_0x58e73b,_0x500d29)));}export function getDynamicServiceDefinitions(_0x40c12d){const _0x39865e=listDynamicServiceDefinitions(_0x40c12d);return _0x39865e['length']>0x0?_0x39865e:undefined;}export function findDynamicServiceDefinition(_0x101260,_0x9b8025){const _0x5208de=a60_0xb3d3;return listDynamicServiceDefinitions(_0x101260)[_0x5208de(0xbf)](_0x1c31a2=>_0x1c31a2[_0x5208de(0xdf)]===_0x9b8025);}export function buildDynamicCommandDefinition(_0x2e4b36,_0x1c8474){const _0x315dd7=a60_0xb3d3;return{'service':_0x2e4b36[_0x315dd7(0xfd)][_0x315dd7(0xf9)],'command':dynamicCommandName(_0x1c8474),'description':_0x1c8474[_0x315dd7(0xcd)]||'Run\x20service\x20command\x20'+_0x1c8474[_0x315dd7(0x119)],'risk':_0x1c8474[_0x315dd7(0x106)],..._0x1c8474[_0x315dd7(0x106)]===_0x315dd7(0xd6)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x1c8474)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x1c8474[_0x315dd7(0xcf)][_0x315dd7(0x10f)](_0x66a72=>({'name':_0x66a72[_0x315dd7(0xf0)],'description':_0x66a72[_0x315dd7(0xcd)]||_0x66a72[_0x315dd7(0xf0)],'required':_0x66a72[_0x315dd7(0xba)]})),'flags':_0x1c8474['flags'][_0x315dd7(0x10f)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x1c8474),async 'dryRun'(_0x349e11){const _0x5b52ec=_0x315dd7,_0x357cfe=await compilePlan(_0x1c8474,_0x349e11);return{'method':_0x5b52ec(0xbc),'url':_0x1c8474[_0x5b52ec(0x119)],'body':{'target':targetPreview(_0x357cfe),'params':_0x357cfe[_0x5b52ec(0xcb)]},'description':_0x5b52ec(0x103)+_0x1c8474[_0x5b52ec(0x119)]};},async 'execute'(_0x127869){const _0x3f405b=_0x315dd7,_0x17c3b0=await compilePlan(_0x1c8474,_0x127869),_0x5c7745=Date[_0x3f405b(0xc9)](),_0x57c38e=await executePlan(_0x17c3b0,_0x1c8474,_0x127869),_0xd54de5=Date[_0x3f405b(0xc9)]()-_0x5c7745;return{'ok':!![],'data':{'service':_0x2e4b36[_0x3f405b(0xfd)],'command':_0x1c8474[_0x3f405b(0x119)],'target':targetPreview(_0x17c3b0),'result':_0x57c38e,'elapsed':_0xd54de5},'message':_0x3f405b(0xed)+_0x1c8474[_0x3f405b(0x119)]+'\x20completed\x20in\x20'+_0xd54de5+'ms'};}};}function a60_0xb3d3(_0x291b98,_0x1d7fe5){_0x291b98=_0x291b98-0xb2;const _0xf812ab=a60_0xf812();let _0xb3d345=_0xf812ab[_0x291b98];return _0xb3d345;}function buildDynamicConfirmationDescription(_0x26e325){const _0x3a99dc=a60_0xb3d3,_0x28aa4b=_0x26e325[_0x3a99dc(0xcd)]||_0x26e325['cliPath'],_0xbc02f=_0x26e325[_0x3a99dc(0x106)]===_0x3a99dc(0xe6)?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':_0x3a99dc(0x109);return _0x3a99dc(0xc6)+_0x28aa4b+_0x3a99dc(0xe2)+_0xbc02f;}function dynamicCommandName(_0x462085){const _0x2b6cb8=a60_0xb3d3;return _0x462085[_0x2b6cb8(0xce)][_0x2b6cb8(0xe5)](0x1)[_0x2b6cb8(0xde)]('\x20');}function riskTag(_0x3e400a){return _0x3e400a==='read'?'':'\x20\x20['+_0x3e400a+']';}function flagToCommandFlag(_0x286be3){const _0x33ddf7=a60_0xb3d3;return{'name':_0x286be3[_0x33ddf7(0xbb)],'type':_0x286be3[_0x33ddf7(0xb2)]===_0x33ddf7(0x117)?_0x33ddf7(0xe8):_0x286be3[_0x33ddf7(0xb2)],'description':_0x286be3[_0x33ddf7(0xcd)]||_0x286be3[_0x33ddf7(0xf0)],'required':_0x286be3['required'],'default':isPrimitiveFlagDefault(_0x286be3[_0x33ddf7(0xf2)])?_0x286be3[_0x33ddf7(0xf2)]:undefined,'enum':_0x286be3[_0x33ddf7(0x102)]};}async function compilePlan(_0x256d22,_0x3ee8b5){const _0x30fc9b=a60_0xb3d3;return compileServiceTreeCommand(_0x256d22,{'flags':_0x3ee8b5[_0x30fc9b(0xdd)],'args':_0x3ee8b5[_0x30fc9b(0xcf)],'context':await buildServiceContext(_0x256d22,_0x3ee8b5)});}async function buildServiceContext(_0x2ef500,_0x11e36d){const _0x4aa5a4=a60_0xb3d3,_0x57f128={'appCode':_0x11e36d['appCode'],'env':_0x11e36d[_0x4aa5a4(0xc7)],'envName':_0x11e36d[_0x4aa5a4(0xc7)]};if(!usesRuntimeContext(_0x2ef500))return _0x57f128;const _0x5958c1=await getLoginUserInfo(),_0x2f77e4=pickFirst(_0x5958c1[_0x4aa5a4(0xea)],_0x5958c1['id']);return{..._0x57f128,'user':_0x5958c1,'userId':_0x2f77e4,'id':_0x5958c1['id'],'username':pickFirst(_0x5958c1[_0x4aa5a4(0xf1)],_0x5958c1['userName'],_0x5958c1[_0x4aa5a4(0xc4)]),'userName':_0x5958c1['userName'],'nickname':pickFirst(_0x5958c1[_0x4aa5a4(0xb8)],_0x5958c1[_0x4aa5a4(0x118)]),'nickName':_0x5958c1[_0x4aa5a4(0x118)],'tenantCode':_0x5958c1['tenantCode'],'employeeId':_0x5958c1[_0x4aa5a4(0x101)]};}function usesRuntimeContext(_0x1fd305){const _0x3bf1c8=a60_0xb3d3;return _0x1fd305[_0x3bf1c8(0xd2)]['some'](_0x3e4fa6=>typeof _0x3e4fa6[_0x3bf1c8(0xeb)]==='string'&&(_0x3e4fa6['source'][_0x3bf1c8(0x115)]('context.')||_0x3e4fa6['source'][_0x3bf1c8(0x115)](_0x3bf1c8(0xf3))));}function pickFirst(..._0x3e5ff4){const _0x52ccc3=a60_0xb3d3;return _0x3e5ff4[_0x52ccc3(0xbf)](_0x2aae1d=>_0x2aae1d!==undefined&&_0x2aae1d!==null);}async function executePlan(_0x3adf64,_0x13976d,_0x5697e9){const _0xff1894=a60_0xb3d3;if(_0x3adf64[_0xff1894(0xe0)]===_0xff1894(0xfe)){const _0x2665a5=await resolveDatasetCode(_0x3adf64,_0x13976d,_0x5697e9);return executeData(_0x2665a5,_0x3adf64[_0xff1894(0xdf)],_0x3adf64['params']);}if(_0x3adf64[_0xff1894(0xe0)]==='sql'){if(!_0x3adf64[_0xff1894(0xbe)])throw CliErrors[_0xff1894(0x104)](_0xff1894(0xed)+_0x13976d[_0xff1894(0x119)]+_0xff1894(0xd5));return executeSdkSql(_0x3adf64[_0xff1894(0xbe)],normalizeScalarParams(_0x3adf64['params']));}if(_0x3adf64[_0xff1894(0xe0)]==='bff'){const _0x498468=_0x3adf64[_0xff1894(0xe9)]||_0x3adf64[_0xff1894(0xc1)]||(_0x3adf64[_0xff1894(0xd8)]==null?'':String(_0x3adf64[_0xff1894(0xd8)]));if(!_0x498468)throw CliErrors['validation'](_0xff1894(0xed)+_0x13976d[_0xff1894(0x119)]+_0xff1894(0x10d));return executeSdkBff(_0x498468,_0x3adf64['params']);}throw CliErrors[_0xff1894(0x104)](_0xff1894(0xfc)+_0x3adf64[_0xff1894(0xe0)]);}async function resolveDatasetCode(_0x5f4429,_0x4180a8,_0xa2852c){const _0x2c4693=a60_0xb3d3;if(_0x5f4429[_0x2c4693(0xe7)])return _0x5f4429[_0x2c4693(0xe7)];if(!_0x5f4429[_0x2c4693(0xfb)])throw CliErrors[_0x2c4693(0x104)](_0x2c4693(0xed)+_0x4180a8[_0x2c4693(0x119)]+_0x2c4693(0xf5));const _0x2e2ed4=await listDatasets(_0xa2852c[_0x2c4693(0xe4)]),_0x4ad16e=_0x2e2ed4[_0x2c4693(0xbf)](_0x1f83af=>_0x1f83af[_0x2c4693(0x107)]?.[_0x2c4693(0xd1)]===_0x5f4429[_0x2c4693(0xfb)]);if(!_0x4ad16e?.[_0x2c4693(0xf9)])throw CliErrors['validation'](_0x2c4693(0x105)+_0x5f4429[_0x2c4693(0xfb)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0xa2852c[_0x2c4693(0xe4)]+'.',_0x2c4693(0x110));return _0x4ad16e['code'];}function applyAppBinding(_0x16e3a9,_0x331efa,_0x38cb49){const _0x5cd38a=a60_0xb3d3,_0x4b8ac5=_0x331efa[_0x5cd38a(0xda)][_0x5cd38a(0xb4)];if(!_0x4b8ac5)return;const _0x519f07=_0x16e3a9['appBindings'][_0x4b8ac5];if(!_0x519f07)throw CliErrors[_0x5cd38a(0x104)]('Unknown\x20appRef\x20\x22'+_0x4b8ac5+_0x5cd38a(0xd3)+_0x331efa[_0x5cd38a(0x119)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x25f11d=_0x519f07[_0x5cd38a(0x114)]||_0x519f07[_0x5cd38a(0xe4)];_0x25f11d&&!hasText(_0x38cb49[_0x5cd38a(0x114)])&&(_0x38cb49[_0x5cd38a(0x114)]=_0x25f11d),_0x519f07['app']&&!hasText(_0x38cb49[_0x5cd38a(0xb3)])&&!hasText(_0x38cb49[_0x5cd38a(0x114)])&&(_0x38cb49[_0x5cd38a(0xb3)]=_0x519f07[_0x5cd38a(0xb3)]),_0x519f07['env']&&!hasText(_0x38cb49['env'])&&(_0x38cb49[_0x5cd38a(0xc3)]=_0x519f07[_0x5cd38a(0xc3)]);}function renderDynamicCommandHelp(_0x1c4860){const _0x363cfe=a60_0xb3d3,_0x46f96f=[_0x363cfe(0x10b),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x1c4860[_0x363cfe(0xda)][_0x363cfe(0xe0)],_0x363cfe(0x111)+_0x1c4860[_0x363cfe(0xda)][_0x363cfe(0xdf)]];if(_0x1c4860[_0x363cfe(0xda)][_0x363cfe(0xe7)])_0x46f96f['push'](_0x363cfe(0xdb)+_0x1c4860[_0x363cfe(0xda)]['datasetCode']);if(_0x1c4860[_0x363cfe(0xda)][_0x363cfe(0xfb)])_0x46f96f[_0x363cfe(0xfa)](_0x363cfe(0xc5)+_0x1c4860['target'][_0x363cfe(0xfb)]);if(_0x1c4860[_0x363cfe(0xda)]['sqlCode'])_0x46f96f['push'](_0x363cfe(0xd0)+_0x1c4860[_0x363cfe(0xda)][_0x363cfe(0xbe)]);if(_0x1c4860[_0x363cfe(0xda)]['scriptName'])_0x46f96f['push'](_0x363cfe(0xd9)+_0x1c4860[_0x363cfe(0xda)]['scriptName']);if(_0x1c4860[_0x363cfe(0xd2)]['length']>0x0){_0x46f96f[_0x363cfe(0xfa)]('','\x20\x20MAP\x20TO');for(const _0x479d36 of _0x1c4860[_0x363cfe(0xd2)]){_0x46f96f['push']('\x20\x20\x20\x20'+(_0x479d36[_0x363cfe(0xeb)]||_0x363cfe(0x10c))+_0x363cfe(0xe3)+_0x479d36[_0x363cfe(0xda)]+(_0x479d36[_0x363cfe(0x112)]?'.'+_0x479d36['operator']:''));}}return _0x46f96f[_0x363cfe(0xde)]('\x0a');}function targetPreview(_0x6cb80b){const _0x3fe9e7=a60_0xb3d3;return{'kind':_0x6cb80b[_0x3fe9e7(0xe0)],'command':_0x6cb80b['command'],'appRef':_0x6cb80b['appRef'],'datasetCode':_0x6cb80b[_0x3fe9e7(0xe7)],'datatable':_0x6cb80b['datatable'],'sqlCode':_0x6cb80b['sqlCode'],'bffCode':_0x6cb80b[_0x3fe9e7(0xc1)],'bffId':_0x6cb80b['bffId'],'functionName':_0x6cb80b[_0x3fe9e7(0xe9)]};}function normalizeScalarParams(_0x417c65){const _0x29ecbe=a60_0xb3d3;return Object[_0x29ecbe(0xec)](Object['entries'](_0x417c65)[_0x29ecbe(0x10e)](([,_0x2dc6fb])=>typeof _0x2dc6fb===_0x29ecbe(0xe8)||typeof _0x2dc6fb===_0x29ecbe(0xdc)));}function hasText(_0x15e3e6){const _0x322a63=a60_0xb3d3;return typeof _0x15e3e6===_0x322a63(0xe8)&&_0x15e3e6[_0x322a63(0xcc)]()[_0x322a63(0x10a)]>0x0;}function isPrimitiveFlagDefault(_0x4c3425){const _0x30c781=a60_0xb3d3;return _0x4c3425===undefined||typeof _0x4c3425==='string'||typeof _0x4c3425==='number'||typeof _0x4c3425===_0x30c781(0xe1);}function a60_0xf812(){const _0x42f7f5=['json','nickName','cliPath','type','app','appRef','10507761WwFgBQ','200EcXUXr','padEnd','nickname','1QCrcFU','required','cliName','SERVICE_TREE','flatMap','sqlCode','find','132330GrJsdQ','bffCode','remainingArgs','env','loginName','\x20\x20\x20\x20datatable:\x20','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','envName','`\x20to\x20inspect\x20the\x20manifest.','now','normalizedManifest','params','trim','description','fullPath','args','\x20\x20\x20\x20sqlCode:\x20','tableName','mapTo','\x22\x20in\x20service\x20command\x20','tree','\x20requires\x20target.sqlCode.','read','1329760MDLzzh','bffId','\x20\x20\x20\x20functionName:\x20','target','\x20\x20\x20\x20datasetCode:\x20','number','rawFlags','join','command','kind','boolean','\x22.\x20','\x20->\x20','appCode','slice','high-risk-write','datasetCode','string','scriptName','userId','source','fromEntries','Service\x20command\x20','Run\x20service\x20command\x20','\x20service\x20detail\x20--service\x20','name','username','default','ctx.','596368ShUMpP','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','1104195HoGkIM','3SEEpzA','9bVLNEY','code','push','datatable','Unsupported\x20service\x20target\x20kind:\x20','service','data','105441XqzNNp','Use\x20`','employeeId','enum','Preview\x20dynamic\x20service\x20command:\x20','validation','Cannot\x20resolve\x20datatable\x20\x22','risk','dbtableConfig','802852EillTC','The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.','length','\x20\x20SERVICE\x20TREE\x20TARGET','const','\x20requires\x20target.functionName.','filter','map','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20\x20\x20\x20command:\x20','operator','\x20<command>\x20[flags]','appcode','startsWith','Commands:'];a60_0xf812=function(){return _0x42f7f5;};return a60_0xf812();}
|
|
1
|
+
(function(_0x2d3fb0,_0xd9cffb){const _0x442fd5=a60_0x3b52,_0x4cfb4a=_0x2d3fb0();while(!![]){try{const _0x4fb6a7=parseInt(_0x442fd5(0x1b8))/0x1+-parseInt(_0x442fd5(0x186))/0x2*(-parseInt(_0x442fd5(0x1d0))/0x3)+parseInt(_0x442fd5(0x1e8))/0x4+parseInt(_0x442fd5(0x1c8))/0x5+parseInt(_0x442fd5(0x1ab))/0x6+parseInt(_0x442fd5(0x184))/0x7*(-parseInt(_0x442fd5(0x1b7))/0x8)+-parseInt(_0x442fd5(0x185))/0x9*(parseInt(_0x442fd5(0x183))/0xa);if(_0x4fb6a7===_0xd9cffb)break;else _0x4cfb4a['push'](_0x4cfb4a['shift']());}catch(_0x3f2123){_0x4cfb4a['push'](_0x4cfb4a['shift']());}}}(a60_0x4caa,0x7e1e8));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(_0x45bd5b,_0x56a968){const _0x1fee85=a60_0x3b52,_0x549954=listLocalServiceTrees();let _0x54bb06;for(const _0x9a4e3a of _0x549954){const _0x31b596=matchServiceTreeCommand(_0x9a4e3a,_0x45bd5b);if(!_0x31b596)continue;(!_0x54bb06||_0x31b596[_0x1fee85(0x1d4)][_0x1fee85(0x1cf)][_0x1fee85(0x1c9)]>_0x54bb06[_0x1fee85(0x1d4)][_0x1fee85(0x1cf)]['length'])&&(_0x54bb06={'tree':_0x9a4e3a,'command':_0x31b596[_0x1fee85(0x1d4)],'remainingArgs':_0x31b596[_0x1fee85(0x1a9)]});}if(!_0x54bb06)return undefined;const _0x2276ad={..._0x56a968};return applyAppBinding(_0x54bb06[_0x1fee85(0x1c4)],_0x54bb06[_0x1fee85(0x1d4)],_0x2276ad),{'definition':buildDynamicCommandDefinition(_0x54bb06[_0x1fee85(0x1c4)],_0x54bb06[_0x1fee85(0x1d4)]),'args':_0x54bb06[_0x1fee85(0x1a9)],'flags':_0x2276ad,'tree':_0x54bb06[_0x1fee85(0x1c4)],'command':_0x54bb06[_0x1fee85(0x1d4)]};}export function generateDynamicServiceHelp(_0x1613d2){const _0x281ad6=a60_0x3b52,_0x2b5e8b=listLocalServiceTrees()[_0x281ad6(0x19c)](_0x1c392a=>_0x1c392a[_0x281ad6(0x1e2)]['code']===_0x1613d2);if(!_0x2b5e8b)return undefined;const _0x3781e3=[CLI_BIN_NAME+'\x20'+_0x1613d2+'\x20<command>\x20[flags]','',_0x2b5e8b['service'][_0x281ad6(0x1c0)]||_0x1613d2,_0x2b5e8b[_0x281ad6(0x1e2)][_0x281ad6(0x1d6)]?'\x20\x20'+_0x2b5e8b[_0x281ad6(0x1e2)][_0x281ad6(0x1d6)]:'','','Commands:',..._0x2b5e8b[_0x281ad6(0x1aa)][_0x281ad6(0x191)](_0x11c7c0=>{const _0x498166=_0x281ad6,_0x2c7759=_0x11c7c0[_0x498166(0x1cf)]['slice'](0x1)[_0x498166(0x19a)]('\x20'),_0x6f046e=_0x11c7c0['risk']===_0x498166(0x1d1)?'':'\x20['+_0x11c7c0[_0x498166(0x19e)]+']';return'\x20\x20'+_0x2c7759[_0x498166(0x190)](0x18)+'\x20'+(_0x11c7c0[_0x498166(0x1d6)]||'')+_0x6f046e;}),'',_0x281ad6(0x1a6)+CLI_BIN_NAME+_0x281ad6(0x18f)+_0x1613d2+_0x281ad6(0x1af)]['filter'](Boolean);return _0x3781e3[_0x281ad6(0x19a)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x1b64e4=>{const _0x2e765b=a60_0x3b52,_0x15d912=_0x1b64e4[_0x2e765b(0x1c2)];return{'service':_0x15d912[_0x2e765b(0x1e2)][_0x2e765b(0x192)],'label':_0x15d912[_0x2e765b(0x1e2)][_0x2e765b(0x1c0)]||_0x15d912[_0x2e765b(0x1e2)][_0x2e765b(0x192)],'commands':_0x15d912['commands'][_0x2e765b(0x191)](_0x52e941=>({'command':dynamicCommandName(_0x52e941),'description':_0x52e941['description']||_0x2e765b(0x1e1)+_0x52e941[_0x2e765b(0x194)],'tag':riskTag(_0x52e941[_0x2e765b(0x19e)])}))};});}export function getDynamicServiceEntry(_0x14eb1b){const _0x2775ea=a60_0x3b52;return listDynamicServiceEntries()[_0x2775ea(0x19c)](_0x44e87d=>_0x44e87d[_0x2775ea(0x1e2)]===_0x14eb1b);}function a60_0x3b52(_0x32c270,_0x2f642c){_0x32c270=_0x32c270-0x182;const _0x4caa83=a60_0x4caa();let _0x3b5288=_0x4caa83[_0x32c270];return _0x3b5288;}export function listDynamicServiceDefinitions(_0x45c7e5){const _0x47ff5b=a60_0x3b52;return listLocalServiceTrees()[_0x47ff5b(0x1d9)](_0x260f0a=>!_0x45c7e5||_0x260f0a[_0x47ff5b(0x1e2)][_0x47ff5b(0x192)]===_0x45c7e5)[_0x47ff5b(0x188)](_0x36f435=>_0x36f435[_0x47ff5b(0x1aa)]['map'](_0x4b746b=>buildDynamicCommandDefinition(_0x36f435,_0x4b746b)));}export function getDynamicServiceDefinitions(_0x28e8f0){const _0x1c4c2d=a60_0x3b52,_0xf6fba6=listDynamicServiceDefinitions(_0x28e8f0);return _0xf6fba6[_0x1c4c2d(0x1c9)]>0x0?_0xf6fba6:undefined;}export function findDynamicServiceDefinition(_0x52d8bb,_0x4b77f3){const _0x3d7070=a60_0x3b52;return listDynamicServiceDefinitions(_0x52d8bb)[_0x3d7070(0x19c)](_0xb6c06e=>_0xb6c06e[_0x3d7070(0x1d4)]===_0x4b77f3);}export function buildDynamicCommandDefinition(_0x421d73,_0x5e977d){const _0x1a82d8=a60_0x3b52;return{'service':_0x421d73[_0x1a82d8(0x1e2)]['code'],'command':dynamicCommandName(_0x5e977d),'description':_0x5e977d[_0x1a82d8(0x1d6)]||'Run\x20service\x20command\x20'+_0x5e977d[_0x1a82d8(0x194)],'risk':_0x5e977d[_0x1a82d8(0x19e)],..._0x5e977d['risk']===_0x1a82d8(0x1d1)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x5e977d)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x5e977d[_0x1a82d8(0x1bf)][_0x1a82d8(0x191)](_0x59abf9=>({'name':_0x59abf9[_0x1a82d8(0x1c0)],'description':_0x59abf9[_0x1a82d8(0x1d6)]||_0x59abf9[_0x1a82d8(0x1c0)],'required':_0x59abf9[_0x1a82d8(0x19b)]})),'flags':_0x5e977d[_0x1a82d8(0x1c7)][_0x1a82d8(0x191)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x5e977d),async 'dryRun'(_0x1f9e7c){const _0x318867=_0x1a82d8,_0x5b0f99=await compilePlan(_0x5e977d,_0x1f9e7c);return{'method':'SERVICE_TREE','url':_0x5e977d[_0x318867(0x194)],'body':{'target':targetPreview(_0x5b0f99),'params':_0x5b0f99[_0x318867(0x1c6)]},'description':_0x318867(0x1a8)+_0x5e977d['cliPath']};},async 'execute'(_0xa3c8d){const _0x34f823=_0x1a82d8,_0x41e0ee=await compilePlan(_0x5e977d,_0xa3c8d),_0x49547a=Date[_0x34f823(0x1b5)](),_0x50e376=await executePlan(_0x41e0ee,_0x5e977d,_0xa3c8d),_0xee85ea=Date[_0x34f823(0x1b5)]()-_0x49547a;return{'ok':!![],'data':{'service':_0x421d73[_0x34f823(0x1e2)],'command':_0x5e977d[_0x34f823(0x194)],'target':targetPreview(_0x41e0ee),'result':_0x50e376,'elapsed':_0xee85ea},'message':_0x34f823(0x1d5)+_0x5e977d[_0x34f823(0x194)]+_0x34f823(0x1a5)+_0xee85ea+'ms'};}};}function buildDynamicConfirmationDescription(_0x4d27fd){const _0x2a22c9=a60_0x3b52,_0x5cc3f7=_0x4d27fd[_0x2a22c9(0x1d6)]||_0x4d27fd[_0x2a22c9(0x194)],_0x9b616a=_0x4d27fd['risk']==='high-risk-write'?'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20high-risk\x20write.\x20It\x20may\x20make\x20business\x20changes\x20that\x20are\x20hard\x20to\x20reverse.':'The\x20manifest\x20marks\x20this\x20command\x20as\x20a\x20write.\x20It\x20may\x20change\x20business\x20data\x20or\x20service\x20state.';return _0x2a22c9(0x1c3)+_0x5cc3f7+_0x2a22c9(0x1c1)+_0x9b616a;}function dynamicCommandName(_0x184353){const _0x266e64=a60_0x3b52;return _0x184353[_0x266e64(0x1cf)][_0x266e64(0x1b1)](0x1)[_0x266e64(0x19a)]('\x20');}function riskTag(_0x2fe4ea){const _0x232ab9=a60_0x3b52;return _0x2fe4ea===_0x232ab9(0x1d1)?'':_0x232ab9(0x1ba)+_0x2fe4ea+']';}function flagToCommandFlag(_0x9f5f66){const _0x676c8a=a60_0x3b52;return{'name':_0x9f5f66[_0x676c8a(0x19d)],'type':_0x9f5f66[_0x676c8a(0x1dc)]===_0x676c8a(0x1d7)?_0x676c8a(0x1dd):_0x9f5f66['type'],'description':_0x9f5f66['description']||_0x9f5f66[_0x676c8a(0x1c0)],'required':_0x9f5f66['required'],'default':isPrimitiveFlagDefault(_0x9f5f66[_0x676c8a(0x1cc)])?_0x9f5f66[_0x676c8a(0x1cc)]:undefined,'enum':_0x9f5f66['enum']};}async function compilePlan(_0x9b1e83,_0x4b3913){const _0x3f72cd=a60_0x3b52;return compileServiceTreeCommand(_0x9b1e83,{'flags':_0x4b3913[_0x3f72cd(0x1e5)],'args':_0x4b3913[_0x3f72cd(0x1bf)],'context':await buildServiceContext(_0x9b1e83,_0x4b3913)});}async function buildServiceContext(_0x2a6883,_0x1f057d){const _0xf20c29=a60_0x3b52,_0x1374d5={'appCode':_0x1f057d[_0xf20c29(0x1d3)],'env':_0x1f057d[_0xf20c29(0x1e0)],'envName':_0x1f057d[_0xf20c29(0x1e0)]};if(!usesRuntimeContext(_0x2a6883))return _0x1374d5;const _0x23f3ab=await getLoginUserInfo(),_0x11cc90=pickFirst(_0x23f3ab[_0xf20c29(0x1e7)],_0x23f3ab['id']);return{..._0x1374d5,'user':_0x23f3ab,'userId':_0x11cc90,'id':_0x23f3ab['id'],'username':pickFirst(_0x23f3ab[_0xf20c29(0x1e9)],_0x23f3ab[_0xf20c29(0x1ae)],_0x23f3ab[_0xf20c29(0x18b)]),'userName':_0x23f3ab[_0xf20c29(0x1ae)],'nickname':pickFirst(_0x23f3ab['nickname'],_0x23f3ab['nickName']),'nickName':_0x23f3ab[_0xf20c29(0x1b2)],'tenantCode':_0x23f3ab[_0xf20c29(0x1b9)],'employeeId':_0x23f3ab[_0xf20c29(0x19f)]};}function usesRuntimeContext(_0x20ac57){const _0x19361c=a60_0x3b52;return _0x20ac57[_0x19361c(0x1df)][_0x19361c(0x198)](_0x16e56f=>typeof _0x16e56f[_0x19361c(0x1c5)]==='string'&&(_0x16e56f[_0x19361c(0x1c5)][_0x19361c(0x1de)](_0x19361c(0x1b4))||_0x16e56f[_0x19361c(0x1c5)][_0x19361c(0x1de)](_0x19361c(0x1d2))));}function pickFirst(..._0x2db51f){return _0x2db51f['find'](_0x58a6bc=>_0x58a6bc!==undefined&&_0x58a6bc!==null);}async function executePlan(_0x3afd15,_0x202b70,_0x1525e3){const _0x21e7a9=a60_0x3b52;if(_0x3afd15[_0x21e7a9(0x1e4)]==='data'){const _0x45ae2b=await resolveDatasetCode(_0x3afd15,_0x202b70,_0x1525e3);return executeData(_0x45ae2b,_0x3afd15[_0x21e7a9(0x1d4)],_0x3afd15[_0x21e7a9(0x1c6)]);}if(_0x3afd15[_0x21e7a9(0x1e4)]===_0x21e7a9(0x1e3)){if(!_0x3afd15[_0x21e7a9(0x1a4)])throw CliErrors[_0x21e7a9(0x1a2)](_0x21e7a9(0x1d5)+_0x202b70[_0x21e7a9(0x194)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x3afd15[_0x21e7a9(0x1a4)],normalizeScalarParams(_0x3afd15[_0x21e7a9(0x1c6)]));}if(_0x3afd15[_0x21e7a9(0x1e4)]===_0x21e7a9(0x1da)){const _0x5bb1f0=_0x3afd15[_0x21e7a9(0x182)]||_0x3afd15[_0x21e7a9(0x1be)]||(_0x3afd15['bffId']==null?'':String(_0x3afd15[_0x21e7a9(0x1ac)]));if(!_0x5bb1f0)throw CliErrors['validation']('Service\x20command\x20'+_0x202b70[_0x21e7a9(0x194)]+_0x21e7a9(0x1cd));return executeSdkBff(_0x5bb1f0,_0x3afd15[_0x21e7a9(0x1c6)]);}throw CliErrors[_0x21e7a9(0x1a2)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x3afd15[_0x21e7a9(0x1e4)]);}async function resolveDatasetCode(_0x2317a1,_0x85776,_0x4c2ef4){const _0x4b048c=a60_0x3b52;if(_0x2317a1['datasetCode'])return _0x2317a1[_0x4b048c(0x189)];if(!_0x2317a1[_0x4b048c(0x1ea)])throw CliErrors[_0x4b048c(0x1a2)]('Service\x20command\x20'+_0x85776[_0x4b048c(0x194)]+_0x4b048c(0x18e));const _0x2c8814=await listDatasets(_0x4c2ef4['appCode']),_0x1bb88b=_0x2c8814[_0x4b048c(0x19c)](_0x419451=>_0x419451[_0x4b048c(0x1a3)]?.['tableName']===_0x2317a1[_0x4b048c(0x1ea)]);if(!_0x1bb88b?.[_0x4b048c(0x192)])throw CliErrors[_0x4b048c(0x1a2)](_0x4b048c(0x196)+_0x2317a1[_0x4b048c(0x1ea)]+_0x4b048c(0x1bc)+_0x4c2ef4['appCode']+'.',_0x4b048c(0x199));return _0x1bb88b[_0x4b048c(0x192)];}function applyAppBinding(_0x55cd73,_0x416c32,_0x219d93){const _0x4ec68f=a60_0x3b52,_0xc13122=_0x416c32[_0x4ec68f(0x1b0)][_0x4ec68f(0x18a)];if(!_0xc13122)return;const _0x123d11=_0x55cd73[_0x4ec68f(0x18c)][_0xc13122];if(!_0x123d11)throw CliErrors[_0x4ec68f(0x1a2)](_0x4ec68f(0x1cb)+_0xc13122+_0x4ec68f(0x1db)+_0x416c32[_0x4ec68f(0x194)]+'.',_0x4ec68f(0x197));const _0x257755=_0x123d11['appcode']||_0x123d11[_0x4ec68f(0x1d3)];_0x257755&&!hasText(_0x219d93[_0x4ec68f(0x18d)])&&(_0x219d93[_0x4ec68f(0x18d)]=_0x257755),_0x123d11[_0x4ec68f(0x1d8)]&&!hasText(_0x219d93[_0x4ec68f(0x1d8)])&&!hasText(_0x219d93['appcode'])&&(_0x219d93[_0x4ec68f(0x1d8)]=_0x123d11[_0x4ec68f(0x1d8)]),_0x123d11[_0x4ec68f(0x1a1)]&&!hasText(_0x219d93[_0x4ec68f(0x1a1)])&&(_0x219d93['env']=_0x123d11['env']);}function renderDynamicCommandHelp(_0x185a36){const _0x3d6ab9=a60_0x3b52,_0xb461a1=[_0x3d6ab9(0x195),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x185a36['target']['kind'],'\x20\x20\x20\x20command:\x20'+_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x1d4)]];if(_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x189)])_0xb461a1[_0x3d6ab9(0x193)](_0x3d6ab9(0x1b6)+_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x189)]);if(_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x1ea)])_0xb461a1[_0x3d6ab9(0x193)](_0x3d6ab9(0x1a7)+_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x1ea)]);if(_0x185a36['target'][_0x3d6ab9(0x1a4)])_0xb461a1['push'](_0x3d6ab9(0x1bb)+_0x185a36[_0x3d6ab9(0x1b0)][_0x3d6ab9(0x1a4)]);if(_0x185a36['target']['scriptName'])_0xb461a1[_0x3d6ab9(0x193)](_0x3d6ab9(0x1a0)+_0x185a36['target']['scriptName']);if(_0x185a36['mapTo']['length']>0x0){_0xb461a1[_0x3d6ab9(0x193)]('',_0x3d6ab9(0x1ad));for(const _0x2683ea of _0x185a36[_0x3d6ab9(0x1df)]){_0xb461a1[_0x3d6ab9(0x193)]('\x20\x20\x20\x20'+(_0x2683ea[_0x3d6ab9(0x1c5)]||'const')+_0x3d6ab9(0x187)+_0x2683ea['target']+(_0x2683ea[_0x3d6ab9(0x1e6)]?'.'+_0x2683ea[_0x3d6ab9(0x1e6)]:''));}}return _0xb461a1[_0x3d6ab9(0x19a)]('\x0a');}function a60_0x4caa(){const _0x3712f6=['app','filter','bff','\x22\x20in\x20service\x20command\x20','type','string','startsWith','mapTo','envName','Run\x20service\x20command\x20','service','sql','kind','rawFlags','operator','userId','2658872umxMol','username','datatable','scriptName','300tuzNOv','56MWsYzB','488250uNGitx','4iEBJKL','\x20->\x20','flatMap','datasetCode','appRef','loginName','appBindings','appcode','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20service\x20detail\x20--service\x20','padEnd','map','code','push','cliPath','\x20\x20SERVICE\x20TREE\x20TARGET','Cannot\x20resolve\x20datatable\x20\x22','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','some','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','join','required','find','cliName','risk','employeeId','\x20\x20\x20\x20functionName:\x20','env','validation','dbtableConfig','sqlCode','\x20completed\x20in\x20','Use\x20`','\x20\x20\x20\x20datatable:\x20','Preview\x20dynamic\x20service\x20command:\x20','remainingArgs','commands','5024820jqXehl','bffId','\x20\x20MAP\x20TO','userName','`\x20to\x20inspect\x20the\x20manifest.','target','slice','nickName','trim','context.','now','\x20\x20\x20\x20datasetCode:\x20','481216CeGoeA','820381UTCmzP','tenantCode','\x20\x20[','\x20\x20\x20\x20sqlCode:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','number','bffCode','args','name','\x22.\x20','normalizedManifest','This\x20will\x20run\x20Service\x20Tree\x20command\x20\x22','tree','source','params','flags','359885MCIqbR','length','boolean','Unknown\x20appRef\x20\x22','default','\x20requires\x20target.functionName.','entries','fullPath','346131zoWeTV','read','ctx.','appCode','command','Service\x20command\x20','description','json'];a60_0x4caa=function(){return _0x3712f6;};return a60_0x4caa();}function targetPreview(_0x1a7c66){const _0x30358f=a60_0x3b52;return{'kind':_0x1a7c66[_0x30358f(0x1e4)],'command':_0x1a7c66[_0x30358f(0x1d4)],'appRef':_0x1a7c66[_0x30358f(0x18a)],'datasetCode':_0x1a7c66[_0x30358f(0x189)],'datatable':_0x1a7c66[_0x30358f(0x1ea)],'sqlCode':_0x1a7c66[_0x30358f(0x1a4)],'bffCode':_0x1a7c66[_0x30358f(0x1be)],'bffId':_0x1a7c66['bffId'],'functionName':_0x1a7c66[_0x30358f(0x182)]};}function normalizeScalarParams(_0x4a34bd){const _0x16d793=a60_0x3b52;return Object['fromEntries'](Object[_0x16d793(0x1ce)](_0x4a34bd)[_0x16d793(0x1d9)](([,_0x932838])=>typeof _0x932838==='string'||typeof _0x932838==='number'));}function hasText(_0x57ca60){const _0x1e60b6=a60_0x3b52;return typeof _0x57ca60==='string'&&_0x57ca60[_0x1e60b6(0x1b3)]()[_0x1e60b6(0x1c9)]>0x0;}function isPrimitiveFlagDefault(_0x3cd76e){const _0x13dc23=a60_0x3b52;return _0x3cd76e===undefined||typeof _0x3cd76e===_0x13dc23(0x1dd)||typeof _0x3cd76e===_0x13dc23(0x1bd)||typeof _0x3cd76e===_0x13dc23(0x1ca);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a61_0x43ad(_0xdc0e75,_0x3dd831){_0xdc0e75=_0xdc0e75-0x19d;const _0x11d009=a61_0x11d0();let _0x43adb0=_0x11d009[_0xdc0e75];return _0x43adb0;}(function(_0x42cf04,_0xfeaefd){const _0x490d82=a61_0x43ad,_0x29603b=_0x42cf04();while(!![]){try{const _0x412876=parseInt(_0x490d82(0x1a6))/0x1*(-parseInt(_0x490d82(0x1a1))/0x2)+-parseInt(_0x490d82(0x1a3))/0x3*(-parseInt(_0x490d82(0x1a2))/0x4)+parseInt(_0x490d82(0x1a7))/0x5+-parseInt(_0x490d82(0x1b6))/0x6+-parseInt(_0x490d82(0x19e))/0x7*(-parseInt(_0x490d82(0x19d))/0x8)+-parseInt(_0x490d82(0x1a5))/0x9*(parseInt(_0x490d82(0x1ab))/0xa)+parseInt(_0x490d82(0x1b8))/0xb;if(_0x412876===_0xfeaefd)break;else _0x29603b['push'](_0x29603b['shift']());}catch(_0x348692){_0x29603b['push'](_0x29603b['shift']());}}}(a61_0x11d0,0x75be2));export function adaptServiceTreeManifestForLegacyFramework(_0x2be979){const _0xee2fc5=a61_0x43ad,_0x5c3d20=cloneJsonValue(_0x2be979),_0x1d78a2=[];if(!isObjectRecord(_0x5c3d20))return{'manifest':_0x5c3d20,'errors':_0x1d78a2};return Array[_0xee2fc5(0x1b0)](_0x5c3d20[_0xee2fc5(0x1bf)])&&_0x5c3d20[_0xee2fc5(0x1bf)][_0xee2fc5(0x1bb)]((_0x5d91bb,_0x14f128)=>{const _0x19bf71=_0xee2fc5;if(!isObjectRecord(_0x5d91bb))return;adaptBffTarget(_0x5d91bb['target'],_0x19bf71(0x1a4)+_0x14f128+_0x19bf71(0x1a9),_0x1d78a2);}),adaptResources(_0x5c3d20['resources'],'$.resources',_0x1d78a2),{'manifest':_0x5c3d20,'errors':_0x1d78a2};}export function toPublicServiceTreeTarget(_0x2ae5f9){const _0x385770=a61_0x43ad,{scriptName:_0x92e4ae,..._0x32e5f8}=_0x2ae5f9;return typeof _0x92e4ae==='string'&&_0x92e4ae[_0x385770(0x1b9)]()&&(_0x32e5f8[_0x385770(0x1b2)]=_0x92e4ae),_0x32e5f8;}export function toPublicNormalizedServiceTree(_0x4a2672){const _0x3a8782=a61_0x43ad;return{..._0x4a2672,'commands':_0x4a2672[_0x3a8782(0x1bf)][_0x3a8782(0x1b7)](_0xaf49bb=>({..._0xaf49bb,'target':toPublicServiceTreeTarget(_0xaf49bb[_0x3a8782(0x1bc)])}))};}function adaptResources(_0x3e23b8,_0x1b8f8a,_0x87818a){const _0x2e8cd0=a61_0x43ad;if(!isObjectRecord(_0x3e23b8))return;for(const [_0x565804,_0x48bc83]of Object[_0x2e8cd0(0x1ac)](_0x3e23b8)){if(!isObjectRecord(_0x48bc83))continue;const _0x3d3b72=_0x1b8f8a+'.'+_0x565804;if(isObjectRecord(_0x48bc83[_0x2e8cd0(0x1b4)]))for(const [_0x45b40e,_0x286afa]of Object[_0x2e8cd0(0x1ac)](_0x48bc83[_0x2e8cd0(0x1b4)])){if(!isObjectRecord(_0x286afa))continue;const _0x59f11f=_0x3d3b72+_0x2e8cd0(0x1bd)+_0x45b40e,_0x5b5109=isObjectRecord(_0x286afa[_0x2e8cd0(0x1bc)])&&_0x286afa[_0x2e8cd0(0x1bc)][_0x2e8cd0(0x1ba)]===_0x2e8cd0(0x1b3);adaptBffTarget(_0x286afa[_0x2e8cd0(0x1bc)],_0x59f11f+_0x2e8cd0(0x1a8),_0x87818a),(_0x5b5109||isBffAction(_0x286afa))&&adaptFunctionNameField(_0x286afa,_0x59f11f,_0x87818a);}adaptResources(_0x48bc83['resources'],_0x3d3b72+'.resources',_0x87818a);}}function adaptBffTarget(_0xa827a,_0x4cb402,_0x16b5f5){const _0x3c8bb3=a61_0x43ad;if(!isObjectRecord(_0xa827a)||_0xa827a[_0x3c8bb3(0x1ba)]!=='bff')return;adaptFunctionNameField(_0xa827a,_0x4cb402,_0x16b5f5);}function a61_0x11d0(){const _0x1aaddf=['350248ArasSF','84YHmefy','push','action','701458nmufQz','20jBNLdI','75393RjrKNc','$.commands[','8535654EGplNr','1yMGAou','3882560qZpZBF','.target','].target','error','10kMeyXm','entries','string','call','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','isArray','object','functionName','bff','actions','functionName\x20must\x20be\x20a\x20non-empty\x20string.','3719598bepUQs','map','10711833CiSHBA','trim','kind','forEach','target','.actions.','scriptName','commands','.scriptName'];a61_0x11d0=function(){return _0x1aaddf;};return a61_0x11d0();}function adaptFunctionNameField(_0x55ea85,_0x23b2ec,_0x21dc16){const _0x318868=a61_0x43ad;Object['prototype']['hasOwnProperty'][_0x318868(0x1ae)](_0x55ea85,'scriptName')&&_0x21dc16[_0x318868(0x19f)]({'level':_0x318868(0x1aa),'path':_0x23b2ec+_0x318868(0x1c0),'message':_0x318868(0x1af)});if(Object['prototype']['hasOwnProperty'][_0x318868(0x1ae)](_0x55ea85,_0x318868(0x1b2))){if(typeof _0x55ea85['functionName']!==_0x318868(0x1ad)||!_0x55ea85[_0x318868(0x1b2)][_0x318868(0x1b9)]()){_0x21dc16['push']({'level':'error','path':_0x23b2ec+'.functionName','message':_0x318868(0x1b5)}),delete _0x55ea85[_0x318868(0x1b2)];return;}_0x55ea85[_0x318868(0x1be)]=_0x55ea85[_0x318868(0x1b2)],delete _0x55ea85['functionName'];}}function isBffAction(_0x32b3d2){const _0x5f5784=a61_0x43ad;return _0x32b3d2['kind']==='bff'||_0x32b3d2[_0x5f5784(0x1a0)]==='bff.exec'||_0x32b3d2[_0x5f5784(0x1bc)]==='bff.exec';}function cloneJsonValue(_0x572993){const _0x25b762=a61_0x43ad;if(Array[_0x25b762(0x1b0)](_0x572993))return _0x572993[_0x25b762(0x1b7)](_0x21a928=>cloneJsonValue(_0x21a928));if(isObjectRecord(_0x572993))return Object['fromEntries'](Object['entries'](_0x572993)[_0x25b762(0x1b7)](([_0x8b9003,_0x4ec85f])=>[_0x8b9003,cloneJsonValue(_0x4ec85f)]));return _0x572993;}function isObjectRecord(_0xe2de22){const _0xa121c3=a61_0x43ad;return Boolean(_0xe2de22)&&typeof _0xe2de22===_0xa121c3(0x1b1)&&!Array[_0xa121c3(0x1b0)](_0xe2de22);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0xba388b=a62_0x9cf6;(function(_0x4102ec,_0x413af9){const _0xfa27dc=a62_0x9cf6,_0x25b4c6=_0x4102ec();while(!![]){try{const _0x2d6a2c=parseInt(_0xfa27dc(0x214))/0x1*(parseInt(_0xfa27dc(0x222))/0x2)+-parseInt(_0xfa27dc(0x1fd))/0x3*(parseInt(_0xfa27dc(0x227))/0x4)+parseInt(_0xfa27dc(0x1ea))/0x5*(-parseInt(_0xfa27dc(0x216))/0x6)+-parseInt(_0xfa27dc(0x228))/0x7*(parseInt(_0xfa27dc(0x1ec))/0x8)+-parseInt(_0xfa27dc(0x1fc))/0x9+parseInt(_0xfa27dc(0x225))/0xa*(-parseInt(_0xfa27dc(0x1f6))/0xb)+parseInt(_0xfa27dc(0x1ed))/0xc;if(_0x2d6a2c===_0x413af9)break;else _0x25b4c6['push'](_0x25b4c6['shift']());}catch(_0x3769c5){_0x25b4c6['push'](_0x25b4c6['shift']());}}}(a62_0x2821,0x59b15));function a62_0x2821(){const _0x120dd7=['file','length','detail','2Vhsxnq','normalizedManifest','14754pFOmVF','Removed\x20service\x20','Updated','list','description','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','risk','write','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','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','cliName','12344gQIMBe','map','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','110DDlGtA','commands','400588JmlVUD','7ydWQrJ','kind','validate','read','entry','flags','service','lower\x20kebab-case\x20service\x20code','Imported\x20','registryServiceCode','importedAt','manifest','WRITE','manifests','registry','535JziDUQ','source','207608tkMClL','24067296QIJaOo','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','report','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.','target','type','warnings','errors','filePath','617276SFOfdJ','hash','string','serviceCount','version','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','5796756jmKWYU','3AFxKiR','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','\x20service\x20','cliPath','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Service\x20Tree\x20manifest\x20file\x20path','Service\x20registry\x20validation\x20passed.','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','Service\x20manifest\x20validation\x20passed.','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','replaced','registryPath','serviceCode','str','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','reduce','name','export','Local\x20service\x20code,\x20for\x20example\x20crm','imported'];a62_0x2821=function(){return _0x120dd7;};return a62_0x2821();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a62_0x9cf6(_0x2852bd,_0x30bf7f){_0x2852bd=_0x2852bd-0x1e9;const _0x282174=a62_0x2821();let _0x9cf6fd=_0x282174[_0x2852bd];return _0x9cf6fd;}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a62_0xba388b(0x211),'type':a62_0xba388b(0x1f8),'required':!![],'description':a62_0xba388b(0x202)},SERVICE_FLAG={'name':'service','type':a62_0xba388b(0x1f8),'required':!![],'description':a62_0xba388b(0x20f),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0xba388b(0x22f)}};function summarizeService(_0x505d92){const _0x48d2f4=a62_0xba388b;return{'serviceCode':_0x505d92[_0x48d2f4(0x209)],'name':_0x505d92[_0x48d2f4(0x215)][_0x48d2f4(0x22e)][_0x48d2f4(0x20d)],'version':_0x505d92[_0x48d2f4(0x1fa)],'importedAt':_0x505d92[_0x48d2f4(0x232)],'source':_0x505d92[_0x48d2f4(0x1eb)],'commandCount':_0x505d92['normalizedManifest'][_0x48d2f4(0x226)]['length'],'commands':_0x505d92['normalizedManifest'][_0x48d2f4(0x226)][_0x48d2f4(0x223)](_0x29cd5a=>({'path':_0x29cd5a[_0x48d2f4(0x200)],'description':_0x29cd5a[_0x48d2f4(0x21a)],'risk':_0x29cd5a[_0x48d2f4(0x21c)],'target':toPublicServiceTreeTarget(_0x29cd5a[_0x48d2f4(0x1f1)]),'flags':_0x29cd5a[_0x48d2f4(0x22d)][_0x48d2f4(0x223)](_0x2efb78=>({'name':_0x2efb78[_0x48d2f4(0x20d)],'cliName':_0x2efb78[_0x48d2f4(0x221)],'type':_0x2efb78[_0x48d2f4(0x1f2)],'required':_0x2efb78['required']===!![]}))}))};}function summarizeLoadedManifest(_0x57d36d){const _0x35d2e6=a62_0xba388b;return{'service':_0x57d36d[_0x35d2e6(0x215)]?.[_0x35d2e6(0x22e)],'version':_0x57d36d[_0x35d2e6(0x215)]?.[_0x35d2e6(0x1fa)],'commandCount':_0x57d36d[_0x35d2e6(0x215)]?.[_0x35d2e6(0x226)][_0x35d2e6(0x212)]??0x0,'commands':_0x57d36d['normalizedManifest']?.['commands'][_0x35d2e6(0x223)](_0x3b6d3d=>({'path':_0x3b6d3d[_0x35d2e6(0x200)],'risk':_0x3b6d3d[_0x35d2e6(0x21c)],'target':toPublicServiceTreeTarget(_0x3b6d3d[_0x35d2e6(0x1f1)])}))??[],'registryIndex':_0x57d36d['registryIndex'],'registryServiceCode':_0x57d36d[_0x35d2e6(0x231)],'errors':_0x57d36d[_0x35d2e6(0x1ef)][_0x35d2e6(0x1f4)],'warnings':_0x57d36d['report'][_0x35d2e6(0x1f3)]};}export const serviceDefinitions=[{'service':a62_0xba388b(0x22e),'command':a62_0xba388b(0x22a),'description':a62_0xba388b(0x220),'risk':a62_0xba388b(0x22b),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x16d622){const _0x1326d7=a62_0xba388b,_0x29140d=loadServiceManifestFromFile(_0x16d622[_0x1326d7(0x20a)]('file'));if(!_0x29140d['report']['ok'])return{'ok':![],'data':{'file':_0x29140d[_0x1326d7(0x1f5)],'hash':_0x29140d['hash'],'kind':_0x29140d[_0x1326d7(0x229)],'serviceCount':_0x29140d[_0x1326d7(0x235)][_0x1326d7(0x212)],'services':_0x29140d['manifests'][_0x1326d7(0x223)](summarizeLoadedManifest),'errors':_0x29140d[_0x1326d7(0x1ef)][_0x1326d7(0x1f4)],'warnings':_0x29140d[_0x1326d7(0x1ef)][_0x1326d7(0x1f3)]},'message':formatValidationFailure(_0x29140d[_0x1326d7(0x1ef)])};if(_0x29140d[_0x1326d7(0x229)]===_0x1326d7(0x1e9)||_0x29140d[_0x1326d7(0x235)][_0x1326d7(0x212)]!==0x1)return{'ok':!![],'data':{'file':_0x29140d[_0x1326d7(0x1f5)],'hash':_0x29140d['hash'],'kind':_0x29140d['kind'],'serviceCount':_0x29140d['manifests'][_0x1326d7(0x212)],'commandCount':_0x29140d[_0x1326d7(0x235)][_0x1326d7(0x20c)]((_0x183eaf,_0x54ec87)=>_0x183eaf+(_0x54ec87['normalizedManifest']?.[_0x1326d7(0x226)]['length']??0x0),0x0),'services':_0x29140d[_0x1326d7(0x235)][_0x1326d7(0x223)](summarizeLoadedManifest),'warnings':_0x29140d['report'][_0x1326d7(0x1f3)]},'message':_0x1326d7(0x203)};return{'ok':!![],'data':{'file':_0x29140d[_0x1326d7(0x1f5)],'hash':_0x29140d['hash'],'kind':_0x29140d[_0x1326d7(0x229)],'service':_0x29140d[_0x1326d7(0x215)]?.[_0x1326d7(0x22e)],'version':_0x29140d[_0x1326d7(0x215)]?.['version'],'commandCount':_0x29140d[_0x1326d7(0x215)]?.['commands'][_0x1326d7(0x212)]??0x0,'commands':_0x29140d[_0x1326d7(0x215)]?.[_0x1326d7(0x226)]['map'](_0x116571=>({'path':_0x116571[_0x1326d7(0x200)],'risk':_0x116571[_0x1326d7(0x21c)],'target':toPublicServiceTreeTarget(_0x116571[_0x1326d7(0x1f1)])})),'warnings':_0x29140d[_0x1326d7(0x1ef)][_0x1326d7(0x1f3)]},'message':_0x1326d7(0x205)};}},{'service':a62_0xba388b(0x22e),'command':'import','description':a62_0xba388b(0x20b),'risk':a62_0xba388b(0x21d),'confirmationDescription':a62_0xba388b(0x21e),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0xde0fb){const _0x45eedb=a62_0xba388b,_0x145430=loadServiceManifestFromFile(_0xde0fb[_0x45eedb(0x20a)](_0x45eedb(0x211)));return{'method':_0x45eedb(0x234),'url':getServiceRegistryPath(),'body':{'file':_0x145430[_0x45eedb(0x1f5)],'hash':_0x145430[_0x45eedb(0x1f7)],'kind':_0x145430['kind'],'ok':_0x145430[_0x45eedb(0x1ef)]['ok'],'service':_0x145430[_0x45eedb(0x215)]?.[_0x45eedb(0x22e)],'version':_0x145430[_0x45eedb(0x215)]?.[_0x45eedb(0x1fa)],'serviceCount':_0x145430[_0x45eedb(0x235)][_0x45eedb(0x212)],'services':_0x145430['manifests']['map'](_0x30e96e=>({'service':_0x30e96e[_0x45eedb(0x215)]?.[_0x45eedb(0x22e)],'version':_0x30e96e[_0x45eedb(0x215)]?.[_0x45eedb(0x1fa)],'commandCount':_0x30e96e[_0x45eedb(0x215)]?.[_0x45eedb(0x226)][_0x45eedb(0x212)]??0x0,'errors':_0x30e96e[_0x45eedb(0x1ef)][_0x45eedb(0x1f4)]})),'errors':_0x145430[_0x45eedb(0x1ef)]['errors'],'commandCount':_0x145430['normalizedManifest']?.[_0x45eedb(0x226)][_0x45eedb(0x212)]??0x0},'description':_0x45eedb(0x201)};},async 'execute'(_0x502e9f){const _0x37fdd7=a62_0xba388b,_0x1b723c=importServiceManifest(_0x502e9f['str'](_0x37fdd7(0x211)));if(_0x1b723c['entries'][_0x37fdd7(0x212)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1b723c[_0x37fdd7(0x208)],'imported':_0x1b723c[_0x37fdd7(0x210)],'updated':_0x1b723c[_0x37fdd7(0x21f)],'serviceCount':_0x1b723c[_0x37fdd7(0x1f9)],'services':_0x1b723c['entries'][_0x37fdd7(0x223)](summarizeService)},'message':_0x37fdd7(0x230)+_0x1b723c[_0x37fdd7(0x210)]+'\x20service(s),\x20updated\x20'+_0x1b723c['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x1b723c[_0x37fdd7(0x208)],'replaced':_0x1b723c[_0x37fdd7(0x207)],'imported':_0x1b723c['imported'],'updated':_0x1b723c[_0x37fdd7(0x21f)],'serviceCount':_0x1b723c[_0x37fdd7(0x1f9)],'service':summarizeService(_0x1b723c[_0x37fdd7(0x22c)])},'message':(_0x1b723c[_0x37fdd7(0x207)]?_0x37fdd7(0x218):'Imported')+_0x37fdd7(0x1ff)+_0x1b723c[_0x37fdd7(0x22c)]['serviceCode']+'.'};}},{'service':a62_0xba388b(0x22e),'command':a62_0xba388b(0x20e),'description':a62_0xba388b(0x1ee),'risk':a62_0xba388b(0x21d),'confirmationDescription':a62_0xba388b(0x1f0),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x4144e6){const _0x308289=a62_0xba388b,_0x3add5c=getLocalServiceEntry(_0x4144e6[_0x308289(0x20a)](_0x308289(0x22e)));return{'method':_0x308289(0x234),'url':_0x4144e6[_0x308289(0x20a)](_0x308289(0x211)),'body':{'service':_0x4144e6['str']('service'),'found':Boolean(_0x3add5c),'version':_0x3add5c?.[_0x308289(0x1fa)],'source':_0x3add5c?.[_0x308289(0x1eb)]},'description':_0x308289(0x1fe)};},async 'execute'(_0x1ad5fb){const _0x5f0e60=a62_0xba388b,_0x577db9=exportServiceManifest(_0x1ad5fb[_0x5f0e60(0x20a)]('service'),_0x1ad5fb[_0x5f0e60(0x20a)]('file'));return{'ok':!![],'data':{'registryPath':_0x577db9[_0x5f0e60(0x208)],'file':_0x577db9[_0x5f0e60(0x1f5)],'service':summarizeService(_0x577db9[_0x5f0e60(0x22c)])},'message':'Exported\x20service\x20'+_0x577db9[_0x5f0e60(0x22c)][_0x5f0e60(0x209)]+'.'};}},{'service':a62_0xba388b(0x22e),'command':a62_0xba388b(0x219),'description':a62_0xba388b(0x224),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xfef007=a62_0xba388b,_0x2a510c=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2a510c['length'],'services':_0x2a510c[_0xfef007(0x223)](summarizeService)}};}},{'service':a62_0xba388b(0x22e),'command':'remove','description':a62_0xba388b(0x204),'risk':'write','confirmationDescription':a62_0xba388b(0x21b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x5c2d27){const _0x5a3fb4=a62_0xba388b,_0x550793=getLocalServiceEntry(_0x5c2d27['str'](_0x5a3fb4(0x22e)));return{'method':_0x5a3fb4(0x234),'url':getServiceRegistryPath(),'body':{'service':_0x5c2d27['str'](_0x5a3fb4(0x22e)),'found':Boolean(_0x550793),'version':_0x550793?.[_0x5a3fb4(0x1fa)],'source':_0x550793?.[_0x5a3fb4(0x1eb)]},'description':_0x5a3fb4(0x206)};},async 'execute'(_0x391ace){const _0x302903=a62_0xba388b,_0x532919=removeServiceManifest(_0x391ace[_0x302903(0x20a)](_0x302903(0x22e)));return{'ok':!![],'data':{'registryPath':_0x532919[_0x302903(0x208)],'serviceCount':_0x532919[_0x302903(0x1f9)],'service':summarizeService(_0x532919[_0x302903(0x22c)])},'message':_0x302903(0x217)+_0x532919[_0x302903(0x22c)][_0x302903(0x209)]+'.'};}},{'service':a62_0xba388b(0x22e),'command':a62_0xba388b(0x213),'description':a62_0xba388b(0x1fb),'risk':a62_0xba388b(0x22b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2adca6){const _0x166c52=a62_0xba388b,_0x30ce29=getLocalServiceEntry(_0x2adca6['str']('service'));if(!_0x30ce29)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2adca6[_0x166c52(0x20a)]('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x2adca6[_0x166c52(0x20a)](_0x166c52(0x22e))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x30ce29),'manifest':_0x30ce29[_0x166c52(0x233)],'normalizedManifest':toPublicNormalizedServiceTree(_0x30ce29[_0x166c52(0x215)])}};}}];
|
|
1
|
+
const a62_0x1cc49a=a62_0x42d7;(function(_0x3df0b7,_0x4a8645){const _0x2e1bf6=a62_0x42d7,_0x2648b3=_0x3df0b7();while(!![]){try{const _0x2e2e86=-parseInt(_0x2e1bf6(0x1ee))/0x1+-parseInt(_0x2e1bf6(0x1db))/0x2+-parseInt(_0x2e1bf6(0x1f9))/0x3+parseInt(_0x2e1bf6(0x227))/0x4*(-parseInt(_0x2e1bf6(0x223))/0x5)+parseInt(_0x2e1bf6(0x1f7))/0x6*(-parseInt(_0x2e1bf6(0x1ec))/0x7)+-parseInt(_0x2e1bf6(0x1f3))/0x8+parseInt(_0x2e1bf6(0x20e))/0x9*(parseInt(_0x2e1bf6(0x207))/0xa);if(_0x2e2e86===_0x4a8645)break;else _0x2648b3['push'](_0x2648b3['shift']());}catch(_0x485311){_0x2648b3['push'](_0x2648b3['shift']());}}}(a62_0x34fd,0xb4b7d));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a62_0x42d7(_0x5c3a52,_0x268471){_0x5c3a52=_0x5c3a52-0x1da;const _0x34fdb7=a62_0x34fd();let _0x42d7f0=_0x34fdb7[_0x5c3a52];return _0x42d7f0;}function a62_0x34fd(){const _0x254009=['registryPath','Removed\x20service\x20','30NiquLi','updated','95694ObiQZV','target','warnings','map','Imported\x20','detail','registryServiceCode','export','lower\x20kebab-case\x20service\x20code','string','service','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','manifest','cliPath','70JlRNFR','Local\x20service\x20not\x20found:\x20','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','registryIndex','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.','entry','Imported','5085855WkBuDn','type','validate','\x20service(s),\x20updated\x20','Service\x20Tree\x20manifest\x20file\x20path','filePath','Removes\x20the\x20given\x20service\x20manifest\x20from\x20the\x20local\x20Service\x20Tree\x20registry.\x20Dynamic\x20commands\x20from\x20that\x20manifest\x20will\x20no\x20longer\x20be\x20available.','registry','errors','required','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.','str','Service\x20registry\x20validation\x20passed.','read','Exported\x20service\x20','reduce','WRITE','remove','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','hash','155SJPEsM','Service\x20manifest\x20validation\x20passed.','length','report','95528bqNzCV','\x20service\x20','810692gsjNIy','replaced','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','name','write','serviceCount','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','list','cliName','risk','normalizedManifest','version','\x20service(s).','manifests','imported','entries','source','890092bIyiWg','serviceCode','1002623dwrmwL','commands','Remove\x20a\x20Service\x20Tree\x20manifest\x20from\x20the\x20local\x20runtime\x20registry','Export\x20the\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','kind','3195640HFPotq','file'];a62_0x34fd=function(){return _0x254009;};return a62_0x34fd();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a62_0x1cc49a(0x1f4),'type':a62_0x1cc49a(0x202),'required':!![],'description':a62_0x1cc49a(0x212)},SERVICE_FLAG={'name':'service','type':a62_0x1cc49a(0x202),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a62_0x1cc49a(0x201)}};function summarizeService(_0x1d488b){const _0x4ad943=a62_0x1cc49a;return{'serviceCode':_0x1d488b['serviceCode'],'name':_0x1d488b[_0x4ad943(0x1e5)][_0x4ad943(0x203)][_0x4ad943(0x1de)],'version':_0x1d488b['version'],'importedAt':_0x1d488b['importedAt'],'source':_0x1d488b[_0x4ad943(0x1eb)],'commandCount':_0x1d488b[_0x4ad943(0x1e5)][_0x4ad943(0x1ef)][_0x4ad943(0x225)],'commands':_0x1d488b[_0x4ad943(0x1e5)]['commands'][_0x4ad943(0x1fc)](_0x44bc15=>({'path':_0x44bc15['cliPath'],'description':_0x44bc15['description'],'risk':_0x44bc15['risk'],'target':toPublicServiceTreeTarget(_0x44bc15['target']),'flags':_0x44bc15['flags']['map'](_0x447572=>({'name':_0x447572[_0x4ad943(0x1de)],'cliName':_0x447572[_0x4ad943(0x1e3)],'type':_0x447572[_0x4ad943(0x20f)],'required':_0x447572[_0x4ad943(0x217)]===!![]}))}))};}function summarizeLoadedManifest(_0x2a3b07){const _0x150c21=a62_0x1cc49a;return{'service':_0x2a3b07[_0x150c21(0x1e5)]?.['service'],'version':_0x2a3b07['normalizedManifest']?.[_0x150c21(0x1e6)],'commandCount':_0x2a3b07['normalizedManifest']?.[_0x150c21(0x1ef)][_0x150c21(0x225)]??0x0,'commands':_0x2a3b07[_0x150c21(0x1e5)]?.[_0x150c21(0x1ef)][_0x150c21(0x1fc)](_0x38e633=>({'path':_0x38e633[_0x150c21(0x206)],'risk':_0x38e633[_0x150c21(0x1e4)],'target':toPublicServiceTreeTarget(_0x38e633[_0x150c21(0x1fa)])}))??[],'registryIndex':_0x2a3b07[_0x150c21(0x20a)],'registryServiceCode':_0x2a3b07[_0x150c21(0x1ff)],'errors':_0x2a3b07[_0x150c21(0x226)][_0x150c21(0x216)],'warnings':_0x2a3b07[_0x150c21(0x226)][_0x150c21(0x1fb)]};}export const serviceDefinitions=[{'service':'service','command':a62_0x1cc49a(0x210),'description':a62_0x1cc49a(0x220),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0xe0ce4e){const _0x4f0f06=a62_0x1cc49a,_0xfebfc8=loadServiceManifestFromFile(_0xe0ce4e[_0x4f0f06(0x219)]('file'));if(!_0xfebfc8[_0x4f0f06(0x226)]['ok'])return{'ok':![],'data':{'file':_0xfebfc8[_0x4f0f06(0x213)],'hash':_0xfebfc8[_0x4f0f06(0x222)],'kind':_0xfebfc8[_0x4f0f06(0x1f2)],'serviceCount':_0xfebfc8[_0x4f0f06(0x1e8)]['length'],'services':_0xfebfc8['manifests']['map'](summarizeLoadedManifest),'errors':_0xfebfc8[_0x4f0f06(0x226)]['errors'],'warnings':_0xfebfc8['report'][_0x4f0f06(0x1fb)]},'message':formatValidationFailure(_0xfebfc8[_0x4f0f06(0x226)])};if(_0xfebfc8[_0x4f0f06(0x1f2)]===_0x4f0f06(0x215)||_0xfebfc8['manifests'][_0x4f0f06(0x225)]!==0x1)return{'ok':!![],'data':{'file':_0xfebfc8[_0x4f0f06(0x213)],'hash':_0xfebfc8[_0x4f0f06(0x222)],'kind':_0xfebfc8[_0x4f0f06(0x1f2)],'serviceCount':_0xfebfc8[_0x4f0f06(0x1e8)][_0x4f0f06(0x225)],'commandCount':_0xfebfc8['manifests'][_0x4f0f06(0x21d)]((_0x18be9d,_0x1731e3)=>_0x18be9d+(_0x1731e3[_0x4f0f06(0x1e5)]?.[_0x4f0f06(0x1ef)]['length']??0x0),0x0),'services':_0xfebfc8[_0x4f0f06(0x1e8)][_0x4f0f06(0x1fc)](summarizeLoadedManifest),'warnings':_0xfebfc8[_0x4f0f06(0x226)][_0x4f0f06(0x1fb)]},'message':_0x4f0f06(0x21a)};return{'ok':!![],'data':{'file':_0xfebfc8[_0x4f0f06(0x213)],'hash':_0xfebfc8[_0x4f0f06(0x222)],'kind':_0xfebfc8[_0x4f0f06(0x1f2)],'service':_0xfebfc8[_0x4f0f06(0x1e5)]?.[_0x4f0f06(0x203)],'version':_0xfebfc8['normalizedManifest']?.[_0x4f0f06(0x1e6)],'commandCount':_0xfebfc8[_0x4f0f06(0x1e5)]?.[_0x4f0f06(0x1ef)][_0x4f0f06(0x225)]??0x0,'commands':_0xfebfc8['normalizedManifest']?.['commands']['map'](_0x1992cb=>({'path':_0x1992cb[_0x4f0f06(0x206)],'risk':_0x1992cb[_0x4f0f06(0x1e4)],'target':toPublicServiceTreeTarget(_0x1992cb[_0x4f0f06(0x1fa)])})),'warnings':_0xfebfc8['report'][_0x4f0f06(0x1fb)]},'message':_0x4f0f06(0x224)};}},{'service':a62_0x1cc49a(0x203),'command':'import','description':a62_0x1cc49a(0x209),'risk':a62_0x1cc49a(0x1df),'confirmationDescription':a62_0x1cc49a(0x20b),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1181f4){const _0x2ced75=a62_0x1cc49a,_0x4d10a3=loadServiceManifestFromFile(_0x1181f4[_0x2ced75(0x219)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x4d10a3[_0x2ced75(0x213)],'hash':_0x4d10a3[_0x2ced75(0x222)],'kind':_0x4d10a3[_0x2ced75(0x1f2)],'ok':_0x4d10a3[_0x2ced75(0x226)]['ok'],'service':_0x4d10a3['normalizedManifest']?.[_0x2ced75(0x203)],'version':_0x4d10a3[_0x2ced75(0x1e5)]?.[_0x2ced75(0x1e6)],'serviceCount':_0x4d10a3['manifests'][_0x2ced75(0x225)],'services':_0x4d10a3['manifests']['map'](_0x438c63=>({'service':_0x438c63['normalizedManifest']?.[_0x2ced75(0x203)],'version':_0x438c63[_0x2ced75(0x1e5)]?.['version'],'commandCount':_0x438c63[_0x2ced75(0x1e5)]?.[_0x2ced75(0x1ef)][_0x2ced75(0x225)]??0x0,'errors':_0x438c63[_0x2ced75(0x226)][_0x2ced75(0x216)]})),'errors':_0x4d10a3[_0x2ced75(0x226)][_0x2ced75(0x216)],'commandCount':_0x4d10a3[_0x2ced75(0x1e5)]?.[_0x2ced75(0x1ef)][_0x2ced75(0x225)]??0x0},'description':_0x2ced75(0x1dd)};},async 'execute'(_0x277692){const _0x35ce27=a62_0x1cc49a,_0x3ea574=importServiceManifest(_0x277692['str']('file'));if(_0x3ea574[_0x35ce27(0x1ea)][_0x35ce27(0x225)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x3ea574[_0x35ce27(0x1f5)],'imported':_0x3ea574['imported'],'updated':_0x3ea574[_0x35ce27(0x1f8)],'serviceCount':_0x3ea574[_0x35ce27(0x1e0)],'services':_0x3ea574['entries'][_0x35ce27(0x1fc)](summarizeService)},'message':_0x35ce27(0x1fd)+_0x3ea574['imported']+_0x35ce27(0x211)+_0x3ea574[_0x35ce27(0x1f8)]+_0x35ce27(0x1e7)};return{'ok':!![],'data':{'registryPath':_0x3ea574[_0x35ce27(0x1f5)],'replaced':_0x3ea574[_0x35ce27(0x1dc)],'imported':_0x3ea574[_0x35ce27(0x1e9)],'updated':_0x3ea574['updated'],'serviceCount':_0x3ea574[_0x35ce27(0x1e0)],'service':summarizeService(_0x3ea574[_0x35ce27(0x20c)])},'message':(_0x3ea574[_0x35ce27(0x1dc)]?'Updated':_0x35ce27(0x20d))+_0x35ce27(0x1da)+_0x3ea574['entry'][_0x35ce27(0x1ed)]+'.'};}},{'service':a62_0x1cc49a(0x203),'command':a62_0x1cc49a(0x200),'description':a62_0x1cc49a(0x1f1),'risk':'write','confirmationDescription':a62_0x1cc49a(0x218),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x3b7e61){const _0x5617c7=a62_0x1cc49a,_0x6ef62c=getLocalServiceEntry(_0x3b7e61[_0x5617c7(0x219)]('service'));return{'method':_0x5617c7(0x21e),'url':_0x3b7e61[_0x5617c7(0x219)]('file'),'body':{'service':_0x3b7e61[_0x5617c7(0x219)](_0x5617c7(0x203)),'found':Boolean(_0x6ef62c),'version':_0x6ef62c?.[_0x5617c7(0x1e6)],'source':_0x6ef62c?.[_0x5617c7(0x1eb)]},'description':_0x5617c7(0x221)};},async 'execute'(_0x1a6b84){const _0x33c3d7=a62_0x1cc49a,_0x26f24b=exportServiceManifest(_0x1a6b84['str']('service'),_0x1a6b84[_0x33c3d7(0x219)](_0x33c3d7(0x1f4)));return{'ok':!![],'data':{'registryPath':_0x26f24b[_0x33c3d7(0x1f5)],'file':_0x26f24b[_0x33c3d7(0x213)],'service':summarizeService(_0x26f24b[_0x33c3d7(0x20c)])},'message':_0x33c3d7(0x21c)+_0x26f24b[_0x33c3d7(0x20c)]['serviceCode']+'.'};}},{'service':'service','command':a62_0x1cc49a(0x1e2),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x567b6d=a62_0x1cc49a,_0x5c7694=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5c7694[_0x567b6d(0x225)],'services':_0x5c7694[_0x567b6d(0x1fc)](summarizeService)}};}},{'service':a62_0x1cc49a(0x203),'command':a62_0x1cc49a(0x21f),'description':a62_0x1cc49a(0x1f0),'risk':a62_0x1cc49a(0x1df),'confirmationDescription':a62_0x1cc49a(0x214),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x33b125){const _0x1386da=a62_0x1cc49a,_0x1c353f=getLocalServiceEntry(_0x33b125[_0x1386da(0x219)](_0x1386da(0x203)));return{'method':_0x1386da(0x21e),'url':getServiceRegistryPath(),'body':{'service':_0x33b125[_0x1386da(0x219)](_0x1386da(0x203)),'found':Boolean(_0x1c353f),'version':_0x1c353f?.[_0x1386da(0x1e6)],'source':_0x1c353f?.[_0x1386da(0x1eb)]},'description':_0x1386da(0x204)};},async 'execute'(_0x2b8d7a){const _0x161cec=a62_0x1cc49a,_0x52b1e1=removeServiceManifest(_0x2b8d7a[_0x161cec(0x219)]('service'));return{'ok':!![],'data':{'registryPath':_0x52b1e1[_0x161cec(0x1f5)],'serviceCount':_0x52b1e1[_0x161cec(0x1e0)],'service':summarizeService(_0x52b1e1[_0x161cec(0x20c)])},'message':_0x161cec(0x1f6)+_0x52b1e1[_0x161cec(0x20c)][_0x161cec(0x1ed)]+'.'};}},{'service':a62_0x1cc49a(0x203),'command':a62_0x1cc49a(0x1fe),'description':a62_0x1cc49a(0x1e1),'risk':a62_0x1cc49a(0x21b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x106ae6){const _0x23f397=a62_0x1cc49a,_0x3b94c2=getLocalServiceEntry(_0x106ae6[_0x23f397(0x219)](_0x23f397(0x203)));if(!_0x3b94c2)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x106ae6[_0x23f397(0x219)](_0x23f397(0x203))},'message':_0x23f397(0x208)+_0x106ae6[_0x23f397(0x219)](_0x23f397(0x203))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3b94c2),'manifest':_0x3b94c2[_0x23f397(0x205)],'normalizedManifest':toPublicNormalizedServiceTree(_0x3b94c2[_0x23f397(0x1e5)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x6a205c,_0x1be0fe){const _0x4a0000=a63_0x3d1e,_0x54d3fd=_0x6a205c();while(!![]){try{const _0x3cb2bb=parseInt(_0x4a0000(0x1a4))/0x1+-parseInt(_0x4a0000(0x1f7))/0x2+parseInt(_0x4a0000(0x1b2))/0x3*(parseInt(_0x4a0000(0x1c4))/0x4)+parseInt(_0x4a0000(0x1b5))/0x5+-parseInt(_0x4a0000(0x1c6))/0x6*(parseInt(_0x4a0000(0x1d8))/0x7)+-parseInt(_0x4a0000(0x1a9))/0x8+parseInt(_0x4a0000(0x1ae))/0x9*(parseInt(_0x4a0000(0x1f1))/0xa);if(_0x3cb2bb===_0x1be0fe)break;else _0x54d3fd['push'](_0x54d3fd['shift']());}catch(_0x44b236){_0x54d3fd['push'](_0x54d3fd['shift']());}}}(a63_0x4cc4,0xd4a0c));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='service.json';function a63_0x4cc4(){const _0x5e97f3=['1782905SjPGFY','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','description','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','parse','services\x20must\x20be\x20an\x20array','command','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Remove\x20or\x20migrate\x20','manifests','length','serviceCode','splice','source','updatedAt','6040372XAyubn','version','79188HVEbMr','bff\x20target\x20requires\x20functionName.','importedAt','Service\x20manifest\x20validation\x20failed:\x0a','sha256','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','].manifest.','path','.tmp','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','service','flatMap','errors','map','code','commands','startsWith','services','658uLHVsb','message','name','validation','].manifest','hex','report','Invalid\x20service\x20manifest\x20JSON:\x20','CliError','string','filePath','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','Service\x20manifest\x20file\x20not\x20found:\x20','missing','kind','warnings','stringify','push','now','homeDir','Cannot\x20write\x20service\x20registry:\x20','target','findIndex','Unsupported\x20schemaVersion:\x20','invalid','3937420wWtXwe','schemaVersion','join','sort','manifest','sourceHash','1377360IzdfiK','Unsupported\x20service\x20registry\x20schemaVersion:\x20','reduce','slice','empty','update','registryIndex','object','256343ACokcT','cliPath','localeCompare','Local\x20service\x20not\x20found:\x20','$.services[','10332088HjmsKQ','utf8','find','file','normalizedManifest','45WbVpFA','Invalid\x20service\x20registry\x20JSON:\x20','trim','ENOENT','3NoBoZd','toISOString','isArray'];a63_0x4cc4=function(){return _0x5e97f3;};return a63_0x4cc4();}export function getServiceRegistryPath(_0x3d92ee={}){const _0x5ef5a5=a63_0x3d1e;return resolve(_0x3d92ee[_0x5ef5a5(0x1eb)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}function a63_0x3d1e(_0x1ecb44,_0x23043b){_0x1ecb44=_0x1ecb44-0x19d;const _0x4cc4a4=a63_0x4cc4();let _0x3d1edf=_0x4cc4a4[_0x1ecb44];return _0x3d1edf;}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3e5525={}){const _0x503d93=a63_0x3d1e,_0x2ba3bb=getServiceRegistryPath(_0x3e5525);if(!existsSync(_0x2ba3bb))return emptyServiceRegistry();try{const _0x325447=readFileSync(_0x2ba3bb,_0x503d93(0x1aa));if(!_0x325447[_0x503d93(0x1b0)]())return emptyServiceRegistry();const _0x381d66=JSON['parse'](_0x325447);if(_0x381d66[_0x503d93(0x1f2)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x503d93(0x1db)](_0x503d93(0x19d)+String(_0x381d66[_0x503d93(0x1f2)]),_0x503d93(0x1bd)+_0x2ba3bb+'.');if(!Array[_0x503d93(0x1b4)](_0x381d66[_0x503d93(0x1d7)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x381d66[_0x503d93(0x1c3)],'services':_0x381d66[_0x503d93(0x1d7)]};}catch(_0xd7f4a3){if(_0xd7f4a3 instanceof Error&&_0xd7f4a3[_0x503d93(0x1da)]===_0x503d93(0x1e0))throw _0xd7f4a3;throw CliErrors[_0x503d93(0x1db)](_0x503d93(0x1af)+_0x2ba3bb,_0x503d93(0x1bc));}}export function writeServiceRegistry(_0x518bdc,_0x1e5295={}){const _0x2dcaa5=a63_0x3d1e,_0x5c27ab=getServiceRegistryPath(_0x1e5295),_0x1114ac=dirname(_0x5c27ab);!existsSync(_0x1114ac)&&mkdirSync(_0x1114ac,{'recursive':!![]});const _0x1eee40=_0x5c27ab+_0x2dcaa5(0x1ce);try{writeFileSync(_0x1eee40,JSON[_0x2dcaa5(0x1e8)](_0x518bdc,null,0x2)+'\x0a',{'encoding':_0x2dcaa5(0x1aa),'mode':0x180}),renameSync(_0x1eee40,_0x5c27ab);}catch(_0x7f2c47){try{unlinkSync(_0x1eee40);}catch{}if(_0x7f2c47?.[_0x2dcaa5(0x1d4)]===_0x2dcaa5(0x1b1))throw CliErrors[_0x2dcaa5(0x1db)](_0x2dcaa5(0x1ec)+_0x5c27ab);throw _0x7f2c47;}return _0x5c27ab;}export function loadServiceManifestFromFile(_0x1c82d7){const _0x223a6b=a63_0x3d1e,_0x4d4a0e=resolve(_0x1c82d7);if(!existsSync(_0x4d4a0e))throw CliErrors['validation'](_0x223a6b(0x1e4)+_0x1c82d7);let _0x4b3346;const _0x5d6cc3=readFileSync(_0x4d4a0e,_0x223a6b(0x1aa));try{_0x4b3346=JSON[_0x223a6b(0x1b9)](_0x5d6cc3);}catch{throw CliErrors[_0x223a6b(0x1db)](_0x223a6b(0x1df)+_0x1c82d7,_0x223a6b(0x1cf));}const _0x214719=sha256(_0x5d6cc3),_0x1d6326=extractLoadedServiceManifests(_0x4b3346,_0x214719),_0x3fcd3a=aggregateValidationReports(_0x1d6326),_0x3e9da5=_0x1d6326[0x0];return{'filePath':_0x4d4a0e,'hash':_0x214719,'kind':isServiceRegistryLike(_0x4b3346)?'registry':'manifest','manifest':_0x3e9da5?.[_0x223a6b(0x1f5)]??_0x4b3346,'report':_0x3fcd3a,'normalizedManifest':_0x1d6326[_0x223a6b(0x1bf)]===0x1?_0x3e9da5?.[_0x223a6b(0x1ad)]:undefined,'manifests':_0x1d6326};}export function importServiceManifest(_0x5c1d63,_0x3b6cbc={}){const _0x546929=a63_0x3d1e,_0x574826=loadServiceManifestFromFile(_0x5c1d63);if(!_0x574826[_0x546929(0x1de)]['ok'])throw CliErrors[_0x546929(0x1db)](formatValidationFailure(_0x574826[_0x546929(0x1de)]),_0x546929(0x1b8));if(_0x574826[_0x546929(0x1be)][_0x546929(0x1bf)]===0x0)throw CliErrors[_0x546929(0x1db)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x546929(0x1cb));const _0x4c6c01=readServiceRegistry(_0x3b6cbc),_0x355580=(_0x3b6cbc[_0x546929(0x1ea)]??(()=>new Date()))()[_0x546929(0x1b3)](),_0x44de96=[];let _0x38da2a=0x0,_0x4d28c3=0x0;for(const _0x1b6ca4 of _0x574826[_0x546929(0x1be)]){if(!_0x1b6ca4[_0x546929(0x1ad)])continue;const _0x3e307c=_0x1b6ca4[_0x546929(0x1ad)][_0x546929(0x1d0)][_0x546929(0x1d4)],_0x5abec6={'serviceCode':_0x3e307c,'version':_0x1b6ca4['normalizedManifest'][_0x546929(0x1c5)],'importedAt':_0x355580,'source':{'type':_0x546929(0x1ac),'path':_0x574826[_0x546929(0x1e2)],'hash':_0x1b6ca4[_0x546929(0x1f6)]},'manifest':_0x1b6ca4[_0x546929(0x1f5)],'normalizedManifest':_0x1b6ca4['normalizedManifest']},_0x2ef65c=_0x4c6c01[_0x546929(0x1d7)]['findIndex'](_0x1ecd58=>_0x1ecd58[_0x546929(0x1c0)]===_0x3e307c);_0x2ef65c>=0x0?(_0x4c6c01['services'][_0x2ef65c]=_0x5abec6,_0x4d28c3++):(_0x4c6c01[_0x546929(0x1d7)][_0x546929(0x1e9)](_0x5abec6),_0x38da2a++),_0x44de96['push'](_0x5abec6);}_0x4c6c01[_0x546929(0x1d7)][_0x546929(0x1f4)]((_0x5ce57e,_0x1d5d60)=>_0x5ce57e['serviceCode'][_0x546929(0x1a6)](_0x1d5d60[_0x546929(0x1c0)])),_0x4c6c01['updatedAt']=_0x355580;const _0x4dcb2c=writeServiceRegistry(_0x4c6c01,_0x3b6cbc);return{'registryPath':_0x4dcb2c,'entry':_0x44de96[0x0],'replaced':_0x44de96[_0x546929(0x1bf)]===0x1?_0x4d28c3===0x1:_0x4d28c3>0x0,'entries':_0x44de96,'imported':_0x38da2a,'updated':_0x4d28c3,'serviceCount':_0x4c6c01[_0x546929(0x1d7)]['length']};}export function exportServiceManifest(_0x465608,_0x53107a,_0x55406c={}){const _0x4df261=a63_0x3d1e,_0x4dd956=getServiceRegistryPath(_0x55406c),_0x2a8629=getLocalServiceEntry(_0x465608,_0x55406c);if(!_0x2a8629)throw CliErrors[_0x4df261(0x1db)](_0x4df261(0x1a7)+_0x465608,_0x4df261(0x1b6));const _0x547170=resolve(_0x53107a),_0x45a9d9=dirname(_0x547170);return!existsSync(_0x45a9d9)&&mkdirSync(_0x45a9d9,{'recursive':!![]}),writeFileSync(_0x547170,JSON['stringify'](_0x2a8629[_0x4df261(0x1f5)],null,0x2)+'\x0a',{'encoding':_0x4df261(0x1aa),'mode':0x180}),{'registryPath':_0x4dd956,'filePath':_0x547170,'entry':_0x2a8629};}export function removeServiceManifest(_0x403dbc,_0x372d6c={}){const _0x5a02e2=a63_0x3d1e,_0x3c0118=readServiceRegistry(_0x372d6c),_0x4d5fe9=_0x403dbc[_0x5a02e2(0x1b0)](),_0x589540=_0x3c0118[_0x5a02e2(0x1d7)][_0x5a02e2(0x1ee)](_0x47524a=>_0x47524a[_0x5a02e2(0x1c0)]===_0x4d5fe9);if(_0x589540<0x0)throw CliErrors[_0x5a02e2(0x1db)](_0x5a02e2(0x1a7)+_0x4d5fe9,_0x5a02e2(0x1b6));const [_0x29d712]=_0x3c0118[_0x5a02e2(0x1d7)][_0x5a02e2(0x1c1)](_0x589540,0x1),_0x2e3ada=(_0x372d6c['now']??(()=>new Date()))()['toISOString']();_0x3c0118[_0x5a02e2(0x1c3)]=_0x2e3ada;const _0x56859a=writeServiceRegistry(_0x3c0118,_0x372d6c);return{'registryPath':_0x56859a,'entry':_0x29d712,'serviceCount':_0x3c0118['services'][_0x5a02e2(0x1bf)]};}export function listLocalServices(_0x4df3e9={}){return readServiceRegistry(_0x4df3e9)['services'];}export function getLocalServiceEntry(_0x5535f5,_0x4cfae3={}){const _0x55f738=a63_0x3d1e;return readServiceRegistry(_0x4cfae3)[_0x55f738(0x1d7)][_0x55f738(0x1ab)](_0xc8edb1=>_0xc8edb1[_0x55f738(0x1c0)]===_0x5535f5[_0x55f738(0x1b0)]());}export function listLocalServiceTrees(_0xa42bc9={}){const _0x3023ec=a63_0x3d1e;return readServiceRegistry(_0xa42bc9)[_0x3023ec(0x1d7)][_0x3023ec(0x1d3)](_0x450661=>_0x450661[_0x3023ec(0x1ad)]);}export function inspectServiceRegistry(_0x3fd7ed={}){const _0x6038a8=a63_0x3d1e,_0x362250=getServiceRegistryPath(_0x3fd7ed);if(!existsSync(_0x362250))return emptyServiceRegistryInspection(_0x362250,_0x6038a8(0x1e5),![]);try{const _0x46c70c=readFileSync(_0x362250,_0x6038a8(0x1aa));if(!_0x46c70c[_0x6038a8(0x1b0)]())return emptyServiceRegistryInspection(_0x362250,_0x6038a8(0x1a0),!![]);const _0x14428b=JSON['parse'](_0x46c70c);if(_0x14428b['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x362250,_0x6038a8(0x1f0),!![]),'schemaVersion':_0x14428b[_0x6038a8(0x1f2)],'message':_0x6038a8(0x1ef)+String(_0x14428b['schemaVersion'])};if(!Array[_0x6038a8(0x1b4)](_0x14428b['services']))return{...emptyServiceRegistryInspection(_0x362250,_0x6038a8(0x1f0),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x14428b['updatedAt'],'message':_0x6038a8(0x1ba)};const _0x2e2d26=_0x14428b['services'][_0x6038a8(0x1d3)](summarizeLocalServiceEntry);return{'registryPath':_0x362250,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x14428b[_0x6038a8(0x1c3)],'serviceCount':_0x2e2d26[_0x6038a8(0x1bf)],'commandCount':_0x2e2d26[_0x6038a8(0x19e)]((_0x3f7398,_0x45afa2)=>_0x3f7398+_0x45afa2['commandCount'],0x0),'services':_0x2e2d26};}catch(_0x5c6971){return{...emptyServiceRegistryInspection(_0x362250,_0x6038a8(0x1f0),!![]),'message':_0x5c6971 instanceof Error?_0x5c6971[_0x6038a8(0x1d9)]:String(_0x5c6971)};}}export function formatValidationFailure(_0x356e41){const _0x340a76=a63_0x3d1e,_0x3029c7=_0x356e41[_0x340a76(0x1d2)][_0x340a76(0x1d3)](_0x4f832e=>_0x4f832e[_0x340a76(0x1cd)]+':\x20'+_0x4f832e['message']);return _0x340a76(0x1c9)+_0x3029c7[_0x340a76(0x1f3)]('\x0a');}function extractLoadedServiceManifests(_0x47d6fe,_0x3e4908){const _0x29bacd=a63_0x3d1e;if(!isServiceRegistryLike(_0x47d6fe)){const _0x19e3b2=_0x47d6fe,{manifest:_0x461b85,errors:_0x4a8f0c}=adaptServiceTreeManifestForLegacyFramework(_0x19e3b2),_0x24080d=validateServiceTreeManifest(_0x461b85),_0x771057=mergeValidationErrors(_0x24080d,_0x4a8f0c);return[{'manifest':_0x19e3b2,'report':_0x771057,'normalizedManifest':_0x771057['ok']?normalizeServiceTreeManifest(_0x461b85):undefined,'sourceHash':_0x3e4908}];}return _0x47d6fe[_0x29bacd(0x1d7)][_0x29bacd(0x1d3)]((_0x1977c1,_0x5839ce)=>{const _0x5586ca=_0x29bacd,_0x2fda70=isObjectRecord(_0x1977c1)?_0x1977c1[_0x5586ca(0x1f5)]:undefined,{manifest:_0x37796f,errors:_0x49d1df}=adaptServiceTreeManifestForLegacyFramework(_0x2fda70),_0x4ab013=validateServiceTreeManifest(_0x37796f),_0x1df018=mergeValidationErrors(_0x4ab013,_0x49d1df),_0x2a20f4=isObjectRecord(_0x1977c1)&&typeof _0x1977c1['serviceCode']===_0x5586ca(0x1e1)?_0x1977c1[_0x5586ca(0x1c0)]:undefined;return{'manifest':_0x2fda70,'report':_0x1df018,'normalizedManifest':_0x1df018['ok']?normalizeServiceTreeManifest(_0x37796f):undefined,'sourceHash':sha256(JSON[_0x5586ca(0x1e8)](_0x2fda70,null,0x2)+'\x0a'),'registryIndex':_0x5839ce,'registryServiceCode':_0x2a20f4};});}function mergeValidationErrors(_0x3efbc7,_0x95f612){const _0x2bea74=a63_0x3d1e,_0x3a401e=_0x3efbc7[_0x2bea74(0x1d2)][_0x2bea74(0x1d3)](_0x424e05=>_0x424e05[_0x2bea74(0x1d9)]===_0x2bea74(0x1e3)?{..._0x424e05,'message':_0x2bea74(0x1c7)}:_0x424e05),_0x5e22e5=[..._0x95f612,..._0x3a401e];return{'ok':_0x5e22e5[_0x2bea74(0x1bf)]===0x0,'errors':_0x5e22e5,'warnings':_0x3efbc7['warnings']};}function aggregateValidationReports(_0x2e5413){const _0x2ce941=a63_0x3d1e,_0x4b592c=_0x2e5413[_0x2ce941(0x1d1)](_0x160170=>_0x160170[_0x2ce941(0x1a2)]===undefined?_0x160170[_0x2ce941(0x1de)][_0x2ce941(0x1d2)]:_0x160170[_0x2ce941(0x1de)]['errors'][_0x2ce941(0x1d3)](_0x4971a2=>({..._0x4971a2,'path':prefixRegistryIssuePath(_0x160170[_0x2ce941(0x1a2)],_0x4971a2['path'])}))),_0x5e2adc=_0x2e5413[_0x2ce941(0x1d1)](_0x2d6e6c=>_0x2d6e6c[_0x2ce941(0x1a2)]===undefined?_0x2d6e6c['report'][_0x2ce941(0x1e7)]:_0x2d6e6c[_0x2ce941(0x1de)][_0x2ce941(0x1e7)][_0x2ce941(0x1d3)](_0x57b23e=>({..._0x57b23e,'path':prefixRegistryIssuePath(_0x2d6e6c[_0x2ce941(0x1a2)],_0x57b23e[_0x2ce941(0x1cd)])})));return{'ok':_0x4b592c[_0x2ce941(0x1bf)]===0x0,'errors':_0x4b592c,'warnings':_0x5e2adc};}function prefixRegistryIssuePath(_0x2666e0,_0x2e4d5a){const _0xabd49f=a63_0x3d1e;if(_0x2e4d5a==='$')return _0xabd49f(0x1a8)+_0x2666e0+'].manifest';if(_0x2e4d5a[_0xabd49f(0x1d6)]('$.'))return _0xabd49f(0x1a8)+_0x2666e0+_0xabd49f(0x1dc)+_0x2e4d5a[_0xabd49f(0x19f)](0x1);if(_0x2e4d5a[_0xabd49f(0x1d6)]('$['))return _0xabd49f(0x1a8)+_0x2666e0+'].manifest'+_0x2e4d5a['slice'](0x1);return'$.services['+_0x2666e0+_0xabd49f(0x1cc)+_0x2e4d5a;}function isServiceRegistryLike(_0x175987){const _0x1acf9b=a63_0x3d1e;return isObjectRecord(_0x175987)&&_0x175987['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x175987[_0x1acf9b(0x1d7)]);}function isObjectRecord(_0x85bb00){const _0x4f8e5e=a63_0x3d1e;return Boolean(_0x85bb00)&&typeof _0x85bb00===_0x4f8e5e(0x1a3)&&!Array['isArray'](_0x85bb00);}function emptyServiceRegistryInspection(_0xf87c68,_0x1c7ee0,_0x1e22f0){return{'registryPath':_0xf87c68,'exists':_0x1e22f0,'status':_0x1c7ee0,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x733adc){const _0x2c672e=a63_0x3d1e,_0x3e44a1=_0x733adc['normalizedManifest'],_0x3aebac=_0x3e44a1[_0x2c672e(0x1d5)][_0x2c672e(0x1d3)](_0x40deaa=>({'path':_0x40deaa[_0x2c672e(0x1a5)],'description':_0x40deaa[_0x2c672e(0x1b7)],'risk':_0x40deaa['risk'],'targetKind':_0x40deaa[_0x2c672e(0x1ed)][_0x2c672e(0x1e6)],'targetCommand':_0x40deaa['target'][_0x2c672e(0x1bb)]}));return{'serviceCode':_0x733adc[_0x2c672e(0x1c0)],'name':_0x3e44a1[_0x2c672e(0x1d0)]['name'],'description':_0x3e44a1[_0x2c672e(0x1d0)][_0x2c672e(0x1b7)],'version':_0x733adc['version'],'importedAt':_0x733adc[_0x2c672e(0x1c8)],'source':_0x733adc[_0x2c672e(0x1c2)],'commandCount':_0x3aebac[_0x2c672e(0x1bf)],'commands':_0x3aebac};}function sha256(_0x3e8399){const _0x28a286=a63_0x3d1e;return createHash(_0x28a286(0x1ca))[_0x28a286(0x1a1)](_0x3e8399)['digest'](_0x28a286(0x1dd));}
|
|
1
|
+
const a63_0x4c31e3=a63_0x15aa;(function(_0x3856e5,_0x530a8c){const _0x28fbf8=a63_0x15aa,_0x1948af=_0x3856e5();while(!![]){try{const _0x158562=parseInt(_0x28fbf8(0x1ad))/0x1+parseInt(_0x28fbf8(0x195))/0x2*(parseInt(_0x28fbf8(0x1d1))/0x3)+-parseInt(_0x28fbf8(0x1c3))/0x4+-parseInt(_0x28fbf8(0x1a9))/0x5+-parseInt(_0x28fbf8(0x18e))/0x6+-parseInt(_0x28fbf8(0x1a8))/0x7+parseInt(_0x28fbf8(0x188))/0x8;if(_0x158562===_0x530a8c)break;else _0x1948af['push'](_0x1948af['shift']());}catch(_0x54f456){_0x1948af['push'](_0x1948af['shift']());}}}(a63_0x5313,0xd179b));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=a63_0x4c31e3(0x1cf);function a63_0x15aa(_0x339841,_0x2b2b4e){_0x339841=_0x339841-0x181;const _0x5313e7=a63_0x5313();let _0x15aa35=_0x5313e7[_0x339841];return _0x15aa35;}export function getServiceRegistryPath(_0x43bc0f={}){const _0x3a28dc=a63_0x4c31e3;return resolve(_0x43bc0f[_0x3a28dc(0x192)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x3486f1={}){const _0xe1fbc0=a63_0x4c31e3,_0x1e44cf=getServiceRegistryPath(_0x3486f1);if(!existsSync(_0x1e44cf))return emptyServiceRegistry();try{const _0x362902=readFileSync(_0x1e44cf,_0xe1fbc0(0x1bf));if(!_0x362902[_0xe1fbc0(0x190)]())return emptyServiceRegistry();const _0x5df800=JSON[_0xe1fbc0(0x186)](_0x362902);if(_0x5df800[_0xe1fbc0(0x1be)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0xe1fbc0(0x198)](_0xe1fbc0(0x1c5)+String(_0x5df800[_0xe1fbc0(0x1be)]),_0xe1fbc0(0x1c1)+_0x1e44cf+'.');if(!Array[_0xe1fbc0(0x1c9)](_0x5df800['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5df800[_0xe1fbc0(0x1d3)],'services':_0x5df800[_0xe1fbc0(0x193)]};}catch(_0x487afd){if(_0x487afd instanceof Error&&_0x487afd[_0xe1fbc0(0x1bc)]===_0xe1fbc0(0x19d))throw _0x487afd;throw CliErrors[_0xe1fbc0(0x198)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x1e44cf,_0xe1fbc0(0x1b6));}}export function writeServiceRegistry(_0x5bd21d,_0x128874={}){const _0x549db6=a63_0x4c31e3,_0x4f778b=getServiceRegistryPath(_0x128874),_0x2115de=dirname(_0x4f778b);!existsSync(_0x2115de)&&mkdirSync(_0x2115de,{'recursive':!![]});const _0xdb786b=_0x4f778b+_0x549db6(0x183);try{writeFileSync(_0xdb786b,JSON[_0x549db6(0x1ab)](_0x5bd21d,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xdb786b,_0x4f778b);}catch(_0x484ddf){try{unlinkSync(_0xdb786b);}catch{}if(_0x484ddf?.[_0x549db6(0x1aa)]===_0x549db6(0x18c))throw CliErrors[_0x549db6(0x198)](_0x549db6(0x1b4)+_0x4f778b);throw _0x484ddf;}return _0x4f778b;}export function loadServiceManifestFromFile(_0x5aa9b4){const _0x1f1eba=a63_0x4c31e3,_0x120206=resolve(_0x5aa9b4);if(!existsSync(_0x120206))throw CliErrors['validation'](_0x1f1eba(0x1a7)+_0x5aa9b4);let _0x1f6b53;const _0x1de50a=readFileSync(_0x120206,'utf8');try{_0x1f6b53=JSON[_0x1f1eba(0x186)](_0x1de50a);}catch{throw CliErrors['validation'](_0x1f1eba(0x191)+_0x5aa9b4,_0x1f1eba(0x187));}const _0x2c9a16=sha256(_0x1de50a),_0x4b9182=extractLoadedServiceManifests(_0x1f6b53,_0x2c9a16),_0x36316c=aggregateValidationReports(_0x4b9182),_0x3a6cf3=_0x4b9182[0x0];return{'filePath':_0x120206,'hash':_0x2c9a16,'kind':isServiceRegistryLike(_0x1f6b53)?_0x1f1eba(0x1cd):_0x1f1eba(0x1a4),'manifest':_0x3a6cf3?.['manifest']??_0x1f6b53,'report':_0x36316c,'normalizedManifest':_0x4b9182['length']===0x1?_0x3a6cf3?.[_0x1f1eba(0x1a0)]:undefined,'manifests':_0x4b9182};}export function importServiceManifest(_0x3dd967,_0x3c64dd={}){const _0x2ff746=a63_0x4c31e3,_0x45cc70=loadServiceManifestFromFile(_0x3dd967);if(!_0x45cc70[_0x2ff746(0x1a2)]['ok'])throw CliErrors[_0x2ff746(0x198)](formatValidationFailure(_0x45cc70['report']),_0x2ff746(0x185));if(_0x45cc70[_0x2ff746(0x1b0)]['length']===0x0)throw CliErrors['validation'](_0x2ff746(0x18b),_0x2ff746(0x1ca));const _0x4c437f=readServiceRegistry(_0x3c64dd),_0x40c6a=(_0x3c64dd['now']??(()=>new Date()))()[_0x2ff746(0x1b5)](),_0x1e0b49=[];let _0x523f35=0x0,_0xa42674=0x0;for(const _0x35f3b6 of _0x45cc70[_0x2ff746(0x1b0)]){if(!_0x35f3b6[_0x2ff746(0x1a0)])continue;const _0x146327=_0x35f3b6[_0x2ff746(0x1a0)][_0x2ff746(0x1a5)]['code'],_0x520d30={'serviceCode':_0x146327,'version':_0x35f3b6['normalizedManifest'][_0x2ff746(0x1c2)],'importedAt':_0x40c6a,'source':{'type':_0x2ff746(0x18d),'path':_0x45cc70['filePath'],'hash':_0x35f3b6[_0x2ff746(0x184)]},'manifest':_0x35f3b6['manifest'],'normalizedManifest':_0x35f3b6[_0x2ff746(0x1a0)]},_0x4d1ce5=_0x4c437f[_0x2ff746(0x193)][_0x2ff746(0x1d0)](_0x382fcb=>_0x382fcb[_0x2ff746(0x182)]===_0x146327);_0x4d1ce5>=0x0?(_0x4c437f['services'][_0x4d1ce5]=_0x520d30,_0xa42674++):(_0x4c437f[_0x2ff746(0x193)][_0x2ff746(0x1cc)](_0x520d30),_0x523f35++),_0x1e0b49[_0x2ff746(0x1cc)](_0x520d30);}_0x4c437f[_0x2ff746(0x193)][_0x2ff746(0x18a)]((_0x5029e2,_0x56018b)=>_0x5029e2[_0x2ff746(0x182)][_0x2ff746(0x1bb)](_0x56018b[_0x2ff746(0x182)])),_0x4c437f[_0x2ff746(0x1d3)]=_0x40c6a;const _0x351f56=writeServiceRegistry(_0x4c437f,_0x3c64dd);return{'registryPath':_0x351f56,'entry':_0x1e0b49[0x0],'replaced':_0x1e0b49[_0x2ff746(0x1b1)]===0x1?_0xa42674===0x1:_0xa42674>0x0,'entries':_0x1e0b49,'imported':_0x523f35,'updated':_0xa42674,'serviceCount':_0x4c437f['services']['length']};}function a63_0x5313(){const _0x42076b=['sort','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','ENOENT','file','5874972KkJwFc','importedAt','trim','Invalid\x20service\x20manifest\x20JSON:\x20','homeDir','services','kind','1978DALsvU','join','risk','validation','commandCount','path','slice','].manifest.','CliError','Service\x20manifest\x20validation\x20failed:\x0a','startsWith','normalizedManifest','sha256','report','registryIndex','manifest','service','hex','Service\x20manifest\x20file\x20not\x20found:\x20','4543126tZumhx','4133125AuIzDl','code','stringify','flatMap','1367198QkXmxd','message','invalid','manifests','length','bff\x20target\x20requires\x20functionName.','find','Cannot\x20write\x20service\x20registry:\x20','toISOString','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','errors','source','commands','services\x20must\x20be\x20an\x20array','localeCompare','name','$.services[','schemaVersion','utf8','string','Remove\x20or\x20migrate\x20','version','4012332rIvxIQ','empty','Unsupported\x20service\x20registry\x20schemaVersion:\x20','warnings','target','].manifest','isArray','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','command','push','registry','map','service.json','findIndex','3723fABtNp','description','updatedAt','splice','serviceCode','.tmp','sourceHash','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','parse','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','13770816lwqSGW','cliPath'];a63_0x5313=function(){return _0x42076b;};return a63_0x5313();}export function exportServiceManifest(_0x2b2a96,_0x43659e,_0x422986={}){const _0x292e87=a63_0x4c31e3,_0x19da03=getServiceRegistryPath(_0x422986),_0x25675e=getLocalServiceEntry(_0x2b2a96,_0x422986);if(!_0x25675e)throw CliErrors[_0x292e87(0x198)]('Local\x20service\x20not\x20found:\x20'+_0x2b2a96,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x146d56=resolve(_0x43659e),_0x41c292=dirname(_0x146d56);return!existsSync(_0x41c292)&&mkdirSync(_0x41c292,{'recursive':!![]}),writeFileSync(_0x146d56,JSON[_0x292e87(0x1ab)](_0x25675e[_0x292e87(0x1a4)],null,0x2)+'\x0a',{'encoding':_0x292e87(0x1bf),'mode':0x180}),{'registryPath':_0x19da03,'filePath':_0x146d56,'entry':_0x25675e};}export function removeServiceManifest(_0x13a1bb,_0x344e5f={}){const _0xb972e2=a63_0x4c31e3,_0x399c0a=readServiceRegistry(_0x344e5f),_0x4ae5dc=_0x13a1bb[_0xb972e2(0x190)](),_0x246c88=_0x399c0a[_0xb972e2(0x193)]['findIndex'](_0x491baf=>_0x491baf[_0xb972e2(0x182)]===_0x4ae5dc);if(_0x246c88<0x0)throw CliErrors[_0xb972e2(0x198)]('Local\x20service\x20not\x20found:\x20'+_0x4ae5dc,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x174aa8]=_0x399c0a[_0xb972e2(0x193)][_0xb972e2(0x181)](_0x246c88,0x1),_0x7fada9=(_0x344e5f['now']??(()=>new Date()))()[_0xb972e2(0x1b5)]();_0x399c0a[_0xb972e2(0x1d3)]=_0x7fada9;const _0x209bd8=writeServiceRegistry(_0x399c0a,_0x344e5f);return{'registryPath':_0x209bd8,'entry':_0x174aa8,'serviceCount':_0x399c0a['services'][_0xb972e2(0x1b1)]};}export function listLocalServices(_0x56a01d={}){const _0x63fabd=a63_0x4c31e3;return readServiceRegistry(_0x56a01d)[_0x63fabd(0x193)];}export function getLocalServiceEntry(_0x594a0f,_0x40876d={}){const _0x58ee84=a63_0x4c31e3;return readServiceRegistry(_0x40876d)[_0x58ee84(0x193)][_0x58ee84(0x1b3)](_0x4cb568=>_0x4cb568[_0x58ee84(0x182)]===_0x594a0f['trim']());}export function listLocalServiceTrees(_0x4110ba={}){const _0x5f5b74=a63_0x4c31e3;return readServiceRegistry(_0x4110ba)[_0x5f5b74(0x193)]['map'](_0xeb92a9=>_0xeb92a9[_0x5f5b74(0x1a0)]);}export function inspectServiceRegistry(_0x41d722={}){const _0x57f4f5=a63_0x4c31e3,_0x230181=getServiceRegistryPath(_0x41d722);if(!existsSync(_0x230181))return emptyServiceRegistryInspection(_0x230181,'missing',![]);try{const _0x5818d7=readFileSync(_0x230181,_0x57f4f5(0x1bf));if(!_0x5818d7[_0x57f4f5(0x190)]())return emptyServiceRegistryInspection(_0x230181,_0x57f4f5(0x1c4),!![]);const _0x47934c=JSON[_0x57f4f5(0x186)](_0x5818d7);if(_0x47934c['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x230181,_0x57f4f5(0x1af),!![]),'schemaVersion':_0x47934c[_0x57f4f5(0x1be)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x47934c[_0x57f4f5(0x1be)])};if(!Array['isArray'](_0x47934c[_0x57f4f5(0x193)]))return{...emptyServiceRegistryInspection(_0x230181,_0x57f4f5(0x1af),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x47934c[_0x57f4f5(0x1d3)],'message':_0x57f4f5(0x1ba)};const _0x39187d=_0x47934c[_0x57f4f5(0x193)][_0x57f4f5(0x1ce)](summarizeLocalServiceEntry);return{'registryPath':_0x230181,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x47934c[_0x57f4f5(0x1d3)],'serviceCount':_0x39187d[_0x57f4f5(0x1b1)],'commandCount':_0x39187d['reduce']((_0xb65ccd,_0x222578)=>_0xb65ccd+_0x222578[_0x57f4f5(0x199)],0x0),'services':_0x39187d};}catch(_0x26d95c){return{...emptyServiceRegistryInspection(_0x230181,'invalid',!![]),'message':_0x26d95c instanceof Error?_0x26d95c[_0x57f4f5(0x1ae)]:String(_0x26d95c)};}}export function formatValidationFailure(_0x414203){const _0xc37015=a63_0x4c31e3,_0x253980=_0x414203[_0xc37015(0x1b7)][_0xc37015(0x1ce)](_0x5d8379=>_0x5d8379[_0xc37015(0x19a)]+':\x20'+_0x5d8379[_0xc37015(0x1ae)]);return _0xc37015(0x19e)+_0x253980[_0xc37015(0x196)]('\x0a');}function extractLoadedServiceManifests(_0x208ecd,_0x45c6f3){if(!isServiceRegistryLike(_0x208ecd)){const _0x563dcf=_0x208ecd,{manifest:_0x5ec232,errors:_0x23b561}=adaptServiceTreeManifestForLegacyFramework(_0x563dcf),_0x34a91b=validateServiceTreeManifest(_0x5ec232),_0x735a26=mergeValidationErrors(_0x34a91b,_0x23b561);return[{'manifest':_0x563dcf,'report':_0x735a26,'normalizedManifest':_0x735a26['ok']?normalizeServiceTreeManifest(_0x5ec232):undefined,'sourceHash':_0x45c6f3}];}return _0x208ecd['services']['map']((_0x10605f,_0xa20907)=>{const _0x7a037d=a63_0x15aa,_0xd54c8f=isObjectRecord(_0x10605f)?_0x10605f[_0x7a037d(0x1a4)]:undefined,{manifest:_0x315a63,errors:_0x332b85}=adaptServiceTreeManifestForLegacyFramework(_0xd54c8f),_0xb8e253=validateServiceTreeManifest(_0x315a63),_0xc40acd=mergeValidationErrors(_0xb8e253,_0x332b85),_0x207080=isObjectRecord(_0x10605f)&&typeof _0x10605f[_0x7a037d(0x182)]===_0x7a037d(0x1c0)?_0x10605f[_0x7a037d(0x182)]:undefined;return{'manifest':_0xd54c8f,'report':_0xc40acd,'normalizedManifest':_0xc40acd['ok']?normalizeServiceTreeManifest(_0x315a63):undefined,'sourceHash':sha256(JSON['stringify'](_0xd54c8f,null,0x2)+'\x0a'),'registryIndex':_0xa20907,'registryServiceCode':_0x207080};});}function mergeValidationErrors(_0x20d630,_0x3b57c0){const _0x5941bc=a63_0x4c31e3,_0xc5faac=_0x20d630[_0x5941bc(0x1b7)][_0x5941bc(0x1ce)](_0x17e19a=>_0x17e19a[_0x5941bc(0x1ae)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x17e19a,'message':_0x5941bc(0x1b2)}:_0x17e19a),_0x23a1b3=[..._0x3b57c0,..._0xc5faac];return{'ok':_0x23a1b3[_0x5941bc(0x1b1)]===0x0,'errors':_0x23a1b3,'warnings':_0x20d630['warnings']};}function aggregateValidationReports(_0x1f040d){const _0x23d561=a63_0x4c31e3,_0x562162=_0x1f040d['flatMap'](_0x496132=>_0x496132['registryIndex']===undefined?_0x496132['report'][_0x23d561(0x1b7)]:_0x496132[_0x23d561(0x1a2)][_0x23d561(0x1b7)][_0x23d561(0x1ce)](_0x549bed=>({..._0x549bed,'path':prefixRegistryIssuePath(_0x496132[_0x23d561(0x1a3)],_0x549bed['path'])}))),_0x47b98f=_0x1f040d[_0x23d561(0x1ac)](_0x23b635=>_0x23b635[_0x23d561(0x1a3)]===undefined?_0x23b635[_0x23d561(0x1a2)][_0x23d561(0x1c6)]:_0x23b635[_0x23d561(0x1a2)][_0x23d561(0x1c6)][_0x23d561(0x1ce)](_0x18a85a=>({..._0x18a85a,'path':prefixRegistryIssuePath(_0x23b635['registryIndex'],_0x18a85a[_0x23d561(0x19a)])})));return{'ok':_0x562162[_0x23d561(0x1b1)]===0x0,'errors':_0x562162,'warnings':_0x47b98f};}function prefixRegistryIssuePath(_0x35949d,_0x18f587){const _0x15f33f=a63_0x4c31e3;if(_0x18f587==='$')return'$.services['+_0x35949d+'].manifest';if(_0x18f587[_0x15f33f(0x19f)]('$.'))return _0x15f33f(0x1bd)+_0x35949d+_0x15f33f(0x1c8)+_0x18f587[_0x15f33f(0x19b)](0x1);if(_0x18f587[_0x15f33f(0x19f)]('$['))return _0x15f33f(0x1bd)+_0x35949d+_0x15f33f(0x1c8)+_0x18f587[_0x15f33f(0x19b)](0x1);return _0x15f33f(0x1bd)+_0x35949d+_0x15f33f(0x19c)+_0x18f587;}function isServiceRegistryLike(_0x4b784e){const _0x12a6c5=a63_0x4c31e3;return isObjectRecord(_0x4b784e)&&_0x4b784e[_0x12a6c5(0x1be)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x12a6c5(0x1c9)](_0x4b784e[_0x12a6c5(0x193)]);}function isObjectRecord(_0x2d0d86){const _0x13a522=a63_0x4c31e3;return Boolean(_0x2d0d86)&&typeof _0x2d0d86==='object'&&!Array[_0x13a522(0x1c9)](_0x2d0d86);}function emptyServiceRegistryInspection(_0x11759b,_0x48254e,_0x2b0864){return{'registryPath':_0x11759b,'exists':_0x2b0864,'status':_0x48254e,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x43ae1b){const _0x5cc245=a63_0x4c31e3,_0x163451=_0x43ae1b[_0x5cc245(0x1a0)],_0x3cb657=_0x163451[_0x5cc245(0x1b9)][_0x5cc245(0x1ce)](_0x58f4cd=>({'path':_0x58f4cd[_0x5cc245(0x189)],'description':_0x58f4cd[_0x5cc245(0x1d2)],'risk':_0x58f4cd[_0x5cc245(0x197)],'targetKind':_0x58f4cd[_0x5cc245(0x1c7)][_0x5cc245(0x194)],'targetCommand':_0x58f4cd[_0x5cc245(0x1c7)][_0x5cc245(0x1cb)]}));return{'serviceCode':_0x43ae1b[_0x5cc245(0x182)],'name':_0x163451[_0x5cc245(0x1a5)][_0x5cc245(0x1bc)],'description':_0x163451[_0x5cc245(0x1a5)][_0x5cc245(0x1d2)],'version':_0x43ae1b[_0x5cc245(0x1c2)],'importedAt':_0x43ae1b[_0x5cc245(0x18f)],'source':_0x43ae1b[_0x5cc245(0x1b8)],'commandCount':_0x3cb657['length'],'commands':_0x3cb657};}function sha256(_0x5dcc18){const _0x1a73f3=a63_0x4c31e3;return createHash(_0x1a73f3(0x1a1))['update'](_0x5dcc18)['digest'](_0x1a73f3(0x1a6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x466b8e=a64_0x5b55;(function(_0x3874aa,_0x1ce2c0){const _0x2e92d5=a64_0x5b55,_0xe85088=_0x3874aa();while(!![]){try{const _0x47f030=parseInt(_0x2e92d5(0x8a))/0x1+parseInt(_0x2e92d5(0x7c))/0x2*(parseInt(_0x2e92d5(0x94))/0x3)+parseInt(_0x2e92d5(0x8c))/0x4+parseInt(_0x2e92d5(0x75))/0x5*(-parseInt(_0x2e92d5(0x82))/0x6)+parseInt(_0x2e92d5(0x92))/0x7+-parseInt(_0x2e92d5(0x7f))/0x8*(parseInt(_0x2e92d5(0x8b))/0x9)+-parseInt(_0x2e92d5(0x84))/0xa*(parseInt(_0x2e92d5(0x7a))/0xb);if(_0x47f030===_0x1ce2c0)break;else _0xe85088['push'](_0xe85088['shift']());}catch(_0x5de5a0){_0xe85088['push'](_0xe85088['shift']());}}}(a64_0x3fa7,0x90b02));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';function a64_0x3fa7(){const _0x4b8ffa=['target','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','content','path','create','83436PVPRwQ','3258414VwRWJJ','2124188anKNum','validation','Created\x20local\x20Skill\x20draft\x20','skill','skillDir','type','5305720Lmfdge','trim','224916EKvsTY','files','map','force','str','170xcysqT','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','utf8','skillName','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','9544227KXCvKY','rendered','14HcRsjq','read','isDirectory','8neyUHQ','isSymbolicLink','Skill\x20directory\x20already\x20exists:\x20','13218Rpfuof','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','10wTYCLF'];a64_0x3fa7=function(){return _0x4b8ffa;};return a64_0x3fa7();}function a64_0x5b55(_0x17e5d6,_0x23311f){_0x17e5d6=_0x17e5d6-0x75;const _0x3fa794=a64_0x3fa7();let _0x5b55be=_0x3fa794[_0x17e5d6];return _0x5b55be;}export const createCommand={'service':a64_0x466b8e(0x8f),'command':a64_0x466b8e(0x89),'description':a64_0x466b8e(0x76),'risk':a64_0x466b8e(0x7d),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x42ade1){const _0x4a4b69=a64_0x466b8e,_0x4356cc=buildSkillCreatePlan(_0x42ade1['str']('name'),_0x42ade1[_0x4a4b69(0x98)](_0x4a4b69(0x91)),_0x42ade1[_0x4a4b69(0x98)](_0x4a4b69(0x85)));return{'method':'WRITE','url':_0x4356cc[_0x4a4b69(0x90)],'body':{'skillName':_0x4356cc[_0x4a4b69(0x7b)][_0x4a4b69(0x78)],'type':_0x4356cc['rendered'][_0x4a4b69(0x91)],'selfContained':!![],'files':_0x4356cc[_0x4a4b69(0x7b)][_0x4a4b69(0x95)][_0x4a4b69(0x96)](_0x2512fe=>_0x2512fe[_0x4a4b69(0x88)])},'description':_0x4a4b69(0x83)};},async 'execute'(_0x2ccd4c){const _0x12ca59=a64_0x466b8e,_0x205238=buildSkillCreatePlan(_0x2ccd4c[_0x12ca59(0x98)]('name'),_0x2ccd4c['str'](_0x12ca59(0x91)),_0x2ccd4c['str']('target'));return writeSkillDraft(_0x205238,_0x2ccd4c['bool'](_0x12ca59(0x97))),{'ok':!![],'data':{'skillName':_0x205238[_0x12ca59(0x7b)][_0x12ca59(0x78)],'type':_0x205238[_0x12ca59(0x7b)]['type'],'dir':_0x205238[_0x12ca59(0x90)],'files':_0x205238[_0x12ca59(0x7b)][_0x12ca59(0x95)][_0x12ca59(0x96)](_0x59c9aa=>_0x59c9aa[_0x12ca59(0x88)])},'message':_0x12ca59(0x8e)+_0x205238[_0x12ca59(0x7b)][_0x12ca59(0x78)]};}};function buildSkillCreatePlan(_0x3039c8,_0x1980a4,_0x494fe5){const _0x388c94=a64_0x466b8e,_0x3953b6=_0x1980a4[_0x388c94(0x93)](),_0x4c3fa0=renderSkillTemplate({'skillName':_0x3039c8,'type':_0x3953b6});!_0x3953b6&&writeCliSideChannelLine(_0x388c94(0x86));const _0x1aa52c=resolve(normalizeSkillTarget(_0x494fe5));return{'rendered':_0x4c3fa0,'targetRoot':_0x1aa52c,'skillDir':resolve(_0x1aa52c,_0x4c3fa0[_0x388c94(0x78)])};}function normalizeSkillTarget(_0x226fdf){const _0xc19caa=a64_0x466b8e;return(_0x226fdf||DEFAULT_SKILL_TARGET)[_0xc19caa(0x93)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x5e161d,_0x1bc109){const _0x3f9607=a64_0x466b8e;if(existsSync(_0x5e161d['skillDir'])){const _0x4c3aee=lstatSync(_0x5e161d[_0x3f9607(0x90)]);if(!_0x4c3aee[_0x3f9607(0x7e)]()||_0x4c3aee[_0x3f9607(0x80)]())throw CliErrors[_0x3f9607(0x8d)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x5e161d[_0x3f9607(0x90)]);if(!_0x1bc109)throw CliErrors[_0x3f9607(0x8d)](_0x3f9607(0x81)+_0x5e161d[_0x3f9607(0x90)],_0x3f9607(0x79));}for(const _0x5ace77 of _0x5e161d['rendered'][_0x3f9607(0x95)]){const _0x3fac51=resolve(_0x5e161d[_0x3f9607(0x90)],_0x5ace77['path']),_0x3c7892=dirname(_0x3fac51);mkdirSync(_0x3c7892,{'recursive':!![]});if(existsSync(_0x3fac51)&&lstatSync(_0x3fac51)[_0x3f9607(0x80)]())throw CliErrors[_0x3f9607(0x8d)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0x3fac51);writeFileSync(_0x3fac51,_0x5ace77[_0x3f9607(0x87)],_0x3f9607(0x77));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x132d16=a65_0x545b;(function(_0x40e90c,_0x5f47b4){const _0x18d9d6=a65_0x545b,_0x5835ec=_0x40e90c();while(!![]){try{const _0x5a248e=parseInt(_0x18d9d6(0x14e))/0x1*(-parseInt(_0x18d9d6(0x172))/0x2)+parseInt(_0x18d9d6(0x166))/0x3+parseInt(_0x18d9d6(0x174))/0x4*(-parseInt(_0x18d9d6(0x153))/0x5)+-parseInt(_0x18d9d6(0x168))/0x6+-parseInt(_0x18d9d6(0x150))/0x7*(parseInt(_0x18d9d6(0x167))/0x8)+parseInt(_0x18d9d6(0x163))/0x9*(-parseInt(_0x18d9d6(0x162))/0xa)+-parseInt(_0x18d9d6(0x155))/0xb*(-parseInt(_0x18d9d6(0x16b))/0xc);if(_0x5a248e===_0x5f47b4)break;else _0x5835ec['push'](_0x5835ec['shift']());}catch(_0x26f1c1){_0x5835ec['push'](_0x5835ec['shift']());}}}(a65_0x54cc,0x579ce));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x30e9e3){const _0xf9eb6c=a65_0x545b,_0x1ef127=_0x30e9e3['str'](_0xf9eb6c(0x15f))[_0xf9eb6c(0x16c)](),_0x26c8b0=_0x30e9e3['str']('version')[_0xf9eb6c(0x16c)](),_0x18d4e4=_0x30e9e3['str']('scope');if(!_0x1ef127||!_0x26c8b0||_0x18d4e4!==_0xf9eb6c(0x152)&&_0x18d4e4!=='company')throw CliErrors[_0xf9eb6c(0x165)](_0xf9eb6c(0x158));return{'skillCode':_0x1ef127,'version':_0x26c8b0,'scope':_0x18d4e4};}async function readDiagramWriteInput(_0x4b4e77){const _0x4a4af=a65_0x545b,_0x41003b=_0x4b4e77[_0x4a4af(0x15e)](_0x4a4af(0x177)),_0x50d6b0=_0x4b4e77[_0x4a4af(0x169)](_0x4a4af(0x156))['trim']();if(!Number[_0x4a4af(0x15b)](_0x41003b)||_0x41003b<0x0)throw CliErrors[_0x4a4af(0x165)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x4a4af(0x16f)](_0x50d6b0))throw CliErrors[_0x4a4af(0x165)](_0x4a4af(0x16e));return{'expectedDiagramRevision':_0x41003b,'sourceFingerprint':_0x50d6b0,'diagram':await readRequiredSkillDiagram(_0x4b4e77['str'](_0x4a4af(0x14c)))};}export const diagramValidateCommand={'service':a65_0x132d16(0x159),'command':'diagram-validate','description':a65_0x132d16(0x170),'risk':a65_0x132d16(0x154),'flags':WRITE_FLAGS,async 'execute'(_0x576a30){const _0x3ed1a5=a65_0x132d16,_0x269cef=readDiagramTarget(_0x576a30),_0x49fb6f=await validateRuntimeSkillVersionDiagram(_0x576a30['appCode'],_0x269cef[_0x3ed1a5(0x161)],_0x269cef[_0x3ed1a5(0x151)],_0x269cef[_0x3ed1a5(0x14f)],await readDiagramWriteInput(_0x576a30));return{'ok':!![],'data':_0x49fb6f,'message':_0x3ed1a5(0x173)+_0x269cef[_0x3ed1a5(0x161)]+'@'+_0x269cef[_0x3ed1a5(0x151)]+'.'};}};export const diagramPushCommand={'service':a65_0x132d16(0x159),'command':a65_0x132d16(0x15c),'description':'Create\x20or\x20replace\x20a\x20Mermaid\x20diagram\x20for\x20a\x20specific\x20Skill\x20version','risk':a65_0x132d16(0x176),'confirmationDescription':a65_0x132d16(0x171),'flags':WRITE_FLAGS,async 'execute'(_0x43a99a){const _0x2ea733=a65_0x132d16,_0x549755=readDiagramTarget(_0x43a99a),_0xd97898=await putRuntimeSkillVersionDiagram(_0x43a99a['appCode'],_0x549755['skillCode'],_0x549755[_0x2ea733(0x151)],_0x549755['scope'],await readDiagramWriteInput(_0x43a99a));return{'ok':!![],'data':_0xd97898,'message':_0xd97898[_0x2ea733(0x175)]==='unchanged'?'Skill\x20diagram\x20for\x20'+_0x549755[_0x2ea733(0x161)]+'@'+_0x549755[_0x2ea733(0x151)]+'\x20is\x20unchanged.':(_0xd97898[_0x2ea733(0x175)]===_0x2ea733(0x15a)?_0x2ea733(0x15d):'Updated')+'\x20Skill\x20diagram\x20for\x20'+_0x549755[_0x2ea733(0x161)]+'@'+_0x549755[_0x2ea733(0x151)]+'.'};}};function a65_0x545b(_0x34b5ff,_0x8ecea3){_0x34b5ff=_0x34b5ff-0x14c;const _0x54cc6b=a65_0x54cc();let _0x545b2c=_0x54cc6b[_0x34b5ff];return _0x545b2c;}export const diagramShowCommand={'service':'skill','command':a65_0x132d16(0x16a),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x1057f1){const _0x51575a=a65_0x132d16,_0x3821ac=readDiagramTarget(_0x1057f1),_0x2d6674=await getRuntimeSkillVersionDiagram(_0x1057f1[_0x51575a(0x14d)],_0x3821ac[_0x51575a(0x161)],_0x3821ac['version'],_0x3821ac['scope']);return{'ok':!![],'data':_0x2d6674,'message':_0x2d6674['found']?_0x51575a(0x164)+_0x3821ac[_0x51575a(0x161)]+'@'+_0x3821ac['version']+_0x51575a(0x157)+_0x2d6674[_0x51575a(0x16d)]+'.':'No\x20Skill\x20diagram\x20is\x20stored\x20for\x20'+_0x3821ac[_0x51575a(0x161)]+'@'+_0x3821ac[_0x51575a(0x151)]+_0x51575a(0x160)+_0x2d6674['expectedDiagramRevision']+'.'};}};function a65_0x54cc(){const _0x54bdb1=['str','diagram-show','16843812EoLGGF','trim','expectedDiagramRevision','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','test','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','Creates\x20or\x20replaces\x20a\x20Mermaid\x20diagram\x20for\x20an\x20exact\x20Skill\x20version.\x20The\x20write\x20is\x20rejected\x20if\x20the\x20server\x20version\x20has\x20changed.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20diagram\x20body.','18Ghudpz','Skill\x20diagram\x20validation\x20passed\x20for\x20','4waVDhF','action','write','expected-diagram-revision','diagram-file','appCode','6001XmWMtd','scope','105tVJVOv','version','personal','549805UOVZcM','read','11xthnSW','source-fingerprint',';\x20next\x20write\x20expects\x20revision\x20','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','skill','created','isInteger','diagram-push','Created','num','skill-code',';\x20first\x20write\x20expects\x20revision\x20','skillCode','676040wZucQf','18PVZXbG','Found\x20Skill\x20diagram\x20for\x20','validation','19077JfvNbp','379368MlpAwG','243930eayGkS'];a65_0x54cc=function(){return _0x54bdb1;};return a65_0x54cc();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x3bcc57=a66_0x4bcc;(function(_0x3f9cd0,_0xb520e6){const _0x436d88=a66_0x4bcc,_0x43b03a=_0x3f9cd0();while(!![]){try{const _0x55547e=parseInt(_0x436d88(0x127))/0x1+parseInt(_0x436d88(0x11c))/0x2+parseInt(_0x436d88(0x124))/0x3*(parseInt(_0x436d88(0x125))/0x4)+parseInt(_0x436d88(0x12f))/0x5*(-parseInt(_0x436d88(0x139))/0x6)+-parseInt(_0x436d88(0x121))/0x7+-parseInt(_0x436d88(0x115))/0x8*(-parseInt(_0x436d88(0x12c))/0x9)+-parseInt(_0x436d88(0x11b))/0xa;if(_0x55547e===_0xb520e6)break;else _0x43b03a['push'](_0x43b03a['shift']());}catch(_0x17841c){_0x43b03a['push'](_0x43b03a['shift']());}}}(a66_0x4541,0x6da06));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';const PACKAGE_DOWNLOAD_CONCURRENCY=0x4;export const installCommand={'service':'skill','command':a66_0x3bcc57(0x129),'description':a66_0x3bcc57(0x13a),'risk':a66_0x3bcc57(0x11a),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x4e2de4){return syncRuntimeSkills(_0x4e2de4);}};async function syncRuntimeSkills(_0x3ddc7e){const _0x213145=a66_0x3bcc57,{downloadRuntimeSkillPackage:_0x5ec88c,listRuntimeSkills:_0x141d25}=await import(_0x213145(0x12e)),{linkEffectiveRuntimeSkills:_0x4a7b1f,materializeRuntimeSkill:_0x456f96,pruneStaleRuntimeSkillCache:_0x58915a,pruneStaleRuntimeSkillLinks:_0x3ef817,resolveRuntimeSkillInstallTarget:_0x4d4d46,reuseMaterializedRuntimeSkill:_0xece330}=await import('../../../skills/runtime-skill-sync.js'),_0x178ede=_0x3ddc7e['str'](_0x213145(0x134)),_0xcf1da6=normalizeSyncScopes(_0x3ddc7e[_0x213145(0x113)](_0x213145(0x112))),_0x2b0b63=_0x3ddc7e['envName']??_0x213145(0x123),_0x56c864=_0x3ddc7e[_0x213145(0x114)],_0x208a74=_0x3ddc7e['bool']('force');if(!_0x56c864)throw CliErrors['authRequired']('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x328a99=_0x4d4d46(_0x3ddc7e[_0x213145(0x137)],_0x3ddc7e[_0x213145(0x130)](_0x213145(0x138))?_0x213145(0x138):_0x213145(0x117)),_0x168483=_0x4d4d46(_0x3ddc7e[_0x213145(0x137)],_0x328a99[_0x213145(0x112)]===_0x213145(0x138)?_0x213145(0x117):_0x213145(0x138)),_0x192407=await _0x141d25({'appCode':_0x3ddc7e[_0x213145(0x137)],'scope':_0xcf1da6[_0x213145(0x11d)]===0x1?_0xcf1da6[0x0]:_0x213145(0x119),'code':_0x178ede[_0x213145(0x12b)]()||undefined}),_0xed734c=_0xcf1da6[_0x213145(0x11e)](_0x213145(0x132))?_0x192407[_0x213145(0x132)]:[],_0x3aea3f=_0xcf1da6[_0x213145(0x11e)](_0x213145(0x118))?_0x192407[_0x213145(0x118)]:[],_0x2a4811=new Set([..._0xed734c[_0x213145(0x122)](_0x1e3643=>_0x1e3643['skillCode']?.[_0x213145(0x12b)]())[_0x213145(0x12a)](_0x9e94d8=>Boolean(_0x9e94d8)),..._0x3aea3f[_0x213145(0x122)](_0x54fb53=>_0x54fb53[_0x213145(0x135)]?.[_0x213145(0x12b)]())['filter'](_0x29d31a=>Boolean(_0x29d31a))]),_0x3199ef=_0x178ede[_0x213145(0x12b)]()?[_0x178ede[_0x213145(0x12b)]()]:undefined,_0x989952=_0xcf1da6[_0x213145(0x11d)]===0x2&&_0xcf1da6[_0x213145(0x11e)](_0x213145(0x132))&&_0xcf1da6[_0x213145(0x11e)](_0x213145(0x118)),_0x5a6328=_0x989952?_0x3ef817(_0x328a99,_0x2a4811,_0x3199ef):[],_0x3b7800=_0x58915a({'env':_0x2b0b63,'accessKey':_0x56c864,'appCode':_0x3ddc7e[_0x213145(0x137)],'activeSkillCodes':_0x2a4811,'pruneSkillCodes':_0x3199ef,'scopes':_0xcf1da6,'protectedLinkRoots':_0x168483['skillRoots']}),_0x2806af=[..._0xed734c[_0x213145(0x122)](_0x21c07d=>({'skill':_0x21c07d,'scope':_0x213145(0x132)})),..._0x3aea3f['map'](_0x59f6c8=>({'skill':_0x59f6c8,'scope':_0x213145(0x118)}))],_0x57a019=await mapConcurrent(_0x2806af,PACKAGE_DOWNLOAD_CONCURRENCY,async({skill:_0x349f36,scope:_0x362e21})=>{const _0x2e083c=_0x213145,_0x10dcfb=_0xece330(_0x349f36,_0x362e21,{'env':_0x2b0b63,'accessKey':_0x56c864,'appCode':_0x3ddc7e[_0x2e083c(0x137)]});if(_0x10dcfb)return _0x10dcfb;return _0x456f96(_0x349f36,_0x362e21,{'env':_0x2b0b63,'accessKey':_0x56c864,'appCode':_0x3ddc7e[_0x2e083c(0x137)],'force':_0x208a74,'packageBytes':await downloadSkillPackage(_0x349f36,_0x362e21,_0x3ddc7e[_0x2e083c(0x137)],_0x5ec88c)});}),_0x30162d=_0x4a7b1f(_0x57a019,_0x328a99),_0x4255b0=countLinkActions(_0x30162d);return{'ok':!![],'data':{'appCode':_0x3ddc7e[_0x213145(0x137)],..._0x328a99[_0x213145(0x112)]===_0x213145(0x138)?{'installTarget':{'scope':_0x328a99[_0x213145(0x112)],'skillRoots':[..._0x328a99[_0x213145(0x11f)]]}}:{},'personal':_0xed734c[_0x213145(0x11d)],'company':_0x3aea3f[_0x213145(0x11d)],'materialized':_0x57a019['length'],'links':{'total':_0x30162d[_0x213145(0x11d)],'created':_0x4255b0[_0x213145(0x128)]??0x0,'updated':_0x4255b0[_0x213145(0x133)]??0x0,'unchanged':_0x4255b0[_0x213145(0x120)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x5a6328['filter'](_0x2d94f5=>_0x2d94f5['action']===_0x213145(0x12d))[_0x213145(0x11d)],'cacheDirs':_0x3b7800['filter'](_0x6eb13a=>_0x6eb13a[_0x213145(0x111)]==='removed')['length'],'skipped':[..._0x5a6328,..._0x3b7800][_0x213145(0x12a)](_0x3e65fd=>_0x3e65fd[_0x213145(0x111)]==='skipped')[_0x213145(0x11d)]},'skills':{'personal':_0xed734c[_0x213145(0x122)](summarizeRuntimeSkill),'company':_0x3aea3f['map'](summarizeRuntimeSkill)}},'message':_0x213145(0x131)+_0xed734c[_0x213145(0x11d)]+'\x20personal\x20and\x20'+_0x3aea3f[_0x213145(0x11d)]+'\x20company\x20Skill(s).'};}async function mapConcurrent(_0x15319b,_0x106ba3,_0x486260){const _0x164b02=a66_0x3bcc57,_0x58f2e1=new Array(_0x15319b[_0x164b02(0x11d)]);let _0x961248=0x0;const _0x47e050=Array[_0x164b02(0x126)]({'length':Math['min'](_0x106ba3,_0x15319b['length'])},async()=>{const _0x24745f=_0x164b02;while(_0x961248<_0x15319b[_0x24745f(0x11d)]){const _0x4cee46=_0x961248;_0x961248+=0x1,_0x58f2e1[_0x4cee46]=await _0x486260(_0x15319b[_0x4cee46]);}});return await Promise[_0x164b02(0x119)](_0x47e050),_0x58f2e1;}async function downloadSkillPackage(_0xb27013,_0x240aab,_0x2c9dd0,_0xdbc23c){const _0x1e1c6d=a66_0x3bcc57,_0x27d392=_0xb27013[_0x1e1c6d(0x136)]?.[_0x1e1c6d(0x12b)]();return _0x27d392?_0xdbc23c(_0x240aab,_0xb27013['skillCode'],_0x2c9dd0,_0x27d392):_0xdbc23c(_0x240aab,_0xb27013['skillCode'],_0x2c9dd0);}function countLinkActions(_0x5e3386){const _0x51ca3=a66_0x3bcc57;return _0x5e3386[_0x51ca3(0x116)]((_0xebbd3f,_0x58a1aa)=>{const _0x8f2538=_0x51ca3;return _0xebbd3f[_0x58a1aa[_0x8f2538(0x111)]]=(_0xebbd3f[_0x58a1aa[_0x8f2538(0x111)]]??0x0)+0x1,_0xebbd3f;},{});}function a66_0x4bcc(_0x3fb261,_0x15a474){_0x3fb261=_0x3fb261-0x111;const _0x454144=a66_0x4541();let _0x4bccbd=_0x454144[_0x3fb261];return _0x4bccbd;}function a66_0x4541(){const _0x132b8a=['815044VkGtxn','from','495360NxdDZZ','created','install','filter','trim','27OhESXD','removed','../../../core/api-client.js','27585DGSzyf','bool','Installed\x20','personal','updated','code','skillCode','version','appCode','project','498vAPjqq','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','action','scope','str','accessKey','1054280sBcULk','reduce','global','company','all','read','253170qgxwNu','430010wvWecr','length','includes','skillRoots','unchanged','5493215KWXITX','map','production','9JWPDbl'];a66_0x4541=function(){return _0x132b8a;};return a66_0x4541();}
|