@lovrabet/lovrabet-cli 2.1.7-beta.1 → 2.1.7-beta.3
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/artifact/index.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/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.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/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/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-retarget.js +1 -0
- 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/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/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/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/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/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.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/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/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -2
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x59ca99=a53_0x2e22;function a53_0x26df(){const _0x2919fe=['Override\x20SkillHub\x20domain','3110868JydROr','21532qBDdJm','locale','Override\x20API\x20domain','Default\x20page\x20size','1802388hjYGCQ','1192tgDWPL','map','18277QUIzZh','format','Override\x20runtime\x20domain','Default\x20output\x20format',';\x20local\x20alias:\x20apps.<alias>.appcode','enumValues','importable','Override\x20user\x20domain','19lTVTRY','9046440igRQBS','854028lqWDvT','1534756ccqKyk','Config\x20key.\x20Top-level:\x20','Target\x20environment','defaultValue','join','Locale','entries','5FJgKqa','filter'];a53_0x26df=function(){return _0x2919fe;};return a53_0x26df();}(function(_0x1be7a4,_0x506412){const _0x1742dd=a53_0x2e22,_0xcc58e5=_0x1be7a4();while(!![]){try{const _0x47d9a5=parseInt(_0x1742dd(0x1b9))/0x1*(parseInt(_0x1742dd(0x1aa))/0x2)+parseInt(_0x1742dd(0x1bb))/0x3+parseInt(_0x1742dd(0x1bc))/0x4*(-parseInt(_0x1742dd(0x1a6))/0x5)+parseInt(_0x1742dd(0x1ae))/0x6+-parseInt(_0x1742dd(0x1b1))/0x7*(-parseInt(_0x1742dd(0x1af))/0x8)+parseInt(_0x1742dd(0x1a9))/0x9+-parseInt(_0x1742dd(0x1ba))/0xa;if(_0x47d9a5===_0x506412)break;else _0xcc58e5['push'](_0xcc58e5['shift']());}catch(_0x25725a){_0xcc58e5['push'](_0xcc58e5['shift']());}}}(a53_0x26df,0x399d2));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':a53_0x59ca99(0x1be),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['env'],'importable':!![]},'format':{'description':a53_0x59ca99(0x1b4),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a53_0x59ca99(0x1b2)],'importable':!![]},'pageSize':{'description':a53_0x59ca99(0x1ad),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a53_0x59ca99(0x1ac),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a53_0x59ca99(0x1b8),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a53_0x59ca99(0x1b3),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillHubDomain':{'description':a53_0x59ca99(0x1a8),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':'Access\x20key\x20(client-ak\x20auth)','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':'Risk\x20level','topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES['riskLevel'],'importable':!![]},'locale':{'description':a53_0x59ca99(0x1a4),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a53_0x59ca99(0x1ab)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a53_0x59ca99(0x1a5)](CONFIG_FIELD_SCHEMAS)[a53_0x59ca99(0x1a7)](([,_0x2e85f3])=>_0x2e85f3['cliSettableTopLevel'])[a53_0x59ca99(0x1b0)](([_0x4ba647])=>_0x4ba647));export const CONFIG_ENUM_VALUES=Object['fromEntries'](Object['entries'](CONFIG_FIELD_SCHEMAS)[a53_0x59ca99(0x1a7)](([,_0xa6c08f])=>_0xa6c08f['enumValues'])['map'](([_0x1bfd07,_0xeabd50])=>[_0x1bfd07,[..._0xeabd50['enumValues']||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object['entries'](CONFIG_FIELD_SCHEMAS)[a53_0x59ca99(0x1a7)](([,_0x569f58])=>_0x569f58[a53_0x59ca99(0x1b7)])['map'](([_0x10203d])=>_0x10203d);export function getConfigFieldSchema(_0xa06548){return CONFIG_FIELD_SCHEMAS[_0xa06548];}export function getConfigEnumValues(_0x5aee0f){const _0x21f419=a53_0x59ca99;return getConfigFieldSchema(_0x5aee0f)?.[_0x21f419(0x1b6)];}export function getConfigDefaultValue(_0x8983f6){const _0x5d61fd=a53_0x59ca99;return getConfigFieldSchema(_0x8983f6)?.[_0x5d61fd(0x1a2)];}export function isTopLevelConfigKey(_0x3991f1){return TOP_LEVEL_CONFIG_KEYS['has'](_0x3991f1);}export function isLegacyCompatConfigKey(_0x4d2da8){return getConfigFieldSchema(_0x4d2da8)?.['legacyCompatOnly']===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}function a53_0x2e22(_0x56eb06,_0x8ef832){_0x56eb06=_0x56eb06-0x1a2;const _0x26dfca=a53_0x26df();let _0x2e2262=_0x26dfca[_0x56eb06];return _0x2e2262;}export function formatConfigKeyList(_0x2bc4e5){const _0x7e7ab8=a53_0x59ca99;return[..._0x2bc4e5][_0x7e7ab8(0x1a3)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x26bb7d=a53_0x59ca99;return _0x26bb7d(0x1bd)+getTopLevelConfigKeySummary()+_0x26bb7d(0x1b5);}export function buildAppProfileListFields(_0xdb4b31){return{'env':_0xdb4b31,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
package/lib/constant/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a54_0x2e3c(){const _0xc326c2=['Published','3HKYSqQ','2062992nHzHXy','45eZuYYE','PUBLISHED','205vASNQM','511358OvQFuN','12vwtzAd','7264NdhsUa','182997hRrhPA','647059shuWLe','5224879hVoNhR','348070zMFnIK'];a54_0x2e3c=function(){return _0xc326c2;};return a54_0x2e3c();}const a54_0x17287b=a54_0x3b2e;(function(_0x471c6f,_0x2b9c80){const _0x18ab2f=a54_0x3b2e,_0x1b6a64=_0x471c6f();while(!![]){try{const _0x4193de=parseInt(_0x18ab2f(0xb4))/0x1+parseInt(_0x18ab2f(0xbe))/0x2*(parseInt(_0x18ab2f(0xb9))/0x3)+-parseInt(_0x18ab2f(0xb3))/0x4*(-parseInt(_0x18ab2f(0xbd))/0x5)+parseInt(_0x18ab2f(0xb2))/0x6*(parseInt(_0x18ab2f(0xb5))/0x7)+-parseInt(_0x18ab2f(0xba))/0x8+parseInt(_0x18ab2f(0xbb))/0x9*(parseInt(_0x18ab2f(0xb7))/0xa)+-parseInt(_0x18ab2f(0xb6))/0xb;if(_0x4193de===_0x2b9c80)break;else _0x1b6a64['push'](_0x1b6a64['shift']());}catch(_0x23c3e2){_0x1b6a64['push'](_0x1b6a64['shift']());}}}(a54_0x2e3c,0x21faa));export const APP_PUBLISH_STATUS={'Published':a54_0x17287b(0xbc),'Unpublished':'UNPUBLISH'};function a54_0x3b2e(_0x43169e,_0xa3666e){_0x43169e=_0x43169e-0xb2;const _0x2e3c0e=a54_0x2e3c();let _0x3b2e0f=_0x2e3c0e[_0x43169e];return _0x3b2e0f;}export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS[a54_0x17287b(0xb8)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x19699e=a55_0x35b8;function a55_0x35b8(_0x1f4308,_0x1ccc27){_0x1f4308=_0x1f4308-0x119;const _0x62a46=a55_0x62a4();let _0x35b818=_0x62a46[_0x1f4308];return _0x35b818;}(function(_0xb5921b,_0x29d399){const _0x4ab11=a55_0x35b8,_0x508e4e=_0xb5921b();while(!![]){try{const _0x4afe77=-parseInt(_0x4ab11(0x11c))/0x1+-parseInt(_0x4ab11(0x121))/0x2*(parseInt(_0x4ab11(0x11b))/0x3)+parseInt(_0x4ab11(0x11f))/0x4*(parseInt(_0x4ab11(0x11d))/0x5)+-parseInt(_0x4ab11(0x127))/0x6*(-parseInt(_0x4ab11(0x122))/0x7)+parseInt(_0x4ab11(0x125))/0x8*(-parseInt(_0x4ab11(0x11a))/0x9)+parseInt(_0x4ab11(0x120))/0xa*(parseInt(_0x4ab11(0x124))/0xb)+parseInt(_0x4ab11(0x123))/0xc*(parseInt(_0x4ab11(0x126))/0xd);if(_0x4afe77===_0x29d399)break;else _0x508e4e['push'](_0x508e4e['shift']());}catch(_0x41df11){_0x508e4e['push'](_0x508e4e['shift']());}}}(a55_0x62a4,0x5be4f));export const AUTH_MODE={'ClientAk':a55_0x19699e(0x119)};function a55_0x62a4(){const _0x144e20=['3324yCWEQr','652157XVbXSc','1248728JxysMm','51662SBKXci','6TDJJfT','client-ak','9gSvvjo','4122druiTZ','405192irfxzL','26170rCLqNk','ClientAk','196WDcouK','20erILZa','898OHqwhE','551390mNGQUb'];a55_0x62a4=function(){return _0x144e20;};return a55_0x62a4();}export function isAuthMode(_0x216b64){const _0x1e40e1=a55_0x19699e;return _0x216b64===AUTH_MODE[_0x1e40e1(0x11e)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a56_0x23bd(_0x5aecee,_0x2bdb25){_0x5aecee=_0x5aecee-0x12b;const _0x314c61=a56_0x314c();let _0x23bd72=_0x314c61[_0x5aecee];return _0x23bd72;}const a56_0x2f097a=a56_0x23bd;function a56_0x314c(){const _0x4f06e8=['boolean','96fhPvrs','Record\x20ID','help','string','110hCiMyU','map','Output\x20format','appcode','<code>','Force\x20non-interactive\x20mode\x20(CI)','Skip\x20confirmation\x20for\x20high-risk\x20writes','cliBinName','dry-run','8969328SQlkOs','Alias\x20for\x20--non-interactive','5MkNZjP','nonInteractive','cliDisplayName','<expr>','<name>','fromEntries','Name\x20filter','production\x20|\x20development\x20|\x20daily','clear','yes','non-interactive','name','Preview\x20operation\x20without\x20executing','sqlcode','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','1235553QtmjNk','global','Use\x20global\x20config\x20scope','params','Override\x20appcode','5748USgDIT','1011020RQMBhk','format','141281eboZnp','env','192RDHeSa','verbose','app','type','1969962iGFyMI','680978rbFEOM','dryRun','Select\x20app\x20profile\x20by\x20name'];a56_0x314c=function(){return _0x4f06e8;};return a56_0x314c();}(function(_0x14dc45,_0x3a07db){const _0xb3d456=a56_0x23bd,_0x48d484=_0x14dc45();while(!![]){try{const _0xab2477=-parseInt(_0xb3d456(0x147))/0x1+parseInt(_0xb3d456(0x13e))/0x2+-parseInt(_0xb3d456(0x13d))/0x3*(-parseInt(_0xb3d456(0x142))/0x4)+parseInt(_0xb3d456(0x15a))/0x5*(parseInt(_0xb3d456(0x146))/0x6)+parseInt(_0xb3d456(0x140))/0x7*(parseInt(_0xb3d456(0x14b))/0x8)+-parseInt(_0xb3d456(0x158))/0x9+parseInt(_0xb3d456(0x14f))/0xa*(parseInt(_0xb3d456(0x138))/0xb);if(_0xab2477===_0x3a07db)break;else _0x48d484['push'](_0x48d484['shift']());}catch(_0x2c128f){_0x48d484['push'](_0x48d484['shift']());}}}(a56_0x314c,0xb13e0));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a56_0x2f097a(0x156)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a56_0x2f097a(0x12b)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a56_0x2f097a(0x152),'meowKey':a56_0x2f097a(0x152),'type':a56_0x2f097a(0x14e),'description':a56_0x2f097a(0x13c),'hint':a56_0x2f097a(0x153)},{'name':a56_0x2f097a(0x144),'meowKey':a56_0x2f097a(0x144),'type':'string','description':a56_0x2f097a(0x149),'hint':a56_0x2f097a(0x12d)},{'name':a56_0x2f097a(0x141),'meowKey':a56_0x2f097a(0x141),'type':a56_0x2f097a(0x14e),'description':'Environment','hint':a56_0x2f097a(0x130)},{'name':a56_0x2f097a(0x13f),'meowKey':a56_0x2f097a(0x13f),'type':a56_0x2f097a(0x14e),'description':a56_0x2f097a(0x151),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a56_0x2f097a(0x14e),'description':a56_0x2f097a(0x137),'hint':a56_0x2f097a(0x12c)},{'name':a56_0x2f097a(0x157),'meowKey':a56_0x2f097a(0x148),'type':a56_0x2f097a(0x14a),'description':a56_0x2f097a(0x135)},{'name':a56_0x2f097a(0x132),'meowKey':'yes','type':a56_0x2f097a(0x14a),'description':a56_0x2f097a(0x155)},{'name':a56_0x2f097a(0x133),'meowKey':a56_0x2f097a(0x15b),'type':a56_0x2f097a(0x14a),'description':a56_0x2f097a(0x154)},{'name':a56_0x2f097a(0x139),'meowKey':'global','type':a56_0x2f097a(0x14a),'description':a56_0x2f097a(0x13a)},{'name':'ci','meowKey':'ci','type':a56_0x2f097a(0x14a),'description':a56_0x2f097a(0x159),'hidden':!![]},{'name':a56_0x2f097a(0x14d),'meowKey':a56_0x2f097a(0x14d),'type':'boolean','description':'Show\x20help'},{'name':'id','meowKey':'id','type':a56_0x2f097a(0x14e),'description':a56_0x2f097a(0x14c),'hidden':!![]},{'name':'name','meowKey':a56_0x2f097a(0x134),'type':a56_0x2f097a(0x14e),'description':a56_0x2f097a(0x12f),'hidden':!![]},{'name':a56_0x2f097a(0x136),'meowKey':a56_0x2f097a(0x136),'type':a56_0x2f097a(0x14e),'description':'SQL\x20query\x20code','hidden':!![]},{'name':a56_0x2f097a(0x13b),'meowKey':'params','type':'string','description':'JSON\x20params\x20for\x20execute\x20commands','hidden':!![]},{'name':a56_0x2f097a(0x143),'meowKey':a56_0x2f097a(0x143),'type':a56_0x2f097a(0x14a),'description':'Verbose\x20output','hidden':!![]},{'name':a56_0x2f097a(0x131),'meowKey':a56_0x2f097a(0x131),'type':a56_0x2f097a(0x14a),'description':'Clear\x20output','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a56_0x2f097a(0x152),a56_0x2f097a(0x144),a56_0x2f097a(0x141),a56_0x2f097a(0x13f),'jq',a56_0x2f097a(0x157),a56_0x2f097a(0x132),a56_0x2f097a(0x133),'ci']);export function buildMeowFlags(){const _0x462d58=a56_0x2f097a;return Object[_0x462d58(0x12e)](GLOBAL_FLAGS[_0x462d58(0x150)](_0x299fa8=>[_0x299fa8['meowKey'],{'type':_0x299fa8[_0x462d58(0x145)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x3a754e=a57_0x2428;(function(_0x265e05,_0x27f741){const _0x489926=a57_0x2428,_0x1d0ea5=_0x265e05();while(!![]){try{const _0x539cb8=parseInt(_0x489926(0x10a))/0x1*(-parseInt(_0x489926(0x10d))/0x2)+parseInt(_0x489926(0x10c))/0x3+parseInt(_0x489926(0x110))/0x4+-parseInt(_0x489926(0x109))/0x5+parseInt(_0x489926(0x112))/0x6*(-parseInt(_0x489926(0x117))/0x7)+-parseInt(_0x489926(0x10b))/0x8*(-parseInt(_0x489926(0x116))/0x9)+parseInt(_0x489926(0x10e))/0xa*(-parseInt(_0x489926(0x115))/0xb);if(_0x539cb8===_0x27f741)break;else _0x1d0ea5['push'](_0x1d0ea5['shift']());}catch(_0x3086fc){_0x1d0ea5['push'](_0x1d0ea5['shift']());}}}(a57_0xecfa,0xa0ded));function a57_0x2428(_0x800365,_0x22f3f9){_0x800365=_0x800365-0x108;const _0xecfa34=a57_0xecfa();let _0x2428cd=_0xecfa34[_0x800365];return _0x2428cd;}function a57_0xecfa(){const _0x42e3a1=['41532IdBSze','production','compress','110ZDozzb','9EZUFSv','28QFePCy','write','2359585cedNAB','42802rPsMfn','6808936ukgpAi','2465118qwBZWJ','14MWylnf','1464710bsempD','main','5000124pkPOXn','en-US'];a57_0xecfa=function(){return _0x42e3a1;};return a57_0xecfa();}export const DEFAULT_APP_PROFILE_NAME=a57_0x3a754e(0x10f);export const DEFAULT_CONFIG_VALUES={'env':a57_0x3a754e(0x113),'format':'compress','locale':a57_0x3a754e(0x111),'riskLevel':a57_0x3a754e(0x108)};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a57_0x3a754e(0x114);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a58_0x28d8(){const _0x349a51=['17624xwbjrY','64JxkeiI','260704AIJanL','116760hjqWbW','3627882YQAyLC','npmPackageName','365ZZbdSl','1662582gdQsnW','4052400YbjpOH','12iQfZWy','91534cxPjaj'];a58_0x28d8=function(){return _0x349a51;};return a58_0x28d8();}const a58_0x39bea4=a58_0x2297;(function(_0x14a1ed,_0xe67663){const _0x1741b7=a58_0x2297,_0x93807c=_0x14a1ed();while(!![]){try{const _0x52dd47=parseInt(_0x1741b7(0x193))/0x1+-parseInt(_0x1741b7(0x18b))/0x2*(parseInt(_0x1741b7(0x192))/0x3)+parseInt(_0x1741b7(0x194))/0x4*(parseInt(_0x1741b7(0x18f))/0x5)+-parseInt(_0x1741b7(0x190))/0x6+parseInt(_0x1741b7(0x18c))/0x7*(-parseInt(_0x1741b7(0x18a))/0x8)+parseInt(_0x1741b7(0x18d))/0x9+parseInt(_0x1741b7(0x191))/0xa;if(_0x52dd47===_0xe67663)break;else _0x93807c['push'](_0x93807c['shift']());}catch(_0xfe07b){_0x93807c['push'](_0x93807c['shift']());}}}(a58_0x28d8,0x46b1d));import{PRODUCT_CONFIG}from'../constant/product.js';function a58_0x2297(_0x3bd4a0,_0x3a8e49){_0x3bd4a0=_0x3bd4a0-0x18a;const _0x28d83e=a58_0x28d8();let _0x2297c2=_0x28d83e[_0x3bd4a0];return _0x2297c2;}export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a58_0x39bea4(0x18e)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG['skillSource'];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG['npmRegistryBaseUrl'];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x116064=a59_0x5a52;function a59_0x5a52(_0x1f749b,_0x163744){_0x1f749b=_0x1f749b-0xcf;const _0x55b6f9=a59_0x55b6();let _0x5a525f=_0x55b6f9[_0x1f749b];return _0x5a525f;}(function(_0x8ec477,_0x3875d9){const _0x19c860=a59_0x5a52,_0x7649d7=_0x8ec477();while(!![]){try{const _0x2d2f2a=-parseInt(_0x19c860(0xe3))/0x1*(parseInt(_0x19c860(0xde))/0x2)+-parseInt(_0x19c860(0xd3))/0x3+-parseInt(_0x19c860(0xd5))/0x4*(-parseInt(_0x19c860(0xd1))/0x5)+-parseInt(_0x19c860(0xdf))/0x6*(-parseInt(_0x19c860(0xd8))/0x7)+parseInt(_0x19c860(0xd0))/0x8+parseInt(_0x19c860(0xdb))/0x9*(-parseInt(_0x19c860(0xd9))/0xa)+-parseInt(_0x19c860(0xdd))/0xb;if(_0x2d2f2a===_0x3875d9)break;else _0x7649d7['push'](_0x7649d7['shift']());}catch(_0x269906){_0x7649d7['push'](_0x7649d7['shift']());}}}(a59_0x55b6,0xa9128));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillHubDomain;export function initDomains(_0x16ca78){const _0xc142b=a59_0x5a52;customApiDomain=_0x16ca78?.[_0xc142b(0xd4)],customUserDomain=_0x16ca78?.['userDomain'],customRuntimeDomain=_0x16ca78?.[_0xc142b(0xcf)],customSkillHubDomain=_0x16ca78?.[_0xc142b(0xdc)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a59_0x116064(0xe1)][a59_0x116064(0xd6)]:PRODUCT_CONFIG[a59_0x116064(0xd7)][a59_0x116064(0xe2)][a59_0x116064(0xd6)]);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a59_0x116064(0xd7)]['production'][a59_0x116064(0xda)]:PRODUCT_CONFIG[a59_0x116064(0xd7)]['nonProduction'][a59_0x116064(0xda)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a59_0x116064(0xd7)][a59_0x116064(0xe1)][a59_0x116064(0xd2)]:PRODUCT_CONFIG[a59_0x116064(0xd7)][a59_0x116064(0xe2)][a59_0x116064(0xd2)]);function a59_0x55b6(){const _0x42bee3=['6669096NyfuFF','384950ALsqwk','runtime','91395AqJORc','apiDomain','60jOdspV','user','domains','581oFksRd','3985490LdiOEQ','api','18BsBDbf','skillHubDomain','7391879woygKh','134JPgoJv','73254RaKTKD','skillhub','production','nonProduction','12086ckKwBe','runtimeDomain'];a59_0x55b6=function(){return _0x42bee3;};return a59_0x55b6();}export const getSkillHubDomain=()=>customSkillHubDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a59_0x116064(0xd7)][a59_0x116064(0xe1)][a59_0x116064(0xe0)]:PRODUCT_CONFIG[a59_0x116064(0xd7)][a59_0x116064(0xe2)][a59_0x116064(0xe0)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x4efa79=a60_0x523b;(function(_0xb3ea59,_0x8058d3){const _0x58569b=a60_0x523b,_0x557428=_0xb3ea59();while(!![]){try{const _0x540aff=-parseInt(_0x58569b(0x6b))/0x1*(-parseInt(_0x58569b(0x70))/0x2)+parseInt(_0x58569b(0x6e))/0x3+parseInt(_0x58569b(0x6d))/0x4*(parseInt(_0x58569b(0x6a))/0x5)+parseInt(_0x58569b(0x74))/0x6+parseInt(_0x58569b(0x73))/0x7+-parseInt(_0x58569b(0x67))/0x8+-parseInt(_0x58569b(0x69))/0x9*(parseInt(_0x58569b(0x71))/0xa);if(_0x540aff===_0x8058d3)break;else _0x557428['push'](_0x557428['shift']());}catch(_0x592fbb){_0x557428['push'](_0x557428['shift']());}}}(a60_0x3baa,0xd3fcb));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=['production','development','daily'];export function normalizeEnv(_0x1a5bc9){const _0xa0e40f=a60_0x523b;return _0x1a5bc9===_0xa0e40f(0x68)?'production':_0x1a5bc9;}export function isProduction(_0x2ffc39){return normalizeEnv(_0x2ffc39)==='production';}export function isDaily(_0x38fb11){const _0x4bb1e4=a60_0x523b;return normalizeEnv(_0x38fb11)===_0x4bb1e4(0x72);}export function isDev(_0x5824db){const _0x6f97b2=a60_0x523b,_0x12fc74=normalizeEnv(_0x5824db);return _0x12fc74===_0x6f97b2(0x6f)||_0x12fc74===_0x6f97b2(0x66);}let env=normalizeEnv(productEnv(a60_0x4efa79(0x6c))||'production');function a60_0x523b(_0x34ad8a,_0x42ad92){_0x34ad8a=_0x34ad8a-0x66;const _0x3baa66=a60_0x3baa();let _0x523b95=_0x3baa66[_0x34ad8a];return _0x523b95;}export function getEnv(){return env;}function a60_0x3baa(){const _0x4b9c7f=['45eUrKax','315RzdfJC','47mNemWW','ENV','61616gUVfcD','465618McqGUG','development','39966hNqgjz','6041540zwQQPd','daily','11276279YOcVkh','1645896XKvgCX','dev','488024VgBmDD','online'];a60_0x3baa=function(){return _0x4b9c7f;};return a60_0x3baa();}export function initEnv(_0x2145a0){env=normalizeEnv(_0x2145a0);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a61_0x3204(_0x19003c,_0x180656){_0x19003c=_0x19003c-0xe6;const _0x3b565d=a61_0x3b56();let _0x32044b=_0x3b565d[_0x19003c];return _0x32044b;}(function(_0x29bc79,_0x5c1931){const _0x3b821d=a61_0x3204,_0x1e1cf0=_0x29bc79();while(!![]){try{const _0x58b4c3=-parseInt(_0x3b821d(0xea))/0x1+-parseInt(_0x3b821d(0xee))/0x2+parseInt(_0x3b821d(0xef))/0x3+parseInt(_0x3b821d(0xeb))/0x4+parseInt(_0x3b821d(0xe6))/0x5*(parseInt(_0x3b821d(0xed))/0x6)+parseInt(_0x3b821d(0xe8))/0x7*(-parseInt(_0x3b821d(0xe7))/0x8)+parseInt(_0x3b821d(0xe9))/0x9*(parseInt(_0x3b821d(0xec))/0xa);if(_0x58b4c3===_0x5c1931)break;else _0x1e1cf0['push'](_0x1e1cf0['shift']());}catch(_0x39cfd9){_0x1e1cf0['push'](_0x1e1cf0['shift']());}}}(a61_0x3b56,0x187ce));function a61_0x3b56(){const _0x5389b5=['46287IzjVgw','234564GMvHih','40ceGyDv','6cLFULh','298670gmQUTg','408273JPGGqz','169010jdACOg','8bluuol','325178zPsHlJ','256149EFVlCY'];a61_0x3b56=function(){return _0x5389b5;};return a61_0x3b56();}export const OUTPUT_FORMAT_VALUES=['json','pretty','compress'];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a62_0x4f11e7=a62_0x51dd;(function(_0x5dfa3e,_0x495e05){const _0x4172fb=a62_0x51dd,_0x2aec52=_0x5dfa3e();while(!![]){try{const _0x1d727b=parseInt(_0x4172fb(0x132))/0x1*(parseInt(_0x4172fb(0x12f))/0x2)+-parseInt(_0x4172fb(0x12c))/0x3+parseInt(_0x4172fb(0x125))/0x4+-parseInt(_0x4172fb(0x123))/0x5*(parseInt(_0x4172fb(0x134))/0x6)+parseInt(_0x4172fb(0x136))/0x7*(-parseInt(_0x4172fb(0x11d))/0x8)+-parseInt(_0x4172fb(0x133))/0x9+parseInt(_0x4172fb(0x131))/0xa;if(_0x1d727b===_0x495e05)break;else _0x2aec52['push'](_0x2aec52['shift']());}catch(_0x1a0072){_0x2aec52['push'](_0x2aec52['shift']());}}}(a62_0x1ee6,0x59aa0));export const PRODUCT_CONFIG={'cliBinName':a62_0x4f11e7(0x124),'cliDisplayName':a62_0x4f11e7(0x127),'npmPackageName':a62_0x4f11e7(0x129),'skillSource':a62_0x4f11e7(0x11b),'npmRegistryBaseUrl':a62_0x4f11e7(0x11f),'envPrefix':'LOVRABET','legacyEnvPrefixes':[a62_0x4f11e7(0x128)],'configFileNames':[a62_0x4f11e7(0x12e),a62_0x4f11e7(0x12b)],'newConfigFileName':a62_0x4f11e7(0x12e),'homeDirName':'.lovrabet','logFileName':a62_0x4f11e7(0x135),'invokeSource':a62_0x4f11e7(0x12a),'userCenterDisplayName':'Lovrabet\x20User\x20Center','skipNpxSkillsEnvSuffix':a62_0x4f11e7(0x11e),'domains':{'production':{'user':'https://user.lovrabet.com','api':a62_0x4f11e7(0x120),'runtime':'https://runtime.lovrabet.com','skillhub':'https://skills.lovrabet.com'},'nonProduction':{'user':a62_0x4f11e7(0x122),'api':'https://daily-api.lovrabet.com','runtime':'https://daily-runtime.lovrabet.com','skillhub':a62_0x4f11e7(0x11c)}},'accessKeyCreatePath':a62_0x4f11e7(0x130)};function a62_0x1ee6(){const _0x103acf=['map','Lovrabet\x20Runtime\x20CLI','RABETBASE','@lovrabet/lovrabet-cli','cli:lovrabet-runtime','.lovrabetrc','2049651MsHCMj','envPrefix','.lovrabet.json','370HQXQDE','/user/ak','21135990LSXeMJ','3145aurfWm','6010461LIkzbn','3014898QaYAKE','.lovrabet-runtime.log','4333xoMqcB','lovrabet/lovrabet-cli','https://skills-daily.lovrabet.com','7824YpiTSJ','SKIP_NPX_SKILLS','https://registry.npmjs.org','https://api.lovrabet.com','legacyEnvPrefixes','https://user-daily.lovrabet.com','5Liywlm','lovrabet','523004EmozjP'];a62_0x1ee6=function(){return _0x103acf;};return a62_0x1ee6();}export function productEnvName(_0x2d40ba){const _0x5373c5=a62_0x4f11e7;return PRODUCT_CONFIG[_0x5373c5(0x12d)]+'_'+_0x2d40ba;}export function productEnvNames(_0x2c96fc){const _0x3db332=a62_0x4f11e7;return[productEnvName(_0x2c96fc),...PRODUCT_CONFIG[_0x3db332(0x121)][_0x3db332(0x126)](_0x1eb636=>_0x1eb636+'_'+_0x2c96fc)];}function a62_0x51dd(_0x5ca908,_0x59f5b5){_0x5ca908=_0x5ca908-0x11b;const _0x1ee6f2=a62_0x1ee6();let _0x51dd87=_0x1ee6f2[_0x5ca908];return _0x51dd87;}export function productEnv(_0x1e95d3){for(const _0x517998 of productEnvNames(_0x1e95d3)){const _0x395aed=process.env[_0x517998];if(_0x395aed!==undefined)return _0x395aed;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a63_0x2d0f(){const _0x143f73=['1011948bzLnBe','21635604lbMicD','read','6500520mvTYHp','15030qHPeiW','561EPWVyK','9338175EpiRUG','4038575OUTsBQ','2406364BpRQbm','6sYikVP','write'];a63_0x2d0f=function(){return _0x143f73;};return a63_0x2d0f();}function a63_0x28fa(_0x5e6649,_0x118178){_0x5e6649=_0x5e6649-0x1a9;const _0x2d0ffd=a63_0x2d0f();let _0x28fa65=_0x2d0ffd[_0x5e6649];return _0x28fa65;}const a63_0x190b02=a63_0x28fa;(function(_0x1be672,_0x46f666){const _0x5a178b=a63_0x28fa,_0x5482d6=_0x1be672();while(!![]){try{const _0x57c712=-parseInt(_0x5a178b(0x1aa))/0x1+parseInt(_0x5a178b(0x1ae))/0x2*(parseInt(_0x5a178b(0x1af))/0x3)+-parseInt(_0x5a178b(0x1b2))/0x4+parseInt(_0x5a178b(0x1b1))/0x5*(-parseInt(_0x5a178b(0x1b3))/0x6)+-parseInt(_0x5a178b(0x1b0))/0x7+parseInt(_0x5a178b(0x1ad))/0x8+parseInt(_0x5a178b(0x1ab))/0x9;if(_0x57c712===_0x46f666)break;else _0x5482d6['push'](_0x5482d6['shift']());}catch(_0x191f11){_0x5482d6['push'](_0x5482d6['shift']());}}}(a63_0x2d0f,0xd38f3));export const RISK_LEVEL_VALUES=[a63_0x190b02(0x1ac),a63_0x190b02(0x1a9),'high-risk-write'];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a64_0x5a47(_0x28f774,_0x13782e){_0x28f774=_0x28f774-0x11d;const _0xa5cd0d=a64_0xa5cd();let _0x5a47ce=_0xa5cd0d[_0x28f774];return _0x5a47ce;}const a64_0x8ff6b7=a64_0x5a47;(function(_0x3051b2,_0x5b54cc){const _0xd92725=a64_0x5a47,_0x2847cb=_0x3051b2();while(!![]){try{const _0x55563c=-parseInt(_0xd92725(0x11e))/0x1+parseInt(_0xd92725(0x121))/0x2*(-parseInt(_0xd92725(0x126))/0x3)+-parseInt(_0xd92725(0x122))/0x4+parseInt(_0xd92725(0x128))/0x5+-parseInt(_0xd92725(0x120))/0x6+parseInt(_0xd92725(0x11d))/0x7*(parseInt(_0xd92725(0x125))/0x8)+-parseInt(_0xd92725(0x124))/0x9*(-parseInt(_0xd92725(0x12a))/0xa);if(_0x55563c===_0x5b54cc)break;else _0x2847cb['push'](_0x2847cb['shift']());}catch(_0x5d89ed){_0x2847cb['push'](_0x2847cb['shift']());}}}(a64_0xa5cd,0x2df3f));function a64_0xa5cd(){const _0x22ec73=['111375maFNMP','domains','4145080Lkweeb','2131101qxBBuD','140389SddHUE','accessKeyCreatePath','1368378jyyZfp','850XAREsX','935936zpNbQE','user','18yvDVVg','8tAEBFq','2577RhPsfr','production'];a64_0xa5cd=function(){return _0x22ec73;};return a64_0xa5cd();}import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a64_0x8ff6b7(0x129)][a64_0x8ff6b7(0x127)][a64_0x8ff6b7(0x123)]+PRODUCT_CONFIG[a64_0x8ff6b7(0x11f)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x1c76be=a64_0x3e91;(function(_0x5886ab,_0x4a00cf){const _0x316ac3=a64_0x3e91,_0x39dcce=_0x5886ab();while(!![]){try{const _0x124466=parseInt(_0x316ac3(0x170))/0x1+parseInt(_0x316ac3(0x171))/0x2+-parseInt(_0x316ac3(0x195))/0x3*(parseInt(_0x316ac3(0x18f))/0x4)+parseInt(_0x316ac3(0x191))/0x5+-parseInt(_0x316ac3(0x179))/0x6+-parseInt(_0x316ac3(0x19d))/0x7*(-parseInt(_0x316ac3(0x18d))/0x8)+-parseInt(_0x316ac3(0x186))/0x9;if(_0x124466===_0x4a00cf)break;else _0x39dcce['push'](_0x39dcce['shift']());}catch(_0x3e99c9){_0x39dcce['push'](_0x39dcce['shift']());}}}(a64_0x5bd2,0xe3e08));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a64_0x1c76be(0x198)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a64_0x1c76be(0x16a)];function resolveConfigPath(_0x4289af){for(const _0xb36113 of CONFIG_NAMES){const _0x379a21=resolve(_0x4289af,_0xb36113);if(existsSync(_0x379a21))return _0x379a21;}return undefined;}export function resolveWriteConfigPath(_0x439d1a){const _0x10b0aa=a64_0x1c76be,_0x461984=_0x439d1a===_0x10b0aa(0x19a)?process[_0x10b0aa(0x19e)]():homedir(),_0x44425f=resolveConfigPath(_0x461984);return _0x44425f??resolve(_0x461984,NEW_CONFIG_NAME);}function a64_0x5bd2(){const _0x4793a4=['utf8','stdin','join','newConfigFileName','./constant/env.js','stdout','true','write','code','1466973ITnlhX','2108394kEZsRs','ENV','object','string','env','raw','setRawMode','find','320712NSWidh','slice','inherit','APPCODE','cache','host','nonInteractive','isTTY','runtimeDomain','riskLevel','trim','locale','authRequired','17930979KccUlR','projectConfig','app','local-alias','missing','appcode','top-level','16inDzCM','values','4xyUxeK','apps','3389200iNBFCc','globalConfig','parse','defaultApp','4980651jWpYXZ','production','accessKey','configFileNames','setRawCommand','project','APP','ACCESS_KEY','5041309VYlMqf','cwd','PAGE_SIZE','global','online','development','./constant/domain.js','error','apiDomain','FORMAT','stringify','format','pageSize','skillHubDomain','read','.tmp'];a64_0x5bd2=function(){return _0x4793a4;};return a64_0x5bd2();}export function readConfigFile(_0x1b9043){const _0x24b6f8=a64_0x1c76be;try{if(existsSync(_0x1b9043)){const _0x4eff5c=readFileSync(_0x1b9043,{'encoding':_0x24b6f8(0x167)});if(_0x4eff5c){const _0x2e32bc=JSON[_0x24b6f8(0x193)](_0x4eff5c);return migrateOnlineEnv(_0x1b9043,_0x2e32bc),_0x2e32bc;}}}catch{}return{};}function migrateOnlineEnv(_0x180fc8,_0x5104a4){const _0x11f3ae=a64_0x1c76be;let _0x2342fe=![];_0x5104a4[_0x11f3ae(0x175)]===_0x11f3ae(0x1a1)&&(_0x5104a4[_0x11f3ae(0x175)]='production',_0x2342fe=!![]);if(_0x5104a4[_0x11f3ae(0x190)]&&typeof _0x5104a4[_0x11f3ae(0x190)]===_0x11f3ae(0x173))for(const _0x5a0818 of Object[_0x11f3ae(0x18e)](_0x5104a4[_0x11f3ae(0x190)])){_0x5a0818&&_0x5a0818[_0x11f3ae(0x175)]===_0x11f3ae(0x1a1)&&(_0x5a0818[_0x11f3ae(0x175)]=_0x11f3ae(0x196),_0x2342fe=!![]);}if(_0x2342fe)try{writeConfigFile(_0x180fc8,_0x5104a4);}catch{}}export function writeConfigFile(_0x5c66cd,_0x287b4a){const _0x5e34aa=a64_0x1c76be,_0x48b388=dirname(_0x5c66cd);!existsSync(_0x48b388)&&mkdirSync(_0x48b388,{'recursive':!![]});const _0x3ce007=_0x5c66cd+_0x5e34aa(0x166);try{writeFileSync(_0x3ce007,JSON[_0x5e34aa(0x161)](_0x287b4a,null,0x2)+'\x0a',{'encoding':_0x5e34aa(0x167),'mode':0x180});try{renameSync(_0x3ce007,_0x5c66cd);}catch(_0x2ba5ce){if(_0x2ba5ce[_0x5e34aa(0x16f)]==='EPERM'||_0x2ba5ce[_0x5e34aa(0x16f)]==='EXDEV'||_0x2ba5ce[_0x5e34aa(0x16f)]==='EACCES'){writeFileSync(_0x5c66cd,JSON['stringify'](_0x287b4a,null,0x2)+'\x0a',{'encoding':_0x5e34aa(0x167)});try{unlinkSync(_0x3ce007);}catch{}}else throw _0x2ba5ce;}}catch(_0x5d4a9b){try{unlinkSync(_0x3ce007);}catch{}throw _0x5d4a9b;}}export function isNonInteractiveMode(_0x4e3304){const _0x31130c=a64_0x1c76be;return!!(_0x4e3304[_0x31130c(0x17f)]||_0x4e3304['ci']||productEnvNames('CI')['some'](_0x1cb01a=>process.env[_0x1cb01a]==='true')||process.env.CI===_0x31130c(0x16d)||!process[_0x31130c(0x16c)][_0x31130c(0x180)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0xb2e51b=a64_0x1c76be;if(!process[_0xb2e51b(0x168)][_0xb2e51b(0x180)])return![];try{const _0x47333a=process[_0xb2e51b(0x168)]['isRaw'];return process['stdin'][_0xb2e51b(0x177)](!![]),process[_0xb2e51b(0x168)][_0xb2e51b(0x177)](_0x47333a??![]),!![];}catch{return![];}}export async function createContext(_0x218431){const _0x2b1cbf=a64_0x1c76be,_0x18a0ff=readRawConfig(),_0x922427=buildConfig(_0x18a0ff,_0x218431);await initGlobalEnvironment(_0x922427);const {getUserDomain:_0x26c5c5,getApiDomain:_0x5b466e}=await import(_0x2b1cbf(0x1a3)),_0x13ab5f={'apiDomain':_0x5b466e(),'userDomain':_0x26c5c5()},_0x59e11b=await buildAuth(_0x922427);logger['setLogPath'](process[_0x2b1cbf(0x19e)]());const _0x309a78=(CLI_BIN_NAME+'\x20'+process['argv'][_0x2b1cbf(0x17a)](0x2)[_0x2b1cbf(0x169)]('\x20'))[_0x2b1cbf(0x183)]();logger[_0x2b1cbf(0x199)](_0x309a78);const _0x282aac=isNonInteractiveMode(_0x218431);return{'config':_0x922427,'auth':_0x59e11b,'logger':logger,'env':_0x13ab5f,'nonInteractive':_0x282aac};}export function buildConfigFromFlags(_0x472c2e){return buildConfig(readRawConfig(),_0x472c2e);}export function getLocalAppAliases(_0x4e446b){const _0xa0675=a64_0x1c76be;return _0x4e446b[_0xa0675(0x190)]&&typeof _0x4e446b[_0xa0675(0x190)]===_0xa0675(0x173)?_0x4e446b[_0xa0675(0x190)]:{};}export function resolveLocalAppAliasCode(_0x55fc9c,_0x494cd9){const _0x16a58a=a64_0x1c76be;if(!_0x494cd9)return undefined;const _0x29dcf2=getLocalAppAliases(_0x55fc9c)[_0x494cd9],_0x17a606=_0x29dcf2?.[_0x16a58a(0x18b)];return typeof _0x17a606===_0x16a58a(0x174)&&_0x17a606[_0x16a58a(0x183)]()?_0x17a606[_0x16a58a(0x183)]():undefined;}export function readAppCodeFromConfig(){const _0x355921=a64_0x1c76be,_0x19dd1c=readRawConfig(),_0x275969=_0x19dd1c['appcode']??_0x19dd1c[_0x355921(0x188)];if(typeof _0x275969===_0x355921(0x174)&&_0x275969[_0x355921(0x183)]())return _0x275969[_0x355921(0x183)]();const _0x19a5f8=resolveLocalAppAliasCode(_0x19dd1c,typeof _0x19dd1c[_0x355921(0x194)]==='string'?_0x19dd1c[_0x355921(0x194)]:undefined);if(_0x19a5f8)return _0x19a5f8;const _0x1a8699=normalizeEnv(String(_0x19dd1c[_0x355921(0x175)]||_0x355921(0x196))),_0x59d2d4=isDaily(_0x1a8699)?'daily':isDev(_0x1a8699)?_0x355921(0x1a2):_0x355921(0x196),_0x5f337b=resolveCachedAppCode(typeof _0x19dd1c[_0x355921(0x194)]===_0x355921(0x174)?_0x19dd1c[_0x355921(0x194)]:undefined,_0x59d2d4,typeof _0x19dd1c[_0x355921(0x197)]===_0x355921(0x174)?_0x19dd1c[_0x355921(0x197)]:undefined);if(_0x5f337b)return _0x5f337b;const _0x222640=Object[_0x355921(0x18e)](getLocalAppAliases(_0x19dd1c))[_0x355921(0x178)](_0x166b32=>_0x166b32?.[_0x355921(0x18b)]);return typeof _0x222640?.[_0x355921(0x18b)]===_0x355921(0x174)&&_0x222640[_0x355921(0x18b)]['trim']()?_0x222640[_0x355921(0x18b)][_0x355921(0x183)]():undefined;}export function readScopedConfig(_0x4a8a2e){const _0x1b913b=a64_0x1c76be,_0x60d818=_0x4a8a2e[_0x1b913b(0x1a0)]?_0x1b913b(0x1a0):_0x1b913b(0x19a);return readConfigFile(resolveWriteConfigPath(_0x60d818));}function a64_0x3e91(_0x1dce8c,_0x55a242){_0x1dce8c=_0x1dce8c-0x161;const _0x5bd278=a64_0x5bd2();let _0x3e9153=_0x5bd278[_0x1dce8c];return _0x3e9153;}export function writeScopedConfig(_0x2eacd4,_0x1420d7){const _0x4c0eaf=a64_0x1c76be,_0x1964c7=_0x1420d7[_0x4c0eaf(0x1a0)]?_0x4c0eaf(0x1a0):_0x4c0eaf(0x19a);writeConfigFile(resolveWriteConfigPath(_0x1964c7),_0x2eacd4);}export async function initGlobalEnvironment(_0x19432b){const _0x277a88=a64_0x1c76be,{initEnv:_0x24dd9e}=await import(_0x277a88(0x16b));_0x24dd9e(_0x19432b['env']);const {initDomains:_0x1e3b63}=await import(_0x277a88(0x1a3));_0x1e3b63({'apiDomain':_0x19432b[_0x277a88(0x176)][_0x277a88(0x1a5)]||_0x19432b[_0x277a88(0x176)][_0x277a88(0x17e)]||undefined,'userDomain':_0x19432b[_0x277a88(0x176)]['userDomain']||undefined,'runtimeDomain':_0x19432b[_0x277a88(0x176)][_0x277a88(0x181)]||undefined,'skillHubDomain':_0x19432b[_0x277a88(0x176)][_0x277a88(0x164)]||undefined});}export function getProjectConfigPath(){const _0x2e7e70=a64_0x1c76be;return resolveConfigPath(process[_0x2e7e70(0x19e)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x345227){const _0x32f939=a64_0x1c76be;if(!existsSync(_0x345227))return{'status':_0x32f939(0x18a)};try{const _0x5df92f=readFileSync(_0x345227,{'encoding':_0x32f939(0x167)});if(!_0x5df92f?.['trim']())return{'status':'empty'};const _0x5eed66=JSON[_0x32f939(0x193)](_0x5df92f);return{'status':'ok','data':_0x5eed66};}catch(_0x34360a){return{'status':_0x32f939(0x1a4),'message':_0x34360a instanceof Error?_0x34360a['message']:String(_0x34360a)};}}export function loadRawConfigLayers(_0x5e57f8){const _0x2aac23=a64_0x1c76be;let _0x47351f={},_0x480950={},_0xcc6871,_0x1edcb4;try{_0xcc6871=resolveConfigPath(homedir());if(_0xcc6871){const _0x4e178b=readFileSync(_0xcc6871,{'encoding':_0x2aac23(0x167)});if(_0x4e178b)_0x47351f=JSON[_0x2aac23(0x193)](_0x4e178b);}}catch{}try{const _0x1cddaa=_0x5e57f8||process[_0x2aac23(0x19e)]();_0x1edcb4=resolveConfigPath(_0x1cddaa);if(_0x1edcb4){const _0x3ba0dd=readFileSync(_0x1edcb4,{'encoding':_0x2aac23(0x167)});if(_0x3ba0dd)_0x480950=JSON['parse'](_0x3ba0dd);}}catch{}return{'globalPath':_0xcc6871,'projectPath':_0x1edcb4,'globalConfig':_0x47351f,'projectConfig':_0x480950};}function mergeRawConfigLayers(_0x45b3b2){const _0x53392e=a64_0x1c76be,{globalConfig:_0x42e9d1,projectConfig:_0x51587e}=_0x45b3b2;if(_0x51587e[_0x53392e(0x17b)]===![]){const _0x4bfca1={..._0x51587e};return delete _0x4bfca1[_0x53392e(0x17b)],_0x4bfca1;}const _0x289b47={..._0x42e9d1,..._0x51587e};if(_0x53392e(0x194)in _0x51587e)_0x289b47['defaultApp']=_0x51587e[_0x53392e(0x194)];else _0x42e9d1['defaultApp']&&(_0x289b47[_0x53392e(0x194)]=_0x42e9d1[_0x53392e(0x194)]);return _0x289b47;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x5cdd7e){return mergeRawConfigLayers(loadRawConfigLayers(_0x5cdd7e));}export function readRawConfigWithLayers(_0x1fbb5d){const _0x6bff90=loadRawConfigLayers(_0x1fbb5d);return{'config':mergeRawConfigLayers(_0x6bff90),'layers':_0x6bff90};}export function resolveDefaultAppSource(_0x124dde){const _0x4e6e4f=a64_0x1c76be;if('defaultApp'in _0x124dde[_0x4e6e4f(0x187)])return _0x4e6e4f(0x19a);if(_0x124dde[_0x4e6e4f(0x187)][_0x4e6e4f(0x17b)]===![])return null;if(_0x124dde[_0x4e6e4f(0x192)][_0x4e6e4f(0x194)])return _0x4e6e4f(0x1a0);return null;}function buildConfig(_0xf7c964,_0x43ead3){const _0x57b611=a64_0x1c76be,_0x182e94=_0xf7c964[_0x57b611(0x194)]||undefined,_0x434b1c=_0x43ead3[_0x57b611(0x188)]||env(_0x57b611(0x19b))||undefined,_0x5cc514=_0x434b1c||_0x182e94||undefined,_0x505c32=env(_0x57b611(0x19c))||_0xf7c964[_0x57b611(0x197)]||undefined,_0x5efb6e=_0x43ead3[_0x57b611(0x175)]||env(_0x57b611(0x172))||_0xf7c964[_0x57b611(0x175)]||DEFAULT_CONFIG_VALUES[_0x57b611(0x175)],_0x1c13c9=normalizeEnv(String(_0x5efb6e)),_0x2cb8b6=isDaily(_0x1c13c9)?'daily':isDev(_0x1c13c9)?_0x57b611(0x1a2):_0x57b611(0x196),_0x5c6d50=resolveLocalAppAliasCode(_0xf7c964,_0x5cc514),_0x31ad0b=resolveCachedAppCode(_0x5cc514,_0x2cb8b6,_0x505c32),_0x43b620=typeof _0x43ead3[_0x57b611(0x18b)]===_0x57b611(0x174)?_0x43ead3[_0x57b611(0x18b)]:undefined,_0x31c2b6=env(_0x57b611(0x17c)),_0x4ac1ab=_0x434b1c?undefined:_0xf7c964[_0x57b611(0x18b)]||_0xf7c964[_0x57b611(0x188)]||undefined,_0x5d69a5=_0x43b620||_0x31c2b6||_0x5c6d50||_0x31ad0b||_0x4ac1ab||undefined,_0x323f56=_0x43b620?'explicit':_0x31c2b6?_0x57b611(0x175):_0x5c6d50?_0x57b611(0x189):_0x31ad0b?_0x57b611(0x17d):_0x4ac1ab?_0x57b611(0x18c):undefined,_0x485e89=_0xf7c964[_0x57b611(0x184)]||DEFAULT_CONFIG_VALUES[_0x57b611(0x184)],_0x180f42=undefined,_0x110f2f=_0x43ead3[_0x57b611(0x162)]||env(_0x57b611(0x1a6))||_0xf7c964[_0x57b611(0x162)],_0x555643=normalizeLegacyOutputFormat(_0x110f2f),_0x24004a=env(_0x57b611(0x19f))||_0xf7c964[_0x57b611(0x163)],_0x3818a9=_0x24004a?Number(_0x24004a)||undefined:undefined,_0x52954f=_0xf7c964[_0x57b611(0x182)]||_0xf7c964['maxRisk'],_0x5f481c=_0x52954f===_0x57b611(0x165)||_0x52954f===_0x57b611(0x16e)||_0x52954f==='high-risk-write'?_0x52954f:DEFAULT_CONFIG_VALUES[_0x57b611(0x182)],_0x169a1f=env('VERBOSE'),_0x4c340c=_0x169a1f==='1'||_0x169a1f===_0x57b611(0x16d);return{'appCode':typeof _0x5d69a5==='string'&&_0x5d69a5[_0x57b611(0x183)]()?_0x5d69a5['trim']():undefined,'appCodeSource':_0x323f56,'env':_0x2cb8b6,'locale':_0x485e89,'cookie':_0x180f42,'accessKey':_0x505c32,'format':_0x555643,'pageSize':_0x3818a9,'riskLevel':_0x5f481c,'verbose':_0x4c340c,'defaultApp':_0x182e94,'currentApp':typeof _0x5cc514==='string'?_0x5cc514:undefined,'raw':_0xf7c964};}function env(_0x590a95){return productEnv(_0x590a95);}async function buildAuth(_0x32f4f0){const _0x5946a5=a64_0x1c76be,_0x1f900d='',_0x5347b=!!_0x32f4f0[_0x5946a5(0x197)];return{'cookie':_0x1f900d,'isLoggedIn':_0x5347b,async 'getOrLogin'(){const _0x3a1f57=_0x5946a5;if(_0x5347b)return _0x1f900d;throw CliErrors[_0x3a1f57(0x185)]();}};}
|
|
1
|
+
const a65_0x163918=a65_0x2f55;(function(_0x4a4e98,_0x25d228){const _0x14bd96=a65_0x2f55,_0x7abc3=_0x4a4e98();while(!![]){try{const _0x57729d=-parseInt(_0x14bd96(0x133))/0x1+parseInt(_0x14bd96(0x145))/0x2+parseInt(_0x14bd96(0x136))/0x3*(-parseInt(_0x14bd96(0x16d))/0x4)+-parseInt(_0x14bd96(0x166))/0x5*(-parseInt(_0x14bd96(0x14f))/0x6)+parseInt(_0x14bd96(0x142))/0x7+-parseInt(_0x14bd96(0x153))/0x8*(-parseInt(_0x14bd96(0x158))/0x9)+parseInt(_0x14bd96(0x162))/0xa*(parseInt(_0x14bd96(0x163))/0xb);if(_0x57729d===_0x25d228)break;else _0x7abc3['push'](_0x7abc3['shift']());}catch(_0x3fdf7e){_0x7abc3['push'](_0x7abc3['shift']());}}}(a65_0x2358,0x4bd25));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a65_0x163918(0x127)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG['newConfigFileName'];function resolveConfigPath(_0x95a402){for(const _0xab365 of CONFIG_NAMES){const _0x51c3c4=resolve(_0x95a402,_0xab365);if(existsSync(_0x51c3c4))return _0x51c3c4;}return undefined;}export function resolveWriteConfigPath(_0x256af8){const _0xf748d4=a65_0x163918,_0x3a0703=_0x256af8===_0xf748d4(0x12d)?process['cwd']():homedir(),_0x3ab331=resolveConfigPath(_0x3a0703);return _0x3ab331??resolve(_0x3a0703,NEW_CONFIG_NAME);}export function readConfigFile(_0x48ceee){const _0x1f0a9e=a65_0x163918;try{if(existsSync(_0x48ceee)){const _0x2a450e=readFileSync(_0x48ceee,{'encoding':_0x1f0a9e(0x155)});if(_0x2a450e){const _0xeecb58=JSON[_0x1f0a9e(0x134)](_0x2a450e);return migrateOnlineEnv(_0x48ceee,_0xeecb58),_0xeecb58;}}}catch{}return{};}function migrateOnlineEnv(_0x2300d2,_0x11d823){const _0x7a809e=a65_0x163918;let _0x591224=![];_0x11d823[_0x7a809e(0x154)]==='online'&&(_0x11d823['env']=_0x7a809e(0x16a),_0x591224=!![]);if(_0x11d823[_0x7a809e(0x16b)]&&typeof _0x11d823[_0x7a809e(0x16b)]===_0x7a809e(0x139))for(const _0x240445 of Object[_0x7a809e(0x161)](_0x11d823[_0x7a809e(0x16b)])){_0x240445&&_0x240445[_0x7a809e(0x154)]===_0x7a809e(0x141)&&(_0x240445[_0x7a809e(0x154)]=_0x7a809e(0x16a),_0x591224=!![]);}if(_0x591224)try{writeConfigFile(_0x2300d2,_0x11d823);}catch{}}function a65_0x2358(){const _0x46c535=['production','apps','true','364BzqagV','accessKey','empty','configFileNames','PAGE_SIZE','code','EPERM','projectConfig','stdout','project','stdin','apiDomain','isTTY','explicit','setRawMode','545647vikPbc','parse','missing','19527SyTyuc','trim','maxRisk','object','cache','error','riskLevel','nonInteractive','high-risk-write','raw','EACCES','online','240569VOlmyH','runtimeDomain','locale','693312ugcGio','globalConfig','development','setLogPath','top-level','isRaw','EXDEV','app','cwd','pageSize','18tyFKnK','inherit','defaultApp','authRequired','3864592xMIpsX','env','utf8','argv','global','9OXXALg','.tmp','host','./constant/env.js','format','skillHubDomain','appcode','string','daily','values','10zEpIlD','5272091UMdBfU','local-alias','./constant/domain.js','175255jyRpkt','write','setRawCommand','some'];a65_0x2358=function(){return _0x46c535;};return a65_0x2358();}export function writeConfigFile(_0x159f1f,_0x38c401){const _0x2bbad0=a65_0x163918,_0x22c9cf=dirname(_0x159f1f);!existsSync(_0x22c9cf)&&mkdirSync(_0x22c9cf,{'recursive':!![]});const _0x8e44b9=_0x159f1f+_0x2bbad0(0x159);try{writeFileSync(_0x8e44b9,JSON['stringify'](_0x38c401,null,0x2)+'\x0a',{'encoding':_0x2bbad0(0x155),'mode':0x180});try{renameSync(_0x8e44b9,_0x159f1f);}catch(_0x483be6){if(_0x483be6[_0x2bbad0(0x129)]===_0x2bbad0(0x12a)||_0x483be6[_0x2bbad0(0x129)]===_0x2bbad0(0x14b)||_0x483be6[_0x2bbad0(0x129)]===_0x2bbad0(0x140)){writeFileSync(_0x159f1f,JSON['stringify'](_0x38c401,null,0x2)+'\x0a',{'encoding':_0x2bbad0(0x155)});try{unlinkSync(_0x8e44b9);}catch{}}else throw _0x483be6;}}catch(_0x9e4e4f){try{unlinkSync(_0x8e44b9);}catch{}throw _0x9e4e4f;}}export function isNonInteractiveMode(_0x9d7be5){const _0xad5542=a65_0x163918;return!!(_0x9d7be5[_0xad5542(0x13d)]||_0x9d7be5['ci']||productEnvNames('CI')[_0xad5542(0x169)](_0x27c666=>process.env[_0x27c666]===_0xad5542(0x16c))||process.env.CI==='true'||!process[_0xad5542(0x12c)][_0xad5542(0x130)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x407076=a65_0x163918;if(!process[_0x407076(0x12e)][_0x407076(0x130)])return![];try{const _0x4f49cb=process[_0x407076(0x12e)][_0x407076(0x14a)];return process[_0x407076(0x12e)][_0x407076(0x132)](!![]),process[_0x407076(0x12e)][_0x407076(0x132)](_0x4f49cb??![]),!![];}catch{return![];}}export async function createContext(_0x557716){const _0xddbd51=a65_0x163918,_0x5bb2f5=readRawConfig(),_0x578537=buildConfig(_0x5bb2f5,_0x557716);await initGlobalEnvironment(_0x578537);const {getUserDomain:_0x54e415,getApiDomain:_0x515f2c}=await import(_0xddbd51(0x165)),_0x30d413={'apiDomain':_0x515f2c(),'userDomain':_0x54e415()},_0x337f62=await buildAuth(_0x578537);logger[_0xddbd51(0x148)](process['cwd']());const _0xd06c1c=(CLI_BIN_NAME+'\x20'+process[_0xddbd51(0x156)]['slice'](0x2)['join']('\x20'))['trim']();logger[_0xddbd51(0x168)](_0xd06c1c);const _0x8c5ee8=isNonInteractiveMode(_0x557716);return{'config':_0x578537,'auth':_0x337f62,'logger':logger,'env':_0x30d413,'nonInteractive':_0x8c5ee8};}export function buildConfigFromFlags(_0x3cd470){return buildConfig(readRawConfig(),_0x3cd470);}export function getLocalAppAliases(_0x222416){const _0x45cce4=a65_0x163918;return _0x222416[_0x45cce4(0x16b)]&&typeof _0x222416[_0x45cce4(0x16b)]===_0x45cce4(0x139)?_0x222416[_0x45cce4(0x16b)]:{};}function a65_0x2f55(_0x3bbdb1,_0x55596f){_0x3bbdb1=_0x3bbdb1-0x127;const _0x2358c0=a65_0x2358();let _0x2f55e3=_0x2358c0[_0x3bbdb1];return _0x2f55e3;}export function resolveLocalAppAliasCode(_0x3b5435,_0x4488a1){const _0x80debb=a65_0x163918;if(!_0x4488a1)return undefined;const _0x34f759=getLocalAppAliases(_0x3b5435)[_0x4488a1],_0x2bcc66=_0x34f759?.[_0x80debb(0x15e)];return typeof _0x2bcc66===_0x80debb(0x15f)&&_0x2bcc66[_0x80debb(0x137)]()?_0x2bcc66['trim']():undefined;}export function readAppCodeFromConfig(){const _0x32ac68=a65_0x163918,_0x38f687=readRawConfig(),_0x5099f4=_0x38f687['appcode']??_0x38f687[_0x32ac68(0x14c)];if(typeof _0x5099f4==='string'&&_0x5099f4['trim']())return _0x5099f4[_0x32ac68(0x137)]();const _0x22c0c3=resolveLocalAppAliasCode(_0x38f687,typeof _0x38f687['defaultApp']===_0x32ac68(0x15f)?_0x38f687[_0x32ac68(0x151)]:undefined);if(_0x22c0c3)return _0x22c0c3;const _0x48f5b3=normalizeEnv(String(_0x38f687[_0x32ac68(0x154)]||_0x32ac68(0x16a))),_0x530c7d=isDaily(_0x48f5b3)?_0x32ac68(0x160):isDev(_0x48f5b3)?'development':_0x32ac68(0x16a),_0x4911e8=resolveCachedAppCode(typeof _0x38f687[_0x32ac68(0x151)]==='string'?_0x38f687[_0x32ac68(0x151)]:undefined,_0x530c7d,typeof _0x38f687[_0x32ac68(0x16e)]==='string'?_0x38f687[_0x32ac68(0x16e)]:undefined);if(_0x4911e8)return _0x4911e8;const _0x341a86=Object[_0x32ac68(0x161)](getLocalAppAliases(_0x38f687))['find'](_0x1247d5=>_0x1247d5?.[_0x32ac68(0x15e)]);return typeof _0x341a86?.[_0x32ac68(0x15e)]===_0x32ac68(0x15f)&&_0x341a86['appcode'][_0x32ac68(0x137)]()?_0x341a86['appcode'][_0x32ac68(0x137)]():undefined;}export function readScopedConfig(_0x6085fe){const _0x48316e=a65_0x163918,_0x55acf8=_0x6085fe['global']?_0x48316e(0x157):_0x48316e(0x12d);return readConfigFile(resolveWriteConfigPath(_0x55acf8));}export function writeScopedConfig(_0x1e8b58,_0x5c5ae9){const _0x5d40ed=a65_0x163918,_0x55ab67=_0x5c5ae9[_0x5d40ed(0x157)]?_0x5d40ed(0x157):'project';writeConfigFile(resolveWriteConfigPath(_0x55ab67),_0x1e8b58);}export async function initGlobalEnvironment(_0x1b40c3){const _0x430f92=a65_0x163918,{initEnv:_0x562a7a}=await import(_0x430f92(0x15b));_0x562a7a(_0x1b40c3['env']);const {initDomains:_0xbb66a}=await import('./constant/domain.js');_0xbb66a({'apiDomain':_0x1b40c3[_0x430f92(0x13f)][_0x430f92(0x12f)]||_0x1b40c3[_0x430f92(0x13f)][_0x430f92(0x15a)]||undefined,'userDomain':_0x1b40c3[_0x430f92(0x13f)]['userDomain']||undefined,'runtimeDomain':_0x1b40c3[_0x430f92(0x13f)][_0x430f92(0x143)]||undefined,'skillHubDomain':_0x1b40c3[_0x430f92(0x13f)][_0x430f92(0x15d)]||undefined});}export function getProjectConfigPath(){const _0x49ae55=a65_0x163918;return resolveConfigPath(process[_0x49ae55(0x14d)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x304499){const _0x5dc14b=a65_0x163918;if(!existsSync(_0x304499))return{'status':_0x5dc14b(0x135)};try{const _0x1a9357=readFileSync(_0x304499,{'encoding':_0x5dc14b(0x155)});if(!_0x1a9357?.['trim']())return{'status':_0x5dc14b(0x16f)};const _0x57318d=JSON[_0x5dc14b(0x134)](_0x1a9357);return{'status':'ok','data':_0x57318d};}catch(_0x547f48){return{'status':_0x5dc14b(0x13b),'message':_0x547f48 instanceof Error?_0x547f48['message']:String(_0x547f48)};}}export function loadRawConfigLayers(_0x2da1c2){const _0x5a6a88=a65_0x163918;let _0x5751b0={},_0x39ce2d={},_0x31b4ec,_0x2daebe;try{_0x31b4ec=resolveConfigPath(homedir());if(_0x31b4ec){const _0x1f802c=readFileSync(_0x31b4ec,{'encoding':_0x5a6a88(0x155)});if(_0x1f802c)_0x5751b0=JSON['parse'](_0x1f802c);}}catch{}try{const _0x333daa=_0x2da1c2||process[_0x5a6a88(0x14d)]();_0x2daebe=resolveConfigPath(_0x333daa);if(_0x2daebe){const _0x3fca01=readFileSync(_0x2daebe,{'encoding':'utf8'});if(_0x3fca01)_0x39ce2d=JSON[_0x5a6a88(0x134)](_0x3fca01);}}catch{}return{'globalPath':_0x31b4ec,'projectPath':_0x2daebe,'globalConfig':_0x5751b0,'projectConfig':_0x39ce2d};}function mergeRawConfigLayers(_0x40d3bc){const _0x4a89e2=a65_0x163918,{globalConfig:_0x5565d3,projectConfig:_0x275ec3}=_0x40d3bc;if(_0x275ec3[_0x4a89e2(0x150)]===![]){const _0x10e178={..._0x275ec3};return delete _0x10e178[_0x4a89e2(0x150)],_0x10e178;}const _0x55a6c6={..._0x5565d3,..._0x275ec3};if(_0x4a89e2(0x151)in _0x275ec3)_0x55a6c6[_0x4a89e2(0x151)]=_0x275ec3[_0x4a89e2(0x151)];else _0x5565d3['defaultApp']&&(_0x55a6c6[_0x4a89e2(0x151)]=_0x5565d3[_0x4a89e2(0x151)]);return _0x55a6c6;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x581856){return mergeRawConfigLayers(loadRawConfigLayers(_0x581856));}export function readRawConfigWithLayers(_0x247487){const _0x38668c=loadRawConfigLayers(_0x247487);return{'config':mergeRawConfigLayers(_0x38668c),'layers':_0x38668c};}export function resolveDefaultAppSource(_0x2fc7ce){const _0x593f88=a65_0x163918;if(_0x593f88(0x151)in _0x2fc7ce[_0x593f88(0x12b)])return'project';if(_0x2fc7ce['projectConfig']['inherit']===![])return null;if(_0x2fc7ce[_0x593f88(0x146)][_0x593f88(0x151)])return'global';return null;}function buildConfig(_0x4a0aee,_0x4d10fb){const _0x4b4fa3=a65_0x163918,_0x1f481f=_0x4a0aee[_0x4b4fa3(0x151)]||undefined,_0x5aa34f=_0x4d10fb[_0x4b4fa3(0x14c)]||env('APP')||undefined,_0x1b0cdd=_0x5aa34f||_0x1f481f||undefined,_0xd74abd=env('ACCESS_KEY')||_0x4a0aee['accessKey']||undefined,_0x3b1255=_0x4d10fb[_0x4b4fa3(0x154)]||env('ENV')||_0x4a0aee[_0x4b4fa3(0x154)]||DEFAULT_CONFIG_VALUES[_0x4b4fa3(0x154)],_0x473a92=normalizeEnv(String(_0x3b1255)),_0x3ddbd9=isDaily(_0x473a92)?_0x4b4fa3(0x160):isDev(_0x473a92)?_0x4b4fa3(0x147):_0x4b4fa3(0x16a),_0x11e93e=typeof _0x4d10fb[_0x4b4fa3(0x15e)]==='string'?_0x4d10fb['appcode']:undefined,_0x2ec32e=env('APPCODE'),_0x5b904e=_0x5aa34f?undefined:_0x4a0aee[_0x4b4fa3(0x15e)]||_0x4a0aee['app']||undefined,_0x2dbbeb=_0x5aa34f||(_0x5b904e?undefined:_0x1f481f),_0x301eee=resolveLocalAppAliasCode(_0x4a0aee,_0x2dbbeb),_0x3703d4=resolveCachedAppCode(_0x2dbbeb,_0x3ddbd9,_0xd74abd),_0x289184=_0x11e93e||_0x2ec32e||_0x5b904e||_0x301eee||_0x3703d4||undefined,_0x37d697=_0x11e93e?_0x4b4fa3(0x131):_0x2ec32e?'env':_0x5b904e?_0x4b4fa3(0x149):_0x301eee?_0x4b4fa3(0x164):_0x3703d4?_0x4b4fa3(0x13a):undefined,_0x54e5d7=_0x4a0aee[_0x4b4fa3(0x144)]||DEFAULT_CONFIG_VALUES[_0x4b4fa3(0x144)],_0x262c86=undefined,_0x340e48=_0x4d10fb['format']||env('FORMAT')||_0x4a0aee[_0x4b4fa3(0x15c)],_0xd3e7fa=normalizeLegacyOutputFormat(_0x340e48),_0x495352=env(_0x4b4fa3(0x128))||_0x4a0aee[_0x4b4fa3(0x14e)],_0x2dc2e2=_0x495352?Number(_0x495352)||undefined:undefined,_0x27083b=_0x4a0aee['riskLevel']||_0x4a0aee[_0x4b4fa3(0x138)],_0x8a031d=_0x27083b==='read'||_0x27083b===_0x4b4fa3(0x167)||_0x27083b===_0x4b4fa3(0x13e)?_0x27083b:DEFAULT_CONFIG_VALUES[_0x4b4fa3(0x13c)],_0x246300=env('VERBOSE'),_0x36718b=_0x246300==='1'||_0x246300===_0x4b4fa3(0x16c);return{'appCode':typeof _0x289184==='string'&&_0x289184[_0x4b4fa3(0x137)]()?_0x289184[_0x4b4fa3(0x137)]():undefined,'appCodeSource':_0x37d697,'env':_0x3ddbd9,'locale':_0x54e5d7,'cookie':_0x262c86,'accessKey':_0xd74abd,'format':_0xd3e7fa,'pageSize':_0x2dc2e2,'riskLevel':_0x8a031d,'verbose':_0x36718b,'defaultApp':_0x1f481f,'currentApp':typeof _0x1b0cdd==='string'?_0x1b0cdd:undefined,'raw':_0x4a0aee};}function env(_0x4d7873){return productEnv(_0x4d7873);}async function buildAuth(_0x1ce049){const _0x1f1dfd=a65_0x163918,_0x5a5741='',_0x37361a=!!_0x1ce049[_0x1f1dfd(0x16e)];return{'cookie':_0x5a5741,'isLoggedIn':_0x37361a,async 'getOrLogin'(){const _0x4c2e71=_0x1f1dfd;if(_0x37361a)return _0x5a5741;throw CliErrors[_0x4c2e71(0x152)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3efe1a,_0x43f662){const _0x3b0a31=a65_0x38dd,_0x4010a3=_0x3efe1a();while(!![]){try{const _0x5da8e1=-parseInt(_0x3b0a31(0x8e))/0x1*(parseInt(_0x3b0a31(0x8f))/0x2)+-parseInt(_0x3b0a31(0xcf))/0x3+parseInt(_0x3b0a31(0xf7))/0x4*(parseInt(_0x3b0a31(0xe7))/0x5)+-parseInt(_0x3b0a31(0xd7))/0x6+parseInt(_0x3b0a31(0xe2))/0x7*(-parseInt(_0x3b0a31(0x99))/0x8)+parseInt(_0x3b0a31(0xc5))/0x9*(-parseInt(_0x3b0a31(0xf2))/0xa)+parseInt(_0x3b0a31(0x9d))/0xb*(parseInt(_0x3b0a31(0xbd))/0xc);if(_0x5da8e1===_0x43f662)break;else _0x4010a3['push'](_0x4010a3['shift']());}catch(_0x2ba393){_0x4010a3['push'](_0x4010a3['shift']());}}}(a65_0x5661,0xcb0cc));function a65_0x38dd(_0x5a8b80,_0xc1058b){_0x5a8b80=_0x5a8b80-0x78;const _0x5661c0=a65_0x5661();let _0x38dd72=_0x5661c0[_0x5a8b80];return _0x38dd72;}import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';function a65_0x5661(){const _0x2c7293=['isArray','packageBase64','errorMsg','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','appName','Check\x20your\x20credentials\x20and\x20try\x20again.','/client/artifact/list?','headlineVersion','4617597KUnIRW','/skills','AbortError','number','errorCode','arrayBuffer','Request\x20timeout:\x20','replace','4574928kHyzcM','Toolbox\x20API\x20error:\x20','object','base64','code','all','toLowerCase','string','content','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','values','6701821XKeHyX','warnings','/client/knowledge-base/personal/create','company','/download','2458255ETYkND','toString','Toolbox\x20API\x20error','skillCode','GET','/publish','file','/client/knowledge-base/personal/list?appCode=','Personal\x20BFF\x20not\x20found:\x20id=','searchParams','map','40vxHZKi','/publish/validate','tableData','/client/user/loginUserInfo','abort','12RddlOY','text','.zip','description','/client/bff/query/','query','status','set','confirmWarnings','visibility','Download\x20failed:\x20','validation','/client/runtime-bff/personal/create','application/zip','data','markdown','Knowledge-base\x20entry\x20not\x20found:\x20id=','Configure\x20accessKey\x20in\x20','skill','catch','/update','stringify','/client/runtime-bff/personal/','invokeSource','authRequired','SkillHub\x20API\x20error:\x20','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','effective','json','valid','4viXEhJ','397034cLHeuV','msg','displayName','/client/runtime-bff/personal/list?appCode=','/execute?appCode=','errors','/client/app/my-apps','favorite','filter','ownerPreviewVersion','8xmmaVM','namespace','POST','tags','91883IgyjQT','PRIVATE','personal','success','application/octet-stream','/client/sql/query','message','items','newConfigFileName','summary','API\x20error:\x20','NAMESPACE_ONLY','/client/artifact/create','version','slug','resolvedSlug','signal','entries','application/json','artifactType','SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/client/knowledge-base/personal/','boolean','scope','/client/artifact/','api-doc-generator','SkillHub\x20error\x20code:\x20','appCode','/api/cli/v1/skills/','name','SQL\x20query\x20not\x20found:\x20','topK','6972PvAevt','from','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','publishedVersion','?appCode=','trim','Artifact\x20not\x20found:\x20id=','resolvedVersion','3247191gxHVQr','apiError'];a65_0x5661=function(){return _0x2c7293;};return a65_0x5661();}import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0x19ecc2){_activeAK=_0x19ecc2||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x5b92d4,_0x551e1d={}){const _0x15784c=a65_0x38dd,{method:method=_0x15784c(0xeb),body:_0x39825a,headers:headers={},timeout:timeout=0x7530}=_0x551e1d,_0x3c047d=_activeAK,_0xffa3a5=getRuntimeDomain();if(!_0x3c047d)throw CliErrors[_0x15784c(0x88)](_0x15784c(0x81)+PRODUCT_CONFIG[_0x15784c(0xa5)]+'.');const _0x1a878b=''+_0xffa3a5+_0x5b92d4,_0x5f4c49={'X-User-AK':_0x3c047d},_0x27e551=new AbortController(),_0x1c056f=setTimeout(()=>_0x27e551[_0x15784c(0xf6)](),timeout);try{const _0x1f83ad=await fetch(_0x1a878b,{'method':method,'headers':{'Content-Type':_0x15784c(0xaf),'X-Invoke-Source':PRODUCT_CONFIG[_0x15784c(0x87)],..._0x5f4c49,...headers},'body':_0x39825a?JSON[_0x15784c(0x85)](_0x39825a):undefined,'signal':_0x27e551[_0x15784c(0xad)]});let _0x14247d;try{_0x14247d=await _0x1f83ad[_0x15784c(0x8c)]();}catch{throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1f83ad[_0x15784c(0xfd)]+')',_0x1f83ad[_0x15784c(0xfd)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}if(!_0x1f83ad['ok']||_0x14247d[_0x15784c(0xa0)]===![])throw CliErrors['apiError'](_0x14247d[_0x15784c(0xc9)]||_0x14247d[_0x15784c(0xa3)]||_0x15784c(0xa7)+_0x1f83ad[_0x15784c(0xfd)],_0x14247d[_0x15784c(0xd3)]?'API\x20error\x20code:\x20'+_0x14247d[_0x15784c(0xd3)]:undefined);return _0x14247d;}catch(_0x5b508a){if(_0x5b508a instanceof Error&&_0x5b508a[_0x15784c(0xba)]==='AbortError')throw CliErrors[_0x15784c(0xc6)](_0x15784c(0xd5)+_0x1a878b);throw _0x5b508a;}finally{clearTimeout(_0x1c056f);}}async function apiBinaryRequest(_0x27e5d5,_0x539b6b={}){const _0x550e6e=a65_0x38dd,{method:method='GET',headers:headers={},timeout:timeout=0x7530}=_0x539b6b,_0x616ec0=_activeAK,_0x340624=getRuntimeDomain();if(!_0x616ec0)throw CliErrors[_0x550e6e(0x88)](_0x550e6e(0x81)+PRODUCT_CONFIG[_0x550e6e(0xa5)]+'.');const _0x4f7c53=''+_0x340624+_0x27e5d5,_0x371121=new AbortController(),_0x35702d=setTimeout(()=>_0x371121[_0x550e6e(0xf6)](),timeout);try{const _0x1dfd91=await fetch(_0x4f7c53,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x550e6e(0x87)],'X-User-AK':_0x616ec0,...headers},'signal':_0x371121[_0x550e6e(0xad)]});if(!_0x1dfd91['ok']){let _0x272bf1;try{const _0x247fc3=await _0x1dfd91['json']();_0x272bf1=_0x247fc3[_0x550e6e(0xc9)]||_0x247fc3[_0x550e6e(0xa3)]||_0x247fc3[_0x550e6e(0xd3)];}catch{_0x272bf1=await _0x1dfd91[_0x550e6e(0xf8)]()[_0x550e6e(0x83)](()=>undefined);}throw CliErrors[_0x550e6e(0xc6)](_0x272bf1||_0x550e6e(0xa7)+_0x1dfd91[_0x550e6e(0xfd)],_0x550e6e(0x7a)+_0x4f7c53);}return Buffer['from'](await _0x1dfd91['arrayBuffer']());}catch(_0x5a995b){if(_0x5a995b instanceof Error&&_0x5a995b[_0x550e6e(0xba)]===_0x550e6e(0xd1))throw CliErrors[_0x550e6e(0xc6)](_0x550e6e(0xd5)+_0x4f7c53);throw _0x5a995b;}finally{clearTimeout(_0x35702d);}}async function toolboxRequest(_0x1761d9,_0x2f4032,_0x3e75a8={}){const _0x1aa8e2=a65_0x38dd,{method:method=_0x1aa8e2(0xeb),headers:headers={},timeout:timeout=0x7530}=_0x3e75a8,_0x1ffe65=_activeAK;if(!_0x1ffe65)throw CliErrors[_0x1aa8e2(0x88)](_0x1aa8e2(0x81)+PRODUCT_CONFIG[_0x1aa8e2(0xa5)]+'.');const _0x50bf62=getApiDomain()[_0x1aa8e2(0xd6)](/\/$/,''),_0x1a28a9=new URL(_0x1761d9,_0x50bf62+'/api/node-toolbox/');if(_0x2f4032)for(const [_0x32058c,_0x391bc6]of Object[_0x1aa8e2(0xae)](_0x2f4032)){_0x391bc6!==undefined&&_0x391bc6!==null&&_0x1a28a9[_0x1aa8e2(0xf0)][_0x1aa8e2(0xfe)](_0x32058c,String(_0x391bc6));}const _0x53a53f=new AbortController(),_0x183172=setTimeout(()=>_0x53a53f[_0x1aa8e2(0xf6)](),timeout);try{const _0xea39a3=await fetch(_0x1a28a9,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x1aa8e2(0x87)],'X-User-AK':_0x1ffe65,...headers},'signal':_0x53a53f[_0x1aa8e2(0xad)]});let _0x47447b;try{_0x47447b=await _0xea39a3[_0x1aa8e2(0x8c)]();}catch{throw CliErrors[_0x1aa8e2(0xc6)](_0x1aa8e2(0xca)+_0xea39a3[_0x1aa8e2(0xfd)]+')',_0xea39a3['status']>=0x190?_0x1aa8e2(0xcc):undefined);}if(!_0xea39a3['ok']){const _0xdca1a0=_0x47447b&&typeof _0x47447b==='object'?_0x47447b:{};throw CliErrors['apiError'](_0xdca1a0[_0x1aa8e2(0xc9)]||_0xdca1a0[_0x1aa8e2(0xa3)]||_0x1aa8e2(0xd8)+_0xea39a3[_0x1aa8e2(0xfd)],_0xdca1a0[_0x1aa8e2(0xd3)]?'Toolbox\x20error\x20code:\x20'+_0xdca1a0[_0x1aa8e2(0xd3)]:undefined);}if(_0x47447b&&typeof _0x47447b===_0x1aa8e2(0xd9)&&_0x1aa8e2(0xa0)in _0x47447b&&typeof _0x47447b[_0x1aa8e2(0xa0)]===_0x1aa8e2(0xb3)){const _0x1c4c59=_0x47447b;if(!_0x1c4c59[_0x1aa8e2(0xa0)])throw CliErrors[_0x1aa8e2(0xc6)](_0x1c4c59[_0x1aa8e2(0xc9)]||_0x1c4c59['message']||_0x1aa8e2(0xe9),_0x1c4c59[_0x1aa8e2(0xd3)]?'Toolbox\x20error\x20code:\x20'+_0x1c4c59[_0x1aa8e2(0xd3)]:undefined);return _0x1c4c59[_0x1aa8e2(0x7e)];}return _0x47447b;}catch(_0xf0a483){if(_0xf0a483 instanceof Error&&_0xf0a483[_0x1aa8e2(0xba)]===_0x1aa8e2(0xd1))throw CliErrors[_0x1aa8e2(0xc6)](_0x1aa8e2(0xd5)+_0x1a28a9['toString']());throw _0xf0a483;}finally{clearTimeout(_0x183172);}}async function skillHubJsonRequest(_0x2419f3,_0x130edb={}){const _0x387829=a65_0x38dd,{method:method=_0x387829(0xeb),query:_0x429ed4,body:_0x20b094,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x130edb,_0x4055b3=_activeAK;if(!_0x4055b3)throw CliErrors[_0x387829(0x88)](_0x387829(0x81)+PRODUCT_CONFIG[_0x387829(0xa5)]+'.');const _0x4911db=getSkillHubDomain()['replace'](/\/$/,''),_0x484713=new URL(_0x2419f3,_0x4911db+'/');if(_0x429ed4)for(const [_0x4c9243,_0x4811c5]of Object[_0x387829(0xae)](_0x429ed4)){_0x4811c5!==undefined&&_0x4811c5!==null&&_0x484713['searchParams'][_0x387829(0xfe)](_0x4c9243,String(_0x4811c5));}const _0x59f254=new AbortController(),_0x2b85a6=setTimeout(()=>_0x59f254['abort'](),timeout);try{const _0xb6893a=await fetch(_0x484713['toString'](),{'method':method,'headers':{'Accept':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x387829(0x87)],'X-User-AK':_0x4055b3,...headers},'body':_0x20b094,'signal':_0x59f254[_0x387829(0xad)]});let _0xb3c39c;try{_0xb3c39c=await _0xb6893a['json']();}catch{if(allowNotFound&&_0xb6893a[_0x387829(0xfd)]===0x194)return undefined;throw CliErrors[_0x387829(0xc6)](_0x387829(0xb1)+_0xb6893a[_0x387829(0xfd)]+')',_0xb6893a['status']>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}if(allowNotFound&&(_0xb6893a[_0x387829(0xfd)]===0x194||_0xb3c39c?.[_0x387829(0xdb)]===0x194))return undefined;const _0x2512ee=!_0xb6893a['ok']||_0xb3c39c?.[_0x387829(0xa0)]===![]||typeof _0xb3c39c?.[_0x387829(0xdb)]===_0x387829(0xd2)&&_0xb3c39c[_0x387829(0xdb)]>=0x190;if(_0x2512ee)throw CliErrors[_0x387829(0xc6)](_0xb3c39c?.[_0x387829(0xc9)]||_0xb3c39c?.['message']||_0xb3c39c?.[_0x387829(0x90)]||'SkillHub\x20API\x20error:\x20'+_0xb6893a['status'],_0xb3c39c?.[_0x387829(0xd3)]?_0x387829(0xb7)+_0xb3c39c[_0x387829(0xd3)]:undefined);return _0xb3c39c?.[_0x387829(0x7e)]??_0xb3c39c;}catch(_0x47d935){if(_0x47d935 instanceof Error&&_0x47d935[_0x387829(0xba)]===_0x387829(0xd1))throw CliErrors[_0x387829(0xc6)]('Request\x20timeout:\x20'+_0x484713[_0x387829(0xe8)]());throw _0x47d935;}finally{clearTimeout(_0x2b85a6);}}async function skillHubBinaryRequest(_0x379427,_0x5a46e8={}){const _0x50ba30=a65_0x38dd,{query:_0x2bbdb6,headers:headers={},timeout:timeout=0x7530}=_0x5a46e8,_0x4ce326=_activeAK;if(!_0x4ce326)throw CliErrors[_0x50ba30(0x88)](_0x50ba30(0x81)+PRODUCT_CONFIG[_0x50ba30(0xa5)]+'.');const _0x23ac36=getSkillHubDomain()[_0x50ba30(0xd6)](/\/$/,''),_0x1fed8e=new URL(_0x379427,_0x23ac36+'/');if(_0x2bbdb6)for(const [_0x541625,_0xc6e7a5]of Object[_0x50ba30(0xae)](_0x2bbdb6)){_0xc6e7a5!==undefined&&_0xc6e7a5!==null&&_0x1fed8e['searchParams'][_0x50ba30(0xfe)](_0x541625,String(_0xc6e7a5));}const _0x5808f4=new AbortController(),_0x29c64b=setTimeout(()=>_0x5808f4[_0x50ba30(0xf6)](),timeout);try{const _0x52ad5b=await fetch(_0x1fed8e[_0x50ba30(0xe8)](),{'method':'GET','headers':{'Accept':_0x50ba30(0xa1),'X-Invoke-Source':PRODUCT_CONFIG[_0x50ba30(0x87)],'X-User-AK':_0x4ce326,...headers},'signal':_0x5808f4[_0x50ba30(0xad)]});if(!_0x52ad5b['ok']){let _0x2f8bab;try{const _0x51ad76=await _0x52ad5b[_0x50ba30(0x8c)]();_0x2f8bab=_0x51ad76[_0x50ba30(0xc9)]||_0x51ad76[_0x50ba30(0xa3)]||_0x51ad76['msg']||_0x51ad76[_0x50ba30(0xd3)];}catch{_0x2f8bab=await _0x52ad5b[_0x50ba30(0xf8)]()['catch'](()=>undefined);}throw CliErrors[_0x50ba30(0xc6)](_0x2f8bab||_0x50ba30(0x89)+_0x52ad5b[_0x50ba30(0xfd)],_0x50ba30(0x7a)+_0x1fed8e[_0x50ba30(0xe8)]());}return Buffer[_0x50ba30(0xbe)](await _0x52ad5b[_0x50ba30(0xd4)]());}catch(_0x2d5ed8){if(_0x2d5ed8 instanceof Error&&_0x2d5ed8['name']===_0x50ba30(0xd1))throw CliErrors[_0x50ba30(0xc6)](_0x50ba30(0xd5)+_0x1fed8e[_0x50ba30(0xe8)]());throw _0x2d5ed8;}finally{clearTimeout(_0x29c64b);}}export async function getBffScriptInfo(_0x47397d){const _0x46fcb0=a65_0x38dd,_0x28fa72=await apiRequest(_0x46fcb0(0xfb)+_0x47397d);if(!_0x28fa72[_0x46fcb0(0x7e)])throw CliErrors[_0x46fcb0(0x7b)]('BFF\x20script\x20not\x20found:\x20id='+_0x47397d);return _0x28fa72[_0x46fcb0(0x7e)];}export async function getSqlQueryInfo(_0x3b3259,_0x56e3fc){const _0x1e1c0c=a65_0x38dd,_0x298acb=await apiRequest(_0x1e1c0c(0xa2),{'method':_0x1e1c0c(0x9b),'body':{'appCode':_0x3b3259,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x56e3fc}}),_0x3cbbca=_0x298acb[_0x1e1c0c(0x7e)],_0x316bfc=_0x3cbbca&&typeof _0x3cbbca==='object'&&_0x1e1c0c(0xf4)in _0x3cbbca?_0x3cbbca[_0x1e1c0c(0xf4)]?.[0x0]:_0x3cbbca&&typeof _0x3cbbca==='object'&&'sqlCode'in _0x3cbbca?_0x3cbbca:undefined;if(!_0x316bfc)throw CliErrors[_0x1e1c0c(0x7b)](_0x1e1c0c(0xbb)+_0x56e3fc);return _0x316bfc;}function isRemoteAppItem(_0x12513a){const _0x49031a=a65_0x38dd;return!!_0x12513a&&typeof _0x12513a===_0x49031a(0xd9)&&typeof _0x12513a['appCode']===_0x49031a(0xde)&&typeof _0x12513a[_0x49031a(0xcb)]===_0x49031a(0xde);}function extractRemoteAppItems(_0x44eaf2){const _0x45fc85=a65_0x38dd;if(Array[_0x45fc85(0xc7)](_0x44eaf2))return _0x44eaf2['filter'](isRemoteAppItem);if(!_0x44eaf2||typeof _0x44eaf2!==_0x45fc85(0xd9))throw CliErrors['apiError'](_0x45fc85(0x8a));const _0x59696b=_0x44eaf2;if(Array[_0x45fc85(0xc7)](_0x59696b['tableData']))return _0x59696b[_0x45fc85(0xf4)]['filter'](isRemoteAppItem);if(_0x59696b[_0x45fc85(0x7e)]&&typeof _0x59696b[_0x45fc85(0x7e)]===_0x45fc85(0xd9)){const _0x400bbd=_0x59696b['data'];if(Array[_0x45fc85(0xc7)](_0x400bbd[_0x45fc85(0xf4)]))return _0x400bbd[_0x45fc85(0xf4)]['filter'](isRemoteAppItem);}throw CliErrors[_0x45fc85(0xc6)](_0x45fc85(0xe0));}export async function getMyApps(){const _0x516ccc=a65_0x38dd,_0x236b1a=await apiRequest(_0x516ccc(0x95));return extractRemoteAppItems(_0x236b1a[_0x516ccc(0x7e)]);}export async function getLoginUserInfo(){const _0x5daf82=a65_0x38dd,_0x348351=await apiRequest(_0x5daf82(0xf5));if(!_0x348351[_0x5daf82(0x7e)]||typeof _0x348351[_0x5daf82(0x7e)]!=='object'||Array[_0x5daf82(0xc7)](_0x348351[_0x5daf82(0x7e)]))throw CliErrors[_0x5daf82(0xc6)](_0x5daf82(0xbf));return _0x348351[_0x5daf82(0x7e)];}export async function listDatasets(_0x11e18d,_0x1e71cb){const _0x4eb1d7=a65_0x38dd,_0x181a00=await apiRequest('/client/dataset/list',{'method':_0x4eb1d7(0x9b),'body':{'appCode':_0x11e18d,..._0x1e71cb?.['code']&&{'code':_0x1e71cb[_0x4eb1d7(0xdb)]},..._0x1e71cb?.[_0x4eb1d7(0xba)]&&{'name':_0x1e71cb[_0x4eb1d7(0xba)]}}});return extractList(_0x181a00['data']);}export async function getDatasetDetail(_0x238f02){const _0x3cd2da=await apiRequest('/client/dataset/get-driven-data?code='+encodeURIComponent(_0x238f02));return _0x3cd2da['data'];}export async function getDatasetSdkUsageDoc(_0x16c2a1,_0x3210d9){const _0x40dfb1=a65_0x38dd,_0x5576d5=await toolboxRequest(_0x40dfb1(0xb6),{'datasetCode':_0x16c2a1,'appCode':_0x3210d9});return typeof _0x5576d5?.['markdown']==='string'?_0x5576d5[_0x40dfb1(0x7f)]:'';}export async function listRuntimeArtifacts(_0x4a4c5e,_0x47f428){const _0x1c5a5d=a65_0x38dd,_0x1b61a3=new URLSearchParams({'appCode':_0x4a4c5e});if(_0x47f428?.[_0x1c5a5d(0xb0)])_0x1b61a3[_0x1c5a5d(0xfe)](_0x1c5a5d(0xb0),_0x47f428[_0x1c5a5d(0xb0)]);if(_0x47f428?.['source'])_0x1b61a3['set']('source',_0x47f428['source']);if(_0x47f428?.[_0x1c5a5d(0x96)]!==undefined)_0x1b61a3[_0x1c5a5d(0xfe)]('favorite',String(_0x47f428['favorite']));const _0x569d23=await apiRequest(_0x1c5a5d(0xcd)+_0x1b61a3[_0x1c5a5d(0xe8)]());return Array[_0x1c5a5d(0xc7)](_0x569d23[_0x1c5a5d(0x7e)])?_0x569d23[_0x1c5a5d(0x7e)]:[];}export async function getRuntimeArtifact(_0x4a5df3,_0x882468){const _0x586f25=a65_0x38dd,_0x4e779e=await apiRequest(_0x586f25(0xb5)+_0x4a5df3+_0x586f25(0xc1)+encodeURIComponent(_0x882468));if(!_0x4e779e[_0x586f25(0x7e)])throw CliErrors['validation'](_0x586f25(0xc3)+_0x4a5df3);return _0x4e779e['data'];}export async function createRuntimeArtifact(_0x56d637,_0x5f2c97){const _0x5cb4fb=a65_0x38dd,_0x53e299=await apiRequest(_0x5cb4fb(0xa9),{'method':'POST','body':{'appCode':_0x56d637,..._0x5f2c97}});return _0x53e299[_0x5cb4fb(0x7e)];}export async function updateRuntimeArtifact(_0xda627b,_0x2a4b96,_0x4c6b41){const _0x104614=a65_0x38dd,_0x48b9c2=await apiRequest(_0x104614(0xb5)+_0xda627b+_0x104614(0x84),{'method':_0x104614(0x9b),'body':{'appCode':_0x2a4b96,..._0x4c6b41}});return _0x48b9c2[_0x104614(0x7e)];}export async function listPersonalBffs(_0x43c3d4){const _0x22eac8=a65_0x38dd,_0x4f03fd=await apiRequest(_0x22eac8(0x92)+encodeURIComponent(_0x43c3d4));return Array[_0x22eac8(0xc7)](_0x4f03fd[_0x22eac8(0x7e)])?_0x4f03fd[_0x22eac8(0x7e)]:[];}export async function getPersonalBff(_0x2d748f,_0x13208e){const _0x1d5489=a65_0x38dd,_0x1d0901=await apiRequest(_0x1d5489(0x86)+_0x2d748f+_0x1d5489(0xc1)+encodeURIComponent(_0x13208e));if(!_0x1d0901[_0x1d5489(0x7e)])throw CliErrors['validation'](_0x1d5489(0xef)+_0x2d748f);return _0x1d0901[_0x1d5489(0x7e)];}export async function createPersonalBff(_0x351bfd,_0x2b694b){const _0x39f1a9=a65_0x38dd,_0x547f5a=await apiRequest(_0x39f1a9(0x7c),{'method':_0x39f1a9(0x9b),'body':{'appCode':_0x351bfd,..._0x2b694b}});return _0x547f5a[_0x39f1a9(0x7e)];}export async function updatePersonalBff(_0x21d651,_0x1c9551,_0x28fec6){const _0x18ddd4=a65_0x38dd,_0x92dbca=await apiRequest('/client/runtime-bff/personal/'+_0x21d651+'/update',{'method':_0x18ddd4(0x9b),'body':{'appCode':_0x1c9551,..._0x28fec6}});return _0x92dbca[_0x18ddd4(0x7e)];}export async function executePersonalBff(_0x55f675,_0x2d3c52,_0x2a223f){const _0x3b60de=a65_0x38dd,_0x1885bb=await apiRequest('/client/runtime-bff/personal/'+_0x55f675+_0x3b60de(0x93)+encodeURIComponent(_0x2d3c52),{'method':_0x3b60de(0x9b),'body':_0x2a223f});return _0x1885bb['data'];}export async function listPersonalKnowledgeBaseItems(_0x38e040){const _0x3c54eb=a65_0x38dd,_0x3a1840=await apiRequest(_0x3c54eb(0xee)+encodeURIComponent(_0x38e040));return Array['isArray'](_0x3a1840[_0x3c54eb(0x7e)])?_0x3a1840['data']:[];}export async function getPersonalKnowledgeBaseItem(_0x1f6ab5,_0x2c79e0){const _0x50f755=a65_0x38dd,_0x554d15=await apiRequest(_0x50f755(0xb2)+_0x1f6ab5+_0x50f755(0xc1)+encodeURIComponent(_0x2c79e0));if(!_0x554d15[_0x50f755(0x7e)])throw CliErrors[_0x50f755(0x7b)](_0x50f755(0x80)+_0x1f6ab5);return _0x554d15[_0x50f755(0x7e)];}export async function createPersonalKnowledgeBaseItem(_0x5015ae,_0x32d8b7){const _0x11149d=a65_0x38dd,_0x1ea78c=await apiRequest(_0x11149d(0xe4),{'method':_0x11149d(0x9b),'body':{'appCode':_0x5015ae,..._0x32d8b7}});return _0x1ea78c['data'];}export async function updatePersonalKnowledgeBaseItem(_0x261776,_0x358fe1,_0x5b2333){const _0x23a792=a65_0x38dd,_0x48eda5=await apiRequest(_0x23a792(0xb2)+_0x261776+_0x23a792(0x84),{'method':_0x23a792(0x9b),'body':{'appCode':_0x358fe1,..._0x5b2333}});return _0x48eda5[_0x23a792(0x7e)];}export async function searchKnowledgeBase(_0x4b8910,_0x3ad3e6){const _0x4f25da=a65_0x38dd,_0x2a499a=await apiRequest('/client/knowledge-base/search',{'method':_0x4f25da(0x9b),'body':{'appCode':_0x4b8910,'query':_0x3ad3e6[_0x4f25da(0xfc)],..._0x3ad3e6[_0x4f25da(0xbc)]!==undefined?{'topK':_0x3ad3e6[_0x4f25da(0xbc)]}:{}}});return Array['isArray'](_0x2a499a[_0x4f25da(0x7e)])?_0x2a499a[_0x4f25da(0x7e)]:[];}export async function getRuntimeSkillByCode(_0x41786d,_0x2c8747){const _0x92b425=await skillHubJsonRequest('/api/v1/skills/'+encodeURIComponent(_0x41786d)+'/'+encodeURIComponent(_0x2c8747),{'allowNotFound':!![]});return _0x92b425?skillHubRuntimeDetailToRuntimeSkill(_0x92b425):undefined;}export async function listRuntimeSkills(_0x427a10){const _0x5ef15b=a65_0x38dd,_0x1da0ec=await skillHubJsonRequest('/api/runtime/v1/namespaces/'+encodeURIComponent(_0x427a10['appCode'])+_0x5ef15b(0xd0),{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x427a10[_0x5ef15b(0xb8)],_0x1da0ec,_0x427a10[_0x5ef15b(0xb4)]??'all',_0x427a10[_0x5ef15b(0xdb)]);}export async function listPersonalRuntimeSkills(_0x4de27f){const _0x23ee99=a65_0x38dd;return(await listRuntimeSkills({'appCode':_0x4de27f,'scope':'personal'}))[_0x23ee99(0x9f)];}export async function listCompanyRuntimeSkills(_0x3f07b8){const _0x573bd8=a65_0x38dd;return(await listRuntimeSkills({'appCode':_0x3f07b8,'scope':_0x573bd8(0xe5)}))[_0x573bd8(0xe5)];}export async function listVisibleRuntimeSkills(_0x4e228f){const _0x140886=a65_0x38dd;return(await listRuntimeSkills({'appCode':_0x4e228f,'scope':_0x140886(0xdc)}))['effective'];}export async function createPersonalRuntimeSkill(_0x14dfe3,_0x10d018){const _0xfdc648=a65_0x38dd;return publishRuntimeSkill(_0x14dfe3,_0x10d018,{'visibility':_0xfdc648(0x9e)});}export async function updatePersonalRuntimeSkill(_0x2ded35,_0x264310,_0x1d3a8f){const _0x56b4f4=a65_0x38dd;return publishRuntimeSkill(_0x264310,{..._0x1d3a8f,'skillCode':_0x1d3a8f[_0x56b4f4(0xea)]??_0x2ded35},{'visibility':'PRIVATE'});}export async function publishCompanyRuntimeSkill(_0x166d1e,_0x2d4e9e,_0x12c764={}){const _0x42ec2f=a65_0x38dd;return publishRuntimeSkill(_0x166d1e,_0x2d4e9e,{'visibility':_0x42ec2f(0xa8),'confirmWarnings':_0x12c764[_0x42ec2f(0x78)]});}export async function validateRuntimeSkillPublish(_0x234852,_0x45508b,_0x55eb00){const _0x3b14e9=a65_0x38dd,_0xbe7a48=buildRuntimeSkillPublishForm(_0x45508b,_0x55eb00[_0x3b14e9(0x79)]),_0x36794e=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0x234852)+_0x3b14e9(0xf3),{'method':_0x3b14e9(0x9b),'body':_0xbe7a48});return{'valid':_0x36794e[_0x3b14e9(0x8d)]===!![],'errors':Array['isArray'](_0x36794e[_0x3b14e9(0x94)])?_0x36794e[_0x3b14e9(0x94)]:[],'warnings':Array[_0x3b14e9(0xc7)](_0x36794e['warnings'])?_0x36794e[_0x3b14e9(0xe3)]:[],'resolvedSlug':_0x36794e[_0x3b14e9(0xac)],'resolvedVersion':_0x36794e[_0x3b14e9(0xc4)]};}export async function downloadRuntimeSkillPackage(_0x2d78dc,_0x106041,_0x1aa506,_0x185229){const _0x514e81=a65_0x38dd;void _0x2d78dc;const _0x1a3540=_0x185229?_0x514e81(0xb9)+encodeURIComponent(_0x1aa506)+'/'+encodeURIComponent(_0x106041)+'/versions/'+encodeURIComponent(_0x185229)+_0x514e81(0xe6):'/api/cli/v1/skills/'+encodeURIComponent(_0x1aa506)+'/'+encodeURIComponent(_0x106041)+'/download';return skillHubBinaryRequest(_0x1a3540);}async function publishRuntimeSkill(_0x5eb3ad,_0x3aee9d,_0x133ec2){const _0x5a2d3c=a65_0x38dd,_0x5028ab=buildRuntimeSkillPublishForm(_0x3aee9d,_0x133ec2[_0x5a2d3c(0x79)]),_0x1b731d=await skillHubJsonRequest(_0x5a2d3c(0xb9)+encodeURIComponent(_0x5eb3ad)+_0x5a2d3c(0xec),{'method':_0x5a2d3c(0x9b),'query':{'confirmWarnings':_0x133ec2['confirmWarnings']===!![]?!![]:undefined},'body':_0x5028ab});return{'appCode':_0x1b731d[_0x5a2d3c(0x9a)]??_0x5eb3ad,'skillCode':_0x1b731d['slug']??_0x3aee9d[_0x5a2d3c(0xea)]??'','skillName':_0x3aee9d['skillName']??_0x1b731d[_0x5a2d3c(0xab)]??_0x3aee9d[_0x5a2d3c(0xea)],'description':_0x3aee9d[_0x5a2d3c(0xfa)],'scope':skillHubVisibilityToScope(_0x1b731d[_0x5a2d3c(0x79)]??_0x133ec2[_0x5a2d3c(0x79)])??_0x5a2d3c(0x9f),'version':_0x1b731d[_0x5a2d3c(0xaa)]??_0x3aee9d[_0x5a2d3c(0xaa)],'tags':_0x3aee9d[_0x5a2d3c(0x9c)],'content':_0x3aee9d[_0x5a2d3c(0xdf)]};}function buildRuntimeSkillPublishForm(_0x4d62db,_0x3a5487){const _0x6e5948=a65_0x38dd,_0x2b34cc=new FormData();return _0x2b34cc['set'](_0x6e5948(0xed),runtimeSkillPackageFile(_0x4d62db)),_0x2b34cc['set'](_0x6e5948(0x79),_0x3a5487),_0x2b34cc;}function runtimeSkillPackageFile(_0x3a640e){const _0x1b77c3=a65_0x38dd;if(!_0x3a640e[_0x1b77c3(0xc8)])throw CliErrors[_0x1b77c3(0x7b)]('Missing\x20Skill\x20package\x20payload.');const _0x2f3def=Buffer['from'](_0x3a640e[_0x1b77c3(0xc8)],_0x1b77c3(0xda)),_0x3faa0e=new Blob([_0x2f3def],{'type':'application/zip'}),_0x2ee6f2=(_0x3a640e[_0x1b77c3(0xea)]||_0x1b77c3(0x82))+_0x1b77c3(0xf9);if(typeof File!=='undefined')return new File([_0x3faa0e],_0x2ee6f2,{'type':_0x1b77c3(0x7d)});return _0x3faa0e;}function normalizeSkillHubRuntimeListResponse(_0x1e991a,_0x563625,_0x21f314,_0x335275){const _0x42c247=a65_0x38dd,_0x31f644=Array[_0x42c247(0xc7)](_0x563625)?_0x563625:Array['isArray'](_0x563625?.[_0x42c247(0xa4)])?_0x563625[_0x42c247(0xa4)]:[],_0x3ebd59=_0x335275?.['trim'](),_0x2035d8=_0x31f644['filter'](_0x38ad2e=>!_0x3ebd59||_0x38ad2e['slug']===_0x3ebd59)[_0x42c247(0xf1)](skillHubRuntimeItemToRuntimeSkill)[_0x42c247(0x97)](_0x1b2d1e=>Boolean(_0x1b2d1e)),_0x17f03f=_0x2035d8['filter'](_0x44a0ad=>_0x44a0ad[_0x42c247(0xb4)]===_0x42c247(0x9f)),_0x332473=_0x2035d8[_0x42c247(0x97)](_0x19980a=>_0x19980a[_0x42c247(0xb4)]===_0x42c247(0xe5));return{'appCode':_0x1e991a,'personal':_0x21f314===_0x42c247(0xe5)?[]:_0x17f03f,'company':_0x21f314===_0x42c247(0x9f)?[]:_0x332473,'effective':buildEffectiveRuntimeSkills(_0x17f03f,_0x332473,_0x21f314)};}function skillHubRuntimeItemToRuntimeSkill(_0x5dc444){const _0xceefe0=a65_0x38dd,_0x2d75ce=_0x5dc444[_0xceefe0(0xab)]?.[_0xceefe0(0xc2)](),_0x5d4ed3=skillHubVisibilityToScope(_0x5dc444[_0xceefe0(0x79)]);if(!_0x2d75ce||!_0x5d4ed3)return undefined;return{'id':_0x5dc444['id'],'appCode':_0x5dc444[_0xceefe0(0x9a)],'skillCode':_0x2d75ce,'skillName':_0x5dc444['displayName']??_0x2d75ce,'description':_0x5dc444['summary'],'scope':_0x5d4ed3,'version':skillHubRuntimeItemVersion(_0x5dc444),'status':_0x5dc444[_0xceefe0(0xfd)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x57c470){const _0x12fb7e=a65_0x38dd,_0x343f95=_0x57c470[_0x12fb7e(0xab)]?.[_0x12fb7e(0xc2)]();if(!_0x343f95)return undefined;return{'id':_0x57c470['id'],'appCode':_0x57c470[_0x12fb7e(0x9a)],'skillCode':_0x343f95,'skillName':_0x57c470[_0x12fb7e(0x91)]??_0x343f95,'description':_0x57c470[_0x12fb7e(0xa6)],'scope':skillHubVisibilityToScope(_0x57c470[_0x12fb7e(0x79)])??_0x57c470['visibility']?.[_0x12fb7e(0xdd)](),'version':skillHubRuntimeItemVersion(_0x57c470),'status':_0x57c470[_0x12fb7e(0xfd)]};}function skillHubVisibilityToScope(_0x4a72cf){const _0x31491a=a65_0x38dd;if(_0x4a72cf==='PRIVATE')return _0x31491a(0x9f);if(_0x4a72cf===_0x31491a(0xa8))return _0x31491a(0xe5);return undefined;}function skillHubRuntimeItemVersion(_0x3be5c8){const _0x464608=a65_0x38dd;return _0x3be5c8[_0x464608(0xc0)]?.[_0x464608(0xaa)]??_0x3be5c8[_0x464608(0xce)]?.[_0x464608(0xaa)]??_0x3be5c8[_0x464608(0x98)]?.[_0x464608(0xaa)];}function buildEffectiveRuntimeSkills(_0x5eda78,_0x562c05,_0x561fb9){const _0x3928f5=a65_0x38dd;if(_0x561fb9===_0x3928f5(0x9f))return _0x5eda78;if(_0x561fb9===_0x3928f5(0xe5))return _0x562c05;const _0x4ed29c=new Map();for(const _0x16f988 of _0x562c05){_0x4ed29c[_0x3928f5(0xfe)](_0x16f988[_0x3928f5(0xea)],_0x16f988);}for(const _0xd8e43b of _0x5eda78){_0x4ed29c[_0x3928f5(0xfe)](_0xd8e43b[_0x3928f5(0xea)],_0xd8e43b);}return Array[_0x3928f5(0xbe)](_0x4ed29c[_0x3928f5(0xe1)]());}function normalizeRuntimeSkillListResponse(_0x31aeeb,_0x4b08b0){const _0x24e4da=a65_0x38dd;if(Array[_0x24e4da(0xc7)](_0x4b08b0)){const _0x2ef922=_0x4b08b0[_0x24e4da(0x97)](_0xd78553=>_0xd78553[_0x24e4da(0xb4)]===_0x24e4da(0x9f)),_0x571c0d=_0x4b08b0[_0x24e4da(0x97)](_0x24c438=>_0x24c438[_0x24e4da(0xb4)]==='company');return{'appCode':_0x31aeeb,'personal':_0x2ef922,'company':_0x571c0d,'effective':[..._0x571c0d,..._0x2ef922]};}return{'appCode':_0x4b08b0?.[_0x24e4da(0xb8)]??_0x31aeeb,'personal':Array[_0x24e4da(0xc7)](_0x4b08b0?.[_0x24e4da(0x9f)])?_0x4b08b0[_0x24e4da(0x9f)]:[],'company':Array[_0x24e4da(0xc7)](_0x4b08b0?.[_0x24e4da(0xe5)])?_0x4b08b0['company']:[],'effective':Array[_0x24e4da(0xc7)](_0x4b08b0?.[_0x24e4da(0x8b)])?_0x4b08b0[_0x24e4da(0x8b)]:[]};}
|
|
1
|
+
(function(_0x23cd43,_0x3a2198){const _0x679b6f=a66_0x525c,_0x4b9fc9=_0x23cd43();while(!![]){try{const _0x20a2d3=parseInt(_0x679b6f(0x18a))/0x1+-parseInt(_0x679b6f(0x17a))/0x2*(-parseInt(_0x679b6f(0x1b8))/0x3)+-parseInt(_0x679b6f(0x171))/0x4+parseInt(_0x679b6f(0x1bc))/0x5+parseInt(_0x679b6f(0x166))/0x6+-parseInt(_0x679b6f(0x154))/0x7*(parseInt(_0x679b6f(0x199))/0x8)+-parseInt(_0x679b6f(0x1b1))/0x9;if(_0x20a2d3===_0x3a2198)break;else _0x4b9fc9['push'](_0x4b9fc9['shift']());}catch(_0x1aa291){_0x4b9fc9['push'](_0x4b9fc9['shift']());}}}(a66_0x4489,0xd0e1d));import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0x4e5035){_activeAK=_0x4e5035||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x777274,_0x50b024={}){const _0x5d0b65=a66_0x525c,{method:method=_0x5d0b65(0x1b3),body:_0x306046,headers:headers={},timeout:timeout=0x7530}=_0x50b024,_0x4c7fc1=_activeAK,_0x190d01=getRuntimeDomain();if(!_0x4c7fc1)throw CliErrors[_0x5d0b65(0x185)](_0x5d0b65(0x165)+PRODUCT_CONFIG[_0x5d0b65(0x1a8)]+'.');const _0x2b3939=''+_0x190d01+_0x777274,_0x127b20={'X-User-AK':_0x4c7fc1},_0x4526f9=new AbortController(),_0x446a36=setTimeout(()=>_0x4526f9['abort'](),timeout);try{const _0x7bdfab=await fetch(_0x2b3939,{'method':method,'headers':{'Content-Type':_0x5d0b65(0x14c),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],..._0x127b20,...headers},'body':_0x306046?JSON['stringify'](_0x306046):undefined,'signal':_0x4526f9[_0x5d0b65(0x178)]});let _0x2368a7;try{_0x2368a7=await _0x7bdfab['json']();}catch{throw CliErrors[_0x5d0b65(0x19e)](_0x5d0b65(0x17e)+_0x7bdfab[_0x5d0b65(0x1a9)]+')',_0x7bdfab[_0x5d0b65(0x1a9)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}if(!_0x7bdfab['ok']||_0x2368a7[_0x5d0b65(0x1b2)]===![])throw CliErrors[_0x5d0b65(0x19e)](_0x2368a7[_0x5d0b65(0x15a)]||_0x2368a7[_0x5d0b65(0x1a5)]||_0x5d0b65(0x148)+_0x7bdfab[_0x5d0b65(0x1a9)],_0x2368a7['errorCode']?'API\x20error\x20code:\x20'+_0x2368a7[_0x5d0b65(0x1a3)]:undefined);return _0x2368a7;}catch(_0x232056){if(_0x232056 instanceof Error&&_0x232056[_0x5d0b65(0x1ad)]===_0x5d0b65(0x181))throw CliErrors[_0x5d0b65(0x19e)]('Request\x20timeout:\x20'+_0x2b3939);throw _0x232056;}finally{clearTimeout(_0x446a36);}}async function apiBinaryRequest(_0x34368d,_0x35f5bf={}){const _0xc8c906=a66_0x525c,{method:method=_0xc8c906(0x1b3),headers:headers={},timeout:timeout=0x7530}=_0x35f5bf,_0x5a7a61=_activeAK,_0x4241b6=getRuntimeDomain();if(!_0x5a7a61)throw CliErrors[_0xc8c906(0x185)](_0xc8c906(0x165)+PRODUCT_CONFIG[_0xc8c906(0x1a8)]+'.');const _0x4d801c=''+_0x4241b6+_0x34368d,_0x5f1ca5=new AbortController(),_0x3af75a=setTimeout(()=>_0x5f1ca5[_0xc8c906(0x1a6)](),timeout);try{const _0x3bc23f=await fetch(_0x4d801c,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0xc8c906(0x161)],'X-User-AK':_0x5a7a61,...headers},'signal':_0x5f1ca5[_0xc8c906(0x178)]});if(!_0x3bc23f['ok']){let _0xacaea9;try{const _0x5a5719=await _0x3bc23f['json']();_0xacaea9=_0x5a5719['errorMsg']||_0x5a5719[_0xc8c906(0x1a5)]||_0x5a5719[_0xc8c906(0x1a3)];}catch{_0xacaea9=await _0x3bc23f[_0xc8c906(0x196)]()[_0xc8c906(0x151)](()=>undefined);}throw CliErrors[_0xc8c906(0x19e)](_0xacaea9||_0xc8c906(0x148)+_0x3bc23f['status'],_0xc8c906(0x1ab)+_0x4d801c);}return Buffer[_0xc8c906(0x15e)](await _0x3bc23f['arrayBuffer']());}catch(_0x1cbe6a){if(_0x1cbe6a instanceof Error&&_0x1cbe6a[_0xc8c906(0x1ad)]===_0xc8c906(0x181))throw CliErrors[_0xc8c906(0x19e)](_0xc8c906(0x19a)+_0x4d801c);throw _0x1cbe6a;}finally{clearTimeout(_0x3af75a);}}async function toolboxRequest(_0x23c632,_0x4027b8,_0x30e114={}){const _0x1ffd9e=a66_0x525c,{method:method=_0x1ffd9e(0x1b3),headers:headers={},timeout:timeout=0x7530}=_0x30e114,_0x28bdea=_activeAK;if(!_0x28bdea)throw CliErrors['authRequired']('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x1ffd9e(0x1a8)]+'.');const _0x384665=getApiDomain()[_0x1ffd9e(0x191)](/\/$/,''),_0x5d26ea=new URL(_0x23c632,_0x384665+_0x1ffd9e(0x19f));if(_0x4027b8)for(const [_0xda9b9c,_0x1d9f82]of Object[_0x1ffd9e(0x18e)](_0x4027b8)){_0x1d9f82!==undefined&&_0x1d9f82!==null&&_0x5d26ea[_0x1ffd9e(0x1bb)][_0x1ffd9e(0x194)](_0xda9b9c,String(_0x1d9f82));}const _0x40a5b8=new AbortController(),_0x317c65=setTimeout(()=>_0x40a5b8['abort'](),timeout);try{const _0x51736e=await fetch(_0x5d26ea,{'method':method,'headers':{'Content-Type':_0x1ffd9e(0x14c),'X-Invoke-Source':PRODUCT_CONFIG[_0x1ffd9e(0x161)],'X-User-AK':_0x28bdea,...headers},'signal':_0x40a5b8[_0x1ffd9e(0x178)]});let _0x212379;try{_0x212379=await _0x51736e[_0x1ffd9e(0x18f)]();}catch{throw CliErrors['apiError'](_0x1ffd9e(0x174)+_0x51736e['status']+')',_0x51736e[_0x1ffd9e(0x1a9)]>=0x190?_0x1ffd9e(0x16b):undefined);}if(!_0x51736e['ok']){const _0x19e24d=_0x212379&&typeof _0x212379===_0x1ffd9e(0x193)?_0x212379:{};throw CliErrors[_0x1ffd9e(0x19e)](_0x19e24d[_0x1ffd9e(0x15a)]||_0x19e24d[_0x1ffd9e(0x1a5)]||_0x1ffd9e(0x16e)+_0x51736e[_0x1ffd9e(0x1a9)],_0x19e24d['errorCode']?_0x1ffd9e(0x1ae)+_0x19e24d['errorCode']:undefined);}if(_0x212379&&typeof _0x212379===_0x1ffd9e(0x193)&&_0x1ffd9e(0x1b2)in _0x212379&&typeof _0x212379[_0x1ffd9e(0x1b2)]===_0x1ffd9e(0x175)){const _0x2aff06=_0x212379;if(!_0x2aff06[_0x1ffd9e(0x1b2)])throw CliErrors[_0x1ffd9e(0x19e)](_0x2aff06[_0x1ffd9e(0x15a)]||_0x2aff06[_0x1ffd9e(0x1a5)]||_0x1ffd9e(0x1a1),_0x2aff06[_0x1ffd9e(0x1a3)]?_0x1ffd9e(0x1ae)+_0x2aff06[_0x1ffd9e(0x1a3)]:undefined);return _0x2aff06[_0x1ffd9e(0x1aa)];}return _0x212379;}catch(_0x5365da){if(_0x5365da instanceof Error&&_0x5365da[_0x1ffd9e(0x1ad)]===_0x1ffd9e(0x181))throw CliErrors[_0x1ffd9e(0x19e)](_0x1ffd9e(0x19a)+_0x5d26ea[_0x1ffd9e(0x183)]());throw _0x5365da;}finally{clearTimeout(_0x317c65);}}async function skillHubJsonRequest(_0x1c82aa,_0x5293d5={}){const _0x59d980=a66_0x525c,{method:method=_0x59d980(0x1b3),query:_0x1ad9c1,body:_0x177897,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x5293d5,_0x19eecd=_activeAK;if(!_0x19eecd)throw CliErrors[_0x59d980(0x185)](_0x59d980(0x165)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x41ac83=getSkillHubDomain()[_0x59d980(0x191)](/\/$/,''),_0x32e37d=new URL(_0x1c82aa,_0x41ac83+'/');if(_0x1ad9c1)for(const [_0x4d119d,_0x562a5b]of Object[_0x59d980(0x18e)](_0x1ad9c1)){_0x562a5b!==undefined&&_0x562a5b!==null&&_0x32e37d[_0x59d980(0x1bb)][_0x59d980(0x194)](_0x4d119d,String(_0x562a5b));}const _0x41d41f=new AbortController(),_0x4ea4e8=setTimeout(()=>_0x41d41f['abort'](),timeout);try{const _0x14f405=await fetch(_0x32e37d[_0x59d980(0x183)](),{'method':method,'headers':{'Accept':_0x59d980(0x14c),'X-Invoke-Source':PRODUCT_CONFIG[_0x59d980(0x161)],'X-User-AK':_0x19eecd,...headers},'body':_0x177897,'signal':_0x41d41f['signal']});let _0x1332ff;try{_0x1332ff=await _0x14f405[_0x59d980(0x18f)]();}catch{if(allowNotFound&&_0x14f405['status']===0x194)return undefined;throw CliErrors['apiError'](_0x59d980(0x147)+_0x14f405['status']+')',_0x14f405['status']>=0x190?_0x59d980(0x16b):undefined);}if(allowNotFound&&(_0x14f405[_0x59d980(0x1a9)]===0x194||_0x1332ff?.[_0x59d980(0x168)]===0x194))return undefined;const _0x191e47=!_0x14f405['ok']||_0x1332ff?.['success']===![]||typeof _0x1332ff?.['code']==='number'&&_0x1332ff[_0x59d980(0x168)]>=0x190;if(_0x191e47)throw CliErrors[_0x59d980(0x19e)](_0x1332ff?.[_0x59d980(0x15a)]||_0x1332ff?.[_0x59d980(0x1a5)]||_0x1332ff?.['msg']||'SkillHub\x20API\x20error:\x20'+_0x14f405[_0x59d980(0x1a9)],_0x1332ff?.[_0x59d980(0x1a3)]?_0x59d980(0x153)+_0x1332ff['errorCode']:undefined);return _0x1332ff?.[_0x59d980(0x1aa)]??_0x1332ff;}catch(_0x1c567e){if(_0x1c567e instanceof Error&&_0x1c567e['name']==='AbortError')throw CliErrors[_0x59d980(0x19e)]('Request\x20timeout:\x20'+_0x32e37d[_0x59d980(0x183)]());throw _0x1c567e;}finally{clearTimeout(_0x4ea4e8);}}function a66_0x4489(){const _0xe3f2f0=['208196qIDTlw','/client/runtime-bff/personal/create','warnings','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','boolean','/client/bff/query/','Missing\x20Skill\x20package\x20payload.','signal','resolvedSlug','346634OUwUny','resolvedVersion','personal','skillCode','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','artifactType','skillName','AbortError','/api/cli/v1/skills/','toString','packageBase64','authRequired','scope','PRIVATE','string','/publish','875272KfbYkO','/execute?appCode=','/client/artifact/','/download','entries','json','source','replace','filter','object','set','tags','text','validation','slug','1264440yREzgz','Request\x20timeout:\x20','trim','isArray','/api/runtime/v1/namespaces/','apiError','/api/node-toolbox/','tableData','Toolbox\x20API\x20error','Knowledge-base\x20entry\x20not\x20found:\x20id=','errorCode','effective','message','abort','/client/runtime-bff/personal/','newConfigFileName','status','data','Download\x20failed:\x20','/client/sql/query','name','Toolbox\x20error\x20code:\x20','?appCode=','/client/user/loginUserInfo','16438239hbZAcd','success','GET','.zip','skill','errors','appCode','15EMyhKv','appName','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','searchParams','2767565SElMJB','headlineVersion','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','/client/knowledge-base/search','file','summary','Personal\x20BFF\x20not\x20found:\x20id=','SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20','API\x20error:\x20','/versions/','map','POST','application/json','valid','confirmWarnings','namespace','version','catch','BFF\x20script\x20not\x20found:\x20id=','SkillHub\x20error\x20code:\x20','35IyrLDL','items','/client/artifact/create','sqlCode','NAMESPACE_ONLY','markdown','errorMsg','/update','favorite','base64','from','/client/knowledge-base/personal/list?appCode=','/client/knowledge-base/personal/create','invokeSource','SQL\x20query\x20not\x20found:\x20','company','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','Configure\x20accessKey\x20in\x20','7374036wbGTVU','application/zip','code','topK','content','Check\x20your\x20credentials\x20and\x20try\x20again.','visibility','all','Toolbox\x20API\x20error:\x20','/client/knowledge-base/personal/','description'];a66_0x4489=function(){return _0xe3f2f0;};return a66_0x4489();}async function skillHubBinaryRequest(_0x385cbd,_0x1ed9b6={}){const _0x121046=a66_0x525c,{query:_0x1bef57,headers:headers={},timeout:timeout=0x7530}=_0x1ed9b6,_0x5a973d=_activeAK;if(!_0x5a973d)throw CliErrors[_0x121046(0x185)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x121046(0x1a8)]+'.');const _0x33ff4b=getSkillHubDomain()[_0x121046(0x191)](/\/$/,''),_0x584d80=new URL(_0x385cbd,_0x33ff4b+'/');if(_0x1bef57)for(const [_0x4aba3c,_0x29a4bb]of Object[_0x121046(0x18e)](_0x1bef57)){_0x29a4bb!==undefined&&_0x29a4bb!==null&&_0x584d80[_0x121046(0x1bb)][_0x121046(0x194)](_0x4aba3c,String(_0x29a4bb));}const _0x508ec7=new AbortController(),_0x9fe702=setTimeout(()=>_0x508ec7['abort'](),timeout);try{const _0x1c6976=await fetch(_0x584d80[_0x121046(0x183)](),{'method':_0x121046(0x1b3),'headers':{'Accept':'application/octet-stream','X-Invoke-Source':PRODUCT_CONFIG[_0x121046(0x161)],'X-User-AK':_0x5a973d,...headers},'signal':_0x508ec7[_0x121046(0x178)]});if(!_0x1c6976['ok']){let _0x5d5355;try{const _0x2b18fd=await _0x1c6976[_0x121046(0x18f)]();_0x5d5355=_0x2b18fd[_0x121046(0x15a)]||_0x2b18fd[_0x121046(0x1a5)]||_0x2b18fd['msg']||_0x2b18fd[_0x121046(0x1a3)];}catch{_0x5d5355=await _0x1c6976[_0x121046(0x196)]()[_0x121046(0x151)](()=>undefined);}throw CliErrors[_0x121046(0x19e)](_0x5d5355||'SkillHub\x20API\x20error:\x20'+_0x1c6976[_0x121046(0x1a9)],_0x121046(0x1ab)+_0x584d80['toString']());}return Buffer[_0x121046(0x15e)](await _0x1c6976['arrayBuffer']());}catch(_0x50de40){if(_0x50de40 instanceof Error&&_0x50de40['name']===_0x121046(0x181))throw CliErrors['apiError'](_0x121046(0x19a)+_0x584d80['toString']());throw _0x50de40;}finally{clearTimeout(_0x9fe702);}}export async function getBffScriptInfo(_0x145b5b){const _0xce9965=a66_0x525c,_0x2dbb72=await apiRequest(_0xce9965(0x176)+_0x145b5b);if(!_0x2dbb72[_0xce9965(0x1aa)])throw CliErrors[_0xce9965(0x197)](_0xce9965(0x152)+_0x145b5b);return _0x2dbb72['data'];}export async function getSqlQueryInfo(_0xc53e43,_0x5c5e03){const _0x4f93a8=a66_0x525c,_0x803584=await apiRequest(_0x4f93a8(0x1ac),{'method':_0x4f93a8(0x14b),'body':{'appCode':_0xc53e43,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x5c5e03}}),_0x31ef02=_0x803584[_0x4f93a8(0x1aa)],_0x2252fa=_0x31ef02&&typeof _0x31ef02===_0x4f93a8(0x193)&&_0x4f93a8(0x1a0)in _0x31ef02?_0x31ef02['tableData']?.[0x0]:_0x31ef02&&typeof _0x31ef02==='object'&&_0x4f93a8(0x157)in _0x31ef02?_0x31ef02:undefined;if(!_0x2252fa)throw CliErrors[_0x4f93a8(0x197)](_0x4f93a8(0x162)+_0x5c5e03);return _0x2252fa;}function isRemoteAppItem(_0x5bda90){const _0x4f6c10=a66_0x525c;return!!_0x5bda90&&typeof _0x5bda90===_0x4f6c10(0x193)&&typeof _0x5bda90[_0x4f6c10(0x1b7)]==='string'&&typeof _0x5bda90[_0x4f6c10(0x1b9)]===_0x4f6c10(0x188);}function extractRemoteAppItems(_0x31c706){const _0x25eda2=a66_0x525c;if(Array[_0x25eda2(0x19c)](_0x31c706))return _0x31c706[_0x25eda2(0x192)](isRemoteAppItem);if(!_0x31c706||typeof _0x31c706!==_0x25eda2(0x193))throw CliErrors[_0x25eda2(0x19e)](_0x25eda2(0x164));const _0x58b7a6=_0x31c706;if(Array['isArray'](_0x58b7a6['tableData']))return _0x58b7a6['tableData'][_0x25eda2(0x192)](isRemoteAppItem);if(_0x58b7a6[_0x25eda2(0x1aa)]&&typeof _0x58b7a6[_0x25eda2(0x1aa)]==='object'){const _0x5ae630=_0x58b7a6['data'];if(Array[_0x25eda2(0x19c)](_0x5ae630[_0x25eda2(0x1a0)]))return _0x5ae630[_0x25eda2(0x1a0)][_0x25eda2(0x192)](isRemoteAppItem);}throw CliErrors['apiError'](_0x25eda2(0x1ba));}export async function getMyApps(){const _0x5a2e97=a66_0x525c,_0x2f6c28=await apiRequest('/client/app/my-apps');return extractRemoteAppItems(_0x2f6c28[_0x5a2e97(0x1aa)]);}export async function getLoginUserInfo(){const _0x3d4677=a66_0x525c,_0x4abc45=await apiRequest(_0x3d4677(0x1b0));if(!_0x4abc45['data']||typeof _0x4abc45['data']!=='object'||Array['isArray'](_0x4abc45[_0x3d4677(0x1aa)]))throw CliErrors[_0x3d4677(0x19e)](_0x3d4677(0x1be));return _0x4abc45[_0x3d4677(0x1aa)];}export async function listDatasets(_0x598188,_0x53d878){const _0x2d3dce=a66_0x525c,_0x3a8ab4=await apiRequest('/client/dataset/list',{'method':_0x2d3dce(0x14b),'body':{'appCode':_0x598188,..._0x53d878?.[_0x2d3dce(0x168)]&&{'code':_0x53d878[_0x2d3dce(0x168)]},..._0x53d878?.['name']&&{'name':_0x53d878[_0x2d3dce(0x1ad)]}}});return extractList(_0x3a8ab4[_0x2d3dce(0x1aa)]);}export async function getDatasetDetail(_0x926594){const _0x2b02ca=a66_0x525c,_0x3fef9e=await apiRequest('/client/dataset/get-driven-data?code='+encodeURIComponent(_0x926594));return _0x3fef9e[_0x2b02ca(0x1aa)];}export async function getDatasetSdkUsageDoc(_0x1f3e2a,_0x2ab8fc){const _0x383a71=a66_0x525c,_0x134ffa=await toolboxRequest('api-doc-generator',{'datasetCode':_0x1f3e2a,'appCode':_0x2ab8fc});return typeof _0x134ffa?.['markdown']===_0x383a71(0x188)?_0x134ffa[_0x383a71(0x159)]:'';}export async function listRuntimeArtifacts(_0x3be898,_0x424706){const _0x2365bc=a66_0x525c,_0x110f7b=new URLSearchParams({'appCode':_0x3be898});if(_0x424706?.[_0x2365bc(0x17f)])_0x110f7b[_0x2365bc(0x194)]('artifactType',_0x424706[_0x2365bc(0x17f)]);if(_0x424706?.[_0x2365bc(0x190)])_0x110f7b[_0x2365bc(0x194)]('source',_0x424706[_0x2365bc(0x190)]);if(_0x424706?.['favorite']!==undefined)_0x110f7b['set'](_0x2365bc(0x15c),String(_0x424706[_0x2365bc(0x15c)]));const _0x10c47a=await apiRequest('/client/artifact/list?'+_0x110f7b[_0x2365bc(0x183)]());return Array[_0x2365bc(0x19c)](_0x10c47a['data'])?_0x10c47a[_0x2365bc(0x1aa)]:[];}export async function getRuntimeArtifact(_0x5bdbe6,_0x239c75){const _0x13a363=a66_0x525c,_0x223eee=await apiRequest(_0x13a363(0x18c)+_0x5bdbe6+_0x13a363(0x1af)+encodeURIComponent(_0x239c75));if(!_0x223eee[_0x13a363(0x1aa)])throw CliErrors['validation']('Artifact\x20not\x20found:\x20id='+_0x5bdbe6);return _0x223eee[_0x13a363(0x1aa)];}export async function createRuntimeArtifact(_0x3fe24b,_0x5a8b8c){const _0x15199f=a66_0x525c,_0x7f40ea=await apiRequest(_0x15199f(0x156),{'method':_0x15199f(0x14b),'body':{'appCode':_0x3fe24b,..._0x5a8b8c}});return _0x7f40ea[_0x15199f(0x1aa)];}export async function updateRuntimeArtifact(_0x3fae55,_0x192aab,_0x353b70){const _0x3f5ff3=a66_0x525c,_0x233b34=await apiRequest(_0x3f5ff3(0x18c)+_0x3fae55+_0x3f5ff3(0x15b),{'method':'POST','body':{'appCode':_0x192aab,..._0x353b70}});return _0x233b34[_0x3f5ff3(0x1aa)];}export async function listPersonalBffs(_0x2b8d97){const _0x109eeb=a66_0x525c,_0x3519be=await apiRequest('/client/runtime-bff/personal/list?appCode='+encodeURIComponent(_0x2b8d97));return Array[_0x109eeb(0x19c)](_0x3519be[_0x109eeb(0x1aa)])?_0x3519be[_0x109eeb(0x1aa)]:[];}export async function getPersonalBff(_0xd68ff2,_0x155eb3){const _0x21e3cb=a66_0x525c,_0x28e34e=await apiRequest(_0x21e3cb(0x1a7)+_0xd68ff2+_0x21e3cb(0x1af)+encodeURIComponent(_0x155eb3));if(!_0x28e34e[_0x21e3cb(0x1aa)])throw CliErrors[_0x21e3cb(0x197)](_0x21e3cb(0x146)+_0xd68ff2);return _0x28e34e[_0x21e3cb(0x1aa)];}export async function createPersonalBff(_0x4bcb59,_0x2d74d1){const _0x5c558c=a66_0x525c,_0x5013ca=await apiRequest(_0x5c558c(0x172),{'method':_0x5c558c(0x14b),'body':{'appCode':_0x4bcb59,..._0x2d74d1}});return _0x5013ca[_0x5c558c(0x1aa)];}export async function updatePersonalBff(_0x244141,_0x3c0385,_0x3410b9){const _0x333024=a66_0x525c,_0x470a3f=await apiRequest(_0x333024(0x1a7)+_0x244141+_0x333024(0x15b),{'method':_0x333024(0x14b),'body':{'appCode':_0x3c0385,..._0x3410b9}});return _0x470a3f['data'];}export async function executePersonalBff(_0x4fbe98,_0x33609a,_0x4ca0ac){const _0x54f1fe=a66_0x525c,_0x3bd18b=await apiRequest(_0x54f1fe(0x1a7)+_0x4fbe98+_0x54f1fe(0x18b)+encodeURIComponent(_0x33609a),{'method':_0x54f1fe(0x14b),'body':_0x4ca0ac});return _0x3bd18b[_0x54f1fe(0x1aa)];}export async function listPersonalKnowledgeBaseItems(_0x373ce1){const _0x46f505=a66_0x525c,_0x3541fb=await apiRequest(_0x46f505(0x15f)+encodeURIComponent(_0x373ce1));return Array[_0x46f505(0x19c)](_0x3541fb[_0x46f505(0x1aa)])?_0x3541fb[_0x46f505(0x1aa)]:[];}export async function getPersonalKnowledgeBaseItem(_0x1f2f40,_0xfcace0){const _0x196402=a66_0x525c,_0x433a05=await apiRequest(_0x196402(0x16f)+_0x1f2f40+'?appCode='+encodeURIComponent(_0xfcace0));if(!_0x433a05[_0x196402(0x1aa)])throw CliErrors[_0x196402(0x197)](_0x196402(0x1a2)+_0x1f2f40);return _0x433a05[_0x196402(0x1aa)];}export async function createPersonalKnowledgeBaseItem(_0x4b7dbf,_0x5b8222){const _0x2d690d=a66_0x525c,_0x4ed2df=await apiRequest(_0x2d690d(0x160),{'method':'POST','body':{'appCode':_0x4b7dbf,..._0x5b8222}});return _0x4ed2df[_0x2d690d(0x1aa)];}export async function updatePersonalKnowledgeBaseItem(_0x56631d,_0x40728f,_0x55d854){const _0x59d4f5=a66_0x525c,_0x506c3e=await apiRequest(_0x59d4f5(0x16f)+_0x56631d+_0x59d4f5(0x15b),{'method':_0x59d4f5(0x14b),'body':{'appCode':_0x40728f,..._0x55d854}});return _0x506c3e['data'];}export async function searchKnowledgeBase(_0x56e597,_0x438a58){const _0x35898a=a66_0x525c,_0x18f620=await apiRequest(_0x35898a(0x1bf),{'method':_0x35898a(0x14b),'body':{'appCode':_0x56e597,'query':_0x438a58['query'],..._0x438a58[_0x35898a(0x169)]!==undefined?{'topK':_0x438a58[_0x35898a(0x169)]}:{}}});return Array[_0x35898a(0x19c)](_0x18f620[_0x35898a(0x1aa)])?_0x18f620[_0x35898a(0x1aa)]:[];}export async function getRuntimeSkillByCode(_0x195fed,_0x4f2d53){const _0x2585d3=await skillHubJsonRequest('/api/v1/skills/'+encodeURIComponent(_0x195fed)+'/'+encodeURIComponent(_0x4f2d53),{'allowNotFound':!![]});return _0x2585d3?skillHubRuntimeDetailToRuntimeSkill(_0x2585d3):undefined;}function a66_0x525c(_0x6ebb8b,_0x11687b){_0x6ebb8b=_0x6ebb8b-0x145;const _0x4489c6=a66_0x4489();let _0x525c18=_0x4489c6[_0x6ebb8b];return _0x525c18;}export async function listRuntimeSkills(_0x116d9c){const _0x304eca=a66_0x525c,_0x2b7b23=await skillHubJsonRequest(_0x304eca(0x19d)+encodeURIComponent(_0x116d9c['appCode'])+'/skills',{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x116d9c[_0x304eca(0x1b7)],_0x2b7b23,_0x116d9c[_0x304eca(0x186)]??_0x304eca(0x16d),_0x116d9c[_0x304eca(0x168)]);}export async function listPersonalRuntimeSkills(_0x5326ec){const _0x2c75a5=a66_0x525c;return(await listRuntimeSkills({'appCode':_0x5326ec,'scope':_0x2c75a5(0x17c)}))[_0x2c75a5(0x17c)];}export async function listCompanyRuntimeSkills(_0x179d21){const _0x357ac1=a66_0x525c;return(await listRuntimeSkills({'appCode':_0x179d21,'scope':_0x357ac1(0x163)}))[_0x357ac1(0x163)];}export async function listVisibleRuntimeSkills(_0x4ae616){const _0x59fa03=a66_0x525c;return(await listRuntimeSkills({'appCode':_0x4ae616,'scope':_0x59fa03(0x16d)}))[_0x59fa03(0x1a4)];}export async function createPersonalRuntimeSkill(_0x253ac5,_0x14aec7){const _0x5befa9=a66_0x525c;return publishRuntimeSkill(_0x253ac5,_0x14aec7,{'visibility':_0x5befa9(0x187)});}export async function updatePersonalRuntimeSkill(_0x47052d,_0x46da36,_0x1b55d8){const _0x187279=a66_0x525c;return publishRuntimeSkill(_0x46da36,{..._0x1b55d8,'skillCode':_0x1b55d8[_0x187279(0x17d)]??_0x47052d},{'visibility':_0x187279(0x187)});}export async function publishCompanyRuntimeSkill(_0x2a30f0,_0x58c95e,_0x45bcc8={}){const _0x480564=a66_0x525c;return publishRuntimeSkill(_0x2a30f0,_0x58c95e,{'visibility':_0x480564(0x158),'confirmWarnings':_0x45bcc8[_0x480564(0x14e)]});}export async function validateRuntimeSkillPublish(_0x2bbe55,_0x5080bf,_0x4ac833){const _0x2f50d7=a66_0x525c,_0x330514=buildRuntimeSkillPublishForm(_0x5080bf,_0x4ac833[_0x2f50d7(0x16c)]),_0x2aca29=await skillHubJsonRequest(_0x2f50d7(0x182)+encodeURIComponent(_0x2bbe55)+'/publish/validate',{'method':'POST','body':_0x330514});return{'valid':_0x2aca29[_0x2f50d7(0x14d)]===!![],'errors':Array[_0x2f50d7(0x19c)](_0x2aca29[_0x2f50d7(0x1b6)])?_0x2aca29['errors']:[],'warnings':Array[_0x2f50d7(0x19c)](_0x2aca29['warnings'])?_0x2aca29[_0x2f50d7(0x173)]:[],'resolvedSlug':_0x2aca29[_0x2f50d7(0x179)],'resolvedVersion':_0x2aca29[_0x2f50d7(0x17b)]};}export async function downloadRuntimeSkillPackage(_0x2fec1a,_0x316b8b,_0x366717,_0x1f3567){const _0x141fe1=a66_0x525c;void _0x2fec1a;const _0xb32d38=_0x1f3567?_0x141fe1(0x182)+encodeURIComponent(_0x366717)+'/'+encodeURIComponent(_0x316b8b)+_0x141fe1(0x149)+encodeURIComponent(_0x1f3567)+_0x141fe1(0x18d):_0x141fe1(0x182)+encodeURIComponent(_0x366717)+'/'+encodeURIComponent(_0x316b8b)+_0x141fe1(0x18d);return skillHubBinaryRequest(_0xb32d38);}async function publishRuntimeSkill(_0x4d105b,_0x3bf0bb,_0x1e7ee9){const _0x2b6d91=a66_0x525c,_0x30b76f=buildRuntimeSkillPublishForm(_0x3bf0bb,_0x1e7ee9[_0x2b6d91(0x16c)]),_0x363681=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0x4d105b)+_0x2b6d91(0x189),{'method':_0x2b6d91(0x14b),'query':{'confirmWarnings':_0x1e7ee9['confirmWarnings']===!![]?!![]:undefined},'body':_0x30b76f});return{'appCode':_0x363681['namespace']??_0x4d105b,'skillCode':_0x363681[_0x2b6d91(0x198)]??_0x3bf0bb[_0x2b6d91(0x17d)]??'','skillName':_0x3bf0bb[_0x2b6d91(0x180)]??_0x363681[_0x2b6d91(0x198)]??_0x3bf0bb[_0x2b6d91(0x17d)],'description':_0x3bf0bb[_0x2b6d91(0x170)],'scope':skillHubVisibilityToScope(_0x363681[_0x2b6d91(0x16c)]??_0x1e7ee9[_0x2b6d91(0x16c)])??_0x2b6d91(0x17c),'version':_0x363681[_0x2b6d91(0x150)]??_0x3bf0bb['version'],'tags':_0x3bf0bb[_0x2b6d91(0x195)],'content':_0x3bf0bb[_0x2b6d91(0x16a)]};}function buildRuntimeSkillPublishForm(_0x149146,_0x5ef34e){const _0xa81364=a66_0x525c,_0x415f7d=new FormData();return _0x415f7d[_0xa81364(0x194)](_0xa81364(0x1c0),runtimeSkillPackageFile(_0x149146)),_0x415f7d[_0xa81364(0x194)](_0xa81364(0x16c),_0x5ef34e),_0x415f7d;}function runtimeSkillPackageFile(_0x5c6648){const _0x5ecf42=a66_0x525c;if(!_0x5c6648['packageBase64'])throw CliErrors['validation'](_0x5ecf42(0x177));const _0x5c1ef3=Buffer[_0x5ecf42(0x15e)](_0x5c6648[_0x5ecf42(0x184)],_0x5ecf42(0x15d)),_0x55e06c=new Blob([_0x5c1ef3],{'type':_0x5ecf42(0x167)}),_0x5bdbf9=(_0x5c6648[_0x5ecf42(0x17d)]||_0x5ecf42(0x1b5))+_0x5ecf42(0x1b4);if(typeof File!=='undefined')return new File([_0x55e06c],_0x5bdbf9,{'type':_0x5ecf42(0x167)});return _0x55e06c;}function normalizeSkillHubRuntimeListResponse(_0x5e3b7d,_0x45aae0,_0x475c3d,_0x12a032){const _0x57aad4=a66_0x525c,_0x4f0af6=Array[_0x57aad4(0x19c)](_0x45aae0)?_0x45aae0:Array[_0x57aad4(0x19c)](_0x45aae0?.[_0x57aad4(0x155)])?_0x45aae0['items']:[],_0x508101=_0x12a032?.[_0x57aad4(0x19b)](),_0x55f137=_0x4f0af6[_0x57aad4(0x192)](_0x152bc5=>!_0x508101||_0x152bc5['slug']===_0x508101)[_0x57aad4(0x14a)](skillHubRuntimeItemToRuntimeSkill)[_0x57aad4(0x192)](_0x598520=>Boolean(_0x598520)),_0x38d282=_0x55f137[_0x57aad4(0x192)](_0x4c25c1=>_0x4c25c1[_0x57aad4(0x186)]==='personal'),_0x197538=_0x55f137['filter'](_0x174963=>_0x174963['scope']===_0x57aad4(0x163));return{'appCode':_0x5e3b7d,'personal':_0x475c3d===_0x57aad4(0x163)?[]:_0x38d282,'company':_0x475c3d===_0x57aad4(0x17c)?[]:_0x197538,'effective':buildEffectiveRuntimeSkills(_0x38d282,_0x197538,_0x475c3d)};}function skillHubRuntimeItemToRuntimeSkill(_0x1630cd){const _0x4079cd=a66_0x525c,_0x41f3b9=_0x1630cd[_0x4079cd(0x198)]?.[_0x4079cd(0x19b)](),_0x373bc8=skillHubVisibilityToScope(_0x1630cd[_0x4079cd(0x16c)]);if(!_0x41f3b9||!_0x373bc8)return undefined;return{'id':_0x1630cd['id'],'appCode':_0x1630cd[_0x4079cd(0x14f)],'skillCode':_0x41f3b9,'skillName':_0x1630cd['displayName']??_0x41f3b9,'description':_0x1630cd[_0x4079cd(0x145)],'scope':_0x373bc8,'version':skillHubRuntimeItemVersion(_0x1630cd),'status':_0x1630cd[_0x4079cd(0x1a9)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x5872f2){const _0x19809d=a66_0x525c,_0x2bfefe=_0x5872f2[_0x19809d(0x198)]?.['trim']();if(!_0x2bfefe)return undefined;return{'id':_0x5872f2['id'],'appCode':_0x5872f2[_0x19809d(0x14f)],'skillCode':_0x2bfefe,'skillName':_0x5872f2['displayName']??_0x2bfefe,'description':_0x5872f2[_0x19809d(0x145)],'scope':skillHubVisibilityToScope(_0x5872f2[_0x19809d(0x16c)])??_0x5872f2[_0x19809d(0x16c)]?.['toLowerCase'](),'version':skillHubRuntimeItemVersion(_0x5872f2),'status':_0x5872f2[_0x19809d(0x1a9)]};}function skillHubVisibilityToScope(_0x5892fc){const _0x522c2c=a66_0x525c;if(_0x5892fc===_0x522c2c(0x187))return _0x522c2c(0x17c);if(_0x5892fc==='NAMESPACE_ONLY')return _0x522c2c(0x163);return undefined;}function skillHubRuntimeItemVersion(_0x492fc9){const _0x1d2593=a66_0x525c;return _0x492fc9['publishedVersion']?.['version']??_0x492fc9[_0x1d2593(0x1bd)]?.[_0x1d2593(0x150)]??_0x492fc9['ownerPreviewVersion']?.[_0x1d2593(0x150)];}function buildEffectiveRuntimeSkills(_0x2a2c3f,_0x73d428,_0x3f1d7e){const _0x5c2e52=a66_0x525c;if(_0x3f1d7e===_0x5c2e52(0x17c))return _0x2a2c3f;if(_0x3f1d7e===_0x5c2e52(0x163))return _0x73d428;const _0x3cd14a=new Map();for(const _0x137de9 of _0x73d428){_0x3cd14a[_0x5c2e52(0x194)](_0x137de9[_0x5c2e52(0x17d)],_0x137de9);}for(const _0x2fa2e1 of _0x2a2c3f){_0x3cd14a[_0x5c2e52(0x194)](_0x2fa2e1[_0x5c2e52(0x17d)],_0x2fa2e1);}return Array['from'](_0x3cd14a['values']());}function normalizeRuntimeSkillListResponse(_0x1d9aae,_0xa2f894){const _0x41d49c=a66_0x525c;if(Array[_0x41d49c(0x19c)](_0xa2f894)){const _0x414735=_0xa2f894['filter'](_0x510738=>_0x510738[_0x41d49c(0x186)]===_0x41d49c(0x17c)),_0x430ff3=_0xa2f894[_0x41d49c(0x192)](_0x25955e=>_0x25955e[_0x41d49c(0x186)]===_0x41d49c(0x163));return{'appCode':_0x1d9aae,'personal':_0x414735,'company':_0x430ff3,'effective':[..._0x430ff3,..._0x414735]};}return{'appCode':_0xa2f894?.['appCode']??_0x1d9aae,'personal':Array[_0x41d49c(0x19c)](_0xa2f894?.[_0x41d49c(0x17c)])?_0xa2f894[_0x41d49c(0x17c)]:[],'company':Array[_0x41d49c(0x19c)](_0xa2f894?.[_0x41d49c(0x163)])?_0xa2f894[_0x41d49c(0x163)]:[],'effective':Array[_0x41d49c(0x19c)](_0xa2f894?.[_0x41d49c(0x1a4)])?_0xa2f894[_0x41d49c(0x1a4)]:[]};}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a67_0x30f2(_0x153601,_0x1a702e){_0x153601=_0x153601-0x101;const _0x3ebf19=a67_0x3ebf();let _0x30f23a=_0x3ebf19[_0x153601];return _0x30f23a;}(function(_0x193b84,_0x44d65b){const _0x5058c9=a67_0x30f2,_0x581a51=_0x193b84();while(!![]){try{const _0x469966=-parseInt(_0x5058c9(0x111))/0x1+-parseInt(_0x5058c9(0x10f))/0x2*(parseInt(_0x5058c9(0x102))/0x3)+-parseInt(_0x5058c9(0x112))/0x4*(parseInt(_0x5058c9(0x10d))/0x5)+-parseInt(_0x5058c9(0x110))/0x6*(-parseInt(_0x5058c9(0x103))/0x7)+-parseInt(_0x5058c9(0x10a))/0x8*(-parseInt(_0x5058c9(0x108))/0x9)+-parseInt(_0x5058c9(0x101))/0xa*(-parseInt(_0x5058c9(0x105))/0xb)+-parseInt(_0x5058c9(0x107))/0xc;if(_0x469966===_0x44d65b)break;else _0x581a51['push'](_0x581a51['shift']());}catch(_0x351b16){_0x581a51['push'](_0x581a51['shift']());}}}(a67_0x3ebf,0x6d5e2));function a67_0x3ebf(){const _0x476c8f=['has','dbId','580kDGWWv','set','321218yBhFih','988950mtPsIY','510770xlvTzK','7804lAWxKy','70OmlwJp','9iihLbB','35tUYHId','entries','1342462QQiwWO','db-','2322960crJtTc','11538qFtQFX','dbName','1136CwVbja'];a67_0x3ebf=function(){return _0x476c8f;};return a67_0x3ebf();}import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x4e2883){const _0x4d0764=a67_0x30f2;if(cache[_0x4d0764(0x10b)](_0x4e2883))return cache['get'](_0x4e2883);const _0x1a0ac7=await listDatasets(_0x4e2883),_0x5a0b9f=new Map();for(const _0x522c22 of _0x1a0ac7){const _0x1173ba=_0x522c22['dbtableConfig'];_0x1173ba?.[_0x4d0764(0x10c)]!=null&&_0x5a0b9f[_0x4d0764(0x10e)](_0x1173ba[_0x4d0764(0x10c)],_0x1173ba[_0x4d0764(0x109)]??_0x4d0764(0x106)+_0x1173ba[_0x4d0764(0x10c)]);}const _0x53007d=[..._0x5a0b9f[_0x4d0764(0x104)]()]['map'](([_0x1adee7,_0x1b2931])=>({'dbId':_0x1adee7,'dbName':_0x1b2931}));return cache['set'](_0x4e2883,_0x53007d),_0x53007d;}export async function getDbName(_0x51278c,_0x2a50be){try{const _0x462c1f=await listDatabases(_0x51278c);return _0x462c1f['find'](_0x3c27fb=>_0x3c27fb['dbId']===_0x2a50be)?.['dbName'];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b3fd4,_0x5e99a1){const _0xcbe594=a68_0x3a05,_0x22b130=_0x1b3fd4();while(!![]){try{const _0x1082b3=parseInt(_0xcbe594(0x102))/0x1+-parseInt(_0xcbe594(0xf2))/0x2*(parseInt(_0xcbe594(0xf3))/0x3)+parseInt(_0xcbe594(0xfe))/0x4+parseInt(_0xcbe594(0xf6))/0x5*(parseInt(_0xcbe594(0xfd))/0x6)+parseInt(_0xcbe594(0x100))/0x7*(-parseInt(_0xcbe594(0x115))/0x8)+-parseInt(_0xcbe594(0x113))/0x9*(parseInt(_0xcbe594(0x116))/0xa)+parseInt(_0xcbe594(0x107))/0xb;if(_0x1082b3===_0x5e99a1)break;else _0x22b130['push'](_0x22b130['shift']());}catch(_0x5198cc){_0x22b130['push'](_0x22b130['shift']());}}}(a68_0xbf81,0x756bc));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';let _client;export function initSdkClient(_0x50d219){const _0x217fa9=a68_0x3a05;_client=createClient({'appCode':_0x50d219[_0x217fa9(0x109)],'env':_0x50d219['env'],'authMode':_0x50d219['authMode'],..._0x50d219['accessKey']?{'accessKey':_0x50d219[_0x217fa9(0x108)]}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x217fa9(0x104)]}}});}function ensureClient(){const _0x4a080c=a68_0x3a05;if(!_client)throw new Error(_0x4a080c(0xff));return _client;}function normalizeAggregateParams(_0x421425){const _0x20642b=a68_0x3a05,_0xaee80e=_0x421425['aggregate'];if(_0xaee80e===undefined)return _0x421425;if(!Array[_0x20642b(0x103)](_0xaee80e))throw CliErrors[_0x20642b(0x101)](_0x20642b(0xf7));return{..._0x421425,'aggregate':_0xaee80e[_0x20642b(0x114)]((_0x52d2a5,_0xdf1020)=>{const _0x55a142=_0x20642b;if(!_0x52d2a5||typeof _0x52d2a5!=='object'||Array['isArray'](_0x52d2a5))throw CliErrors['validation'](_0x55a142(0x10c)+_0xdf1020+_0x55a142(0xf4));const _0x50e306=_0x52d2a5[_0x55a142(0xf8)]??_0x52d2a5['field'];if(typeof _0x50e306!=='string'||_0x50e306['trim']()==='')throw CliErrors[_0x55a142(0x101)](_0x55a142(0x10c)+_0xdf1020+']\x20requires\x20\x22column\x22;\x20\x22field\x22\x20is\x20accepted\x20only\x20as\x20a\x20deprecated\x20alias.');const _0x2f3636={..._0x52d2a5,'column':_0x50e306};return delete _0x2f3636[_0x55a142(0x106)],_0x2f3636;})};}export async function executeData(_0x387256,_0x47e9a5,_0x551273){const _0x23e0c1=a68_0x3a05,_0x4fb51c=ensureClient(),_0x4101c1='dataset_'+_0x387256,_0x10cef7=_0x4fb51c['models'][_0x4101c1];if(!_0x10cef7||typeof _0x10cef7[_0x47e9a5]!==_0x23e0c1(0x111))throw new Error(_0x23e0c1(0x105)+_0x47e9a5+_0x23e0c1(0x10a)+_0x23e0c1(0x10f));if(_0x47e9a5==='batchCreate')return _0x10cef7[_0x23e0c1(0xfc)](parseBatchCreateItemsFromParams(_0x551273));const _0x3b0c0f=_0x551273!==undefined&&_0x551273!==null&&!Array[_0x23e0c1(0x103)](_0x551273)?_0x551273:{};switch(_0x47e9a5){case _0x23e0c1(0x10b):{const _0x4ab908=_0x3b0c0f['id'];if(_0x4ab908===undefined||_0x4ab908===null)throw new Error(_0x23e0c1(0xfa));return _0x10cef7[_0x23e0c1(0x10b)](_0x4ab908);}case _0x23e0c1(0xf5):{const {id:_0x171d77,..._0x20cfce}=_0x3b0c0f;if(_0x171d77===undefined||_0x171d77===null)throw new Error('update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27');return _0x10cef7[_0x23e0c1(0xf5)](_0x171d77,_0x20cfce);}case _0x23e0c1(0x112):{const _0x26bee5=_0x3b0c0f['id'];if(_0x26bee5===undefined||_0x26bee5===null)throw new Error(_0x23e0c1(0x10d));return _0x10cef7['delete'](_0x26bee5);}case'aggregate':return _0x10cef7[_0x23e0c1(0x10e)](normalizeAggregateParams(_0x3b0c0f));default:return _0x10cef7[_0x47e9a5](_0x3b0c0f);}}function a68_0xbf81(){const _0x508a99=['14ZCDeqv','validation','239645eURwDW','isArray','invokeSource','SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22','field','16398635etLFIx','accessKey','appCode','\x22.\x20','getOne','data\x20aggregate\x20--params.aggregate[','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','aggregate','Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.','bff','function','delete','2269161YpySZM','map','3653784pqsWYo','30JYlCtC','1008836FbuhOq','3jvsyse',']\x20must\x20be\x20an\x20object.','update','21510zEzMbk','data\x20aggregate\x20--params.aggregate\x20must\x20be\x20an\x20array.','column','execute','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','sql','batchCreate','1164rkQzAg','360756mMMBMl','SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.'];a68_0xbf81=function(){return _0x508a99;};return a68_0xbf81();}function a68_0x3a05(_0x206798,_0x5173ab){_0x206798=_0x206798-0xf2;const _0xbf8144=a68_0xbf81();let _0x3a0552=_0xbf8144[_0x206798];return _0x3a0552;}export async function executeSdkSql(_0xe6abe9,_0x24a886){const _0x2115fe=a68_0x3a05,_0x38edc0=ensureClient();return _0x38edc0[_0x2115fe(0xfb)][_0x2115fe(0xf9)]({'sqlCode':_0xe6abe9,'params':_0x24a886});}export async function executeSdkBff(_0x1d7f9b,_0xc3c063){const _0x1dd410=a68_0x3a05,_0x480b63=ensureClient();return _0x480b63[_0x1dd410(0x110)]['execute']({'scriptName':_0x1d7f9b,'params':_0xc3c063});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a69_0x3103de=a69_0x3c28;(function(_0x539613,_0x238e2b){const _0x5d30f0=a69_0x3c28,_0xa52e35=_0x539613();while(!![]){try{const _0x14d8a5=-parseInt(_0x5d30f0(0xf8))/0x1*(-parseInt(_0x5d30f0(0xfb))/0x2)+parseInt(_0x5d30f0(0x103))/0x3+-parseInt(_0x5d30f0(0xf5))/0x4*(parseInt(_0x5d30f0(0x102))/0x5)+parseInt(_0x5d30f0(0xfc))/0x6+-parseInt(_0x5d30f0(0xf3))/0x7+parseInt(_0x5d30f0(0x100))/0x8*(parseInt(_0x5d30f0(0x101))/0x9)+-parseInt(_0x5d30f0(0xfa))/0xa*(parseInt(_0x5d30f0(0xf6))/0xb);if(_0x14d8a5===_0x238e2b)break;else _0xa52e35['push'](_0xa52e35['shift']());}catch(_0x547405){_0xa52e35['push'](_0xa52e35['shift']());}}}(a69_0x4283,0x51684));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';function a69_0x4283(){const _0x7164a6=['1535661KuRqoF','3168291KTrZKj','\x20auth\x20login`.','16dWDeEH','2141359hdQVhO','newConfigFileName','325631VkdcgV','\x20or\x20run\x20`','50QFkhVx','4ODlCrb','2906670gLbObU','Set\x20appcode\x20via\x20--appcode\x20or\x20','\x20file.','Configure\x20accessKey\x20in\x20','8fQRGPS','3472416aTOTJz','342520NdsxRX'];a69_0x4283=function(){return _0x7164a6;};return a69_0x4283();}export{CliError};function a69_0x3c28(_0x50db6f,_0x15376d){_0x50db6f=_0x50db6f-0xf3;const _0x428331=a69_0x4283();let _0x3c28ba=_0x428331[_0x50db6f];return _0x3c28ba;}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a69_0x3103de(0xff)+PRODUCT_CONFIG[a69_0x3103de(0xf7)]+a69_0x3103de(0xf9)+CLI_BIN_NAME+a69_0x3103de(0xf4),'configMissingHint':a69_0x3103de(0xfd)+PRODUCT_CONFIG['newConfigFileName']+'.','notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20'+PRODUCT_CONFIG[a69_0x3103de(0xf7)]+a69_0x3103de(0xfe)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1be33d,_0x21389c){var _0x5113d6=a70_0x3339,_0x17fbb7=_0x1be33d();while(!![]){try{var _0x243588=parseInt(_0x5113d6(0x11f))/0x1*(parseInt(_0x5113d6(0x122))/0x2)+parseInt(_0x5113d6(0x11c))/0x3*(parseInt(_0x5113d6(0x123))/0x4)+-parseInt(_0x5113d6(0x127))/0x5+parseInt(_0x5113d6(0x125))/0x6*(parseInt(_0x5113d6(0x121))/0x7)+-parseInt(_0x5113d6(0x124))/0x8*(-parseInt(_0x5113d6(0x120))/0x9)+-parseInt(_0x5113d6(0x11d))/0xa+-parseInt(_0x5113d6(0x126))/0xb*(parseInt(_0x5113d6(0x11e))/0xc);if(_0x243588===_0x21389c)break;else _0x17fbb7['push'](_0x17fbb7['shift']());}catch(_0x1ef34e){_0x17fbb7['push'](_0x17fbb7['shift']());}}}(a70_0x22f0,0xef130));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a70_0x3339(_0x459364,_0x47d8e1){_0x459364=_0x459364-0x11c;var _0x22f0a1=a70_0x22f0();var _0x33394e=_0x22f0a1[_0x459364];return _0x33394e;}import{buildAllFlags as a70_0x2025d7}from'@lovrabet/cli-framework';function a70_0x22f0(){var _0x358ad5=['3890700cfgCPN','2761000krfwuX','101844LMvlMY','1254109lIcfPv','36IsDuOS','21dtRzCh','2zkacPO','4gCPtnL','2839472hMNEEq','3047832OFkSaw','4565IPOifj','3586040aBxOYy'];a70_0x22f0=function(){return _0x358ad5;};return a70_0x22f0();}export function buildAllFlags(_0x19b698){return a70_0x2025d7(_0x19b698,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a71_0xfc05(){const _0x2d9cfa=['212409JDEDRy','48594vXFdwt','body','description','50BAucgY','154mUoVSL','61096etJhRW','1322008FbmcgP','1151535BiIJJH','239674ytaXkS','285879DegPsi','27fdhjit','8YODNKk'];a71_0xfc05=function(){return _0x2d9cfa;};return a71_0xfc05();}(function(_0x189f8e,_0x11c295){const _0x6266fe=a71_0x4bb0,_0x4eb218=_0x189f8e();while(!![]){try{const _0x5858d=-parseInt(_0x6266fe(0x171))/0x1+parseInt(_0x6266fe(0x16e))/0x2*(parseInt(_0x6266fe(0x173))/0x3)+-parseInt(_0x6266fe(0x16f))/0x4+parseInt(_0x6266fe(0x170))/0x5+parseInt(_0x6266fe(0x176))/0x6*(parseInt(_0x6266fe(0x16d))/0x7)+-parseInt(_0x6266fe(0x174))/0x8*(parseInt(_0x6266fe(0x175))/0x9)+-parseInt(_0x6266fe(0x16c))/0xa*(-parseInt(_0x6266fe(0x172))/0xb);if(_0x5858d===_0x11c295)break;else _0x4eb218['push'](_0x4eb218['shift']());}catch(_0x4a931e){_0x4eb218['push'](_0x4eb218['shift']());}}}(a71_0xfc05,0x359c1));function a71_0x4bb0(_0x27d99f,_0x497610){_0x27d99f=_0x27d99f-0x16b;const _0xfc05f3=a71_0xfc05();let _0x4bb0a2=_0xfc05f3[_0x27d99f];return _0x4bb0a2;}export function dryRun(_0x20cd4f,_0x509e69){const _0x8dcfa1={'method':_0x20cd4f,'url':_0x509e69},_0x43e9ba={'body'(_0x5b6320){const _0x4e86c4=a71_0x4bb0;return _0x8dcfa1[_0x4e86c4(0x177)]=_0x5b6320,_0x43e9ba;},'description'(_0x5bd85a){const _0x88c77c=a71_0x4bb0;return _0x8dcfa1[_0x88c77c(0x16b)]=_0x5bd85a,_0x43e9ba;},'build'(){return{..._0x8dcfa1};}};return _0x43e9ba;}
|