@lovrabet/lovrabet-cli 2.3.10-beta.2 → 2.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +1 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +4 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.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/references/lovrabet-config-commands.md +17 -33
- package/skills/lovrabet/references/lovrabet-config.md +11 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +4 -4
- package/skills/lovrabet.manifest.json +3 -3
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x4892f7=a0_0x46b3;(function(_0x4824fe,_0x211871){const _0x7e5021=a0_0x46b3,_0x37306a=_0x4824fe();while(!![]){try{const _0x512bbe=parseInt(_0x7e5021(0x12f))/0x1*(parseInt(_0x7e5021(0x133))/0x2)+-parseInt(_0x7e5021(0x11f))/0x3*(parseInt(_0x7e5021(0x12b))/0x4)+-parseInt(_0x7e5021(0x117))/0x5*(parseInt(_0x7e5021(0x10f))/0x6)+parseInt(_0x7e5021(0x11c))/0x7*(parseInt(_0x7e5021(0x111))/0x8)+parseInt(_0x7e5021(0x11e))/0x9*(parseInt(_0x7e5021(0x135))/0xa)+parseInt(_0x7e5021(0x12c))/0xb*(-parseInt(_0x7e5021(0x127))/0xc)+-parseInt(_0x7e5021(0x113))/0xd*(-parseInt(_0x7e5021(0x126))/0xe);if(_0x512bbe===_0x211871)break;else _0x37306a['push'](_0x37306a['shift']());}catch(_0x4d4edc){_0x37306a['push'](_0x37306a['shift']());}}}(a0_0x48d6,0x3ff1a));import{jsx as a0_0x466198}from'react/jsx-runtime';import a0_0x5e2495 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions,resolveRemovedCommand}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';function a0_0x48d6(){const _0x1e65f8=['Unexpected\x20error:','1038296EhMkBt','1152aDVtfz','log','error','original','103684EHtTQV','25036xgMfoB','hint','handler','218670OtBLbS','assign','exit','definition','2uvrHSR','flatMap','50UUIWxw','\x0aCancelled.\x0a','Error:\x20','corrected','[preparse]\x20','name','flags','help','exitCode','write',':\x20--','18bCVeen','message','8lyEOXu','code','130lBhJtV','catch','slice','ERR_USE_AFTER_CLOSE','402145APOsmk','args','ERR_STREAM_DESTROYED','validation','config','724052sNgcRq','cancelled','37521oAmoMZ','42qliTUW','./framework/preparse.js','input','stderr','defaultCommand','doctor'];a0_0x48d6=function(){return _0x1e65f8;};return a0_0x48d6();}import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';function a0_0x46b3(_0x5c2c09,_0x549eb1){_0x5c2c09=_0x5c2c09-0x107;const _0x48d619=a0_0x48d6();let _0x46b37a=_0x48d619[_0x5c2c09];return _0x46b37a;}const helpText=generateFullHelp(),cli=a0_0x5e2495(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x4892f7(0x114)](handleError);async function main(){try{await run();}catch(_0x3a2d4c){handleError(_0x3a2d4c);}}async function run(){const _0x331f44=a0_0x4892f7;let _0x5bebef=cli[_0x331f44(0x121)][0x0],_0x14071c=cli[_0x331f44(0x121)][0x1];const _0x1e1d3f=cli[_0x331f44(0x10a)];try{const {correctFlags:_0x156497}=await import(_0x331f44(0x120)),_0x56e583=getAllDefinitions()[_0x331f44(0x134)](_0x19a91d=>_0x19a91d['flags']??[]),{flags:_0x9e302b,corrections:_0x10f6b6}=_0x156497(_0x1e1d3f,_0x56e583);if(_0x10f6b6['length']>0x0){for(const _0xce9843 of _0x10f6b6){process[_0x331f44(0x122)][_0x331f44(0x10d)](_0x331f44(0x108)+_0xce9843[_0x331f44(0x12e)]+_0x331f44(0x10e)+_0xce9843[_0x331f44(0x12a)]+'\x20->\x20--'+_0xce9843[_0x331f44(0x107)]+'\x0a');}Object[_0x331f44(0x130)](_0x1e1d3f,_0x9e302b);}}catch{}if(!_0x5bebef){const {waitUntilExit:_0x366edb}=render(a0_0x466198(Help,{}));await _0x366edb();return;}const _0xc2f99=resolveRemovedCommand(_0x5bebef,_0x14071c);if(_0xc2f99)throw CliErrors[_0x331f44(0x11a)](_0xc2f99['message'],_0xc2f99[_0x331f44(0x12d)]);if(!isKnownService(_0x5bebef)){const _0x321136=resolveDynamicServiceCommand(cli[_0x331f44(0x121)],_0x1e1d3f);if(_0x321136){if(_0x1e1d3f['help']){console['log'](generateCommandHelp(_0x321136[_0x331f44(0x132)]));return;}Object[_0x331f44(0x130)](_0x1e1d3f,_0x321136[_0x331f44(0x10a)]);const _0x41b069=buildConfigFromFlags(_0x1e1d3f);await initGlobalEnvironment(_0x41b069);const _0x11c679=createPipelineEnv(_0x41b069,_0x1e1d3f);_0x11c679[_0x331f44(0x118)]=_0x321136[_0x331f44(0x118)],await runCommand(_0x321136[_0x331f44(0x132)],_0x11c679);return;}if(_0x1e1d3f[_0x331f44(0x10b)]){const _0x11bcd9=generateDynamicServiceHelp(_0x5bebef);if(_0x11bcd9){console[_0x331f44(0x128)](_0x11bcd9);return;}}const {waitUntilExit:_0x229da4}=render(a0_0x466198(Help,{}));await _0x229da4();return;}const _0x27f7de=getServiceEntry(_0x5bebef);if(!_0x14071c){if(_0x1e1d3f[_0x331f44(0x10b)]){console[_0x331f44(0x128)](generateServiceHelp(_0x5bebef));return;}if(_0x27f7de[_0x331f44(0x123)])_0x14071c=_0x27f7de[_0x331f44(0x123)];else{console[_0x331f44(0x128)](generateServiceHelp(_0x5bebef));return;}}const _0x306f2b=findDefinition(_0x5bebef,_0x14071c);!_0x306f2b&&(console[_0x331f44(0x128)](generateServiceHelp(_0x5bebef)),handleError(CliErrors['unknownCommand'](_0x5bebef+'\x20'+_0x14071c)));if(_0x1e1d3f[_0x331f44(0x10b)]){console[_0x331f44(0x128)](generateCommandHelp(_0x306f2b));return;}const _0x3ec838=buildConfigFromFlags(_0x1e1d3f);_0x5bebef!==_0x331f44(0x11b)&&_0x5bebef!==_0x331f44(0x124)&&await initGlobalEnvironment(_0x3ec838);const _0x5efb7d=createPipelineEnv(_0x3ec838,_0x1e1d3f);_0x5efb7d[_0x331f44(0x118)]=cli[_0x331f44(0x121)][_0x331f44(0x115)](0x2),await runCommand(_0x306f2b,_0x5efb7d);}function handleError(_0x4a6163){const _0x2db459=a0_0x4892f7;if(_0x4a6163 instanceof CliError){_0x4a6163[_0x2db459(0x112)]===_0x2db459(0x11d)&&(process[_0x2db459(0x122)]['write'](_0x2db459(0x136)),process['exit'](0x0));console[_0x2db459(0x129)](_0x2db459(0x137)+_0x4a6163[_0x2db459(0x110)]);if(_0x4a6163[_0x2db459(0x12d)])console[_0x2db459(0x129)]('Hint:\x20'+_0x4a6163[_0x2db459(0x12d)]);process['exit'](_0x4a6163[_0x2db459(0x10c)]);}isUserCancellation(_0x4a6163)&&(process[_0x2db459(0x122)]['write']('\x0aCancelled.\x0a'),process['exit'](0x0)),console[_0x2db459(0x129)](_0x2db459(0x125),_0x4a6163),process[_0x2db459(0x131)](0x1);}function isUserCancellation(_0x3d0346){const _0x3e40c1=a0_0x4892f7;if(!(_0x3d0346 instanceof Error))return![];if(_0x3d0346[_0x3e40c1(0x109)]==='ExitPromptError')return!![];if(_0x3d0346[_0x3e40c1(0x112)]===_0x3e40c1(0x116))return!![];if(_0x3d0346['code']===_0x3e40c1(0x119))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a1_0xf2dfc=a1_0x38fb;(function(_0x24e71b,_0x26e2f4){const _0x235e75=a1_0x38fb,_0x462303=_0x24e71b();while(!![]){try{const _0x2e8285=-parseInt(_0x235e75(0x1d2))/0x1+-parseInt(_0x235e75(0x18a))/0x2*(-parseInt(_0x235e75(0x187))/0x3)+-parseInt(_0x235e75(0x1b4))/0x4*(parseInt(_0x235e75(0x1e2))/0x5)+parseInt(_0x235e75(0x1a6))/0x6*(-parseInt(_0x235e75(0x186))/0x7)+parseInt(_0x235e75(0x1db))/0x8+parseInt(_0x235e75(0x195))/0x9*(-parseInt(_0x235e75(0x1e5))/0xa)+parseInt(_0x235e75(0x17d))/0xb;if(_0x2e8285===_0x26e2f4)break;else _0x462303['push'](_0x462303['shift']());}catch(_0x141215){_0x462303['push'](_0x462303['shift']());}}}(a1_0x17cc,0xc9f5d));function a1_0x17cc(){const _0x584a22=['title','Execute\x20a\x20BF\x20endpoint\x20function','/api/{appCode}/{datasetCode}/aggregate','summary','appCode','functionName','/api/runtime-bff/personal/{id}/execute','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','list','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','dataset','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','Filter\x20dataset\x20records','12HhiUnP','lovrabet\x20personal-bff\x20exec\x20--id\x20<id>\x20--params\x20\x27{}\x27','{\x22fieldName\x22:\x22value\x22}','List\x20datasets','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','/client/bff/endpoint/{appCode}/{functionName}','category','result\x20rows\x20contain\x20aggregate\x20aliases','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','string','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','Execute\x20BF\x20endpoint\x20function','1534540uepvJh','keyword','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','Exact\x20endpoint\x20function\x20name','trim','POST','Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','read','Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','Function\x20execution\x20may\x20have\x20business\x20side\x20effects;\x20inspect\x20detail\x20before\x20execution.','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','Personal\x20Backend\x20Function\x20script\x20ID,\x20for\x20example\x20123','validation','fields/properties\x20describe\x20data\x20shape','{\x22param\x22:\x22value\x22}','Get\x20BF\x20endpoint\x20function\x20contract','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','str','tableData\x20contains\x20records','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','dataset_list','Aggregate\x20dataset\x20records','Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','Get\x20one\x20dataset\x20record','method','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','None','join','1466781xOKKzX','/api/dataset/get-dataset-list-by-app-code','32-character\x20dataset\x20code','includes','GET','relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned','length','##\x20Dataset\x20detail','Execute\x20Personal\x20Backend\x20Function','4469288ymADHu','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','api-doc','Returns\x20script\x20business\x20payload','List\x20datasets\x20with\x20pagination','Current\x20app\x20code','5RrdmnU','##\x20Filter\x20dataset\x20data','custom_sql','1130zvDLls','Create\x20dataset\x20record','Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','dataset_detail','/api/endpoint/{appCode}/{functionName}','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','code','Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','##\x20List\x20datasets','dataset_data_get_one','paging\x20contains\x20pagination','/api/{appCode}/{datasetCode}/filter','dataset_data_aggregate','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','filter','Create\x20a\x20dataset\x20record','toLowerCase','{\x22id\x22:123}','Use\x20when\x20the\x20target\x20Personal\x20BFF\x20script\x20id\x20is\x20confirmed\x20under\x20the\x20current\x20user\x20and\x20you\x20need\x20to\x20execute\x20that\x20personal\x20script\x20with\x20optional\x20JSON\x20params','custom_sql_execute','path','List\x20available\x20runtime\x20API\x20documentation\x20entries','Endpoint\x20function\x20name','45547898eHGaFK','Execute\x20custom\x20SQL','/api/dataset/getOneByCode?code={datasetCode}','Personal\x20BFF\x20scripts\x20are\x20user-owned\x20and\x20scoped\x20per\x20app.','personal_bf_execute','dataset_data_filter','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','/api/{appCode}/{datasetCode}/create','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','5748785YkrnkG','71871JidkAA','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','Filter\x20dataset\x20data','8NXVCGo','where\x20filters\x20before\x20aggregation','API\x20doc\x20code\x20not\x20found:\x20','/api/{appCode}/{datasetCode}/getOne','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Show\x20runtime\x20API\x20documentation\x20by\x20code','find','Aggregate\x20dataset\x20data','Get\x20dataset\x20detail','datasetCode','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','37836QSAATJ','##\x20Execute\x20Personal\x20Backend\x20Function','Execute\x20a\x20Personal\x20Backend\x20Function\x20by\x20script\x20ID'];a1_0x17cc=function(){return _0x584a22;};return a1_0x17cc();}function a1_0x38fb(_0x303dbc,_0x2f14e2){_0x303dbc=_0x303dbc-0x16b;const _0x17cc6a=a1_0x17cc();let _0x38fb3b=_0x17cc6a[_0x303dbc];return _0x38fb3b;}import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':'category','type':a1_0xf2dfc(0x1b0),'description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0xf2dfc(0x1b5),'type':a1_0xf2dfc(0x1b0),'description':a1_0xf2dfc(0x194)},DOC_CODE_FLAG={'name':'code','type':a1_0xf2dfc(0x1b0),'required':!![],'description':'API\x20doc\x20code,\x20for\x20example\x20dataset_list'},DOCS=[{'code':a1_0xf2dfc(0x1ca),'category':a1_0xf2dfc(0x1a2),'title':a1_0xf2dfc(0x1a9),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x1d3),'summary':a1_0xf2dfc(0x1e0),'whenToUse':a1_0xf2dfc(0x16c),'pathParams':[],'queryParams':[],'bodySchema':a1_0xf2dfc(0x1b6),'responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name','paging.totalCount\x20gives\x20total\x20rows'],'examples':[a1_0xf2dfc(0x173)],'notes':[a1_0xf2dfc(0x1c8)],'markdown':[a1_0xf2dfc(0x16e),'',a1_0xf2dfc(0x185)]['join']('\x0a')},{'code':a1_0xf2dfc(0x1e8),'category':a1_0xf2dfc(0x1a2),'title':'Dataset\x20detail','method':a1_0xf2dfc(0x1d6),'path':a1_0xf2dfc(0x17f),'summary':a1_0xf2dfc(0x192),'whenToUse':'Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','pathParams':[],'queryParams':[{'name':a1_0xf2dfc(0x16b),'description':a1_0xf2dfc(0x1d4)}],'bodySchema':a1_0xf2dfc(0x1d0),'responseHighlights':[a1_0xf2dfc(0x1c2),a1_0xf2dfc(0x1d7),'operations\x20describes\x20runtime\x20APIs'],'examples':[a1_0xf2dfc(0x16d)],'notes':[a1_0xf2dfc(0x1dd)],'markdown':[a1_0xf2dfc(0x1d9),'',a1_0xf2dfc(0x18e)]['join']('\x0a')},{'code':a1_0xf2dfc(0x182),'category':a1_0xf2dfc(0x1a2),'title':a1_0xf2dfc(0x189),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x171),'summary':a1_0xf2dfc(0x1a5),'whenToUse':'Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','pathParams':[{'name':'appCode','description':a1_0xf2dfc(0x1e1)},{'name':'datasetCode','description':a1_0xf2dfc(0x1d4)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':[a1_0xf2dfc(0x1c7),a1_0xf2dfc(0x170)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27',a1_0xf2dfc(0x1af)],'notes':['where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.',a1_0xf2dfc(0x1ea),'Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.',a1_0xf2dfc(0x1b2)],'markdown':[a1_0xf2dfc(0x1e3),'',a1_0xf2dfc(0x19f)]['join']('\x0a')},{'code':a1_0xf2dfc(0x172),'category':a1_0xf2dfc(0x1a2),'title':a1_0xf2dfc(0x191),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x19a),'summary':a1_0xf2dfc(0x1cb),'whenToUse':a1_0xf2dfc(0x1bc),'pathParams':[{'name':a1_0xf2dfc(0x19c),'description':a1_0xf2dfc(0x1e1)},{'name':a1_0xf2dfc(0x193),'description':a1_0xf2dfc(0x1d4)}],'queryParams':[],'bodySchema':a1_0xf2dfc(0x1b1),'responseHighlights':[a1_0xf2dfc(0x1ae),a1_0xf2dfc(0x18b)],'examples':['lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27'],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'],'markdown':['##\x20Aggregate\x20dataset\x20data','','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.']['join']('\x0a')},{'code':a1_0xf2dfc(0x16f),'category':a1_0xf2dfc(0x1a2),'title':a1_0xf2dfc(0x1cd),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x18d),'summary':'Get\x20one\x20dataset\x20record','whenToUse':a1_0xf2dfc(0x1e7),'pathParams':[{'name':a1_0xf2dfc(0x19c),'description':a1_0xf2dfc(0x1e1)},{'name':a1_0xf2dfc(0x193),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0xf2dfc(0x177),'responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':[a1_0xf2dfc(0x1c9)],'notes':[a1_0xf2dfc(0x1bf)],'markdown':a1_0xf2dfc(0x1a4)},{'code':'dataset_data_create','category':a1_0xf2dfc(0x1a2),'title':a1_0xf2dfc(0x1e6),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x184),'summary':a1_0xf2dfc(0x175),'whenToUse':a1_0xf2dfc(0x1ba),'pathParams':[{'name':a1_0xf2dfc(0x19c),'description':a1_0xf2dfc(0x1e1)},{'name':a1_0xf2dfc(0x193),'description':a1_0xf2dfc(0x1d4)}],'queryParams':[],'bodySchema':a1_0xf2dfc(0x1a8),'responseHighlights':[a1_0xf2dfc(0x1aa)],'examples':['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27'],'notes':[a1_0xf2dfc(0x183)],'markdown':a1_0xf2dfc(0x1cf)},{'code':'bf_detail','category':'bf','title':a1_0xf2dfc(0x1c4),'method':'GET','path':a1_0xf2dfc(0x1ac),'summary':a1_0xf2dfc(0x1cc),'whenToUse':'Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','pathParams':[{'name':a1_0xf2dfc(0x19c),'description':a1_0xf2dfc(0x1e1)},{'name':a1_0xf2dfc(0x19d),'description':a1_0xf2dfc(0x1b7)}],'queryParams':[],'bodySchema':a1_0xf2dfc(0x1d0),'responseHighlights':['CLI\x20returns\x20appCode/functionName/description/version/gmtModified'],'examples':[a1_0xf2dfc(0x1a1)],'notes':['This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.'],'markdown':'##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.'},{'code':'bf_execute','category':'bf','title':a1_0xf2dfc(0x1b3),'method':'POST','path':a1_0xf2dfc(0x1e9),'summary':a1_0xf2dfc(0x199),'whenToUse':a1_0xf2dfc(0x1ab),'pathParams':[{'name':a1_0xf2dfc(0x19c),'description':a1_0xf2dfc(0x1e1)},{'name':'functionName','description':a1_0xf2dfc(0x17c)}],'queryParams':[],'bodySchema':a1_0xf2dfc(0x1c3),'responseHighlights':[a1_0xf2dfc(0x1df)],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':[a1_0xf2dfc(0x1be)],'markdown':a1_0xf2dfc(0x1dc)},{'code':a1_0xf2dfc(0x181),'category':'bf','title':a1_0xf2dfc(0x1da),'method':a1_0xf2dfc(0x1b9),'path':a1_0xf2dfc(0x19e),'summary':a1_0xf2dfc(0x197),'whenToUse':a1_0xf2dfc(0x178),'pathParams':[{'name':'id','description':a1_0xf2dfc(0x1c0)}],'queryParams':[{'name':'appCode','description':a1_0xf2dfc(0x1e1)}],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0xf2dfc(0x1a7)],'notes':[a1_0xf2dfc(0x180),a1_0xf2dfc(0x1bd)],'markdown':[a1_0xf2dfc(0x196),'','Execute\x20a\x20known\x20Personal\x20Backend\x20Function\x20script\x20through\x20its\x20runtime\x20execute\x20endpoint.']['join']('\x0a')},{'code':a1_0xf2dfc(0x179),'category':a1_0xf2dfc(0x1e4),'title':a1_0xf2dfc(0x17e),'method':a1_0xf2dfc(0x1b9),'path':'/api/custom/executeSql','summary':a1_0xf2dfc(0x17e),'whenToUse':'Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0xf2dfc(0x188)],'notes':[a1_0xf2dfc(0x1c5)],'markdown':a1_0xf2dfc(0x1a3)}];function entrySummary(_0x1f6490){const _0x2e335f=a1_0xf2dfc;return{'code':_0x1f6490['code'],'category':_0x1f6490[_0x2e335f(0x1ad)],'method':_0x1f6490[_0x2e335f(0x1ce)],'path':_0x1f6490[_0x2e335f(0x17a)],'summary':_0x1f6490[_0x2e335f(0x19b)],'whenToUse':_0x1f6490['whenToUse']};}export function listApiDocEntries(_0x2ee733={}){const _0x26fb64=a1_0xf2dfc,_0x12b6d5=String(_0x2ee733[_0x26fb64(0x1ad)]||'')[_0x26fb64(0x1b8)](),_0x27acf8=String(_0x2ee733[_0x26fb64(0x1b5)]||'')[_0x26fb64(0x1b8)]()[_0x26fb64(0x176)]();return DOCS[_0x26fb64(0x174)](_0x35812c=>{const _0x1cad8b=_0x26fb64;if(_0x12b6d5&&_0x35812c[_0x1cad8b(0x1ad)]!==_0x12b6d5)return![];if(!_0x27acf8)return!![];return[_0x35812c[_0x1cad8b(0x16b)],_0x35812c[_0x1cad8b(0x1ad)],_0x35812c['method'],_0x35812c[_0x1cad8b(0x17a)],_0x35812c[_0x1cad8b(0x19b)],_0x35812c['whenToUse'],_0x35812c[_0x1cad8b(0x198)]][_0x1cad8b(0x1d1)]('\x20')[_0x1cad8b(0x176)]()[_0x1cad8b(0x1d5)](_0x27acf8);})['map'](entrySummary);}export function getApiDocDetail(_0x363bcd){const _0x41f720=a1_0xf2dfc,_0x2a95b0=DOCS[_0x41f720(0x190)](_0xdc470f=>_0xdc470f['code']===_0x363bcd);if(!_0x2a95b0)throw CliErrors[_0x41f720(0x1c1)](_0x41f720(0x18c)+_0x363bcd);return{..._0x2a95b0};}const apiDocList={'service':'api-doc','command':a1_0xf2dfc(0x1a0),'description':a1_0xf2dfc(0x17b),'risk':a1_0xf2dfc(0x1bb),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x442bdf){const _0x5307c3=a1_0xf2dfc,_0x55cc39=listApiDocEntries({'category':_0x442bdf[_0x5307c3(0x1c6)](_0x5307c3(0x1ad)),'keyword':_0x442bdf['str'](_0x5307c3(0x1b5))});return{'ok':!![],'data':{'total':_0x55cc39[_0x5307c3(0x1d8)],'items':_0x55cc39}};}},apiDocDetail={'service':a1_0xf2dfc(0x1de),'command':'detail','description':a1_0xf2dfc(0x18f),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x2da928){const _0x11d108=a1_0xf2dfc;return{'ok':!![],'data':getApiDocDetail(_0x2da928[_0x11d108(0x1c6)](_0x11d108(0x16b)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
1
|
+
const a1_0x2b90c2=a1_0x41a7;function a1_0x41a7(_0x1ec7a4,_0x55923d){_0x1ec7a4=_0x1ec7a4-0x1a8;const _0x552a51=a1_0x552a();let _0x41a7a9=_0x552a51[_0x1ec7a4];return _0x41a7a9;}(function(_0x3311d0,_0x413209){const _0x361be7=a1_0x41a7,_0x37d189=_0x3311d0();while(!![]){try{const _0x20cb82=-parseInt(_0x361be7(0x1c7))/0x1*(parseInt(_0x361be7(0x1bf))/0x2)+-parseInt(_0x361be7(0x229))/0x3*(-parseInt(_0x361be7(0x1fb))/0x4)+parseInt(_0x361be7(0x1e4))/0x5*(parseInt(_0x361be7(0x1d4))/0x6)+parseInt(_0x361be7(0x1ee))/0x7*(parseInt(_0x361be7(0x20d))/0x8)+parseInt(_0x361be7(0x1ac))/0x9+-parseInt(_0x361be7(0x1f5))/0xa*(-parseInt(_0x361be7(0x1af))/0xb)+-parseInt(_0x361be7(0x22e))/0xc;if(_0x20cb82===_0x413209)break;else _0x37d189['push'](_0x37d189['shift']());}catch(_0x3ac9bc){_0x37d189['push'](_0x37d189['shift']());}}}(a1_0x552a,0xb5090));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x2b90c2(0x1d6),'type':'string','description':a1_0x2b90c2(0x1e0)},KEYWORD_FLAG={'name':a1_0x2b90c2(0x1bc),'type':a1_0x2b90c2(0x1d1),'description':a1_0x2b90c2(0x21f)},DOC_CODE_FLAG={'name':'code','type':a1_0x2b90c2(0x1d1),'required':!![],'description':a1_0x2b90c2(0x1eb)},DOCS=[{'code':'dataset_list','category':a1_0x2b90c2(0x220),'title':a1_0x2b90c2(0x1e5),'method':'POST','path':a1_0x2b90c2(0x210),'summary':a1_0x2b90c2(0x207),'whenToUse':a1_0x2b90c2(0x1bd),'pathParams':[],'queryParams':[],'bodySchema':a1_0x2b90c2(0x212),'responseHighlights':[a1_0x2b90c2(0x201),'paging.totalCount\x20gives\x20total\x20rows'],'examples':[a1_0x2b90c2(0x1e3)],'notes':[a1_0x2b90c2(0x20e)],'markdown':[a1_0x2b90c2(0x1c6),'',a1_0x2b90c2(0x22a)][a1_0x2b90c2(0x1cc)]('\x0a')},{'code':a1_0x2b90c2(0x1c2),'category':'dataset','title':a1_0x2b90c2(0x218),'method':a1_0x2b90c2(0x1f6),'path':a1_0x2b90c2(0x1c3),'summary':'Get\x20dataset\x20detail','whenToUse':a1_0x2b90c2(0x1e2),'pathParams':[],'queryParams':[{'name':'code','description':'32-character\x20dataset\x20code'}],'bodySchema':a1_0x2b90c2(0x21a),'responseHighlights':[a1_0x2b90c2(0x225),'relations\x20contains\x20the\x20object-shaped\x20API\x20relations\x20value\x20when\x20returned',a1_0x2b90c2(0x223)],'examples':[a1_0x2b90c2(0x1c4)],'notes':[a1_0x2b90c2(0x1dc)],'markdown':[a1_0x2b90c2(0x20b),'','Inspect\x20field\x20names,\x20relations,\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x2b90c2(0x1cc)]('\x0a')},{'code':a1_0x2b90c2(0x1cd),'category':a1_0x2b90c2(0x220),'title':a1_0x2b90c2(0x1d5),'method':a1_0x2b90c2(0x224),'path':a1_0x2b90c2(0x1a8),'summary':a1_0x2b90c2(0x1fc),'whenToUse':a1_0x2b90c2(0x228),'pathParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)},{'name':a1_0x2b90c2(0x20a),'description':a1_0x2b90c2(0x1b2)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':[a1_0x2b90c2(0x1db),a1_0x2b90c2(0x1cb)],'examples':[a1_0x2b90c2(0x1c0),a1_0x2b90c2(0x1f8)],'notes':[a1_0x2b90c2(0x204),a1_0x2b90c2(0x1f1),a1_0x2b90c2(0x1b3),a1_0x2b90c2(0x200)],'markdown':[a1_0x2b90c2(0x1ba),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.'][a1_0x2b90c2(0x1cc)]('\x0a')},{'code':a1_0x2b90c2(0x211),'category':a1_0x2b90c2(0x220),'title':a1_0x2b90c2(0x1ae),'method':a1_0x2b90c2(0x224),'path':a1_0x2b90c2(0x1da),'summary':a1_0x2b90c2(0x1aa),'whenToUse':'Use\x20when\x20you\x20need\x20groupBy\x20plus\x20count,\x20sum,\x20avg,\x20max,\x20or\x20min\x20aggregates','pathParams':[{'name':a1_0x2b90c2(0x221),'description':'Current\x20app\x20code'},{'name':a1_0x2b90c2(0x20a),'description':a1_0x2b90c2(0x1b2)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x2b90c2(0x1b5),a1_0x2b90c2(0x1e8)],'examples':[a1_0x2b90c2(0x213)],'notes':[a1_0x2b90c2(0x1fa),'`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'],'markdown':[a1_0x2b90c2(0x1ff),'',a1_0x2b90c2(0x1fe)][a1_0x2b90c2(0x1cc)]('\x0a')},{'code':a1_0x2b90c2(0x22c),'category':a1_0x2b90c2(0x220),'title':a1_0x2b90c2(0x1f9),'method':a1_0x2b90c2(0x224),'path':a1_0x2b90c2(0x1c8),'summary':'Get\x20one\x20dataset\x20record','whenToUse':a1_0x2b90c2(0x1fd),'pathParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)},{'name':a1_0x2b90c2(0x20a),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x2b90c2(0x1c5),'responseHighlights':[a1_0x2b90c2(0x21d)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':['Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.'],'markdown':a1_0x2b90c2(0x202)},{'code':a1_0x2b90c2(0x1e9),'category':a1_0x2b90c2(0x220),'title':'Create\x20dataset\x20record','method':'POST','path':a1_0x2b90c2(0x1c9),'summary':a1_0x2b90c2(0x1d7),'whenToUse':a1_0x2b90c2(0x226),'pathParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)},{'name':'datasetCode','description':a1_0x2b90c2(0x1b2)}],'queryParams':[],'bodySchema':a1_0x2b90c2(0x208),'responseHighlights':[a1_0x2b90c2(0x21e)],'examples':[a1_0x2b90c2(0x1d8)],'notes':[a1_0x2b90c2(0x22b)],'markdown':'##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.'},{'code':'bf_detail','category':'bf','title':a1_0x2b90c2(0x22d),'method':a1_0x2b90c2(0x1f6),'path':a1_0x2b90c2(0x1ab),'summary':a1_0x2b90c2(0x1d3),'whenToUse':a1_0x2b90c2(0x209),'pathParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)},{'name':a1_0x2b90c2(0x1f7),'description':a1_0x2b90c2(0x1f2)}],'queryParams':[],'bodySchema':a1_0x2b90c2(0x21a),'responseHighlights':[a1_0x2b90c2(0x203)],'examples':[a1_0x2b90c2(0x206)],'notes':[a1_0x2b90c2(0x1f4)],'markdown':a1_0x2b90c2(0x205)},{'code':a1_0x2b90c2(0x20f),'category':'bf','title':'Execute\x20BF\x20endpoint\x20function','method':a1_0x2b90c2(0x224),'path':a1_0x2b90c2(0x1b7),'summary':a1_0x2b90c2(0x1d9),'whenToUse':a1_0x2b90c2(0x1a9),'pathParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)},{'name':a1_0x2b90c2(0x1f7),'description':a1_0x2b90c2(0x1d2)}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x2b90c2(0x1bb)],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':[a1_0x2b90c2(0x1e6)],'markdown':a1_0x2b90c2(0x1b1)},{'code':a1_0x2b90c2(0x21b),'category':'bf','title':'Execute\x20Personal\x20Backend\x20Function','method':a1_0x2b90c2(0x224),'path':a1_0x2b90c2(0x1be),'summary':a1_0x2b90c2(0x227),'whenToUse':a1_0x2b90c2(0x1b4),'pathParams':[{'name':'id','description':'Personal\x20Backend\x20Function\x20script\x20ID,\x20for\x20example\x20123'}],'queryParams':[{'name':a1_0x2b90c2(0x221),'description':a1_0x2b90c2(0x214)}],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x2b90c2(0x1bb)],'examples':['lovrabet\x20personal-bff\x20exec\x20--id\x20<id>\x20--params\x20\x27{}\x27'],'notes':[a1_0x2b90c2(0x1b6),'Function\x20execution\x20may\x20have\x20business\x20side\x20effects;\x20inspect\x20detail\x20before\x20execution.'],'markdown':[a1_0x2b90c2(0x1e1),'',a1_0x2b90c2(0x1ea)][a1_0x2b90c2(0x1cc)]('\x0a')},{'code':a1_0x2b90c2(0x1de),'category':'custom_sql','title':a1_0x2b90c2(0x1e7),'method':'POST','path':a1_0x2b90c2(0x1ad),'summary':'Execute\x20custom\x20SQL','whenToUse':a1_0x2b90c2(0x1b0),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x2b90c2(0x1c1)],'examples':['lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27'],'notes':[a1_0x2b90c2(0x222)],'markdown':a1_0x2b90c2(0x1f0)}];function a1_0x552a(){const _0x14bd3f=['Returns\x20script\x20business\x20payload','keyword','Use\x20when\x20you\x20need\x20a\x20paginated\x20runtime\x20dataset\x20list\x20by\x20appCode\x20and\x20want\x20to\x20collect\x20available\x20datasetCode\x20values','/api/runtime-bff/personal/{id}/execute','135486DfHkew','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','Returns\x20SQL\x20execution\x20payload','dataset_detail','/api/dataset/getOneByCode?code={datasetCode}','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','{\x22id\x22:123}','##\x20List\x20datasets','11wxFKIu','/api/{appCode}/{datasetCode}/getOne','/api/{appCode}/{datasetCode}/create','summary','paging\x20contains\x20pagination','join','dataset_data_filter','title','toLowerCase','str','string','Endpoint\x20function\x20name','Get\x20a\x20BF\x20endpoint\x20contract\x20by\x20app\x20and\x20function\x20name','3256626BAIgtB','Filter\x20dataset\x20data','category','Create\x20a\x20dataset\x20record','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','Execute\x20a\x20BF\x20endpoint\x20function','/api/{appCode}/{datasetCode}/aggregate','tableData\x20contains\x20records','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','whenToUse','custom_sql_execute','detail','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','##\x20Execute\x20Personal\x20Backend\x20Function','Use\x20when\x20you\x20need\x20fields,\x20table\x20info,\x20relations,\x20or\x20operation\x20definitions\x20for\x20a\x20dataset\x20code','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','5RqABoD','List\x20datasets','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Execute\x20custom\x20SQL','where\x20filters\x20before\x20aggregation','dataset_data_create','Execute\x20a\x20known\x20Personal\x20Backend\x20Function\x20script\x20through\x20its\x20runtime\x20execute\x20endpoint.','API\x20doc\x20code,\x20for\x20example\x20dataset_list','filter','includes','6118geGaAl','validation','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','For\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged\x20and\x20increment\x20only\x20currentPage,\x20which\x20starts\x20at\x201.','Exact\x20endpoint\x20function\x20name','API\x20doc\x20code\x20not\x20found:\x20','This\x20is\x20an\x20exact\x20lookup\x20by\x20appCode\x20+\x20functionName.\x20The\x20CLI\x20does\x20not\x20enumerate\x20Backend\x20Function\x20definitions\x20or\x20expose\x20platform-only\x20fields.','140RGmFrD','GET','functionName','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','Get\x20one\x20dataset\x20record','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','4YXvKZf','Filter\x20dataset\x20records','Use\x20when\x20you\x20already\x20know\x20the\x20record\x20id\x20and\x20need\x20one\x20business\x20row\x20from\x20a\x20dataset','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','##\x20Aggregate\x20dataset\x20data','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','tableData\x20contains\x20dataset\x20id/code/name','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','CLI\x20returns\x20appCode/functionName/description/version/gmtModified','where,\x20select,\x20orderBy,\x20currentPage,\x20and\x20pageSize\x20belong\x20inside\x20one\x20--params\x20JSON\x20object;\x20they\x20are\x20not\x20standalone\x20CLI\x20flags.','##\x20Get\x20BF\x20endpoint\x20function\x20contract\x0a\x0aInspect\x20one\x20known\x20endpoint\x20function\x20through\x20the\x20AK-authenticated\x20exact\x20detail\x20API.','lovrabet\x20bff\x20detail\x20--name\x20<functionName>','List\x20datasets\x20with\x20pagination','{\x22fieldName\x22:\x22value\x22}','Use\x20when\x20the\x20function\x20name\x20is\x20already\x20confirmed\x20and\x20you\x20need\x20that\x20ENDPOINT\x27s\x20runtime\x20metadata','datasetCode','##\x20Dataset\x20detail','Show\x20runtime\x20API\x20documentation\x20by\x20code','13304nbsAKl','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','bf_execute','/api/dataset/get-dataset-list-by-app-code','dataset_data_aggregate','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','Current\x20app\x20code','path','method','trim','Dataset\x20detail','api-doc','None','personal_bf_execute','list','Returns\x20one\x20matching\x20business\x20record','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','dataset','appCode','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','operations\x20describes\x20runtime\x20APIs','POST','fields/properties\x20describe\x20data\x20shape','Use\x20when\x20you\x20need\x20to\x20insert\x20one\x20business\x20record\x20into\x20a\x20dataset','Execute\x20a\x20Personal\x20Backend\x20Function\x20by\x20script\x20ID','Use\x20when\x20you\x20need\x20to\x20read\x20business\x20data\x20with\x20where,\x20orderBy,\x20pagination,\x20or\x20similar\x20filters','3146331pQzxfD','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','dataset_data_get_one','Get\x20BF\x20endpoint\x20function\x20contract','36852828PKvhCk','/api/{appCode}/{datasetCode}/filter','Use\x20when\x20the\x20target\x20BF\x20functionName\x20is\x20confirmed\x20and\x20you\x20need\x20to\x20call\x20that\x20ENDPOINT','Aggregate\x20dataset\x20records','/client/bff/endpoint/{appCode}/{functionName}','3372228UfXtws','/api/custom/executeSql','Aggregate\x20dataset\x20data','894190CWtwHW','Use\x20when\x20the\x20target\x20sqlCode\x20exists\x20and\x20you\x20need\x20to\x20execute\x20that\x20custom\x20SQL','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','32-character\x20dataset\x20code','Verify\x20tableData\x20and\x20paging\x20before\x20treating\x20the\x20response\x20as\x20a\x20business\x20fact.','Use\x20when\x20the\x20target\x20Personal\x20BFF\x20script\x20id\x20is\x20confirmed\x20under\x20the\x20current\x20user\x20and\x20you\x20need\x20to\x20execute\x20that\x20personal\x20script\x20with\x20optional\x20JSON\x20params','result\x20rows\x20contain\x20aggregate\x20aliases','Personal\x20BFF\x20scripts\x20are\x20user-owned\x20and\x20scoped\x20per\x20app.','/api/endpoint/{appCode}/{functionName}','code','read','##\x20Filter\x20dataset\x20data'];a1_0x552a=function(){return _0x14bd3f;};return a1_0x552a();}function entrySummary(_0x5f4601){const _0x1ebc2d=a1_0x2b90c2;return{'code':_0x5f4601[_0x1ebc2d(0x1b8)],'category':_0x5f4601[_0x1ebc2d(0x1d6)],'method':_0x5f4601[_0x1ebc2d(0x216)],'path':_0x5f4601[_0x1ebc2d(0x215)],'summary':_0x5f4601[_0x1ebc2d(0x1ca)],'whenToUse':_0x5f4601[_0x1ebc2d(0x1dd)]};}export function listApiDocEntries(_0x1cfecc={}){const _0x257a52=a1_0x2b90c2,_0x23b5c7=String(_0x1cfecc[_0x257a52(0x1d6)]||'')[_0x257a52(0x217)](),_0x1b2d56=String(_0x1cfecc[_0x257a52(0x1bc)]||'')[_0x257a52(0x217)]()[_0x257a52(0x1cf)]();return DOCS[_0x257a52(0x1ec)](_0x2b27f3=>{const _0xae6841=_0x257a52;if(_0x23b5c7&&_0x2b27f3[_0xae6841(0x1d6)]!==_0x23b5c7)return![];if(!_0x1b2d56)return!![];return[_0x2b27f3[_0xae6841(0x1b8)],_0x2b27f3[_0xae6841(0x1d6)],_0x2b27f3[_0xae6841(0x216)],_0x2b27f3[_0xae6841(0x215)],_0x2b27f3[_0xae6841(0x1ca)],_0x2b27f3[_0xae6841(0x1dd)],_0x2b27f3[_0xae6841(0x1ce)]][_0xae6841(0x1cc)]('\x20')[_0xae6841(0x1cf)]()[_0xae6841(0x1ed)](_0x1b2d56);})['map'](entrySummary);}export function getApiDocDetail(_0x51739a){const _0x8c5cb8=a1_0x2b90c2,_0x45e935=DOCS['find'](_0x193aea=>_0x193aea[_0x8c5cb8(0x1b8)]===_0x51739a);if(!_0x45e935)throw CliErrors[_0x8c5cb8(0x1ef)](_0x8c5cb8(0x1f3)+_0x51739a);return{..._0x45e935};}const apiDocList={'service':a1_0x2b90c2(0x219),'command':a1_0x2b90c2(0x21c),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':a1_0x2b90c2(0x1b9),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x3a5ebf){const _0x545d3d=a1_0x2b90c2,_0x30d138=listApiDocEntries({'category':_0x3a5ebf[_0x545d3d(0x1d0)](_0x545d3d(0x1d6)),'keyword':_0x3a5ebf['str'](_0x545d3d(0x1bc))});return{'ok':!![],'data':{'total':_0x30d138['length'],'items':_0x30d138}};}},apiDocDetail={'service':'api-doc','command':a1_0x2b90c2(0x1df),'description':a1_0x2b90c2(0x20c),'risk':a1_0x2b90c2(0x1b9),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x8e358a){const _0x2a4f0c=a1_0x2b90c2;return{'ok':!![],'data':getApiDocDetail(_0x8e358a[_0x2a4f0c(0x1d0)](_0x2a4f0c(0x1b8)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5cf855,_0x7aaea2){const _0x1e19ec=a2_0x482e,_0x3cfaeb=_0x5cf855();while(!![]){try{const _0x96dd86=-parseInt(_0x1e19ec(0xe4))/0x1*(-parseInt(_0x1e19ec(0xf6))/0x2)+-parseInt(_0x1e19ec(0xf3))/0x3*(parseInt(_0x1e19ec(0xf0))/0x4)+parseInt(_0x1e19ec(0xea))/0x5+-parseInt(_0x1e19ec(0xf5))/0x6+-parseInt(_0x1e19ec(0xde))/0x7+parseInt(_0x1e19ec(0xe7))/0x8+parseInt(_0x1e19ec(0xf7))/0x9*(-parseInt(_0x1e19ec(0xe8))/0xa);if(_0x96dd86===_0x7aaea2)break;else _0x3cfaeb['push'](_0x3cfaeb['shift']());}catch(_0x2f7cd0){_0x3cfaeb['push'](_0x3cfaeb['shift']());}}}(a2_0x116e,0x75cca));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{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function a2_0x116e(){const _0x10750d=['2666503oWlidR','slice','cache','utf8','homeDirName','stringify','3aWXBfV','items','parse','6910912nYGfmQ','80GudkYS','find','3782615IAMerA','ak_','trim','update','digest','appCode','52AFLpxS','EXDEV','code','10527HtHIDi','hex','5093484eMmHRE','117986wUjGdg','44325mmsGwL'];a2_0x116e=function(){return _0x10750d;};return a2_0x116e();}export function fingerprintAccessKey(_0x1b3235){const _0x1f64f2=a2_0x482e,_0x1ee1e=_0x1b3235[_0x1f64f2(0xec)](),_0x24a42a=_0x1ee1e[_0x1f64f2(0xdf)](-0x6)||'unknown',_0x347f8f=createHash('sha256')[_0x1f64f2(0xed)](_0x1ee1e)[_0x1f64f2(0xee)](_0x1f64f2(0xf4))['slice'](0x0,0xc);return _0x1f64f2(0xeb)+_0x24a42a+'_'+_0x347f8f;}export function getAppCacheFilePath(_0x45d8f8,_0x2d83ce){const _0x45a03b=a2_0x482e;return resolve(homedir(),PRODUCT_CONFIG[_0x45a03b(0xe2)],_0x45a03b(0xe0),_0x45d8f8,fingerprintAccessKey(_0x2d83ce),'my-apps.json');}export function readCachedAppList(_0x2f5895,_0x11c1bc){const _0x48a620=a2_0x482e;if(!_0x11c1bc?.[_0x48a620(0xec)]())return null;const _0x329283=getAppCacheFilePath(_0x2f5895,_0x11c1bc);if(!existsSync(_0x329283))return null;try{const _0x58f035=readFileSync(_0x329283,_0x48a620(0xe1));if(!_0x58f035['trim']())return null;const _0xcd0783=JSON[_0x48a620(0xe6)](_0x58f035);if(!Array['isArray'](_0xcd0783[_0x48a620(0xe5)]))return null;return _0xcd0783;}catch{return null;}}export function writeCachedAppList(_0xc174ea,_0x4605a1,_0x485682){const _0x3ddaf4=a2_0x482e,_0x3b8675=getAppCacheFilePath(_0xc174ea,_0x4605a1),_0x2fd67a=dirname(_0x3b8675);!existsSync(_0x2fd67a)&&mkdirSync(_0x2fd67a,{'recursive':!![]});const _0xf0aa17=_0x3b8675+'.tmp';try{writeFileSync(_0xf0aa17,JSON['stringify'](_0x485682,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0xf0aa17,_0x3b8675);}catch(_0x5cfac6){if(_0x5cfac6['code']==='EPERM'||_0x5cfac6[_0x3ddaf4(0xf2)]===_0x3ddaf4(0xf1)||_0x5cfac6[_0x3ddaf4(0xf2)]==='EACCES'){writeFileSync(_0x3b8675,JSON[_0x3ddaf4(0xe3)](_0x485682,null,0x2)+'\x0a',{'encoding':_0x3ddaf4(0xe1)});try{unlinkSync(_0xf0aa17);}catch{}}else throw _0x5cfac6;}}catch(_0x1eec86){try{unlinkSync(_0xf0aa17);}catch{}throw _0x1eec86;}return _0x3b8675;}function a2_0x482e(_0x389e21,_0x3ad78b){_0x389e21=_0x389e21-0xde;const _0x116e11=a2_0x116e();let _0x482ec2=_0x116e11[_0x389e21];return _0x482ec2;}export function resolveCachedAppCode(_0x1fb878,_0x3ab3bd,_0x5e4005){const _0x41fa51=a2_0x482e;if(!_0x1fb878)return undefined;const _0x5cf241=readCachedAppList(_0x3ab3bd,_0x5e4005),_0x48937b=_0x5cf241?.['items'][_0x41fa51(0xe9)](_0x14dcb0=>_0x14dcb0['appName']===_0x1fb878&&isRuntimeAccessibleApp(_0x14dcb0));return _0x48937b?.[_0x41fa51(0xef)]?.['trim']()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a3_0x4c4594=a3_0x53e8;(function(_0x1ad8cd,_0x4bd8c0){const _0x18cb87=a3_0x53e8,_0x4ef81f=_0x1ad8cd();while(!![]){try{const _0xd4d24=parseInt(_0x18cb87(0x10f))/0x1*(-parseInt(_0x18cb87(0x105))/0x2)+parseInt(_0x18cb87(0x106))/0x3*(parseInt(_0x18cb87(0x122))/0x4)+parseInt(_0x18cb87(0x11b))/0x5+parseInt(_0x18cb87(0x113))/0x6+parseInt(_0x18cb87(0xff))/0x7+parseInt(_0x18cb87(0x100))/0x8*(parseInt(_0x18cb87(0x134))/0x9)+-parseInt(_0x18cb87(0x11f))/0xa;if(_0xd4d24===_0x4bd8c0)break;else _0x4ef81f['push'](_0x4ef81f['shift']());}catch(_0x348b54){_0x4ef81f['push'](_0x4ef81f['shift']());}}}(a3_0x406f,0xebca8));import{appImportFlagDefs,runAppImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';function a3_0x406f(){const _0x3c26f4=['type','Refreshed\x20app\x20cache\x20with\x20','push','34401060bEhIWn','pull','\x20cached\x20app(s)\x20for\x20env=\x22','30524HLLqQl','isArray','read','Target\x20environment\x20(default:\x20current\x20env)','nonInteractive','fetchedAt','../../commands/app/remote-source.js','bool','remote','langs','string','filter','Read\x20from\x20local\x20cache\x20only','name','config','\x20app(s)\x20for\x20env=\x22','local','length','329337hpTHid','boolean','entries','cachePath','production','Read\x20app\x20list\x20from\x20local\x20cache\x20only','Loaded\x20','enableI18n','trim','source','accessKey','Include\x20unpublished\x20apps\x20for\x20diagnostics','import','7226408eQSHPx','248MjbyqG','no-cache','include-unpublished','appcode','cache','2651436NKaCcz','279AhMoID','map','No\x20apps\x20found\x20on\x20the\x20platform.','globalPath','mergedCli','str','write','Reads\x20the\x20given\x20.rabetbase.json\x20and\x20imports\x20a\x20usable\x20default\x20app\x20into\x20local\x20.lovrabet.json.\x20Matching\x20keys\x20may\x20be\x20updated.','appOwnerName','1NJcGDh','env','items','find','8660436akuLmJ','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','Filter\x20by\x20environment\x20(default:\x20current\x20env)','../../context.js','app','appName','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','i18nInfo','7059040QGQMls'];a3_0x406f=function(){return _0x3c26f4;};return a3_0x406f();}import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';function a3_0x53e8(_0xc130f1,_0xb52e1c){_0xc130f1=_0xc130f1-0xf7;const _0x406fde=a3_0x406f();let _0x53e8f6=_0x406fde[_0xc130f1];return _0x53e8f6;}function collectFlags(_0x41ca1f,_0x1e9e69){const _0x37876c=a3_0x53e8,_0x293e0d={};for(const _0x381a8e of _0x1e9e69){const _0x2da776=_0x381a8e[_0x37876c(0x11c)]===_0x37876c(0x135)?_0x41ca1f[_0x37876c(0x129)](_0x381a8e['name']):_0x41ca1f['str'](_0x381a8e[_0x37876c(0x12f)]);if(_0x2da776!==''&&_0x2da776!==![])_0x293e0d[_0x381a8e[_0x37876c(0x12f)]]=_0x2da776;}if(_0x41ca1f[_0x37876c(0x126)])_0x293e0d['nonInteractive']=!![];return _0x293e0d;}function normalizeLanguages(_0x1379dc){const _0x1aa7cf=a3_0x53e8;if(!Array[_0x1aa7cf(0x123)](_0x1379dc))return[];return _0x1379dc[_0x1aa7cf(0x12d)](_0xcb45a7=>typeof _0xcb45a7===_0x1aa7cf(0x12c))['map'](_0x2c67d2=>_0x2c67d2[_0x1aa7cf(0xfa)]())[_0x1aa7cf(0x12d)](Boolean);}function buildRemoteAppI18nFields(_0x495216){const _0x1e47be=a3_0x53e8,_0x513e40=normalizeLanguages(_0x495216[_0x1e47be(0x11a)]?.[_0x1e47be(0x12b)]);return{'enableI18n':typeof _0x495216['enableI18n']===_0x1e47be(0x135)?_0x495216[_0x1e47be(0xf9)]:null,'languages':_0x513e40,'i18nInfo':_0x495216[_0x1e47be(0x11a)]?{..._0x495216[_0x1e47be(0x11a)],'langs':_0x513e40[_0x1e47be(0x133)]?_0x513e40:null}:null};}const listDef={'service':a3_0x4c4594(0x117),'command':'list','description':a3_0x4c4594(0x114),'risk':a3_0x4c4594(0x124),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':'string','description':a3_0x4c4594(0x115),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':'boolean','description':a3_0x4c4594(0xf7),'default':![]},{'name':a3_0x4c4594(0x101),'type':a3_0x4c4594(0x135),'description':a3_0x4c4594(0x119),'default':![]},{'name':a3_0x4c4594(0x102),'type':a3_0x4c4594(0x135),'description':a3_0x4c4594(0xfd),'default':![]}],async 'execute'(_0x1ac836){const _0x2abe44=a3_0x4c4594,_0x1e7c22=_0x1ac836['str'](_0x2abe44(0x110))||_0x1ac836['envName']||getEnv()||_0x2abe44(0x138),_0x350e4b=_0x1ac836['bool'](_0x2abe44(0x132)),_0x5458df=_0x1ac836[_0x2abe44(0x129)](_0x2abe44(0x101)),_0x51d2db=_0x1ac836[_0x2abe44(0x129)](_0x2abe44(0x102)),{readRawConfigWithLayers:_0x40fc32,resolveDefaultAppSource:_0x1e6c7b,getLocalAppAliases:_0x1dc949}=await import(_0x2abe44(0x116)),{getRemoteAppList:_0x1eec6c}=await import(_0x2abe44(0x128)),{config:_0x2cf474,layers:_0x2b63b1}=_0x40fc32(),_0x34ac36=_0x1e6c7b(_0x2b63b1),{defaultApp:_0xf1b656}=_0x2cf474,_0x37a802=await _0x1eec6c({'env':_0x1e7c22,'accessKey':_0x1ac836['accessKey'],'localOnly':_0x350e4b,'noCache':_0x5458df}),_0x13fea2=_0x51d2db?_0x37a802[_0x2abe44(0x111)]:filterRuntimeAccessibleApps(_0x37a802['items']),_0x14f855=_0x37a802[_0x2abe44(0x111)][_0x2abe44(0x133)]-_0x13fea2['length'],_0xd15800=_0x13fea2[_0x2abe44(0x107)](_0x4ceb82=>{const _0x5caed6=_0x2abe44;return{'name':_0x4ceb82[_0x5caed6(0x118)],'appcode':_0x4ceb82['appCode'],'named':!![],'definedIn':_0x5caed6(0x12a),'isDefault':_0x4ceb82[_0x5caed6(0x118)]===_0xf1b656,...buildAppProfileListFields(_0x1e7c22),...buildRemoteAppI18nFields(_0x4ceb82),'source':_0x37a802[_0x5caed6(0xfb)],'owner':_0x4ceb82[_0x5caed6(0x10e)]??null,'status':_0x4ceb82['appPublishStatus']??null,'cachedAt':_0x37a802[_0x5caed6(0x127)]};}),_0x5bb017=_0x1dc949(_0x2cf474);let _0x5d7ee0=0x0;for(const [_0x25c90f,_0x208e90]of Object[_0x2abe44(0x136)](_0x5bb017)){const _0xbb6dda=typeof _0x208e90[_0x2abe44(0x103)]===_0x2abe44(0x12c)?_0x208e90[_0x2abe44(0x103)][_0x2abe44(0xfa)]():'';if(!_0xbb6dda)continue;const _0x3ee019=findAppByCode(_0x37a802[_0x2abe44(0x111)],_0xbb6dda);if(!_0x51d2db&&_0x3ee019&&!isRuntimeAccessibleApp(_0x3ee019))continue;_0x5d7ee0+=0x1,_0xd15800[_0x2abe44(0x11e)]({'name':_0x25c90f,'appcode':_0xbb6dda,'named':!![],'definedIn':_0x2abe44(0x132),'isDefault':_0x25c90f===_0xf1b656,...buildAppProfileListFields(_0x1e7c22),'source':_0x2abe44(0x130),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0xd15800,_0x1ac836[_0x2abe44(0x10a)]);const _0x6309b7=_0xd15800[_0x2abe44(0x112)](_0x3006a9=>_0x3006a9['isCurrent']===!![]),_0x5441ed=_0xf1b656??_0x6309b7?.[_0x2abe44(0x12f)]??null,_0x5e1916={'env':_0x1e7c22,'source':_0x37a802['source'],'fetchedAt':_0x37a802['fetchedAt'],'cachePath':_0x37a802['cachePath'],'globalPath':_0x2b63b1[_0x2abe44(0x109)]??null,'projectPath':_0x2b63b1['projectPath']??null,'defaultApp':_0x5441ed,'defaultAppSource':_0xf1b656!=null?_0x34ac36:null,'localAliasCount':_0x5d7ee0,'remoteTotal':_0x37a802['items'][_0x2abe44(0x133)],'hiddenUnpublishedCount':_0x14f855,'includeUnpublished':_0x51d2db};if(_0xd15800[_0x2abe44(0x133)]===0x0)return{'ok':!![],'data':{'items':_0xd15800,'meta':_0x5e1916},'message':_0x37a802[_0x2abe44(0xfb)]===_0x2abe44(0x104)?'No\x20cached\x20apps\x20found.':_0x2abe44(0x108)};return{'ok':!![],'data':{'items':_0xd15800,'meta':_0x5e1916}};}},pullDef={'service':a3_0x4c4594(0x117),'command':a3_0x4c4594(0x120),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x4c4594(0x10c),'confirmationDescription':'Reads\x20the\x20apps\x20available\x20to\x20the\x20current\x20account\x20and\x20overwrites\x20the\x20local\x20app\x20cache\x20for\x20that\x20environment.\x20Platform\x20apps\x20are\x20not\x20modified.','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':'string','description':a3_0x4c4594(0x125),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x4c4594(0x132),'type':a3_0x4c4594(0x135),'description':a3_0x4c4594(0x12e),'default':![]},{'name':a3_0x4c4594(0x101),'type':a3_0x4c4594(0x135),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0xb94d80){const _0x44074a=a3_0x4c4594,_0x300875=_0xb94d80[_0x44074a(0x10b)](_0x44074a(0x110))||_0xb94d80['envName']||getEnv()||'production',_0x456e56=_0xb94d80[_0x44074a(0x129)]('local'),_0x1259df=_0xb94d80[_0x44074a(0x129)](_0x44074a(0x101)),{getRemoteAppList:_0x1bc961}=await import('../../commands/app/remote-source.js'),_0x37ec03=await _0x1bc961({'env':_0x300875,'accessKey':_0xb94d80[_0x44074a(0xfc)],'localOnly':_0x456e56,'noCache':_0x1259df});return{'ok':!![],'data':{'total':_0x37ec03['items'][_0x44074a(0x133)],'env':_0x300875,'source':_0x37ec03[_0x44074a(0xfb)],'fetchedAt':_0x37ec03[_0x44074a(0x127)],'cachePath':_0x37ec03[_0x44074a(0x137)]},'message':_0x37ec03[_0x44074a(0xfb)]===_0x44074a(0x104)?_0x44074a(0xf8)+_0x37ec03['items'][_0x44074a(0x133)]+_0x44074a(0x121)+_0x300875+'\x22.':_0x44074a(0x11d)+_0x37ec03[_0x44074a(0x111)][_0x44074a(0x133)]+_0x44074a(0x131)+_0x300875+'\x22.'};}},importDef={'service':'app','command':a3_0x4c4594(0xfe),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x4c4594(0x10c),'confirmationDescription':a3_0x4c4594(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':appImportFlagDefs,async 'execute'(_0x253dd8){return await runAppImport(collectFlags(_0x253dd8,appImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[listDef,pullDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55b4a4,_0x79a229){const _0x5d4040=a4_0x1903,_0x510d48=_0x55b4a4();while(!![]){try{const _0x437bf2=-parseInt(_0x5d4040(0x17c))/0x1+parseInt(_0x5d4040(0x184))/0x2+-parseInt(_0x5d4040(0x180))/0x3+parseInt(_0x5d4040(0x17f))/0x4*(parseInt(_0x5d4040(0x171))/0x5)+parseInt(_0x5d4040(0x17b))/0x6*(-parseInt(_0x5d4040(0x185))/0x7)+-parseInt(_0x5d4040(0x16e))/0x8*(-parseInt(_0x5d4040(0x179))/0x9)+parseInt(_0x5d4040(0x17d))/0xa;if(_0x437bf2===_0x79a229)break;else _0x510d48['push'](_0x510d48['shift']());}catch(_0x3c612c){_0x510d48['push'](_0x510d48['shift']());}}}(a4_0x246b,0x8c151));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x2af8b7){const _0x2e544a=a4_0x1903;if(typeof _0x2af8b7!==_0x2e544a(0x178))return null;const _0x38c479=_0x2af8b7['trim']();return _0x38c479?_0x38c479[_0x2e544a(0x17e)]():null;}function a4_0x246b(){const _0x44bfa3=['appPublishStatus','.\x20Publish\x20the\x20app\x20before\x20using\x20','1955DGlulP','App\x20','filter','appName','find','trim','appCode','string','3006lneMSZ','UNKNOWN','34014tJUIkm','94637knVdQb','13049680PqdKDF','toUpperCase','6944tEwsnw','2278446OHBBIS','validation','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','Current\x20status:\x20','313968peUSOK','980wYkxXu','1936VirYfU'];a4_0x246b=function(){return _0x44bfa3;};return a4_0x246b();}export function isRuntimeAccessibleApp(_0x2e9d50){const _0x49c211=a4_0x1903;return normalizeAppPublishStatus(_0x2e9d50[_0x49c211(0x16f)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x10becc){const _0xe4c4c8=a4_0x1903;return _0x10becc[_0xe4c4c8(0x173)](isRuntimeAccessibleApp);}function a4_0x1903(_0x30210a,_0x5c56a2){_0x30210a=_0x30210a-0x16e;const _0x246bf7=a4_0x246b();let _0x190399=_0x246bf7[_0x30210a];return _0x190399;}export function findAppByName(_0x20646c,_0x39d01b){const _0x27f99e=a4_0x1903;return _0x20646c['find'](_0x9f3838=>_0x9f3838[_0x27f99e(0x174)]===_0x39d01b);}export function findAppByCode(_0x99d19d,_0x5d4d63){const _0x57bd17=a4_0x1903,_0x24a277=_0x5d4d63[_0x57bd17(0x176)]();if(!_0x24a277)return undefined;return _0x99d19d[_0x57bd17(0x175)](_0x3426ca=>_0x3426ca[_0x57bd17(0x177)]?.[_0x57bd17(0x176)]()===_0x24a277);}export function runtimeInaccessibleAppError(_0x6e8d85,_0x4c12e0){const _0x3425bd=a4_0x1903,_0x2ce788=normalizeAppPublishStatus(_0x6e8d85[_0x3425bd(0x16f)])??_0x3425bd(0x17a);return CliErrors[_0x3425bd(0x181)](_0x3425bd(0x172)+_0x4c12e0+'\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.',_0x3425bd(0x183)+_0x2ce788+_0x3425bd(0x170)+CLI_BIN_NAME+_0x3425bd(0x182));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x72324c,_0x436b20){const _0x351f7c=a5_0x5730,_0x1ca78d=_0x72324c();while(!![]){try{const _0x1f9285=parseInt(_0x351f7c(0xed))/0x1+parseInt(_0x351f7c(0xf5))/0x2+-parseInt(_0x351f7c(0xf4))/0x3+parseInt(_0x351f7c(0xfa))/0x4+-parseInt(_0x351f7c(0xf6))/0x5*(parseInt(_0x351f7c(0xf9))/0x6)+-parseInt(_0x351f7c(0xef))/0x7+parseInt(_0x351f7c(0xfc))/0x8*(parseInt(_0x351f7c(0xf8))/0x9);if(_0x1f9285===_0x436b20)break;else _0x1ca78d['push'](_0x1ca78d['shift']());}catch(_0x490c64){_0x1ca78d['push'](_0x1ca78d['shift']());}}}(a5_0x4943,0x68cff));import{fileURLToPath}from'url';function a5_0x4943(){const _0x11f92b=['305220yIbBfu','859976NoxZVK','480tkQklh','data','5016717BkFYfl','49188EfwDoN','2711616Hupfws','errorMsg','8iPJfTG','228436hlNifJ','errorCode','4029774PzBFlH','../../../mock/app-list.json','success','parse','tableData'];a5_0x4943=function(){return _0x11f92b;};return a5_0x4943();}import{dirname,join}from'path';import{readFileSync}from'fs';function a5_0x5730(_0x5254e1,_0x5c5d31){_0x5254e1=_0x5254e1-0xed;const _0x494349=a5_0x4943();let _0x57301f=_0x494349[_0x5254e1];return _0x57301f;}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x49901b=a5_0x5730,_0x2c9795=join(__dirname,_0x49901b(0xf0)),_0x3d5228=readFileSync(_0x2c9795,'utf-8');return JSON[_0x49901b(0xf2)](_0x3d5228);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x5a0b9d=a5_0x5730,_0xade535=getMockAppList();if(!_0xade535[_0x5a0b9d(0xf1)])throw new Error('Mock\x20API\x20error:\x20'+_0xade535[_0x5a0b9d(0xfb)]+'\x20('+_0xade535[_0x5a0b9d(0xee)]+')');return _0xade535[_0x5a0b9d(0xf7)][_0x5a0b9d(0xf3)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fae7b,_0x634cc0){const _0x3faad2=a6_0x233f,_0x53306d=_0x1fae7b();while(!![]){try{const _0x395c4d=parseInt(_0x3faad2(0x8a))/0x1+-parseInt(_0x3faad2(0x96))/0x2+-parseInt(_0x3faad2(0x90))/0x3+-parseInt(_0x3faad2(0x98))/0x4*(-parseInt(_0x3faad2(0x93))/0x5)+parseInt(_0x3faad2(0x8f))/0x6*(parseInt(_0x3faad2(0x8d))/0x7)+parseInt(_0x3faad2(0x99))/0x8*(-parseInt(_0x3faad2(0x94))/0x9)+parseInt(_0x3faad2(0x92))/0xa*(parseInt(_0x3faad2(0x91))/0xb);if(_0x395c4d===_0x634cc0)break;else _0x53306d['push'](_0x53306d['shift']());}catch(_0x59d5fd){_0x53306d['push'](_0x53306d['shift']());}}}(a6_0x24b3,0x9fc79));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';function a6_0x233f(_0x111f8d,_0xceef3c){_0x111f8d=_0x111f8d-0x87;const _0x24b38b=a6_0x24b3();let _0x233f07=_0x24b38b[_0x111f8d];return _0x233f07;}import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x51563b=a6_0x233f,_0x1834e1=(productEnv(_0x51563b(0x9a))||'')[_0x51563b(0x8c)]()[_0x51563b(0x89)]();return _0x1834e1===_0x51563b(0x97);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x8c027d){const _0x4d8364=a6_0x233f,{env:_0x5f3977,accessKey:_0x19aa42,localOnly:localOnly=![],noCache:noCache=![]}=_0x8c027d,_0x3def77=readCachedAppList(_0x5f3977,_0x19aa42),_0x3b167c=_0x19aa42?.[_0x4d8364(0x8c)]()?getAppCacheFilePath(_0x5f3977,_0x19aa42):null;if(localOnly)return{'items':_0x3def77?.[_0x4d8364(0x8e)]??[],'source':_0x4d8364(0x95),'fetchedAt':_0x3def77?.[_0x4d8364(0x87)]??null,'cachePath':_0x3b167c};try{const _0x327e10=await getRemoteAppItems(),_0x366db2=shouldUseMockRemoteApps()?_0x4d8364(0x97):_0x4d8364(0x88),_0x205743=new Date()[_0x4d8364(0x8b)](),_0x1a8d3a=_0x19aa42?.['trim']()?writeCachedAppList(_0x5f3977,_0x19aa42,{'env':_0x5f3977,'fetchedAt':_0x205743,'source':_0x366db2,'items':_0x327e10}):null;return{'items':_0x327e10,'source':_0x366db2,'fetchedAt':_0x205743,'cachePath':_0x1a8d3a};}catch(_0xc1d638){if(!noCache&&_0x3def77)return{'items':_0x3def77['items'],'source':_0x4d8364(0x95),'fetchedAt':_0x3def77[_0x4d8364(0x87)],'cachePath':_0x3b167c};throw _0xc1d638;}}function a6_0x24b3(){const _0x12f8f5=['2077851sCDjPV','2255GsRaSF','31840XHvGir','755WRjWKw','18CyVKXP','cache','2095070YfOBiM','mock','28216miUICU','213072mStvTK','APP_LIST_SOURCE','fetchedAt','remote','toLowerCase','239387XPFNfz','toISOString','trim','429289aYHXqn','items','48rvYPlK'];a6_0x24b3=function(){return _0x12f8f5;};return a6_0x24b3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x289e09,_0x42b695){const _0x2b0f2a=a7_0x4ebc,_0x265b0b=_0x289e09();while(!![]){try{const _0x589ba3=-parseInt(_0x2b0f2a(0x123))/0x1+-parseInt(_0x2b0f2a(0x130))/0x2+parseInt(_0x2b0f2a(0x133))/0x3*(-parseInt(_0x2b0f2a(0x125))/0x4)+-parseInt(_0x2b0f2a(0x122))/0x5*(parseInt(_0x2b0f2a(0x12b))/0x6)+-parseInt(_0x2b0f2a(0x12e))/0x7+parseInt(_0x2b0f2a(0x126))/0x8+parseInt(_0x2b0f2a(0x12c))/0x9*(parseInt(_0x2b0f2a(0x127))/0xa);if(_0x589ba3===_0x42b695)break;else _0x265b0b['push'](_0x265b0b['shift']());}catch(_0x1fe6b2){_0x265b0b['push'](_0x265b0b['shift']());}}}(a7_0x46ff,0xbf702));function a7_0x4ebc(_0x28be23,_0x3f6520){_0x28be23=_0x28be23-0x122;const _0x46fff7=a7_0x46ff();let _0x4ebcb3=_0x46fff7[_0x28be23];return _0x4ebcb3;}export function enrichAppListItemsWithMergedSelection(_0x3aed93,_0x3691bb){const _0x599cab=a7_0x4ebc;if(!_0x3691bb)return;const _0x4ee9fa=!!(_0x3691bb[_0x599cab(0x124)]??_0x3691bb['defaultApp']);for(const _0x5cf96b of _0x3aed93){_0x5cf96b['isCurrent']=![];}const _0x44d75a=_0x3691bb[_0x599cab(0x131)]!=null?String(_0x3691bb[_0x599cab(0x131)])[_0x599cab(0x129)]():'';if(_0x4ee9fa){const _0x53e555=_0x3691bb[_0x599cab(0x124)]??_0x3691bb['defaultApp'];if(_0x53e555){const _0x1e1a1f=_0x3aed93[_0x599cab(0x134)](_0x752feb=>_0x752feb[_0x599cab(0x132)]===!![]&&_0x752feb[_0x599cab(0x128)]===_0x53e555&&_0x752feb['definedIn']===_0x599cab(0x12a)),_0x440d6f=_0x1e1a1f??_0x3aed93[_0x599cab(0x134)](_0xf4b41b=>_0xf4b41b[_0x599cab(0x132)]===!![]&&_0xf4b41b[_0x599cab(0x128)]===_0x53e555);if(_0x440d6f){const _0xa2f8df=String(_0x440d6f[_0x599cab(0x12d)]??'')[_0x599cab(0x129)]();if(!_0x44d75a||_0xa2f8df===_0x44d75a){_0x440d6f[_0x599cab(0x12f)]=!![];return;}}}if(_0x44d75a){const _0x4fc777=_0x3aed93[_0x599cab(0x134)](_0xa37f9b=>String(_0xa37f9b[_0x599cab(0x12d)]??'')['trim']()===_0x44d75a);_0x4fc777&&(_0x4fc777[_0x599cab(0x12f)]=!![]);}return;}if(!_0x44d75a)return;for(const _0x15ce22 of _0x3aed93){String(_0x15ce22[_0x599cab(0x12d)]??'')['trim']()===_0x44d75a&&(_0x15ce22[_0x599cab(0x12f)]=!![]);}}function a7_0x46ff(){const _0x616eaa=['27xxPPxO','appcode','2648646BYjNYG','isCurrent','35354evdgAw','appCode','named','682113mILzKn','find','8495VNrsqK','746878VnZucl','currentApp','4BEETNR','4898696FOmNoF','9008380RSIPWa','name','trim','local','4098TXLMem'];a7_0x46ff=function(){return _0x616eaa;};return a7_0x46ff();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x5e7947=a8_0x2bf9;(function(_0x165fd6,_0x5e2a8f){const _0x231565=a8_0x2bf9,_0x16ca2e=_0x165fd6();while(!![]){try{const _0x2e5cfe=parseInt(_0x231565(0xbc))/0x1+parseInt(_0x231565(0xc2))/0x2+parseInt(_0x231565(0xbf))/0x3+-parseInt(_0x231565(0xc7))/0x4+-parseInt(_0x231565(0xb9))/0x5+-parseInt(_0x231565(0xc0))/0x6*(-parseInt(_0x231565(0xbe))/0x7)+parseInt(_0x231565(0xba))/0x8;if(_0x2e5cfe===_0x5e2a8f)break;else _0x16ca2e['push'](_0x16ca2e['shift']());}catch(_0x5c119a){_0x16ca2e['push'](_0x16ca2e['shift']());}}}(a8_0x5fe7,0xd2a9f));function a8_0x2bf9(_0x26cb16,_0xc8c352){_0x26cb16=_0x26cb16-0xb9;const _0x5fe771=a8_0x5fe7();let _0x2bf9ee=_0x5fe771[_0x26cb16];return _0x2bf9ee;}import{getRuntimeAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const appConfigGet={'service':'app-config','command':a8_0x5e7947(0xcb),'description':a8_0x5e7947(0xc1),'risk':'read','args':[{'name':'key','description':a8_0x5e7947(0xca),'required':!![]}],'flags':[],async 'execute'(_0x18e739){const _0x12f08d=a8_0x5e7947,_0x4b9c34=_0x18e739[_0x12f08d(0xc9)][0x0]?.[_0x12f08d(0xc5)]();if(!_0x4b9c34)throw CliErrors[_0x12f08d(0xc6)](_0x12f08d(0xc4),_0x12f08d(0xc3)+CLI_BIN_NAME+'\x20app-config\x20get\x20<key>');try{const _0x1768fe=await getRuntimeAppConfigByKey(_0x18e739[_0x12f08d(0xbd)],_0x4b9c34);return{'ok':!![],'data':_0x1768fe};}catch{throw CliErrors[_0x12f08d(0xcc)]('Unable\x20to\x20get\x20app-config\x20value:\x20key='+_0x4b9c34+_0x12f08d(0xbb)+_0x18e739['appCode'],_0x12f08d(0xc8));}}};function a8_0x5fe7(){const _0x111b00=['7575540yQoPKF','8337304jVvfJa',',\x20appCode=','370023sKCKwk','appCode','118538JYcSPS','405006jWGjKl','18GdSJHL','Get\x20one\x20runtime\x20app-config\x20value\x20by\x20key','2429682bGZIDV','Usage:\x20','Missing\x20app-config\x20key.','trim','validation','1739376tVFLxG','Check\x20that\x20the\x20key\x20exists,\x20the\x20current\x20AccessKey\x20has\x20permission,\x20and\x20the\x20runtime\x20app-config\x20endpoint\x20is\x20available.','args','App\x20config\x20key','get','apiError'];a8_0x5fe7=function(){return _0x111b00;};return a8_0x5fe7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x518300,_0x17dee1){const _0x44f924=a9_0x18c2,_0x672261=_0x518300();while(!![]){try{const _0x4f7bc5=parseInt(_0x44f924(0x1cc))/0x1+parseInt(_0x44f924(0x1ce))/0x2*(-parseInt(_0x44f924(0x1cd))/0x3)+parseInt(_0x44f924(0x1ca))/0x4+parseInt(_0x44f924(0x1cf))/0x5+-parseInt(_0x44f924(0x1c9))/0x6+parseInt(_0x44f924(0x1cb))/0x7*(-parseInt(_0x44f924(0x1c7))/0x8)+-parseInt(_0x44f924(0x1c8))/0x9;if(_0x4f7bc5===_0x17dee1)break;else _0x672261['push'](_0x672261['shift']());}catch(_0x2709d5){_0x672261['push'](_0x672261['shift']());}}}(a9_0x3196,0xec193));function a9_0x18c2(_0x3026ed,_0x359b6b){_0x3026ed=_0x3026ed-0x1c7;const _0x319617=a9_0x3196();let _0x18c215=_0x319617[_0x3026ed];return _0x18c215;}import{appConfigGet}from'../../commands/app-config/get.js';export const appConfigDefinitions=[appConfigGet];function a9_0x3196(){const _0x460085=['14pyxaLP','751185vKMTHg','3FykirW','958676rlwNuN','7488290HkIfzl','1215472DWcpZh','3508092gHeolr','2733474YstQhD','1387156VWmrgQ'];a9_0x3196=function(){return _0x460085;};return a9_0x3196();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a10_0x47a896=a10_0x2df5;(function(_0x583c45,_0xb384fb){const _0x15e41d=a10_0x2df5,_0x591430=_0x583c45();while(!![]){try{const _0x4edfcf=parseInt(_0x15e41d(0x72))/0x1+parseInt(_0x15e41d(0x88))/0x2+parseInt(_0x15e41d(0xa5))/0x3*(-parseInt(_0x15e41d(0x76))/0x4)+-parseInt(_0x15e41d(0xb0))/0x5+parseInt(_0x15e41d(0x89))/0x6+parseInt(_0x15e41d(0x75))/0x7*(parseInt(_0x15e41d(0xb4))/0x8)+-parseInt(_0x15e41d(0x7e))/0x9*(parseInt(_0x15e41d(0x7c))/0xa);if(_0x4edfcf===_0xb384fb)break;else _0x591430['push'](_0x591430['shift']());}catch(_0x20e11c){_0x591430['push'](_0x591430['shift']());}}}(a10_0xc5fb,0x8e177));import{readFileSync}from'node:fs';import{resolve}from'node:path';import{approveApprovalTask,getApprovalTaskDetail,listApprovalTodo,transferApprovalTask}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun as a10_0x4de794}from'../../framework/dryrun.js';import{redactSensitiveValue}from'../../utils/redaction.js';import{parseLosslessJson}from'../../utils/lossless-json.js';const APP_CODE_FLAG={'name':a10_0x47a896(0x77),'type':'string','description':a10_0x47a896(0x82)},PAGE_FLAG={'name':'page','type':a10_0x47a896(0x9d),'default':0x1,'description':a10_0x47a896(0x78)},PAGE_SIZE_FLAG={'name':a10_0x47a896(0xa9),'type':a10_0x47a896(0x9d),'default':0x14,'description':a10_0x47a896(0x97)},TASK_ID_FLAG={'name':a10_0x47a896(0x93),'type':a10_0x47a896(0x86),'required':!![],'description':a10_0x47a896(0xa1)},COMMENT_FLAG={'name':a10_0x47a896(0xb3),'type':a10_0x47a896(0x86),'description':a10_0x47a896(0x9e)},VARIABLES_FLAG={'name':a10_0x47a896(0xa2),'type':a10_0x47a896(0x86),'description':a10_0x47a896(0x8b)},TARGET_USER_ID_FLAG={'name':a10_0x47a896(0xb1),'type':a10_0x47a896(0x86),'required':!![],'description':a10_0x47a896(0x84)};function requireApprovalAppCode(_0x53e138){const _0x59a1be=a10_0x47a896,_0x18fcd7=(_0x53e138[_0x59a1be(0x85)](_0x59a1be(0x77))||_0x53e138[_0x59a1be(0x99)]?.[_0x59a1be(0xab)]||_0x53e138[_0x59a1be(0xab)]||'')[_0x59a1be(0xb6)]();if(!_0x18fcd7)throw CliErrors[_0x59a1be(0x8d)](_0x59a1be(0xa7));return _0x18fcd7;}function requireTaskId(_0x42160a){const _0xa6790a=a10_0x47a896,_0xc633b7=_0x42160a[_0xa6790a(0x85)](_0xa6790a(0x93))[_0xa6790a(0xb6)]();if(!_0xc633b7)throw CliErrors['validation'](_0xa6790a(0x7f));return _0xc633b7;}function a10_0xc5fb(){const _0x23e04b=['isSafeInteger','Approve\x20a\x20pending\x20Runtime\x20task','1101312ZXdtBU','reject','Transfers\x20the\x20pending\x20Runtime\x20task\x20to\x20the\x20selected\x20eligible\x20user.\x20The\x20current\x20handler\x20may\x20lose\x20permission\x20to\x20process\x20the\x20task.','14AuHHGF','611648BIGZDw','app-code','One-based\x20todo\x20page\x20number','Approved\x20approval\x20task\x20','Preview:\x20reject\x20an\x20approval\x20task','read','6326470kRXESk','isArray','9wJRSvH','--task-id\x20must\x20not\x20be\x20blank.','approve','body','Application\x20code\x20(falls\x20back\x20to\x20the\x20active\x20workspace\x20app)','task-detail','Target\x20user\x20ID\x20selected\x20from\x20Runtime\x20transfer\x20candidates','str','string','high-risk-write','170724IcYVwa','2308440hnJyLU','--variables\x20must\x20be\x20a\x20JSON\x20object.','Workflow\x20variables\x20as\x20JSON\x20or\x20@path/to/variables.json','validation','configMissing','startsWith','todo','List\x20the\x20current\x20user\x27s\x20approval\x20todo\x20tasks','Reject\x20a\x20pending\x20Runtime\x20task','POST','task-id','build','Preview:\x20approve\x20an\x20approval\x20task','transfer','Number\x20of\x20todo\x20records\x20per\x20page','num','mergedCli','--page-size\x20must\x20be\x20a\x20positive\x20integer.','--page\x20must\x20be\x20a\x20positive\x20integer.','Unable\x20to\x20read\x20--variables\x20file.','number','Approval\x20or\x20transfer\x20comment','/client/flow/approve','utf8','Runtime\x20approval\x20task\x20ID','variables','--variables\x20must\x20contain\x20valid\x20JSON.','page','6VflmuE','approval','Set\x20--app-code,\x20--appcode,\x20or\x20an\x20active\x20app\x20in\x20the\x20workspace\x20configuration.','/client/flow/task/transfer','page-size','--target-user-id\x20must\x20not\x20be\x20blank.','appCode','--variables\x20@file\x20path\x20must\x20not\x20be\x20blank.','Transferred\x20approval\x20task\x20','Rejected\x20approval\x20task\x20','Rejects\x20the\x20pending\x20Runtime\x20task\x20and\x20applies\x20the\x20workflow\x20rejection\x20path.\x20This\x20action\x20may\x20end\x20the\x20workflow\x20or\x20trigger\x20downstream\x20business\x20side\x20effects.','5539310SZPdzF','target-user-id','Preview:\x20transfer\x20an\x20approval\x20task','comment','4227704XKtiBM','taskId','trim','description'];a10_0xc5fb=function(){return _0x23e04b;};return a10_0xc5fb();}function validatePage(_0x5adb7d){const _0x5ce62c=a10_0x47a896,_0xad1446=_0x5adb7d[_0x5ce62c(0x98)](_0x5ce62c(0xa4),0x1),_0x1c6cfa=_0x5adb7d[_0x5ce62c(0x98)](_0x5ce62c(0xa9),0x14);if(!Number['isSafeInteger'](_0xad1446)||_0xad1446<0x1)throw CliErrors['validation'](_0x5ce62c(0x9b));if(!Number[_0x5ce62c(0xb8)](_0x1c6cfa)||_0x1c6cfa<0x1)throw CliErrors[_0x5ce62c(0x8c)](_0x5ce62c(0x9a));}function readVariables(_0x512183){const _0x4bf670=a10_0x47a896,_0x45cacb=_0x512183[_0x4bf670(0x85)](_0x4bf670(0xa2))['trim']();if(!_0x45cacb)return undefined;let _0x23cddd=_0x45cacb;if(_0x45cacb[_0x4bf670(0x8e)]('@')){const _0x55c365=_0x45cacb['slice'](0x1)[_0x4bf670(0xb6)]();if(!_0x55c365)throw CliErrors[_0x4bf670(0x8c)](_0x4bf670(0xac));try{_0x23cddd=readFileSync(resolve(_0x55c365),_0x4bf670(0xa0));}catch{throw CliErrors[_0x4bf670(0x8c)](_0x4bf670(0x9c));}}let _0x11e333;try{_0x11e333=parseLosslessJson(_0x23cddd);}catch{throw CliErrors[_0x4bf670(0x8c)](_0x4bf670(0xa3));}if(!_0x11e333||typeof _0x11e333!=='object'||Array[_0x4bf670(0x7d)](_0x11e333))throw CliErrors['validation'](_0x4bf670(0x8a));return _0x11e333;}function approvalBody(_0x4f0b2d,_0x46ffce){const _0x38558e=a10_0x47a896,_0x45f3bb={'appCode':requireApprovalAppCode(_0x4f0b2d),'taskId':requireTaskId(_0x4f0b2d),'approved':_0x46ffce},_0x2ca4d9=_0x4f0b2d['str'](_0x38558e(0xb3)),_0xaa6edd=readVariables(_0x4f0b2d);if(_0x2ca4d9)_0x45f3bb[_0x38558e(0xb3)]=_0x2ca4d9;if(_0xaa6edd!==undefined)_0x45f3bb['variables']=_0xaa6edd;return _0x45f3bb;}function transferBody(_0x12de13){const _0x13d025=a10_0x47a896,_0x4ca1bf=requireTaskId(_0x12de13),_0x20eeea=_0x12de13['str'](_0x13d025(0xb1))[_0x13d025(0xb6)]();if(!_0x20eeea)throw CliErrors[_0x13d025(0x8c)](_0x13d025(0xaa));const _0x8403f3={'appCode':requireApprovalAppCode(_0x12de13),'taskId':_0x4ca1bf,'targetUserId':_0x20eeea},_0x5c4abd=_0x12de13[_0x13d025(0x85)](_0x13d025(0xb3));if(_0x5c4abd)_0x8403f3[_0x13d025(0xb3)]=_0x5c4abd;return _0x8403f3;}function a10_0x2df5(_0x3235b1,_0x5f45db){_0x3235b1=_0x3235b1-0x72;const _0xc5fbef=a10_0xc5fb();let _0x2df58f=_0xc5fbef[_0x3235b1];return _0x2df58f;}function sanitized(_0x5741a0){return redactSensitiveValue(_0x5741a0);}const approvalTodo={'service':'approval','command':a10_0x47a896(0x8f),'description':a10_0x47a896(0x90),'risk':a10_0x47a896(0x7b),'requiresAppCode':![],'flags':[APP_CODE_FLAG,PAGE_FLAG,PAGE_SIZE_FLAG],async 'validate'(_0x3d24cb){requireApprovalAppCode(_0x3d24cb),validatePage(_0x3d24cb);},async 'execute'(_0x3d3162){const _0x255eaf=a10_0x47a896,_0x8b5bfe=requireApprovalAppCode(_0x3d3162),_0x5d7e73=await listApprovalTodo(_0x8b5bfe,_0x3d3162['num']('page',0x1),_0x3d3162[_0x255eaf(0x98)](_0x255eaf(0xa9),0x14));return{'ok':!![],'data':sanitized(_0x5d7e73)};}},approvalTaskDetail={'service':a10_0x47a896(0xa6),'command':a10_0x47a896(0x83),'description':'Show\x20an\x20approval\x20task\x20and\x20its\x20current\x20handling\x20permissions','risk':'read','requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG],async 'validate'(_0x4492c8){requireApprovalAppCode(_0x4492c8),requireTaskId(_0x4492c8);},async 'execute'(_0xe65b){const _0x4252cd=requireTaskId(_0xe65b),_0x2b2dfd=await getApprovalTaskDetail(_0x4252cd,requireApprovalAppCode(_0xe65b));return{'ok':!![],'data':sanitized(_0x2b2dfd)};}},approvalApprove={'service':a10_0x47a896(0xa6),'command':a10_0x47a896(0x80),'description':a10_0x47a896(0xb9),'risk':'high-risk-write','confirmationDescription':'Approves\x20the\x20pending\x20Runtime\x20task\x20and\x20advances\x20its\x20workflow.\x20This\x20action\x20may\x20trigger\x20downstream\x20nodes\x20and\x20business\x20side\x20effects.','requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,COMMENT_FLAG,VARIABLES_FLAG],async 'validate'(_0x5319a3){approvalBody(_0x5319a3,!![]);},async 'execute'(_0x118119){const _0xc23fb8=a10_0x47a896,_0x4fc5dd=approvalBody(_0x118119,!![]),_0x3dc494=await approveApprovalTask(_0x4fc5dd);return{'ok':!![],'data':sanitized(_0x3dc494),'message':_0xc23fb8(0x79)+_0x4fc5dd[_0xc23fb8(0xb5)]};},async 'dryRun'(_0x9897b1){const _0x1e64fa=a10_0x47a896,_0x2acb01=approvalBody(_0x9897b1,!![]);return a10_0x4de794(_0x1e64fa(0x92),_0x1e64fa(0x9f))[_0x1e64fa(0x81)](sanitized(_0x2acb01))[_0x1e64fa(0xb7)](_0x1e64fa(0x95))[_0x1e64fa(0x94)]();}},approvalReject={'service':a10_0x47a896(0xa6),'command':a10_0x47a896(0x73),'description':a10_0x47a896(0x91),'risk':a10_0x47a896(0x87),'confirmationDescription':a10_0x47a896(0xaf),'requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,COMMENT_FLAG,VARIABLES_FLAG],async 'validate'(_0x562957){approvalBody(_0x562957,![]);},async 'execute'(_0x568493){const _0x11a648=a10_0x47a896,_0x3c3677=approvalBody(_0x568493,![]),_0x9d7eba=await approveApprovalTask(_0x3c3677);return{'ok':!![],'data':sanitized(_0x9d7eba),'message':_0x11a648(0xae)+_0x3c3677[_0x11a648(0xb5)]};},async 'dryRun'(_0x273ce5){const _0xdea1ce=a10_0x47a896,_0x2bd252=approvalBody(_0x273ce5,![]);return a10_0x4de794('POST',_0xdea1ce(0x9f))[_0xdea1ce(0x81)](sanitized(_0x2bd252))[_0xdea1ce(0xb7)](_0xdea1ce(0x7a))[_0xdea1ce(0x94)]();}},approvalTransfer={'service':a10_0x47a896(0xa6),'command':a10_0x47a896(0x96),'description':'Transfer\x20a\x20pending\x20Runtime\x20task\x20to\x20an\x20allowed\x20user','risk':'high-risk-write','confirmationDescription':a10_0x47a896(0x74),'requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,TARGET_USER_ID_FLAG,COMMENT_FLAG],async 'validate'(_0x440ca5){transferBody(_0x440ca5);},async 'execute'(_0x3813ea){const _0x2fd94e=a10_0x47a896,_0x5878c6=transferBody(_0x3813ea),_0x1db537=await transferApprovalTask(_0x5878c6);return{'ok':!![],'data':sanitized(_0x1db537),'message':_0x2fd94e(0xad)+_0x5878c6[_0x2fd94e(0xb5)]};},async 'dryRun'(_0x5a119b){const _0x460628=a10_0x47a896,_0x2d5a96=transferBody(_0x5a119b);return a10_0x4de794(_0x460628(0x92),_0x460628(0xa8))[_0x460628(0x81)](sanitized(_0x2d5a96))['description'](_0x460628(0xb2))[_0x460628(0x94)]();}};export const approvalDefinitions=[approvalTodo,approvalTaskDetail,approvalApprove,approvalReject,approvalTransfer];export{approvalApprove,approvalReject,approvalTaskDetail,approvalTodo,approvalTransfer};
|
|
1
|
+
const a10_0x52282e=a10_0x5147;(function(_0x5cda35,_0x4f5440){const _0x3ade57=a10_0x5147,_0x2c6e7e=_0x5cda35();while(!![]){try{const _0x312f3c=parseInt(_0x3ade57(0xde))/0x1*(-parseInt(_0x3ade57(0xeb))/0x2)+-parseInt(_0x3ade57(0xf7))/0x3*(-parseInt(_0x3ade57(0xdc))/0x4)+parseInt(_0x3ade57(0xf0))/0x5+parseInt(_0x3ade57(0xe0))/0x6*(parseInt(_0x3ade57(0x104))/0x7)+-parseInt(_0x3ade57(0xe6))/0x8*(-parseInt(_0x3ade57(0xdb))/0x9)+-parseInt(_0x3ade57(0x109))/0xa+-parseInt(_0x3ade57(0xf6))/0xb;if(_0x312f3c===_0x4f5440)break;else _0x2c6e7e['push'](_0x2c6e7e['shift']());}catch(_0x5cc6e8){_0x2c6e7e['push'](_0x2c6e7e['shift']());}}}(a10_0x4f9f,0xc53ae));import{readFileSync}from'node:fs';import{resolve}from'node:path';import{approveApprovalTask,getApprovalTaskDetail,listApprovalTodo,transferApprovalTask}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun as a10_0x1f408d}from'../../framework/dryrun.js';import{redactSensitiveValue}from'../../utils/redaction.js';import{parseLosslessJson}from'../../utils/lossless-json.js';const APP_CODE_FLAG={'name':a10_0x52282e(0x114),'type':a10_0x52282e(0x10a),'description':'Application\x20code\x20(falls\x20back\x20to\x20the\x20active\x20workspace\x20app)'},PAGE_FLAG={'name':a10_0x52282e(0xef),'type':'number','default':0x1,'description':a10_0x52282e(0x101)},PAGE_SIZE_FLAG={'name':a10_0x52282e(0x115),'type':a10_0x52282e(0xf4),'default':0x14,'description':a10_0x52282e(0xd9)},TASK_ID_FLAG={'name':a10_0x52282e(0x119),'type':'string','required':!![],'description':a10_0x52282e(0xfc)},COMMENT_FLAG={'name':a10_0x52282e(0x105),'type':a10_0x52282e(0x10a),'description':a10_0x52282e(0x100)},VARIABLES_FLAG={'name':'variables','type':a10_0x52282e(0x10a),'description':a10_0x52282e(0x10d)},TARGET_USER_ID_FLAG={'name':a10_0x52282e(0x113),'type':a10_0x52282e(0x10a),'required':!![],'description':a10_0x52282e(0xf1)};function requireApprovalAppCode(_0x2c267e){const _0x568ff6=a10_0x52282e,_0x30682e=(_0x2c267e[_0x568ff6(0xf9)]('app-code')||_0x2c267e[_0x568ff6(0x10c)]?.[_0x568ff6(0x108)]||_0x2c267e[_0x568ff6(0x108)]||'')[_0x568ff6(0xf2)]();if(!_0x30682e)throw CliErrors[_0x568ff6(0xdf)](_0x568ff6(0xe4));return _0x30682e;}function requireTaskId(_0x8c9883){const _0xcb17b0=a10_0x52282e,_0x6951b=_0x8c9883[_0xcb17b0(0xf9)](_0xcb17b0(0x119))[_0xcb17b0(0xf2)]();if(!_0x6951b)throw CliErrors[_0xcb17b0(0x10b)](_0xcb17b0(0xfe));return _0x6951b;}function validatePage(_0x409c39){const _0x182b70=a10_0x52282e,_0xbc2c94=_0x409c39['num'](_0x182b70(0xef),0x1),_0x25b5b4=_0x409c39[_0x182b70(0xfa)]('page-size',0x14);if(!Number[_0x182b70(0x112)](_0xbc2c94)||_0xbc2c94<0x1)throw CliErrors[_0x182b70(0x10b)](_0x182b70(0x117));if(!Number['isSafeInteger'](_0x25b5b4)||_0x25b5b4<0x1)throw CliErrors['validation'](_0x182b70(0xf5));}function readVariables(_0x42f737){const _0x3b949b=a10_0x52282e,_0x382fba=_0x42f737[_0x3b949b(0xf9)]('variables')[_0x3b949b(0xf2)]();if(!_0x382fba)return undefined;let _0x4b94c0=_0x382fba;if(_0x382fba['startsWith']('@')){const _0x56ec31=_0x382fba['slice'](0x1)[_0x3b949b(0xf2)]();if(!_0x56ec31)throw CliErrors[_0x3b949b(0x10b)](_0x3b949b(0xd8));try{_0x4b94c0=readFileSync(resolve(_0x56ec31),'utf8');}catch{throw CliErrors[_0x3b949b(0x10b)](_0x3b949b(0xda));}}let _0x4fc640;try{_0x4fc640=parseLosslessJson(_0x4b94c0);}catch{throw CliErrors[_0x3b949b(0x10b)](_0x3b949b(0xe9));}if(!_0x4fc640||typeof _0x4fc640!==_0x3b949b(0x11c)||Array[_0x3b949b(0xd7)](_0x4fc640))throw CliErrors[_0x3b949b(0x10b)](_0x3b949b(0xe5));return _0x4fc640;}function a10_0x5147(_0x2d3f45,_0x3a7f45){_0x2d3f45=_0x2d3f45-0xd7;const _0x4f9f8c=a10_0x4f9f();let _0x51476f=_0x4f9f8c[_0x2d3f45];return _0x51476f;}function a10_0x4f9f(){const _0x2ea1da=['high-risk-write','isSafeInteger','target-user-id','app-code','page-size','Transfers\x20the\x20pending\x20Runtime\x20task\x20to\x20the\x20selected\x20eligible\x20user.\x20The\x20current\x20handler\x20may\x20lose\x20permission\x20to\x20process\x20the\x20task.','--page\x20must\x20be\x20a\x20positive\x20integer.','read','task-id','Transfer\x20a\x20pending\x20Runtime\x20task\x20to\x20an\x20allowed\x20user','POST','object','isArray','--variables\x20@file\x20path\x20must\x20not\x20be\x20blank.','Number\x20of\x20todo\x20records\x20per\x20page','Unable\x20to\x20read\x20--variables\x20file.','1777932IJGrwo','2653720qsnzin','Transferred\x20approval\x20task\x20','1383827JRnUTs','configMissing','9642rOeVdb','approve','Show\x20an\x20approval\x20task\x20and\x20its\x20current\x20handling\x20permissions','reject','Set\x20--app-code,\x20--appcode,\x20or\x20an\x20active\x20app\x20in\x20the\x20workspace\x20configuration.','--variables\x20must\x20be\x20a\x20JSON\x20object.','48jZzdCX','build','Preview:\x20approve\x20an\x20approval\x20task','--variables\x20must\x20contain\x20valid\x20JSON.','variables','2OVfBDl','body','todo','List\x20the\x20current\x20user\x27s\x20approval\x20todo\x20tasks','page','396630QhhLCo','Target\x20user\x20ID\x20selected\x20from\x20Runtime\x20transfer\x20candidates','trim','task-detail','number','--page-size\x20must\x20be\x20a\x20positive\x20integer.','3929453ZiyEzi','3bDnctP','Rejects\x20the\x20pending\x20Runtime\x20task\x20and\x20applies\x20the\x20workflow\x20rejection\x20path.\x20This\x20action\x20may\x20end\x20the\x20workflow\x20or\x20trigger\x20downstream\x20business\x20side\x20effects.','str','num','Preview:\x20transfer\x20an\x20approval\x20task','Runtime\x20approval\x20task\x20ID','Approves\x20the\x20pending\x20Runtime\x20task\x20and\x20advances\x20its\x20workflow.\x20This\x20action\x20may\x20trigger\x20downstream\x20nodes\x20and\x20business\x20side\x20effects.','--task-id\x20must\x20not\x20be\x20blank.','approval','Approval\x20or\x20transfer\x20comment','One-based\x20todo\x20page\x20number','taskId','Reject\x20a\x20pending\x20Runtime\x20task','6097IRvIzJ','comment','/client/flow/approve','Approve\x20a\x20pending\x20Runtime\x20task','appCode','7788370JREIGK','string','validation','mergedCli','Workflow\x20variables\x20as\x20JSON\x20or\x20@path/to/variables.json','description','--target-user-id\x20must\x20not\x20be\x20blank.','Approved\x20approval\x20task\x20'];a10_0x4f9f=function(){return _0x2ea1da;};return a10_0x4f9f();}function approvalBody(_0xdebe2c,_0x1e44f6){const _0x5ad7fe=a10_0x52282e,_0x127820={'appCode':requireApprovalAppCode(_0xdebe2c),'taskId':requireTaskId(_0xdebe2c),'approved':_0x1e44f6},_0x45678d=_0xdebe2c[_0x5ad7fe(0xf9)]('comment'),_0x9ab9f1=readVariables(_0xdebe2c);if(_0x45678d)_0x127820[_0x5ad7fe(0x105)]=_0x45678d;if(_0x9ab9f1!==undefined)_0x127820[_0x5ad7fe(0xea)]=_0x9ab9f1;return _0x127820;}function transferBody(_0x4111dc){const _0xcc5c3=a10_0x52282e,_0x1f00f6=requireTaskId(_0x4111dc),_0x52ce6b=_0x4111dc[_0xcc5c3(0xf9)]('target-user-id')[_0xcc5c3(0xf2)]();if(!_0x52ce6b)throw CliErrors['validation'](_0xcc5c3(0x10f));const _0x2283f8={'appCode':requireApprovalAppCode(_0x4111dc),'taskId':_0x1f00f6,'targetUserId':_0x52ce6b},_0x303a87=_0x4111dc[_0xcc5c3(0xf9)](_0xcc5c3(0x105));if(_0x303a87)_0x2283f8[_0xcc5c3(0x105)]=_0x303a87;return _0x2283f8;}function sanitized(_0x725659){return redactSensitiveValue(_0x725659);}const approvalTodo={'service':'approval','command':a10_0x52282e(0xed),'description':a10_0x52282e(0xee),'risk':a10_0x52282e(0x118),'requiresAppCode':![],'flags':[APP_CODE_FLAG,PAGE_FLAG,PAGE_SIZE_FLAG],async 'validate'(_0xa3e452){requireApprovalAppCode(_0xa3e452),validatePage(_0xa3e452);},async 'execute'(_0x520f9d){const _0x33a02f=a10_0x52282e,_0x470ad7=requireApprovalAppCode(_0x520f9d),_0x48709e=await listApprovalTodo(_0x470ad7,_0x520f9d[_0x33a02f(0xfa)](_0x33a02f(0xef),0x1),_0x520f9d[_0x33a02f(0xfa)](_0x33a02f(0x115),0x14));return{'ok':!![],'data':sanitized(_0x48709e)};}},approvalTaskDetail={'service':a10_0x52282e(0xff),'command':a10_0x52282e(0xf3),'description':a10_0x52282e(0xe2),'risk':'read','requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG],async 'validate'(_0x3145e6){requireApprovalAppCode(_0x3145e6),requireTaskId(_0x3145e6);},async 'execute'(_0x190733){const _0x4ee851=requireTaskId(_0x190733),_0x3531d2=await getApprovalTaskDetail(_0x4ee851,requireApprovalAppCode(_0x190733));return{'ok':!![],'data':sanitized(_0x3531d2)};}},approvalApprove={'service':a10_0x52282e(0xff),'command':a10_0x52282e(0xe1),'description':a10_0x52282e(0x107),'risk':a10_0x52282e(0x111),'confirmationDescription':a10_0x52282e(0xfd),'requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,COMMENT_FLAG,VARIABLES_FLAG],async 'validate'(_0x46a3de){approvalBody(_0x46a3de,!![]);},async 'execute'(_0x3ebce5){const _0x2aebaa=a10_0x52282e,_0x165602=approvalBody(_0x3ebce5,!![]),_0xd88805=await approveApprovalTask(_0x165602);return{'ok':!![],'data':sanitized(_0xd88805),'message':_0x2aebaa(0x110)+_0x165602['taskId']};},async 'dryRun'(_0x5bdb03){const _0x4ffdaa=a10_0x52282e,_0x34116d=approvalBody(_0x5bdb03,!![]);return a10_0x1f408d(_0x4ffdaa(0x11b),_0x4ffdaa(0x106))[_0x4ffdaa(0xec)](sanitized(_0x34116d))[_0x4ffdaa(0x10e)](_0x4ffdaa(0xe8))[_0x4ffdaa(0xe7)]();}},approvalReject={'service':'approval','command':a10_0x52282e(0xe3),'description':a10_0x52282e(0x103),'risk':a10_0x52282e(0x111),'confirmationDescription':a10_0x52282e(0xf8),'requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,COMMENT_FLAG,VARIABLES_FLAG],async 'validate'(_0x241c3d){approvalBody(_0x241c3d,![]);},async 'execute'(_0x450ac5){const _0x11b639=a10_0x52282e,_0x3683fa=approvalBody(_0x450ac5,![]),_0x4895f9=await approveApprovalTask(_0x3683fa);return{'ok':!![],'data':sanitized(_0x4895f9),'message':'Rejected\x20approval\x20task\x20'+_0x3683fa[_0x11b639(0x102)]};},async 'dryRun'(_0x5ae21a){const _0x3e9b5e=a10_0x52282e,_0x5c6599=approvalBody(_0x5ae21a,![]);return a10_0x1f408d(_0x3e9b5e(0x11b),_0x3e9b5e(0x106))[_0x3e9b5e(0xec)](sanitized(_0x5c6599))[_0x3e9b5e(0x10e)]('Preview:\x20reject\x20an\x20approval\x20task')[_0x3e9b5e(0xe7)]();}},approvalTransfer={'service':a10_0x52282e(0xff),'command':'transfer','description':a10_0x52282e(0x11a),'risk':a10_0x52282e(0x111),'confirmationDescription':a10_0x52282e(0x116),'requiresAppCode':![],'flags':[APP_CODE_FLAG,TASK_ID_FLAG,TARGET_USER_ID_FLAG,COMMENT_FLAG],async 'validate'(_0x43f301){transferBody(_0x43f301);},async 'execute'(_0x234489){const _0x4889de=a10_0x52282e,_0x5d6c51=transferBody(_0x234489),_0x10a273=await transferApprovalTask(_0x5d6c51);return{'ok':!![],'data':sanitized(_0x10a273),'message':_0x4889de(0xdd)+_0x5d6c51['taskId']};},async 'dryRun'(_0x3cd899){const _0x39ec67=a10_0x52282e,_0x59dcb8=transferBody(_0x3cd899);return a10_0x1f408d(_0x39ec67(0x11b),'/client/flow/task/transfer')[_0x39ec67(0xec)](sanitized(_0x59dcb8))[_0x39ec67(0x10e)](_0x39ec67(0xfb))[_0x39ec67(0xe7)]();}};export const approvalDefinitions=[approvalTodo,approvalTaskDetail,approvalApprove,approvalReject,approvalTransfer];export{approvalApprove,approvalReject,approvalTaskDetail,approvalTodo,approvalTransfer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a11_0x32d3b7=a11_0x1c63;(function(_0x53ad7e,_0x5e0c23){const _0x208f26=a11_0x1c63,_0x1fa393=_0x53ad7e();while(!![]){try{const _0x965cd4=parseInt(_0x208f26(0x1d0))/0x1+parseInt(_0x208f26(0x1c6))/0x2*(-parseInt(_0x208f26(0x1ef))/0x3)+-parseInt(_0x208f26(0x1cf))/0x4*(-parseInt(_0x208f26(0x1ee))/0x5)+-parseInt(_0x208f26(0x1ff))/0x6+parseInt(_0x208f26(0x1e2))/0x7+-parseInt(_0x208f26(0x1f3))/0x8*(parseInt(_0x208f26(0x1d2))/0x9)+parseInt(_0x208f26(0x1e3))/0xa;if(_0x965cd4===_0x5e0c23)break;else _0x1fa393['push'](_0x1fa393['shift']());}catch(_0x1968de){_0x1fa393['push'](_0x1fa393['shift']());}}}(a11_0x3849,0x516f2));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a11_0x1c63(_0xc804f8,_0x4d572b){_0xc804f8=_0xc804f8-0x1bf;const _0x38492f=a11_0x3849();let _0x1c637a=_0x38492f[_0xc804f8];return _0x1c637a;}const ARTIFACT_TYPE_REACT_MODULE='react_module',ARTIFACT_SOURCE_AGENT=a11_0x32d3b7(0x1d5),ALLOWED_REACT_MODULE_IMPORTS=['react',a11_0x32d3b7(0x1ce),a11_0x32d3b7(0x202),a11_0x32d3b7(0x1ea),a11_0x32d3b7(0x1d9),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a11_0x32d3b7(0x1f1)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a11_0x32d3b7(0x1f0),'type':a11_0x32d3b7(0x1fb),'required':!![],'description':a11_0x32d3b7(0x205)},ARTIFACT_NAME_FLAG={'name':a11_0x32d3b7(0x1e0),'type':a11_0x32d3b7(0x1fb),'description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a11_0x32d3b7(0x20a),'type':a11_0x32d3b7(0x1fb),'description':a11_0x32d3b7(0x208)};function isPlainObject(_0x184a0c){const _0x11de5e=a11_0x32d3b7;return typeof _0x184a0c===_0x11de5e(0x1d6)&&_0x184a0c!==null&&!Array[_0x11de5e(0x1f8)](_0x184a0c);}function readSourceFile(_0x74f6b8){const _0x59f451=a11_0x32d3b7;if(!_0x74f6b8)throw CliErrors[_0x59f451(0x1c4)](_0x59f451(0x209));if(!existsSync(_0x74f6b8))throw CliErrors[_0x59f451(0x1c4)](_0x59f451(0x1cc)+_0x74f6b8);if(!statSync(_0x74f6b8)['isFile']())throw CliErrors[_0x59f451(0x1c4)](_0x59f451(0x1f7)+_0x74f6b8);const _0x2259a8=readFileSync(_0x74f6b8,_0x59f451(0x1c2));return validateReactModuleSource(_0x2259a8),_0x2259a8;}function parseMetadata(_0x40e935){const _0xc39a45=a11_0x32d3b7;if(!_0x40e935)return undefined;let _0x2eb2a0;try{_0x2eb2a0=JSON[_0xc39a45(0x1f6)](_0x40e935);}catch{throw CliErrors[_0xc39a45(0x1c4)](_0xc39a45(0x1d7)+_0x40e935);}if(!isPlainObject(_0x2eb2a0))throw CliErrors['validation']('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x62bd9c={..._0x2eb2a0};return delete _0x62bd9c[_0xc39a45(0x200)],_0x62bd9c;}function a11_0x3849(){const _0x58b6ec=['appCode','Optional\x20favorite-state\x20filter','2830hAGAww','555NyJMwf','file','join','some','8xsxhbe','source','update','parse','File\x20is\x20not\x20a\x20regular\x20file:\x20','isArray','create','favorite','string','Artifact\x20ID','description','POST','3620706YWlsVV','compiledContent','filter','lodash','map','list','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','.\x20Unsupported:\x20','str','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','File\x20path\x20is\x20required.','metadata','Show\x20one\x20Artifact\x20by\x20id','/client/artifact/','lastIndex','utf8','verbose','validation','content','7034xXvIZC','body','test','createTime','exec','read','File\x20not\x20found:\x20','split','react-dom','2740Ygucfk','335601djQOKS','/update','5336559aebudb','updateTime','length','AGENT','object','Invalid\x20JSON\x20for\x20--metadata:\x20','bool','antd','List\x20current-app\x20react_module\x20Artifacts','react_module\x20imports\x20are\x20limited\x20to:\x20','num','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','startsWith','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','name','Updated\x20Artifact\x20','4474792ivQUpG','8180340ERmPJl','detail','/client/artifact/create','artifactType','artifact','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','deleted','dayjs','trim'];a11_0x3849=function(){return _0x58b6ec;};return a11_0x3849();}function getPackageName(_0x2885c7){const _0x29ae00=a11_0x32d3b7;if(_0x2885c7[_0x29ae00(0x1de)]('@')){const [_0x1af495,_0x3c7790]=_0x2885c7[_0x29ae00(0x1cd)]('/');return _0x1af495&&_0x3c7790?_0x1af495+'/'+_0x3c7790:_0x2885c7;}return _0x2885c7['split']('/')[0x0]||_0x2885c7;}function validateAllowedImports(_0x5c9c2e){const _0x341368=a11_0x32d3b7,_0x50d379=new Set();for(const _0x5e6682 of IMPORT_SOURCE_PATTERNS){_0x5e6682[_0x341368(0x1c1)]=0x0;let _0x46469b;while((_0x46469b=_0x5e6682[_0x341368(0x1ca)](_0x5c9c2e))!==null){const _0x244b8c=_0x46469b[0x1]?.[_0x341368(0x1eb)]();_0x244b8c&&_0x50d379['add'](_0x244b8c);}}const _0x422bf0=[..._0x50d379][_0x341368(0x203)](getPackageName)[_0x341368(0x201)](_0x4e58ca=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x4e58ca));if(_0x422bf0[_0x341368(0x1d4)]>0x0)throw CliErrors['validation'](_0x341368(0x1db)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x341368(0x206)+[...new Set(_0x422bf0)]['join'](',\x20'));}export function validateReactModuleSource(_0x11f486){const _0x3f4e94=a11_0x32d3b7;if(!_0x11f486[_0x3f4e94(0x1eb)]())throw CliErrors[_0x3f4e94(0x1c4)]('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS[_0x3f4e94(0x1f2)](_0x6ee6b6=>_0x6ee6b6[_0x3f4e94(0x1c8)](_0x11f486)))throw CliErrors[_0x3f4e94(0x1c4)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x11f486);}function buildArtifactInput(_0x4e17c3){const _0x5355a2=a11_0x32d3b7,_0x48bf8c=readSourceFile(_0x4e17c3[_0x5355a2(0x207)](_0x5355a2(0x1f0))),_0x4141aa=_0x4e17c3[_0x5355a2(0x207)](_0x5355a2(0x1e0))['trim'](),_0x26b0c3=parseMetadata(_0x4e17c3[_0x5355a2(0x207)](_0x5355a2(0x20a)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4141aa?{'name':_0x4141aa}:{},'content':_0x48bf8c,..._0x26b0c3?{'metadata':_0x26b0c3}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x3e4bb6){const _0x287c6e=a11_0x32d3b7;return{'id':_0x3e4bb6['id'],'name':_0x3e4bb6[_0x287c6e(0x1e0)],'artifactType':_0x3e4bb6[_0x287c6e(0x1e6)],'source':_0x3e4bb6[_0x287c6e(0x1f4)],'favorite':_0x3e4bb6['favorite'],'deleted':_0x3e4bb6[_0x287c6e(0x1e9)],'createTime':_0x3e4bb6['createTime'],'updateTime':_0x3e4bb6[_0x287c6e(0x1d3)]};}function detailArtifact(_0x5b0b49){const _0x483985=a11_0x32d3b7;return{'id':_0x5b0b49['id'],'appCode':_0x5b0b49[_0x483985(0x1ec)],'name':_0x5b0b49[_0x483985(0x1e0)],'artifactType':_0x5b0b49['artifactType'],'source':_0x5b0b49[_0x483985(0x1f4)],'favorite':_0x5b0b49[_0x483985(0x1fa)],'deleted':_0x5b0b49['deleted'],'content':_0x5b0b49[_0x483985(0x1c5)]??'','compiledContent':_0x5b0b49[_0x483985(0x200)],'metadata':_0x5b0b49[_0x483985(0x20a)]??{},'createTime':_0x5b0b49[_0x483985(0x1c9)],'updateTime':_0x5b0b49[_0x483985(0x1d3)]};}function readFavoriteFlag(_0x323ee5){const _0x37910c=a11_0x32d3b7,_0x22d05c=_0x323ee5['flag']('favorite');return _0x22d05c===undefined||_0x22d05c===null||_0x22d05c===''?undefined:_0x323ee5[_0x37910c(0x1d8)](_0x37910c(0x1fa));}const artifactList={'service':a11_0x32d3b7(0x1e7),'command':a11_0x32d3b7(0x204),'description':a11_0x32d3b7(0x1da),'risk':a11_0x32d3b7(0x1cb),'flags':[{'name':a11_0x32d3b7(0x1f4),'type':a11_0x32d3b7(0x1fb),'description':a11_0x32d3b7(0x1e8)},{'name':a11_0x32d3b7(0x1fa),'type':'boolean','description':a11_0x32d3b7(0x1ed)},VERBOSE_FLAG],async 'execute'(_0x2676fc){const _0x536e39=a11_0x32d3b7,_0x503518=await listRuntimeArtifacts(_0x2676fc['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x2676fc[_0x536e39(0x207)]('source')?{'source':_0x2676fc[_0x536e39(0x207)](_0x536e39(0x1f4))}:{},...readFavoriteFlag(_0x2676fc)!==undefined?{'favorite':readFavoriteFlag(_0x2676fc)}:{}});return{'ok':!![],'data':{'total':_0x503518[_0x536e39(0x1d4)],'items':_0x2676fc[_0x536e39(0x1d8)](_0x536e39(0x1c3))?_0x503518:_0x503518[_0x536e39(0x203)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a11_0x32d3b7(0x1e4),'description':a11_0x32d3b7(0x1bf),'risk':a11_0x32d3b7(0x1cb),'flags':[{...ID_FLAG,'description':a11_0x32d3b7(0x1fc)}],async 'execute'(_0x1c386e){const _0x5ab678=a11_0x32d3b7,_0x583fce=await getRuntimeArtifact(_0x1c386e[_0x5ab678(0x1dc)]('id'),_0x1c386e['appCode']);return{'ok':!![],'data':detailArtifact(_0x583fce)};}},artifactCreate={'service':'artifact','command':a11_0x32d3b7(0x1f9),'description':a11_0x32d3b7(0x1dd),'risk':'read','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x37c623){const _0x404b89=a11_0x32d3b7,_0x1f1ffa=buildArtifactInput(_0x37c623),_0x1be2d4=await createRuntimeArtifact(_0x37c623[_0x404b89(0x1ec)],_0x1f1ffa);return{'ok':!![],'data':detailArtifact(_0x1be2d4),'message':'Created\x20Artifact\x20'+_0x1be2d4['id']+(_0x1be2d4['name']?'\x20('+_0x1be2d4[_0x404b89(0x1e0)]+')':'')};},async 'dryRun'(_0x383419){const _0xf2afc7=a11_0x32d3b7,_0xd7b7ea=buildArtifactInput(_0x383419);return dryRun(_0xf2afc7(0x1fe),_0xf2afc7(0x1e5))[_0xf2afc7(0x1c7)]({'appCode':_0x383419[_0xf2afc7(0x1ec)],..._0xd7b7ea})[_0xf2afc7(0x1fd)]('Preview:\x20create\x20react_module\x20Artifact')['build']();}},artifactUpdate={'service':a11_0x32d3b7(0x1e7),'command':a11_0x32d3b7(0x1f5),'description':a11_0x32d3b7(0x1df),'risk':'read','flags':[{...ID_FLAG,'description':a11_0x32d3b7(0x1fc)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x157101){const _0x424d51=a11_0x32d3b7,_0x20b0c7=_0x157101[_0x424d51(0x1dc)]('id'),_0xe76103=buildArtifactInput(_0x157101),_0x133d3c=await updateRuntimeArtifact(_0x20b0c7,_0x157101[_0x424d51(0x1ec)],_0xe76103);return{'ok':!![],'data':detailArtifact(_0x133d3c),'message':_0x424d51(0x1e1)+_0x133d3c['id']+(_0x133d3c[_0x424d51(0x1e0)]?'\x20('+_0x133d3c[_0x424d51(0x1e0)]+')':'')};},async 'dryRun'(_0x59b609){const _0x54e002=a11_0x32d3b7,_0xb1d52=_0x59b609[_0x54e002(0x1dc)]('id'),_0x52d4b9=buildArtifactInput(_0x59b609);return dryRun(_0x54e002(0x1fe),_0x54e002(0x1c0)+_0xb1d52+_0x54e002(0x1d1))[_0x54e002(0x1c7)]({'appCode':_0x59b609[_0x54e002(0x1ec)],..._0x52d4b9})[_0x54e002(0x1fd)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0xb1d52)['build']();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a11_0x1f4ab3=a11_0x3670;(function(_0x15ea8b,_0x37fedf){const _0xb1780e=a11_0x3670,_0x4c6ea0=_0x15ea8b();while(!![]){try{const _0x49e9fc=-parseInt(_0xb1780e(0x19c))/0x1+-parseInt(_0xb1780e(0x198))/0x2+-parseInt(_0xb1780e(0x18b))/0x3+parseInt(_0xb1780e(0x1ac))/0x4*(parseInt(_0xb1780e(0x1c3))/0x5)+parseInt(_0xb1780e(0x1c7))/0x6*(-parseInt(_0xb1780e(0x1a6))/0x7)+-parseInt(_0xb1780e(0x19f))/0x8*(parseInt(_0xb1780e(0x1ab))/0x9)+parseInt(_0xb1780e(0x186))/0xa;if(_0x49e9fc===_0x37fedf)break;else _0x4c6ea0['push'](_0x4c6ea0['shift']());}catch(_0x47a945){_0x4c6ea0['push'](_0x4c6ea0['shift']());}}}(a11_0x3862,0xd21ed));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a11_0x1f4ab3(0x1ce),ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a11_0x1f4ab3(0x1d2),a11_0x1f4ab3(0x1d1),a11_0x1f4ab3(0x1c4),a11_0x1f4ab3(0x1bb),a11_0x1f4ab3(0x1a5),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a11_0x1f4ab3(0x1d5),'type':a11_0x1f4ab3(0x18e),'required':!![],'description':a11_0x1f4ab3(0x18f)},ARTIFACT_NAME_FLAG={'name':a11_0x1f4ab3(0x193),'type':a11_0x1f4ab3(0x18e),'description':a11_0x1f4ab3(0x1c5)},METADATA_FLAG={'name':a11_0x1f4ab3(0x1b0),'type':'string','description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x11bcab){const _0x23937c=a11_0x1f4ab3;return typeof _0x11bcab===_0x23937c(0x1cf)&&_0x11bcab!==null&&!Array[_0x23937c(0x189)](_0x11bcab);}function readSourceFile(_0x2258a7){const _0x3a9237=a11_0x1f4ab3;if(!_0x2258a7)throw CliErrors[_0x3a9237(0x1c6)](_0x3a9237(0x1aa));if(!existsSync(_0x2258a7))throw CliErrors[_0x3a9237(0x1c6)](_0x3a9237(0x1b6)+_0x2258a7);if(!statSync(_0x2258a7)[_0x3a9237(0x1d0)]())throw CliErrors[_0x3a9237(0x1c6)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2258a7);const _0x2603d5=readFileSync(_0x2258a7,_0x3a9237(0x1d4));return validateReactModuleSource(_0x2603d5),_0x2603d5;}function a11_0x3862(){const _0x3cc90b=['7ebipki','build','source','body','File\x20path\x20is\x20required.','12645xZFuJb','685836xljlFr','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','.\x20Unsupported:\x20','metadata','includes','POST','Created\x20Artifact\x20','artifactType','/client/artifact/create','File\x20not\x20found:\x20','compiledContent','exec','str','add','dayjs','appCode','split','favorite','parse','flag','createTime','description','45zNVNaN','lodash','Artifact\x20display\x20name','validation','3975102TKOehY','detail','trim','create','length','bool','Artifact\x20ID','react_module','object','isFile','react-dom','react','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','utf8','file','33144890cIpxNE','react_module\x20imports\x20are\x20limited\x20to:\x20','updateTime','isArray','verbose','1266246ttmgBN','Preview:\x20update\x20react_module\x20Artifact\x20','read','string','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','map','/update','startsWith','name','Optional\x20favorite-state\x20filter','num','artifact','test','1722920ZmDrKE','join','deleted','Artifact\x20source\x20file\x20is\x20blank.','981703zcvALb','Show\x20one\x20Artifact\x20by\x20id','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','6088ZntutI','Preview:\x20create\x20react_module\x20Artifact','update','List\x20current-app\x20react_module\x20Artifacts','list','/client/artifact/','antd'];a11_0x3862=function(){return _0x3cc90b;};return a11_0x3862();}function parseMetadata(_0x3e4918){const _0xbb5d0a=a11_0x1f4ab3;if(!_0x3e4918)return undefined;let _0x16cf8f;try{_0x16cf8f=JSON[_0xbb5d0a(0x1bf)](_0x3e4918);}catch{throw CliErrors[_0xbb5d0a(0x1c6)]('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x3e4918);}if(!isPlainObject(_0x16cf8f))throw CliErrors[_0xbb5d0a(0x1c6)](_0xbb5d0a(0x1ad));const _0x3006eb={..._0x16cf8f};return delete _0x3006eb[_0xbb5d0a(0x1b7)],_0x3006eb;}function getPackageName(_0x390692){const _0x1471ad=a11_0x1f4ab3;if(_0x390692[_0x1471ad(0x192)]('@')){const [_0x4f55e7,_0x3b47d4]=_0x390692[_0x1471ad(0x1bd)]('/');return _0x4f55e7&&_0x3b47d4?_0x4f55e7+'/'+_0x3b47d4:_0x390692;}return _0x390692[_0x1471ad(0x1bd)]('/')[0x0]||_0x390692;}function validateAllowedImports(_0x47f010){const _0xabebf=a11_0x1f4ab3,_0x27b9c5=new Set();for(const _0x57c04f of IMPORT_SOURCE_PATTERNS){_0x57c04f['lastIndex']=0x0;let _0x1f78cd;while((_0x1f78cd=_0x57c04f[_0xabebf(0x1b8)](_0x47f010))!==null){const _0x1cdb84=_0x1f78cd[0x1]?.[_0xabebf(0x1c9)]();_0x1cdb84&&_0x27b9c5[_0xabebf(0x1ba)](_0x1cdb84);}}const _0x38ca3f=[..._0x27b9c5][_0xabebf(0x190)](getPackageName)['filter'](_0x4c5e18=>!ALLOWED_REACT_MODULE_IMPORTS[_0xabebf(0x1b1)](_0x4c5e18));if(_0x38ca3f[_0xabebf(0x1cb)]>0x0)throw CliErrors['validation'](_0xabebf(0x187)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0xabebf(0x1af)+[...new Set(_0x38ca3f)][_0xabebf(0x199)](',\x20'));}export function validateReactModuleSource(_0x1ad356){const _0x469bd6=a11_0x1f4ab3;if(!_0x1ad356[_0x469bd6(0x1c9)]())throw CliErrors[_0x469bd6(0x1c6)](_0x469bd6(0x19b));if(PAGE_LEVEL_PATTERNS['some'](_0x289cb6=>_0x289cb6[_0x469bd6(0x197)](_0x1ad356)))throw CliErrors[_0x469bd6(0x1c6)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x1ad356);}function a11_0x3670(_0x4bba89,_0xe6406d){_0x4bba89=_0x4bba89-0x186;const _0x386293=a11_0x3862();let _0x367016=_0x386293[_0x4bba89];return _0x367016;}function buildArtifactInput(_0x799307){const _0x47f455=a11_0x1f4ab3,_0x3406a2=readSourceFile(_0x799307[_0x47f455(0x1b9)](_0x47f455(0x1d5))),_0x4905fb=_0x799307['str']('name')['trim'](),_0x1ebc59=parseMetadata(_0x799307[_0x47f455(0x1b9)](_0x47f455(0x1b0)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4905fb?{'name':_0x4905fb}:{},'content':_0x3406a2,..._0x1ebc59?{'metadata':_0x1ebc59}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x20177d){const _0x5a79d4=a11_0x1f4ab3;return{'id':_0x20177d['id'],'name':_0x20177d['name'],'artifactType':_0x20177d[_0x5a79d4(0x1b4)],'source':_0x20177d['source'],'favorite':_0x20177d[_0x5a79d4(0x1be)],'deleted':_0x20177d[_0x5a79d4(0x19a)],'createTime':_0x20177d[_0x5a79d4(0x1c1)],'updateTime':_0x20177d['updateTime']};}function detailArtifact(_0x32551e){const _0x32ead0=a11_0x1f4ab3;return{'id':_0x32551e['id'],'appCode':_0x32551e[_0x32ead0(0x1bc)],'name':_0x32551e['name'],'artifactType':_0x32551e[_0x32ead0(0x1b4)],'source':_0x32551e[_0x32ead0(0x1a8)],'favorite':_0x32551e[_0x32ead0(0x1be)],'deleted':_0x32551e['deleted'],'content':_0x32551e['content']??'','compiledContent':_0x32551e[_0x32ead0(0x1b7)],'metadata':_0x32551e[_0x32ead0(0x1b0)]??{},'createTime':_0x32551e['createTime'],'updateTime':_0x32551e[_0x32ead0(0x188)]};}function readFavoriteFlag(_0x1ffcb2){const _0xd63446=a11_0x1f4ab3,_0x409f91=_0x1ffcb2[_0xd63446(0x1c0)](_0xd63446(0x1be));return _0x409f91===undefined||_0x409f91===null||_0x409f91===''?undefined:_0x1ffcb2[_0xd63446(0x1cc)](_0xd63446(0x1be));}const artifactList={'service':a11_0x1f4ab3(0x196),'command':a11_0x1f4ab3(0x1a3),'description':a11_0x1f4ab3(0x1a2),'risk':'read','flags':[{'name':'source','type':a11_0x1f4ab3(0x18e),'description':a11_0x1f4ab3(0x1d3)},{'name':a11_0x1f4ab3(0x1be),'type':'boolean','description':a11_0x1f4ab3(0x194)},VERBOSE_FLAG],async 'execute'(_0x16281c){const _0x4e4a7c=a11_0x1f4ab3,_0x1b82e2=await listRuntimeArtifacts(_0x16281c[_0x4e4a7c(0x1bc)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x16281c[_0x4e4a7c(0x1b9)](_0x4e4a7c(0x1a8))?{'source':_0x16281c[_0x4e4a7c(0x1b9)](_0x4e4a7c(0x1a8))}:{},...readFavoriteFlag(_0x16281c)!==undefined?{'favorite':readFavoriteFlag(_0x16281c)}:{}});return{'ok':!![],'data':{'total':_0x1b82e2[_0x4e4a7c(0x1cb)],'items':_0x16281c[_0x4e4a7c(0x1cc)](_0x4e4a7c(0x18a))?_0x1b82e2:_0x1b82e2[_0x4e4a7c(0x190)](summarizeArtifact)}};}},artifactDetail={'service':a11_0x1f4ab3(0x196),'command':a11_0x1f4ab3(0x1c8),'description':a11_0x1f4ab3(0x19d),'risk':a11_0x1f4ab3(0x18d),'flags':[{...ID_FLAG,'description':a11_0x1f4ab3(0x1cd)}],async 'execute'(_0x22ab5e){const _0x5c2573=a11_0x1f4ab3,_0x225a1b=await getRuntimeArtifact(_0x22ab5e['num']('id'),_0x22ab5e[_0x5c2573(0x1bc)]);return{'ok':!![],'data':detailArtifact(_0x225a1b)};}},artifactCreate={'service':a11_0x1f4ab3(0x196),'command':a11_0x1f4ab3(0x1ca),'description':a11_0x1f4ab3(0x1ae),'risk':'read','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x31c506){const _0x4547f0=a11_0x1f4ab3,_0x56c877=buildArtifactInput(_0x31c506),_0x194de9=await createRuntimeArtifact(_0x31c506[_0x4547f0(0x1bc)],_0x56c877);return{'ok':!![],'data':detailArtifact(_0x194de9),'message':_0x4547f0(0x1b3)+_0x194de9['id']+(_0x194de9[_0x4547f0(0x193)]?'\x20('+_0x194de9[_0x4547f0(0x193)]+')':'')};},async 'dryRun'(_0x1184c6){const _0xdaff57=a11_0x1f4ab3,_0x1fdef1=buildArtifactInput(_0x1184c6);return dryRun(_0xdaff57(0x1b2),_0xdaff57(0x1b5))[_0xdaff57(0x1a9)]({'appCode':_0x1184c6[_0xdaff57(0x1bc)],..._0x1fdef1})[_0xdaff57(0x1c2)](_0xdaff57(0x1a0))['build']();}},artifactUpdate={'service':a11_0x1f4ab3(0x196),'command':a11_0x1f4ab3(0x1a1),'description':a11_0x1f4ab3(0x19e),'risk':a11_0x1f4ab3(0x18d),'flags':[{...ID_FLAG,'description':a11_0x1f4ab3(0x1cd)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x18a5d4){const _0x2846dd=a11_0x1f4ab3,_0x37d743=_0x18a5d4[_0x2846dd(0x195)]('id'),_0x1a2beb=buildArtifactInput(_0x18a5d4),_0x589445=await updateRuntimeArtifact(_0x37d743,_0x18a5d4[_0x2846dd(0x1bc)],_0x1a2beb);return{'ok':!![],'data':detailArtifact(_0x589445),'message':'Updated\x20Artifact\x20'+_0x589445['id']+(_0x589445['name']?'\x20('+_0x589445[_0x2846dd(0x193)]+')':'')};},async 'dryRun'(_0x4c4198){const _0x2a6c7d=a11_0x1f4ab3,_0x1c824c=_0x4c4198['num']('id'),_0x5a42e0=buildArtifactInput(_0x4c4198);return dryRun(_0x2a6c7d(0x1b2),_0x2a6c7d(0x1a4)+_0x1c824c+_0x2a6c7d(0x191))[_0x2a6c7d(0x1a9)]({'appCode':_0x4c4198[_0x2a6c7d(0x1bc)],..._0x5a42e0})['description'](_0x2a6c7d(0x18c)+_0x1c824c)[_0x2a6c7d(0x1a7)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x326fbb=a12_0x23a6;(function(_0x3bb7e8,_0x1b4703){const _0xe6ec92=a12_0x23a6,_0x27ac3f=_0x3bb7e8();while(!![]){try{const _0x228049=parseInt(_0xe6ec92(0x199))/0x1+parseInt(_0xe6ec92(0x1c8))/0x2+parseInt(_0xe6ec92(0x18e))/0x3*(parseInt(_0xe6ec92(0x1c0))/0x4)+-parseInt(_0xe6ec92(0x1a7))/0x5*(parseInt(_0xe6ec92(0x17d))/0x6)+-parseInt(_0xe6ec92(0x18c))/0x7*(parseInt(_0xe6ec92(0x1b3))/0x8)+-parseInt(_0xe6ec92(0x1b4))/0x9+parseInt(_0xe6ec92(0x18a))/0xa;if(_0x228049===_0x1b4703)break;else _0x27ac3f['push'](_0x27ac3f['shift']());}catch(_0xb362f){_0x27ac3f['push'](_0x27ac3f['shift']());}}}(a12_0xc2aa,0x99d24));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a12_0xc2aa(){const _0x112ec7=['118288gHDjdw','7902999gccZnT','&source=','status','global-default','str','toISOString','object','utf8','Invalid\x20device\x20auth\x20response','lovrabet-cli','stderr','\x20config.','4686796oJypZb','networkError','aborted','homeDirName','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','/.device-auth','randomUUID','/api/device-auth/token','7384KQGwBw','project','apiError','Device\x20authorization\x20successful.','34212YMZJoq','Write\x20to\x20project\x20config','\x20auth\x20device','Verify:\x20','Invalid\x20access_key\x20returned\x20by\x20server.','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','global','\x0dWaiting\x20for\x20authorization...\x20','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','\x20remaining','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','),\x20retrying...','createdAt','5506500NzTzyk','/device-auth?code=','595Pwnuwg','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','3QmyMAG','stringify','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','nonInteractive','access_key','success','once','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','abort','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','trim','1232800DiMKKx','SIGINT','boolean','accessKey','validation','log','cancelled','AccessKey\x20saved\x20to\x20','Device\x20authorization\x20cancelled.','getTime','parse','After\x20authorizing,\x20re-run:\x20','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','url-only','170eBxtyP','bool','data','write','source','floor','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','string','scope','name','code','Write\x20to\x20global\x20config\x20(default)'];a12_0xc2aa=function(){return _0x112ec7;};return a12_0xc2aa();}function resolveAuthScopeFlags(_0x2c4aae){const _0x41a6dd=a12_0x23a6;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2c4aae['bool'](_0x41a6dd(0x183)),'explicitProject':_0x2c4aae[_0x41a6dd(0x1a8)](_0x41a6dd(0x17a)),'policy':_0x41a6dd(0x1b7)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;export function generateDeviceCode(){const _0x1e18c8=a12_0x23a6;return crypto[_0x1e18c8(0x1c6)]();}function a12_0x23a6(_0x38c7c1,_0x55cfd7){_0x38c7c1=_0x38c7c1-0x17a;const _0xc2aa86=a12_0xc2aa();let _0x23a69c=_0xc2aa86[_0x38c7c1];return _0x23a69c;}export function buildDeviceAuthUrl(_0x3507fe,_0x5b5206,_0x31dc58=a12_0x326fbb(0x1bd)){const _0x147f89=a12_0x326fbb;return _0x3507fe+_0x147f89(0x18b)+encodeURIComponent(_0x5b5206)+_0x147f89(0x1b5)+encodeURIComponent(_0x31dc58);}export function getDeviceCodePath(){const _0xa0489e=a12_0x326fbb;return homedir()+'/'+PRODUCT_CONFIG[_0xa0489e(0x1c3)]+_0xa0489e(0x1c5);}export function readStoredDeviceCode(){const _0x33f43f=a12_0x326fbb,_0x8fa355=getDeviceCodePath();if(!existsSync(_0x8fa355))return null;try{const _0x5e12aa=readFileSync(_0x8fa355,{'encoding':'utf8'}),_0x5380a3=JSON[_0x33f43f(0x1a3)](_0x5e12aa);if(_0x5380a3&&typeof _0x5380a3[_0x33f43f(0x1b1)]===_0x33f43f(0x1ae)&&typeof _0x5380a3['createdAt']===_0x33f43f(0x1ae)&&(_0x5380a3['scope']===_0x33f43f(0x183)||_0x5380a3[_0x33f43f(0x1af)]===_0x33f43f(0x17a)))return _0x5380a3;}catch{}return null;}export function writeStoredDeviceCode(_0x1617ef,_0xf602a7){const _0x471fdf=a12_0x326fbb,_0x391161=getDeviceCodePath(),_0x27d186=dirname(_0x391161);!existsSync(_0x27d186)&&mkdirSync(_0x27d186,{'recursive':!![]});const _0x279694={'code':_0x1617ef,'createdAt':new Date()[_0x471fdf(0x1b9)](),'scope':_0xf602a7};writeFileSync(_0x391161,JSON[_0x471fdf(0x18f)](_0x279694),{'encoding':_0x471fdf(0x1bb),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x202129=getDeviceCodePath();try{unlinkSync(_0x202129);}catch{}}export function isStoredDeviceCodeExpired(_0x5d9800){const _0xf0be33=a12_0x326fbb;return Date['now']()-new Date(_0x5d9800[_0xf0be33(0x189)])[_0xf0be33(0x1a2)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x17b984,_0x3d591e){const _0x985db9=a12_0x326fbb,_0x1a6864=_0x17b984+_0x985db9(0x1c7),_0x51d7bc=new AbortController(),_0x49c8cb=setTimeout(()=>_0x51d7bc[_0x985db9(0x196)](),0x2710),_0x27993b=await fetch(_0x1a6864,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON[_0x985db9(0x18f)]({'code':_0x3d591e}),'signal':_0x51d7bc['signal']});clearTimeout(_0x49c8cb);if(!_0x27993b['ok'])throw CliErrors[_0x985db9(0x1c1)]('Device\x20auth\x20API\x20returned\x20HTTP\x20'+_0x27993b[_0x985db9(0x1b6)]);const _0x3d26dd=await _0x27993b['json'](),_0x4688c5=_0x3d26dd['data']&&typeof _0x3d26dd[_0x985db9(0x1a9)]===_0x985db9(0x1ba)?_0x3d26dd[_0x985db9(0x1a9)]:_0x3d26dd;if(!_0x4688c5||typeof _0x4688c5[_0x985db9(0x1b6)]!==_0x985db9(0x1ae))throw CliErrors[_0x985db9(0x17b)](_0x985db9(0x1bc));return{'status':_0x4688c5[_0x985db9(0x1b6)],'access_key':typeof _0x4688c5[_0x985db9(0x192)]===_0x985db9(0x1ae)?_0x4688c5[_0x985db9(0x192)]:undefined};}export async function pollDeviceToken(_0x5750de,_0x3d719e,_0x5c1c8e){const _0x2df128=a12_0x326fbb;let _0x20c527=0x0;for(let _0x1ba1b9=0x0;_0x1ba1b9<MAX_POLLS;_0x1ba1b9++){if(_0x5c1c8e[_0x2df128(0x1c2)])throw CliErrors[_0x2df128(0x19f)](_0x2df128(0x1a1));let _0x534882;try{_0x534882=await fetchDeviceToken(_0x5750de,_0x3d719e);}catch(_0x4bfe58){if(_0x4bfe58 instanceof Error&&_0x4bfe58[_0x2df128(0x1b0)]==='AbortError')throw CliErrors[_0x2df128(0x19f)](_0x2df128(0x1a1));_0x20c527++;if(_0x20c527>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x2df128(0x1c1)](_0x2df128(0x1ad));writeCliSideChannelLine('Device\x20auth\x20API\x20error\x20('+_0x20c527+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x2df128(0x188)),await sleep(POLL_INTERVAL_MS);continue;}_0x20c527=0x0;if(_0x534882[_0x2df128(0x1b6)]===_0x2df128(0x193)){if(!_0x534882[_0x2df128(0x192)])throw CliErrors[_0x2df128(0x17b)](_0x2df128(0x181));return _0x534882[_0x2df128(0x192)];}if(_0x534882[_0x2df128(0x1b6)]==='expired'){deleteStoredDeviceCode();throw CliErrors['validation'](_0x2df128(0x195));}const _0x2fe9ae=(_0x1ba1b9+0x1)*POLL_INTERVAL_MS,_0x2bc9d4=DEVICE_CODE_TTL_MS-_0x2fe9ae,_0x4c0d7f=Math[_0x2df128(0x1ac)](_0x2bc9d4/0xea60),_0x3952c5=Math[_0x2df128(0x1ac)](_0x2bc9d4%0xea60/0x3e8);process['stderr'][_0x2df128(0x1aa)](_0x2df128(0x184)+_0x4c0d7f+':'+String(_0x3952c5)['padStart'](0x2,'0')+_0x2df128(0x186)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x2df128(0x19d)](_0x2df128(0x1a5));}function sleep(_0x416106){return new Promise(_0x497e61=>setTimeout(_0x497e61,_0x416106));}export const authDeviceDefinition={'service':'auth','command':'device','description':a12_0x326fbb(0x190),'risk':a12_0x326fbb(0x1aa),'confirmationDescription':a12_0x326fbb(0x18d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x326fbb(0x183),'type':a12_0x326fbb(0x19b),'description':a12_0x326fbb(0x1b2),'default':!![]},{'name':a12_0x326fbb(0x17a),'type':a12_0x326fbb(0x19b),'description':a12_0x326fbb(0x17e),'default':![]},{'name':a12_0x326fbb(0x1ab),'type':a12_0x326fbb(0x1ae),'description':'App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','default':a12_0x326fbb(0x1bd)},{'name':'url-only','type':'boolean','description':a12_0x326fbb(0x182),'default':![]}],async 'execute'(_0x5d9b73){const _0x3bee3f=a12_0x326fbb,_0x1c5b78=resolveAuthScopeFlags(_0x5d9b73),_0x20a613=_0x1c5b78[_0x3bee3f(0x183)]?'global':_0x3bee3f(0x17a),_0x24384e=readScopedConfig(_0x1c5b78);if(_0x24384e[_0x3bee3f(0x19c)])return{'ok':!![],'message':_0x3bee3f(0x1c4)};const _0x2d4bdd=(_0x5d9b73[_0x3bee3f(0x1b8)]('source')||'lovrabet-cli')[_0x3bee3f(0x198)](),_0x43e8a5=getUserDomain(),_0x58a6c5=readStoredDeviceCode(),_0x1dd875=_0x58a6c5&&!isStoredDeviceCodeExpired(_0x58a6c5)?_0x58a6c5[_0x3bee3f(0x1b1)]:((()=>{const _0xf72dfd=generateDeviceCode();return writeStoredDeviceCode(_0xf72dfd,_0x20a613),_0xf72dfd;})()),_0x4f4ba7=buildDeviceAuthUrl(_0x43e8a5,_0x1dd875,_0x2d4bdd);if(_0x5d9b73['bool'](_0x3bee3f(0x1a6)))return console[_0x3bee3f(0x19e)](_0x4f4ba7),{'ok':!![]};writeCliSideChannelLine('Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:'),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x4f4ba7),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x3bee3f(0x187));if(_0x5d9b73[_0x3bee3f(0x191)])return writeCliSideChannelLine(_0x3bee3f(0x1a4)+CLI_BIN_NAME+_0x3bee3f(0x17f)),{'ok':!![],'message':_0x3bee3f(0x197)};writeCliSideChannelLine(_0x3bee3f(0x185));const _0x9db7e6=new AbortController(),_0x17726a=()=>{const _0x17b64e=_0x3bee3f;_0x9db7e6[_0x17b64e(0x196)](),process['removeListener'](_0x17b64e(0x19a),_0x17726a);};process[_0x3bee3f(0x194)](_0x3bee3f(0x19a),_0x17726a);let _0x797422;try{_0x797422=await pollDeviceToken(_0x43e8a5,_0x1dd875,_0x9db7e6['signal']);}finally{process['removeListener'](_0x3bee3f(0x19a),_0x17726a);}if(!ACCESS_KEY_PATTERN['test'](_0x797422))throw CliErrors['apiError'](_0x3bee3f(0x181));const _0x587603=readScopedConfig(_0x1c5b78);return _0x587603[_0x3bee3f(0x19c)]=_0x797422,writeScopedConfig(_0x587603,_0x1c5b78),deleteStoredDeviceCode(),process[_0x3bee3f(0x1be)]['write']('\x0a'),writeCliSideChannelLine(_0x3bee3f(0x1a0)+_0x20a613+_0x3bee3f(0x1bf)),writeCliSideChannelLine(_0x3bee3f(0x180)+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x3bee3f(0x17c)};}};
|
|
1
|
+
const a12_0x2ffeec=a12_0x5b84;(function(_0x22bf61,_0x1b94c6){const _0x552151=a12_0x5b84,_0x437939=_0x22bf61();while(!![]){try{const _0x2f2b74=parseInt(_0x552151(0x191))/0x1*(-parseInt(_0x552151(0x192))/0x2)+parseInt(_0x552151(0x166))/0x3*(parseInt(_0x552151(0x188))/0x4)+-parseInt(_0x552151(0x17e))/0x5*(parseInt(_0x552151(0x142))/0x6)+-parseInt(_0x552151(0x18b))/0x7*(parseInt(_0x552151(0x18d))/0x8)+-parseInt(_0x552151(0x15b))/0x9*(parseInt(_0x552151(0x174))/0xa)+parseInt(_0x552151(0x187))/0xb*(parseInt(_0x552151(0x17d))/0xc)+parseInt(_0x552151(0x15e))/0xd;if(_0x2f2b74===_0x1b94c6)break;else _0x437939['push'](_0x437939['shift']());}catch(_0x1358ae){_0x437939['push'](_0x437939['shift']());}}}(a12_0x15a4,0x848c4));import{existsSync,mkdirSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';import{dirname}from'node:path';import{homedir}from'node:os';import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{getUserDomain}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function resolveAuthScopeFlags(_0x2b2eda){const _0x24fef4=a12_0x5b84;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2b2eda[_0x24fef4(0x171)](_0x24fef4(0x175)),'explicitProject':_0x2b2eda[_0x24fef4(0x171)](_0x24fef4(0x179)),'policy':_0x24fef4(0x150)}));}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/,DEVICE_CODE_TTL_MS=0x927c0,POLL_INTERVAL_MS=0xbb8,MAX_POLLS=0xc8,MAX_CONSECUTIVE_NETWORK_ERRORS=0x5;function a12_0x5b84(_0x2fa849,_0x2991ca){_0x2fa849=_0x2fa849-0x13d;const _0x15a4f7=a12_0x15a4();let _0x5b8439=_0x15a4f7[_0x2fa849];return _0x5b8439;}export function generateDeviceCode(){const _0x2fae8a=a12_0x5b84;return crypto[_0x2fae8a(0x17c)]();}export function buildDeviceAuthUrl(_0x434ee0,_0x3fb4c6,_0x167bac=a12_0x2ffeec(0x16b)){const _0x1b3326=a12_0x2ffeec;return _0x434ee0+_0x1b3326(0x16d)+encodeURIComponent(_0x3fb4c6)+'&source='+encodeURIComponent(_0x167bac);}export function getDeviceCodePath(){const _0x5251b5=a12_0x2ffeec;return homedir()+'/'+PRODUCT_CONFIG[_0x5251b5(0x181)]+_0x5251b5(0x14b);}export function readStoredDeviceCode(){const _0x4f2708=a12_0x2ffeec,_0x32e244=getDeviceCodePath();if(!existsSync(_0x32e244))return null;try{const _0x45ee47=readFileSync(_0x32e244,{'encoding':_0x4f2708(0x17a)}),_0x433d6b=JSON[_0x4f2708(0x146)](_0x45ee47);if(_0x433d6b&&typeof _0x433d6b[_0x4f2708(0x18a)]===_0x4f2708(0x190)&&typeof _0x433d6b[_0x4f2708(0x157)]==='string'&&(_0x433d6b[_0x4f2708(0x15c)]==='global'||_0x433d6b[_0x4f2708(0x15c)]===_0x4f2708(0x179)))return _0x433d6b;}catch{}return null;}export function writeStoredDeviceCode(_0xa474fe,_0x4dbfcd){const _0x213508=a12_0x2ffeec,_0xee3914=getDeviceCodePath(),_0x100b33=dirname(_0xee3914);!existsSync(_0x100b33)&&mkdirSync(_0x100b33,{'recursive':!![]});const _0x11e069={'code':_0xa474fe,'createdAt':new Date()[_0x213508(0x143)](),'scope':_0x4dbfcd};writeFileSync(_0xee3914,JSON[_0x213508(0x169)](_0x11e069),{'encoding':_0x213508(0x17a),'mode':0x180});}export function deleteStoredDeviceCode(){const _0x3445aa=getDeviceCodePath();try{unlinkSync(_0x3445aa);}catch{}}export function isStoredDeviceCodeExpired(_0x42b668){const _0x46fef2=a12_0x2ffeec;return Date[_0x46fef2(0x14d)]()-new Date(_0x42b668[_0x46fef2(0x157)])[_0x46fef2(0x15d)]()>DEVICE_CODE_TTL_MS;}export async function fetchDeviceToken(_0x3b40b9,_0x446183){const _0x2b6a8f=a12_0x2ffeec,_0x7c5dc4=_0x3b40b9+_0x2b6a8f(0x177),_0x39908c=new AbortController(),_0x36c6e0=setTimeout(()=>_0x39908c['abort'](),0x2710),_0x163c2b=await fetch(_0x7c5dc4,{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON[_0x2b6a8f(0x169)]({'code':_0x446183}),'signal':_0x39908c[_0x2b6a8f(0x186)]});clearTimeout(_0x36c6e0);if(!_0x163c2b['ok'])throw CliErrors[_0x2b6a8f(0x159)](_0x2b6a8f(0x152)+_0x163c2b[_0x2b6a8f(0x165)]);const _0x8e1c15=await _0x163c2b['json'](),_0x12cf0b=_0x8e1c15[_0x2b6a8f(0x172)]&&typeof _0x8e1c15[_0x2b6a8f(0x172)]===_0x2b6a8f(0x170)?_0x8e1c15['data']:_0x8e1c15;if(!_0x12cf0b||typeof _0x12cf0b[_0x2b6a8f(0x165)]!==_0x2b6a8f(0x190))throw CliErrors[_0x2b6a8f(0x140)](_0x2b6a8f(0x16f));return{'status':_0x12cf0b[_0x2b6a8f(0x165)],'access_key':typeof _0x12cf0b[_0x2b6a8f(0x180)]==='string'?_0x12cf0b[_0x2b6a8f(0x180)]:undefined};}export async function pollDeviceToken(_0x5bfbc3,_0x54fc06,_0x2db10f){const _0x408748=a12_0x2ffeec;let _0x3e86ef=0x0;for(let _0xa7516=0x0;_0xa7516<MAX_POLLS;_0xa7516++){if(_0x2db10f[_0x408748(0x15f)])throw CliErrors[_0x408748(0x145)](_0x408748(0x158));let _0xe8ee9a;try{_0xe8ee9a=await fetchDeviceToken(_0x5bfbc3,_0x54fc06);}catch(_0x359ade){if(_0x359ade instanceof Error&&_0x359ade[_0x408748(0x14e)]===_0x408748(0x148))throw CliErrors[_0x408748(0x145)](_0x408748(0x158));_0x3e86ef++;if(_0x3e86ef>=MAX_CONSECUTIVE_NETWORK_ERRORS)throw CliErrors[_0x408748(0x159)](_0x408748(0x16a));writeCliSideChannelLine(_0x408748(0x13f)+_0x3e86ef+'/'+MAX_CONSECUTIVE_NETWORK_ERRORS+_0x408748(0x162)),await sleep(POLL_INTERVAL_MS);continue;}_0x3e86ef=0x0;if(_0xe8ee9a[_0x408748(0x165)]===_0x408748(0x183)){if(!_0xe8ee9a[_0x408748(0x180)])throw CliErrors[_0x408748(0x140)](_0x408748(0x163));return _0xe8ee9a[_0x408748(0x180)];}if(_0xe8ee9a[_0x408748(0x165)]===_0x408748(0x15a)){deleteStoredDeviceCode();throw CliErrors[_0x408748(0x144)](_0x408748(0x160));}const _0x21db3c=(_0xa7516+0x1)*POLL_INTERVAL_MS,_0x4f6c33=DEVICE_CODE_TTL_MS-_0x21db3c,_0x2acc5f=Math[_0x408748(0x155)](_0x4f6c33/0xea60),_0x2e599e=Math[_0x408748(0x155)](_0x4f6c33%0xea60/0x3e8);process[_0x408748(0x18f)][_0x408748(0x176)](_0x408748(0x141)+_0x2acc5f+':'+String(_0x2e599e)[_0x408748(0x13d)](0x2,'0')+_0x408748(0x156)),await sleep(POLL_INTERVAL_MS);}deleteStoredDeviceCode();throw CliErrors[_0x408748(0x144)](_0x408748(0x13e));}function sleep(_0xf7bc9f){return new Promise(_0x322d99=>setTimeout(_0x322d99,_0xf7bc9f));}export const authDeviceDefinition={'service':a12_0x2ffeec(0x185),'command':a12_0x2ffeec(0x173),'description':a12_0x2ffeec(0x17b),'risk':a12_0x2ffeec(0x176),'confirmationDescription':a12_0x2ffeec(0x161),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x2ffeec(0x175),'type':'boolean','description':a12_0x2ffeec(0x189),'default':!![]},{'name':'project','type':a12_0x2ffeec(0x182),'description':a12_0x2ffeec(0x18e),'default':![]},{'name':'source','type':a12_0x2ffeec(0x190),'description':a12_0x2ffeec(0x151),'default':a12_0x2ffeec(0x16b)},{'name':a12_0x2ffeec(0x14c),'type':'boolean','description':a12_0x2ffeec(0x168),'default':![]}],async 'execute'(_0xf5ca0d){const _0x8800dc=a12_0x2ffeec,_0x5481aa=resolveAuthScopeFlags(_0xf5ca0d),_0x547c3c=_0x5481aa[_0x8800dc(0x175)]?'global':_0x8800dc(0x179),_0x1c4b2b=readScopedConfig(_0x5481aa);if(_0x1c4b2b[_0x8800dc(0x14f)])return{'ok':!![],'message':_0x8800dc(0x14a)};const _0x3ed650=(_0xf5ca0d['str'](_0x8800dc(0x194))||'lovrabet-cli')[_0x8800dc(0x16e)](),_0x3d9ffb=getUserDomain(),_0x3e87c7=readStoredDeviceCode(),_0x3b1197=_0x3e87c7&&!isStoredDeviceCodeExpired(_0x3e87c7)?_0x3e87c7[_0x8800dc(0x18a)]:((()=>{const _0x867c6a=generateDeviceCode();return writeStoredDeviceCode(_0x867c6a,_0x547c3c),_0x867c6a;})()),_0x34802f=buildDeviceAuthUrl(_0x3d9ffb,_0x3b1197,_0x3ed650);if(_0xf5ca0d['bool'](_0x8800dc(0x14c)))return console['log'](_0x34802f),{'ok':!![]};writeCliSideChannelLine(_0x8800dc(0x18c)),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x34802f),writeCliSideChannelLine(''),writeCliSideChannelLine(_0x8800dc(0x178));if(_0xf5ca0d[_0x8800dc(0x195)])return writeCliSideChannelLine('After\x20authorizing,\x20re-run:\x20'+CLI_BIN_NAME+_0x8800dc(0x184)),{'ok':!![],'message':_0x8800dc(0x167)};writeCliSideChannelLine(_0x8800dc(0x153));const _0x1e7f9c=new AbortController(),_0x4bec9d=()=>{const _0x59ff94=_0x8800dc;_0x1e7f9c[_0x59ff94(0x147)](),process[_0x59ff94(0x164)](_0x59ff94(0x17f),_0x4bec9d);};process[_0x8800dc(0x149)](_0x8800dc(0x17f),_0x4bec9d);let _0x915df4;try{_0x915df4=await pollDeviceToken(_0x3d9ffb,_0x3b1197,_0x1e7f9c[_0x8800dc(0x186)]);}finally{process['removeListener'](_0x8800dc(0x17f),_0x4bec9d);}if(!ACCESS_KEY_PATTERN[_0x8800dc(0x154)](_0x915df4))throw CliErrors['apiError'](_0x8800dc(0x163));const _0xcc0edb=readScopedConfig(_0x5481aa);return _0xcc0edb['accessKey']=_0x915df4,writeScopedConfig(_0xcc0edb,_0x5481aa),deleteStoredDeviceCode(),process[_0x8800dc(0x18f)]['write']('\x0a'),writeCliSideChannelLine('AccessKey\x20saved\x20to\x20'+_0x547c3c+'\x20config.'),writeCliSideChannelLine(_0x8800dc(0x193)+CLI_BIN_NAME+'\x20auth\x20status'),{'ok':!![],'message':_0x8800dc(0x16c)};}};function a12_0x15a4(){const _0x4815d7=['data','device','10fudbQO','global','write','/api/device-auth/token','The\x20device\x20code\x20is\x20valid\x20for\x2010\x20minutes.','project','utf8','Authorize\x20with\x20the\x20device-code\x20flow\x20(complete\x20in\x20the\x20browser;\x20no\x20copy-paste\x20required)','randomUUID','2200284USvEaI','105CgraAW','SIGINT','access_key','homeDirName','boolean','success','\x20auth\x20device','auth','signal','11xDAylc','1796JrGOAA','Write\x20to\x20global\x20config\x20(default)','code','213409cSzgZn','Open\x20this\x20URL\x20in\x20your\x20browser\x20to\x20authorize:','16GXxXWp','Write\x20to\x20project\x20config','stderr','string','3pYOOoU','79346dvxdYP','Verify:\x20','source','nonInteractive','padStart','Device\x20authorization\x20timed\x20out\x20after\x2010\x20minutes.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','Device\x20auth\x20API\x20error\x20(','apiError','\x0dWaiting\x20for\x20authorization...\x20','157434ZcYEGc','toISOString','validation','cancelled','parse','abort','AbortError','once','Already\x20authorized.\x20Use\x20`lovrabet\x20auth\x20status`\x20to\x20verify.','/.device-auth','url-only','now','name','accessKey','global-default','App\x20name\x20shown\x20on\x20authorization\x20page\x20(default:\x20lovrabet)','Device\x20auth\x20API\x20returned\x20HTTP\x20','Waiting\x20for\x20authorization\x20(timeout:\x2010\x20minutes,\x20Ctrl+C\x20to\x20cancel)...','test','floor','\x20remaining','createdAt','Device\x20authorization\x20cancelled.','networkError','expired','7491429dwwkuT','scope','getTime','21070075THLOsB','aborted','Device\x20code\x20expired.\x20Run\x20`lovrabet\x20auth\x20device`\x20to\x20get\x20a\x20new\x20code.','Starts\x20the\x20device-code\x20login\x20flow.\x20On\x20success,\x20the\x20AccessKey\x20is\x20saved\x20to\x20the\x20selected\x20Lovrabet\x20config.\x20The\x20confirmation\x20UI\x20does\x20not\x20show\x20the\x20device\x20code\x20or\x20secret.','),\x20retrying...','Invalid\x20access_key\x20returned\x20by\x20server.','removeListener','status','2019TjpZBY','Device\x20authorization\x20URL\x20printed.\x20Complete\x20authorization\x20in\x20browser,\x20then\x20re-run.','Print\x20URL\x20to\x20stdout\x20and\x20exit\x20(for\x20WorkBuddy\x20integration)','stringify','Device\x20auth\x20API\x20unreachable\x20after\x20multiple\x20retries.','lovrabet-cli','Device\x20authorization\x20successful.','/device-auth?code=','trim','Invalid\x20device\x20auth\x20response','object','bool'];a12_0x15a4=function(){return _0x4815d7;};return a12_0x15a4();}
|