@lovrabet/lovrabet-cli 2.1.19 → 2.1.20-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/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-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/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.d.ts +12 -0
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.d.ts +12 -0
- package/lib/framework/raw-flags.js +1 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x135f5d=a63_0x4404;(function(_0x348090,_0x8f3399){const _0x460539=a63_0x4404,_0x368c7f=_0x348090();while(!![]){try{const _0x3e7729=-parseInt(_0x460539(0x94))/0x1+-parseInt(_0x460539(0x83))/0x2*(-parseInt(_0x460539(0x89))/0x3)+-parseInt(_0x460539(0x8e))/0x4*(parseInt(_0x460539(0x79))/0x5)+-parseInt(_0x460539(0x87))/0x6+parseInt(_0x460539(0x90))/0x7*(-parseInt(_0x460539(0x95))/0x8)+-parseInt(_0x460539(0x78))/0x9*(parseInt(_0x460539(0x91))/0xa)+parseInt(_0x460539(0x8b))/0xb;if(_0x3e7729===_0x8f3399)break;else _0x368c7f['push'](_0x368c7f['shift']());}catch(_0x4438fd){_0x368c7f['push'](_0x368c7f['shift']());}}}(a63_0x415c,0x41e29));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a63_0x4404(_0x50e093,_0x175652){_0x50e093=_0x50e093-0x74;const _0x415caf=a63_0x415c();let _0x440474=_0x415caf[_0x50e093];return _0x440474;}function a63_0x415c(){const _0x27a5a2=['map','has','1062603ysNQwn','10285mUAdfl','Locale','Override\x20runtime\x20domain','Override\x20SkillHub\x20domain','Target\x20environment','legacyCompatOnly','entries','Override\x20API\x20domain','format','join','9686adFCSe','riskLevel','importable','Risk\x20level','2110476zUmIJC','cliSettableTopLevel','60xtYkwP',';\x20local\x20alias:\x20apps.<alias>.appcode','17035975IytUhG','Default\x20output\x20format','Default\x20page\x20size','604wPpwxo','fromEntries','7MHNtQR','10JPMTXj','enumValues','filter','226071vvGSYP','2953832UJJJHa','Access\x20key\x20(client-ak\x20auth)','locale'];a63_0x415c=function(){return _0x27a5a2;};return a63_0x415c();}import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':a63_0x135f5d(0x7d),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['env'],'importable':!![]},'format':{'description':a63_0x135f5d(0x8c),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a63_0x135f5d(0x81)],'importable':!![]},'pageSize':{'description':a63_0x135f5d(0x8d),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a63_0x135f5d(0x80),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':'Override\x20user\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a63_0x135f5d(0x7b),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'skillHubDomain':{'description':a63_0x135f5d(0x7c),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a63_0x135f5d(0x74),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a63_0x135f5d(0x86),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a63_0x135f5d(0x84)],'importable':!![]},'locale':{'description':a63_0x135f5d(0x7a),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a63_0x135f5d(0x75)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object['entries'](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x251976])=>_0x251976[a63_0x135f5d(0x88)])['map'](([_0x14f6bd])=>_0x14f6bd));export const CONFIG_ENUM_VALUES=Object[a63_0x135f5d(0x8f)](Object['entries'](CONFIG_FIELD_SCHEMAS)[a63_0x135f5d(0x93)](([,_0x32ca3a])=>_0x32ca3a[a63_0x135f5d(0x92)])['map'](([_0x53fb31,_0x386d03])=>[_0x53fb31,[..._0x386d03[a63_0x135f5d(0x92)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a63_0x135f5d(0x7f)](CONFIG_FIELD_SCHEMAS)[a63_0x135f5d(0x93)](([,_0x1de5b7])=>_0x1de5b7[a63_0x135f5d(0x85)])[a63_0x135f5d(0x76)](([_0x2b4b56])=>_0x2b4b56);export function getConfigFieldSchema(_0x14b99a){return CONFIG_FIELD_SCHEMAS[_0x14b99a];}export function getConfigEnumValues(_0x13cae){const _0x26a20b=a63_0x135f5d;return getConfigFieldSchema(_0x13cae)?.[_0x26a20b(0x92)];}export function getConfigDefaultValue(_0x338842){return getConfigFieldSchema(_0x338842)?.['defaultValue'];}export function isTopLevelConfigKey(_0x464615){const _0x2436e0=a63_0x135f5d;return TOP_LEVEL_CONFIG_KEYS[_0x2436e0(0x77)](_0x464615);}export function isLegacyCompatConfigKey(_0x4a745c){const _0x493b87=a63_0x135f5d;return getConfigFieldSchema(_0x4a745c)?.[_0x493b87(0x7e)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x4ccd92){const _0x4265e8=a63_0x135f5d;return[..._0x4ccd92][_0x4265e8(0x82)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x6bfaad=a63_0x135f5d;return'Config\x20key.\x20Top-level:\x20'+getTopLevelConfigKeySummary()+_0x6bfaad(0x8a);}export function buildAppProfileListFields(_0x32a45f){return{'env':_0x32a45f,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
package/lib/constant/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a64_0x154b(_0x5513be,_0x48c354){_0x5513be=_0x5513be-0x93;const _0x56aff8=a64_0x56af();let _0x154bf4=_0x56aff8[_0x5513be];return _0x154bf4;}const a64_0x11abee=a64_0x154b;(function(_0x2dc1f7,_0x371fe5){const _0x4bac7f=a64_0x154b,_0x2056d1=_0x2dc1f7();while(!![]){try{const _0x5f3499=parseInt(_0x4bac7f(0x97))/0x1*(parseInt(_0x4bac7f(0x95))/0x2)+-parseInt(_0x4bac7f(0x9c))/0x3*(-parseInt(_0x4bac7f(0x99))/0x4)+parseInt(_0x4bac7f(0x93))/0x5+-parseInt(_0x4bac7f(0x9b))/0x6*(-parseInt(_0x4bac7f(0x9e))/0x7)+parseInt(_0x4bac7f(0x94))/0x8+-parseInt(_0x4bac7f(0x9a))/0x9*(-parseInt(_0x4bac7f(0x9d))/0xa)+parseInt(_0x4bac7f(0xa1))/0xb*(-parseInt(_0x4bac7f(0xa0))/0xc);if(_0x5f3499===_0x371fe5)break;else _0x2056d1['push'](_0x2056d1['shift']());}catch(_0x579cf2){_0x2056d1['push'](_0x2056d1['shift']());}}}(a64_0x56af,0x7da6d));function a64_0x56af(){const _0x185443=['12230JYUYyw','UNPUBLISH','125SSPdLx','Published','3240140GChgWk','657AShJmG','24WpUSip','3hyAvtC','89290jziAfB','1118404hxFSKh','PUBLISHED','5268TgIeYo','91806ZGrjSC','2963155RXkFow','5764936lcQpPw'];a64_0x56af=function(){return _0x185443;};return a64_0x56af();}export const APP_PUBLISH_STATUS={'Published':a64_0x11abee(0x9f),'Unpublished':a64_0x11abee(0x96)};export const RUNTIME_ACCESSIBLE_APP_STATUS=APP_PUBLISH_STATUS[a64_0x11abee(0x98)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a65_0x599c(_0x373798,_0x4872f3){_0x373798=_0x373798-0x13d;const _0x29dfb9=a65_0x29df();let _0x599cd9=_0x29dfb9[_0x373798];return _0x599cd9;}const a65_0x21d2f1=a65_0x599c;(function(_0x5461f4,_0x274648){const _0xc1456f=a65_0x599c,_0x4007f3=_0x5461f4();while(!![]){try{const _0x5a1e74=parseInt(_0xc1456f(0x149))/0x1+-parseInt(_0xc1456f(0x14a))/0x2*(-parseInt(_0xc1456f(0x147))/0x3)+-parseInt(_0xc1456f(0x146))/0x4*(parseInt(_0xc1456f(0x13f))/0x5)+parseInt(_0xc1456f(0x141))/0x6*(-parseInt(_0xc1456f(0x143))/0x7)+-parseInt(_0xc1456f(0x140))/0x8*(parseInt(_0xc1456f(0x145))/0x9)+parseInt(_0xc1456f(0x13d))/0xa+-parseInt(_0xc1456f(0x142))/0xb*(-parseInt(_0xc1456f(0x13e))/0xc);if(_0x5a1e74===_0x274648)break;else _0x4007f3['push'](_0x4007f3['shift']());}catch(_0x5eb911){_0x4007f3['push'](_0x4007f3['shift']());}}}(a65_0x29df,0x99586));export const AUTH_MODE={'ClientAk':a65_0x21d2f1(0x148)};function a65_0x29df(){const _0x33be1e=['569096spBTHT','862211qTnMPX','ClientAk','9VBWcZf','4lBSizV','819543SwSzgw','client-ak','530211DzMuCM','6rOROOq','6212460TUfRPY','408cejtXe','4345195KZRmOF','8009224BxKqQD','60FvrRhq'];a65_0x29df=function(){return _0x33be1e;};return a65_0x29df();}export function isAuthMode(_0x57f5d5){const _0x14ea4c=a65_0x21d2f1;return _0x57f5d5===AUTH_MODE[_0x14ea4c(0x144)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x313bf5=a66_0x47ea;(function(_0x3561e1,_0x52caad){const _0x404d47=a66_0x47ea,_0x41324d=_0x3561e1();while(!![]){try{const _0x419aaf=-parseInt(_0x404d47(0x18a))/0x1*(-parseInt(_0x404d47(0x19e))/0x2)+-parseInt(_0x404d47(0x183))/0x3*(parseInt(_0x404d47(0x187))/0x4)+parseInt(_0x404d47(0x178))/0x5*(-parseInt(_0x404d47(0x191))/0x6)+-parseInt(_0x404d47(0x185))/0x7*(parseInt(_0x404d47(0x17b))/0x8)+parseInt(_0x404d47(0x1a6))/0x9*(-parseInt(_0x404d47(0x190))/0xa)+parseInt(_0x404d47(0x1a3))/0xb+parseInt(_0x404d47(0x198))/0xc;if(_0x419aaf===_0x52caad)break;else _0x41324d['push'](_0x41324d['shift']());}catch(_0x1a0a3e){_0x41324d['push'](_0x41324d['shift']());}}}(a66_0x58da,0xb1319));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';function a66_0x58da(){const _0x4c0df4=['Name\x20filter','2398796ITjzpa','nonInteractive','production\x20|\x20development\x20|\x20daily','19mnOuIs','dry-run','format','Skip\x20confirmation\x20for\x20high-risk\x20writes','cliBinName','help','10bPwZEj','92298XDbmFY','sqlcode','<name>','yes','fromEntries','Use\x20global\x20config\x20scope','dryRun','20839668fBKYEF','meowKey','Override\x20appcode','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','global','string','98914rVGukx','Preview\x20operation\x20without\x20executing','clear','Environment','map','9562069XvYbet','boolean','non-interactive','3693231fOHvqJ','Force\x20non-interactive\x20mode\x20(CI)','Show\x20help','appcode','verbose','330YOqZkU','name','Clear\x20output','8aKnqWO','app','cliDisplayName','Record\x20ID','Verbose\x20output','env','type','params','6RrvCWc','Output\x20format','1363467lGqitW'];a66_0x58da=function(){return _0x4c0df4;};return a66_0x58da();}export const CLI_BIN_NAME=PRODUCT_CONFIG[a66_0x313bf5(0x18e)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a66_0x313bf5(0x17d)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a66_0x313bf5(0x1a9),'type':a66_0x313bf5(0x19d),'description':a66_0x313bf5(0x19a),'hint':'<code>'},{'name':'app','meowKey':a66_0x313bf5(0x17c),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a66_0x313bf5(0x193)},{'name':'env','meowKey':a66_0x313bf5(0x180),'type':a66_0x313bf5(0x19d),'description':a66_0x313bf5(0x1a1),'hint':a66_0x313bf5(0x189)},{'name':'format','meowKey':a66_0x313bf5(0x18c),'type':'string','description':a66_0x313bf5(0x184),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':'string','description':a66_0x313bf5(0x19b),'hint':'<expr>'},{'name':a66_0x313bf5(0x18b),'meowKey':a66_0x313bf5(0x197),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x19f)},{'name':'yes','meowKey':a66_0x313bf5(0x194),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x18d)},{'name':'non-interactive','meowKey':a66_0x313bf5(0x188),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x1a7)},{'name':a66_0x313bf5(0x19c),'meowKey':a66_0x313bf5(0x19c),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x196)},{'name':'ci','meowKey':'ci','type':a66_0x313bf5(0x1a4),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a66_0x313bf5(0x18f),'meowKey':a66_0x313bf5(0x18f),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x1a8)},{'name':'id','meowKey':'id','type':a66_0x313bf5(0x19d),'description':a66_0x313bf5(0x17e),'hidden':!![]},{'name':'name','meowKey':a66_0x313bf5(0x179),'type':a66_0x313bf5(0x19d),'description':a66_0x313bf5(0x186),'hidden':!![]},{'name':a66_0x313bf5(0x192),'meowKey':a66_0x313bf5(0x192),'type':a66_0x313bf5(0x19d),'description':'SQL\x20query\x20code','hidden':!![]},{'name':a66_0x313bf5(0x182),'meowKey':a66_0x313bf5(0x182),'type':a66_0x313bf5(0x19d),'description':'JSON\x20params\x20for\x20execute\x20commands','hidden':!![]},{'name':a66_0x313bf5(0x177),'meowKey':a66_0x313bf5(0x177),'type':'boolean','description':a66_0x313bf5(0x17f),'hidden':!![]},{'name':a66_0x313bf5(0x1a0),'meowKey':a66_0x313bf5(0x1a0),'type':a66_0x313bf5(0x1a4),'description':a66_0x313bf5(0x17a),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a66_0x313bf5(0x1a9),'app',a66_0x313bf5(0x180),a66_0x313bf5(0x18c),'jq','dry-run',a66_0x313bf5(0x194),a66_0x313bf5(0x1a5),'ci']);function a66_0x47ea(_0x536275,_0x1e6e1b){_0x536275=_0x536275-0x177;const _0x58dad0=a66_0x58da();let _0x47ead5=_0x58dad0[_0x536275];return _0x47ead5;}export function buildMeowFlags(){const _0x160ab9=a66_0x313bf5;return Object[_0x160ab9(0x195)](GLOBAL_FLAGS[_0x160ab9(0x1a2)](_0x4746fd=>[_0x4746fd[_0x160ab9(0x199)],{'type':_0x4746fd[_0x160ab9(0x181)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x3e0ea4=a67_0xfd67;(function(_0x2ba7d3,_0x2d1b7e){const _0x2ede61=a67_0xfd67,_0x342d94=_0x2ba7d3();while(!![]){try{const _0x64d14f=parseInt(_0x2ede61(0x125))/0x1*(parseInt(_0x2ede61(0x124))/0x2)+parseInt(_0x2ede61(0x123))/0x3+-parseInt(_0x2ede61(0x11f))/0x4*(parseInt(_0x2ede61(0x121))/0x5)+parseInt(_0x2ede61(0x11a))/0x6*(parseInt(_0x2ede61(0x119))/0x7)+-parseInt(_0x2ede61(0x117))/0x8*(parseInt(_0x2ede61(0x122))/0x9)+-parseInt(_0x2ede61(0x11d))/0xa*(-parseInt(_0x2ede61(0x11e))/0xb)+-parseInt(_0x2ede61(0x11b))/0xc;if(_0x64d14f===_0x2d1b7e)break;else _0x342d94['push'](_0x342d94['shift']());}catch(_0x9172c5){_0x342d94['push'](_0x342d94['shift']());}}}(a67_0x2a87,0x3bb23));export const DEFAULT_APP_PROFILE_NAME=a67_0x3e0ea4(0x126);export const DEFAULT_CONFIG_VALUES={'env':a67_0x3e0ea4(0x120),'format':'compress','locale':'en-US','riskLevel':a67_0x3e0ea4(0x118)};function a67_0x2a87(){const _0x1e4cff=['898846TtjREG','1zkKDqr','main','253688GHExeU','write','588ogUuXo','23580ZAgBuJ','9233064NcLHcP','compress','211810ozCvrY','253eTQsGP','12iMULcd','production','759945IkvhfI','45bYUXNn','1085259HDHeha'];a67_0x2a87=function(){return _0x1e4cff;};return a67_0x2a87();}function a67_0xfd67(_0x222de3,_0x32e83d){_0x222de3=_0x222de3-0x117;const _0x2a879f=a67_0x2a87();let _0xfd6729=_0x2a879f[_0x222de3];return _0xfd6729;}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a67_0x3e0ea4(0x11c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a68_0x28e3(){const _0x4fd742=['8mRBEkZ','3264751cCpPhM','npmPackageName','31911Qzkgiu','2648045BbxTLs','2379453bAZrRp','48mnynvi','3405996VYhuOg','12051MXDOpQ','1981836DcuSvf','22620zsJpvl','npmRegistryBaseUrl'];a68_0x28e3=function(){return _0x4fd742;};return a68_0x28e3();}const a68_0x55f32d=a68_0x4a3c;function a68_0x4a3c(_0x3cd368,_0x4c8fc4){_0x3cd368=_0x3cd368-0xc9;const _0x28e385=a68_0x28e3();let _0x4a3ca5=_0x28e385[_0x3cd368];return _0x4a3ca5;}(function(_0x3914bf,_0x19626d){const _0x24b3f8=a68_0x4a3c,_0x1be3aa=_0x3914bf();while(!![]){try{const _0x355c00=parseInt(_0x24b3f8(0xcd))/0x1*(-parseInt(_0x24b3f8(0xd0))/0x2)+-parseInt(_0x24b3f8(0xcf))/0x3+-parseInt(_0x24b3f8(0xd3))/0x4+-parseInt(_0x24b3f8(0xce))/0x5+parseInt(_0x24b3f8(0xd1))/0x6+-parseInt(_0x24b3f8(0xcb))/0x7*(parseInt(_0x24b3f8(0xca))/0x8)+parseInt(_0x24b3f8(0xd2))/0x9*(parseInt(_0x24b3f8(0xd4))/0xa);if(_0x355c00===_0x19626d)break;else _0x1be3aa['push'](_0x1be3aa['shift']());}catch(_0x3a587b){_0x1be3aa['push'](_0x1be3aa['shift']());}}}(a68_0x28e3,0x854d8));import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a68_0x55f32d(0xcc)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG['skillSource'];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a68_0x55f32d(0xc9)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a69_0x21e11e=a69_0x2112;(function(_0x1f9f3e,_0x3c009d){const _0x3112b4=a69_0x2112,_0x1ed096=_0x1f9f3e();while(!![]){try{const _0x31b670=-parseInt(_0x3112b4(0x1b3))/0x1+parseInt(_0x3112b4(0x1b7))/0x2+parseInt(_0x3112b4(0x1bb))/0x3+parseInt(_0x3112b4(0x1b0))/0x4*(parseInt(_0x3112b4(0x1be))/0x5)+parseInt(_0x3112b4(0x1b5))/0x6+-parseInt(_0x3112b4(0x1c1))/0x7+-parseInt(_0x3112b4(0x1b4))/0x8;if(_0x31b670===_0x3c009d)break;else _0x1ed096['push'](_0x1ed096['shift']());}catch(_0x4227d3){_0x1ed096['push'](_0x1ed096['shift']());}}}(a69_0x1a77,0x9ac8a));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillHubDomain;function a69_0x1a77(){const _0x3cb0dc=['nonProduction','domains','apiDomain','140409Yiwhkj','production','user','20UnUQTQ','userDomain','runtime','3564239tkQxeI','723204WvTyeP','runtimeDomain','skillhub','270292YjjEbX','5014560CtSjup','5122530CrmOSb','api','833042FmUsst'];a69_0x1a77=function(){return _0x3cb0dc;};return a69_0x1a77();}export function initDomains(_0x35da19){const _0x3d420d=a69_0x2112;customApiDomain=_0x35da19?.[_0x3d420d(0x1ba)],customUserDomain=_0x35da19?.[_0x3d420d(0x1bf)],customRuntimeDomain=_0x35da19?.[_0x3d420d(0x1b1)],customSkillHubDomain=_0x35da19?.['skillHubDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a69_0x21e11e(0x1b9)][a69_0x21e11e(0x1bc)][a69_0x21e11e(0x1bd)]:PRODUCT_CONFIG['domains']['nonProduction'][a69_0x21e11e(0x1bd)]);function a69_0x2112(_0x3f98c8,_0x3ff802){_0x3f98c8=_0x3f98c8-0x1b0;const _0x1a77d7=a69_0x1a77();let _0x21120c=_0x1a77d7[_0x3f98c8];return _0x21120c;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a69_0x21e11e(0x1bc)][a69_0x21e11e(0x1b6)]:PRODUCT_CONFIG[a69_0x21e11e(0x1b9)][a69_0x21e11e(0x1b8)]['api']);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a69_0x21e11e(0x1b9)]['production'][a69_0x21e11e(0x1c0)]:PRODUCT_CONFIG[a69_0x21e11e(0x1b9)]['nonProduction'][a69_0x21e11e(0x1c0)]);export const getSkillHubDomain=()=>customSkillHubDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a69_0x21e11e(0x1b9)]['production'][a69_0x21e11e(0x1b2)]:PRODUCT_CONFIG[a69_0x21e11e(0x1b9)]['nonProduction'][a69_0x21e11e(0x1b2)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a70_0x3a0b0a=a70_0x3f4a;(function(_0x58bbc6,_0x20d709){const _0x453e1b=a70_0x3f4a,_0x3f389b=_0x58bbc6();while(!![]){try{const _0x35c2b8=parseInt(_0x453e1b(0x17d))/0x1+parseInt(_0x453e1b(0x181))/0x2*(-parseInt(_0x453e1b(0x178))/0x3)+parseInt(_0x453e1b(0x177))/0x4*(-parseInt(_0x453e1b(0x17c))/0x5)+parseInt(_0x453e1b(0x180))/0x6*(-parseInt(_0x453e1b(0x185))/0x7)+parseInt(_0x453e1b(0x187))/0x8+-parseInt(_0x453e1b(0x17e))/0x9*(-parseInt(_0x453e1b(0x182))/0xa)+parseInt(_0x453e1b(0x183))/0xb;if(_0x35c2b8===_0x20d709)break;else _0x3f389b['push'](_0x3f389b['shift']());}catch(_0x3f5489){_0x3f389b['push'](_0x3f389b['shift']());}}}(a70_0x3229,0x5f9a8));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=[a70_0x3a0b0a(0x179),a70_0x3a0b0a(0x184),a70_0x3a0b0a(0x17b)];export function normalizeEnv(_0x4c64b2){const _0x191368=a70_0x3a0b0a;return _0x4c64b2===_0x191368(0x186)?_0x191368(0x179):_0x4c64b2;}function a70_0x3f4a(_0x482752,_0x1a1644){_0x482752=_0x482752-0x177;const _0x32290e=a70_0x3229();let _0x3f4ad2=_0x32290e[_0x482752];return _0x3f4ad2;}export function isProduction(_0x4d5463){const _0x5582b3=a70_0x3a0b0a;return normalizeEnv(_0x4d5463)===_0x5582b3(0x179);}export function isDaily(_0x3af7d7){const _0x376301=a70_0x3a0b0a;return normalizeEnv(_0x3af7d7)===_0x376301(0x17b);}export function isDev(_0x28b224){const _0x214aaa=a70_0x3a0b0a,_0x76407f=normalizeEnv(_0x28b224);return _0x76407f===_0x214aaa(0x184)||_0x76407f===_0x214aaa(0x17a);}let env=normalizeEnv(productEnv(a70_0x3a0b0a(0x17f))||'production');function a70_0x3229(){const _0x79cfc7=['online','3760536RnFAvi','760AWoyKw','264PYGtGA','production','dev','daily','2165hGcWvX','431020zerfWG','135wWsawr','ENV','4359054Mddmop','11038pmjKrF','484730mvTeRc','636471qJePRu','development','7NTEIjq'];a70_0x3229=function(){return _0x79cfc7;};return a70_0x3229();}export function getEnv(){return env;}export function initEnv(_0x248802){env=normalizeEnv(_0x248802);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a71_0x43c7(){const _0x5c9254=['276otIGSO','4588130kSqLCp','17071320SsvRxm','compress','802439pFUTSz','pretty','63qQZCFF','306wMuanK','1949912udHkSp','475128mJqFpj','10588ETKXyX','26648aWOTNo'];a71_0x43c7=function(){return _0x5c9254;};return a71_0x43c7();}const a71_0x203555=a71_0x4201;function a71_0x4201(_0x530646,_0x4ffb63){_0x530646=_0x530646-0x121;const _0x43c742=a71_0x43c7();let _0x420157=_0x43c742[_0x530646];return _0x420157;}(function(_0x5a1b87,_0x1d543b){const _0x1acaf2=a71_0x4201,_0x5137c9=_0x5a1b87();while(!![]){try{const _0xe496da=parseInt(_0x1acaf2(0x129))/0x1+parseInt(_0x1acaf2(0x123))/0x2*(parseInt(_0x1acaf2(0x125))/0x3)+-parseInt(_0x1acaf2(0x121))/0x4+-parseInt(_0x1acaf2(0x126))/0x5+parseInt(_0x1acaf2(0x122))/0x6*(-parseInt(_0x1acaf2(0x12b))/0x7)+-parseInt(_0x1acaf2(0x124))/0x8*(parseInt(_0x1acaf2(0x12c))/0x9)+parseInt(_0x1acaf2(0x127))/0xa;if(_0xe496da===_0x1d543b)break;else _0x5137c9['push'](_0x5137c9['shift']());}catch(_0x5989a6){_0x5137c9['push'](_0x5137c9['shift']());}}}(a71_0x43c7,0xbae81));export const OUTPUT_FORMAT_VALUES=['json',a71_0x203555(0x12a),a71_0x203555(0x128)];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x220557=a72_0x2cec;(function(_0x5aade4,_0x5abf78){const _0x4d7ef8=a72_0x2cec,_0x423d54=_0x5aade4();while(!![]){try{const _0x5c13d2=parseInt(_0x4d7ef8(0x16e))/0x1+parseInt(_0x4d7ef8(0x16f))/0x2+parseInt(_0x4d7ef8(0x17f))/0x3*(parseInt(_0x4d7ef8(0x180))/0x4)+-parseInt(_0x4d7ef8(0x178))/0x5*(-parseInt(_0x4d7ef8(0x177))/0x6)+parseInt(_0x4d7ef8(0x172))/0x7+-parseInt(_0x4d7ef8(0x186))/0x8+parseInt(_0x4d7ef8(0x181))/0x9*(-parseInt(_0x4d7ef8(0x17c))/0xa);if(_0x5c13d2===_0x5abf78)break;else _0x423d54['push'](_0x423d54['shift']());}catch(_0x46134f){_0x423d54['push'](_0x423d54['shift']());}}}(a72_0x2bef,0x62e87));export const PRODUCT_CONFIG={'cliBinName':'lovrabet','cliDisplayName':a72_0x220557(0x183),'npmPackageName':'@lovrabet/lovrabet-cli','skillSource':a72_0x220557(0x176),'npmRegistryBaseUrl':'https://registry.npmjs.org','envPrefix':a72_0x220557(0x17d),'legacyEnvPrefixes':[a72_0x220557(0x188)],'configFileNames':[a72_0x220557(0x174),a72_0x220557(0x17b)],'newConfigFileName':'.lovrabet.json','homeDirName':a72_0x220557(0x16d),'logFileName':a72_0x220557(0x175),'invokeSource':a72_0x220557(0x179),'userCenterDisplayName':a72_0x220557(0x184),'skipNpxSkillsEnvSuffix':a72_0x220557(0x185),'domains':{'production':{'user':a72_0x220557(0x170),'api':'https://api.lovrabet.com','runtime':'https://runtime.lovrabet.com','skillhub':a72_0x220557(0x182)},'nonProduction':{'user':a72_0x220557(0x17e),'api':a72_0x220557(0x171),'runtime':a72_0x220557(0x17a),'skillhub':'https://skills-daily.lovrabet.com'}},'accessKeyCreatePath':a72_0x220557(0x187)};export function productEnvName(_0x3934fe){return PRODUCT_CONFIG['envPrefix']+'_'+_0x3934fe;}export function productEnvNames(_0x45dcf4){const _0x583da4=a72_0x220557;return[productEnvName(_0x45dcf4),...PRODUCT_CONFIG[_0x583da4(0x173)]['map'](_0xcf8edc=>_0xcf8edc+'_'+_0x45dcf4)];}export function productEnv(_0x5f3236){for(const _0x17ef2a of productEnvNames(_0x5f3236)){const _0x326541=process.env[_0x17ef2a];if(_0x326541!==undefined)return _0x326541;}return undefined;}function a72_0x2cec(_0x455f65,_0x545845){_0x455f65=_0x455f65-0x16d;const _0x2bef9b=a72_0x2bef();let _0x2cec8e=_0x2bef9b[_0x455f65];return _0x2cec8e;}function a72_0x2bef(){const _0x32f923=['legacyEnvPrefixes','.lovrabet.json','.lovrabet-runtime.log','lovrabet/lovrabet-cli','1956CtqHJn','5835xKmFcq','cli:lovrabet-runtime','https://daily-runtime.lovrabet.com','.lovrabetrc','513410AEJHAF','LOVRABET','https://user-daily.lovrabet.com','597ISTbaw','2540whUjvy','117XdTNnx','https://skills.lovrabet.com','Lovrabet\x20Runtime\x20CLI','Lovrabet\x20User\x20Center','SKIP_NPX_SKILLS','1893472qtXwky','/user/ak','RABETBASE','.lovrabet','117087yilPVV','343344avvRuW','https://user.lovrabet.com','https://daily-api.lovrabet.com','3595746ZRnCZq'];a72_0x2bef=function(){return _0x32f923;};return a72_0x2bef();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a73_0x1c4e(_0x2d8053,_0x154374){_0x2d8053=_0x2d8053-0x186;const _0x1e3e9b=a73_0x1e3e();let _0x1c4e60=_0x1e3e9b[_0x2d8053];return _0x1c4e60;}const a73_0x36787c=a73_0x1c4e;function a73_0x1e3e(){const _0x23a88c=['555AXNxLu','1869720UtochE','252iEMwQJ','2090936SWwpsc','10960SbNUXi','8627861TdAwgJ','write','3688810BjpCqp','4267jcjTDo','high-risk-write','read','7HWNann','45PXWomT','16125880WnPACl'];a73_0x1e3e=function(){return _0x23a88c;};return a73_0x1e3e();}(function(_0x2b04b7,_0x3ddcca){const _0x894def=a73_0x1c4e,_0x2b7d15=_0x2b04b7();while(!![]){try{const _0x11e820=parseInt(_0x894def(0x193))/0x1*(parseInt(_0x894def(0x18d))/0x2)+parseInt(_0x894def(0x18b))/0x3*(-parseInt(_0x894def(0x18f))/0x4)+parseInt(_0x894def(0x192))/0x5+parseInt(_0x894def(0x18c))/0x6*(-parseInt(_0x894def(0x188))/0x7)+-parseInt(_0x894def(0x18e))/0x8*(-parseInt(_0x894def(0x189))/0x9)+-parseInt(_0x894def(0x18a))/0xa+parseInt(_0x894def(0x190))/0xb;if(_0x11e820===_0x3ddcca)break;else _0x2b7d15['push'](_0x2b7d15['shift']());}catch(_0x4bf1d1){_0x2b7d15['push'](_0x2b7d15['shift']());}}}(a73_0x1e3e,0xe463a));export const RISK_LEVEL_VALUES=[a73_0x36787c(0x187),a73_0x36787c(0x191),a73_0x36787c(0x186)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a74_0xe662(_0x1d3895,_0x417e0f){_0x1d3895=_0x1d3895-0x7c;const _0x5c36f5=a74_0x5c36();let _0xe66269=_0x5c36f5[_0x1d3895];return _0xe66269;}const a74_0x215bc9=a74_0xe662;(function(_0x5e5eb9,_0xd3e7ee){const _0x36355f=a74_0xe662,_0x3fecb0=_0x5e5eb9();while(!![]){try{const _0x16f2cb=parseInt(_0x36355f(0x83))/0x1*(-parseInt(_0x36355f(0x85))/0x2)+parseInt(_0x36355f(0x82))/0x3+-parseInt(_0x36355f(0x7c))/0x4+-parseInt(_0x36355f(0x7e))/0x5+-parseInt(_0x36355f(0x81))/0x6+parseInt(_0x36355f(0x7d))/0x7+parseInt(_0x36355f(0x80))/0x8;if(_0x16f2cb===_0xd3e7ee)break;else _0x3fecb0['push'](_0x3fecb0['shift']());}catch(_0x3e2d80){_0x3fecb0['push'](_0x3fecb0['shift']());}}}(a74_0x5c36,0x45646));function a74_0x5c36(){const _0x17be58=['2597476LqALkm','585560ZdufWQ','domains','6719808rwmusH','3376074reUOHq','1703337cckEIW','32983moNCla','accessKeyCreatePath','26NfNQOl','1544092IaeNEt'];a74_0x5c36=function(){return _0x17be58;};return a74_0x5c36();}import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a74_0x215bc9(0x7f)]['production']['user']+PRODUCT_CONFIG[a74_0x215bc9(0x84)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a75_0x4c5faa=a75_0x1f2e;(function(_0x3f039e,_0x38d72e){const _0x36482b=a75_0x1f2e,_0x4620f0=_0x3f039e();while(!![]){try{const _0x141d98=parseInt(_0x36482b(0x17e))/0x1*(-parseInt(_0x36482b(0x160))/0x2)+-parseInt(_0x36482b(0x14f))/0x3+parseInt(_0x36482b(0x13d))/0x4*(-parseInt(_0x36482b(0x135))/0x5)+-parseInt(_0x36482b(0x178))/0x6*(parseInt(_0x36482b(0x162))/0x7)+-parseInt(_0x36482b(0x158))/0x8+parseInt(_0x36482b(0x132))/0x9*(-parseInt(_0x36482b(0x168))/0xa)+parseInt(_0x36482b(0x16f))/0xb*(parseInt(_0x36482b(0x17d))/0xc);if(_0x141d98===_0x38d72e)break;else _0x4620f0['push'](_0x4620f0['shift']());}catch(_0x497db1){_0x4620f0['push'](_0x4620f0['shift']());}}}(a75_0x16a1,0x328ff));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[a75_0x4c5faa(0x138)];function a75_0x1f2e(_0x4835d6,_0x458870){_0x4835d6=_0x4835d6-0x132;const _0x16a1d8=a75_0x16a1();let _0x1f2e93=_0x16a1d8[_0x4835d6];return _0x1f2e93;}export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a75_0x4c5faa(0x170)];function resolveConfigPath(_0x551e4c){for(const _0x569e73 of CONFIG_NAMES){const _0x550ab6=resolve(_0x551e4c,_0x569e73);if(existsSync(_0x550ab6))return _0x550ab6;}return undefined;}export function resolveWriteConfigPath(_0x15c4a6){const _0x440697=a75_0x4c5faa,_0x9fefbb=_0x15c4a6===_0x440697(0x141)?process['cwd']():homedir(),_0x5f3422=resolveConfigPath(_0x9fefbb);return _0x5f3422??resolve(_0x9fefbb,NEW_CONFIG_NAME);}export function readConfigFile(_0x427c8d){const _0x46aea9=a75_0x4c5faa;try{if(existsSync(_0x427c8d)){const _0x7a9f11=readFileSync(_0x427c8d,{'encoding':_0x46aea9(0x15f)});if(_0x7a9f11){const _0x10cca9=JSON['parse'](_0x7a9f11);return migrateOnlineEnv(_0x427c8d,_0x10cca9),_0x10cca9;}}}catch{}return{};}function migrateOnlineEnv(_0xe510ab,_0x366a1d){const _0x6b3542=a75_0x4c5faa;let _0xc8a6e3=![];_0x366a1d[_0x6b3542(0x16b)]==='online'&&(_0x366a1d['env']=_0x6b3542(0x14e),_0xc8a6e3=!![]);if(_0x366a1d['apps']&&typeof _0x366a1d['apps']===_0x6b3542(0x16e))for(const _0x494c0d of Object[_0x6b3542(0x145)](_0x366a1d[_0x6b3542(0x16a)])){_0x494c0d&&_0x494c0d[_0x6b3542(0x16b)]===_0x6b3542(0x15a)&&(_0x494c0d[_0x6b3542(0x16b)]=_0x6b3542(0x14e),_0xc8a6e3=!![]);}if(_0xc8a6e3)try{writeConfigFile(_0xe510ab,_0x366a1d);}catch{}}export function writeConfigFile(_0x120b74,_0x5afd66){const _0x4411c2=a75_0x4c5faa,_0x18500a=dirname(_0x120b74);!existsSync(_0x18500a)&&mkdirSync(_0x18500a,{'recursive':!![]});const _0x3cedf5=_0x120b74+'.tmp';try{writeFileSync(_0x3cedf5,JSON['stringify'](_0x5afd66,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x3cedf5,_0x120b74);}catch(_0xc90843){if(_0xc90843[_0x4411c2(0x133)]===_0x4411c2(0x153)||_0xc90843['code']===_0x4411c2(0x172)||_0xc90843[_0x4411c2(0x133)]==='EACCES'){writeFileSync(_0x120b74,JSON[_0x4411c2(0x14d)](_0x5afd66,null,0x2)+'\x0a',{'encoding':_0x4411c2(0x15f)});try{unlinkSync(_0x3cedf5);}catch{}}else throw _0xc90843;}}catch(_0xbb1691){try{unlinkSync(_0x3cedf5);}catch{}throw _0xbb1691;}}export function isNonInteractiveMode(_0x329bc9){const _0x4ef3f3=a75_0x4c5faa;return!!(_0x329bc9[_0x4ef3f3(0x156)]||_0x329bc9['ci']||productEnvNames('CI')[_0x4ef3f3(0x174)](_0x4f5651=>process.env[_0x4f5651]===_0x4ef3f3(0x137))||process.env.CI===_0x4ef3f3(0x137)||!process[_0x4ef3f3(0x159)]['isTTY']||!isStdinRawModeSupported());}function a75_0x16a1(){const _0x4c5e90=['find','values','appcode','PAGE_SIZE','isRaw','high-risk-write','missing','maxRisk','riskLevel','stringify','production','471402azvFzv','string','ENV','message','EPERM','argv','apiDomain','nonInteractive','app','1173984IQQFNT','stdout','online','FORMAT','defaultApp','development','explicit','utf8','4klPtHP','isTTY','252KOijpq','setLogPath','setRawMode','local-alias','setRawCommand','APPCODE','435170nxWGOa','empty','apps','env','join','cwd','object','22CevtmN','newConfigFileName','./constant/domain.js','EXDEV','accessKey','some','daily','parse','globalConfig','24018jzddYc','global','trim','read','VERBOSE','7562196XdaMPX','104729knRHkf','runtimeDomain','projectConfig','45GBkIRQ','code','stdin','6855dwnTGP','format','true','configFileNames','error','inherit','top-level','host','520UcPyMI','cache','write','ACCESS_KEY','project','./constant/env.js','raw'];a75_0x16a1=function(){return _0x4c5e90;};return a75_0x16a1();}function isStdinRawModeSupported(){const _0x3a5047=a75_0x4c5faa;if(!process[_0x3a5047(0x134)][_0x3a5047(0x161)])return![];try{const _0x287572=process['stdin'][_0x3a5047(0x148)];return process[_0x3a5047(0x134)][_0x3a5047(0x164)](!![]),process[_0x3a5047(0x134)][_0x3a5047(0x164)](_0x287572??![]),!![];}catch{return![];}}export async function createContext(_0x285173){const _0x1e040c=a75_0x4c5faa,_0x2773d2=readRawConfig(),_0x34f513=buildConfig(_0x2773d2,_0x285173);await initGlobalEnvironment(_0x34f513);const {getUserDomain:_0x2ea83a,getApiDomain:_0x59d74d}=await import('./constant/domain.js'),_0x1601f0={'apiDomain':_0x59d74d(),'userDomain':_0x2ea83a()},_0x51dfc3=await buildAuth(_0x34f513);logger[_0x1e040c(0x163)](process['cwd']());const _0x381634=(CLI_BIN_NAME+'\x20'+process[_0x1e040c(0x154)]['slice'](0x2)[_0x1e040c(0x16c)]('\x20'))[_0x1e040c(0x17a)]();logger[_0x1e040c(0x166)](_0x381634);const _0x16d8ac=isNonInteractiveMode(_0x285173);return{'config':_0x34f513,'auth':_0x51dfc3,'logger':logger,'env':_0x1601f0,'nonInteractive':_0x16d8ac};}export function buildConfigFromFlags(_0x4909bf){return buildConfig(readRawConfig(),_0x4909bf);}export function getLocalAppAliases(_0x322e99){const _0x232630=a75_0x4c5faa;return _0x322e99['apps']&&typeof _0x322e99[_0x232630(0x16a)]===_0x232630(0x16e)?_0x322e99[_0x232630(0x16a)]:{};}export function resolveLocalAppAliasCode(_0xf79516,_0x20d0c9){const _0x195039=a75_0x4c5faa;if(!_0x20d0c9)return undefined;const _0x3b42c9=getLocalAppAliases(_0xf79516)[_0x20d0c9],_0x532ddb=_0x3b42c9?.[_0x195039(0x146)];return typeof _0x532ddb==='string'&&_0x532ddb[_0x195039(0x17a)]()?_0x532ddb[_0x195039(0x17a)]():undefined;}export function readAppCodeFromConfig(){const _0x377ca4=a75_0x4c5faa,_0x1538a1=readRawConfig(),_0x5bff94=_0x1538a1[_0x377ca4(0x146)]??_0x1538a1[_0x377ca4(0x157)];if(typeof _0x5bff94===_0x377ca4(0x150)&&_0x5bff94[_0x377ca4(0x17a)]())return _0x5bff94[_0x377ca4(0x17a)]();const _0x150af4=resolveLocalAppAliasCode(_0x1538a1,typeof _0x1538a1[_0x377ca4(0x15c)]===_0x377ca4(0x150)?_0x1538a1[_0x377ca4(0x15c)]:undefined);if(_0x150af4)return _0x150af4;const _0x40add3=normalizeEnv(String(_0x1538a1[_0x377ca4(0x16b)]||_0x377ca4(0x14e))),_0x3288ef=isDaily(_0x40add3)?_0x377ca4(0x175):isDev(_0x40add3)?_0x377ca4(0x15d):_0x377ca4(0x14e),_0x2d5d0b=resolveCachedAppCode(typeof _0x1538a1[_0x377ca4(0x15c)]===_0x377ca4(0x150)?_0x1538a1[_0x377ca4(0x15c)]:undefined,_0x3288ef,typeof _0x1538a1[_0x377ca4(0x173)]===_0x377ca4(0x150)?_0x1538a1['accessKey']:undefined);if(_0x2d5d0b)return _0x2d5d0b;const _0x35f54f=Object[_0x377ca4(0x145)](getLocalAppAliases(_0x1538a1))[_0x377ca4(0x144)](_0x129f3e=>_0x129f3e?.[_0x377ca4(0x146)]);return typeof _0x35f54f?.[_0x377ca4(0x146)]===_0x377ca4(0x150)&&_0x35f54f['appcode'][_0x377ca4(0x17a)]()?_0x35f54f[_0x377ca4(0x146)][_0x377ca4(0x17a)]():undefined;}export function readScopedConfig(_0x522b0c){const _0x251948=a75_0x4c5faa,_0x3b5c10=_0x522b0c['global']?_0x251948(0x179):_0x251948(0x141);return readConfigFile(resolveWriteConfigPath(_0x3b5c10));}export function writeScopedConfig(_0x18ee65,_0x1d6874){const _0x2a371c=a75_0x4c5faa,_0x370bdb=_0x1d6874[_0x2a371c(0x179)]?_0x2a371c(0x179):_0x2a371c(0x141);writeConfigFile(resolveWriteConfigPath(_0x370bdb),_0x18ee65);}export async function initGlobalEnvironment(_0x293626){const _0x40f19c=a75_0x4c5faa,{initEnv:_0x226552}=await import(_0x40f19c(0x142));_0x226552(_0x293626[_0x40f19c(0x16b)]);const {initDomains:_0x4d4d4d}=await import(_0x40f19c(0x171));_0x4d4d4d({'apiDomain':_0x293626[_0x40f19c(0x143)][_0x40f19c(0x155)]||_0x293626[_0x40f19c(0x143)][_0x40f19c(0x13c)]||undefined,'userDomain':_0x293626[_0x40f19c(0x143)]['userDomain']||undefined,'runtimeDomain':_0x293626[_0x40f19c(0x143)][_0x40f19c(0x17f)]||undefined,'skillHubDomain':_0x293626[_0x40f19c(0x143)]['skillHubDomain']||undefined});}export function getProjectConfigPath(){const _0x17390e=a75_0x4c5faa;return resolveConfigPath(process[_0x17390e(0x16d)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x3eaaec){const _0x1e63c7=a75_0x4c5faa;if(!existsSync(_0x3eaaec))return{'status':_0x1e63c7(0x14a)};try{const _0x2f90a7=readFileSync(_0x3eaaec,{'encoding':_0x1e63c7(0x15f)});if(!_0x2f90a7?.[_0x1e63c7(0x17a)]())return{'status':_0x1e63c7(0x169)};const _0x596af8=JSON[_0x1e63c7(0x176)](_0x2f90a7);return{'status':'ok','data':_0x596af8};}catch(_0x3043f3){return{'status':_0x1e63c7(0x139),'message':_0x3043f3 instanceof Error?_0x3043f3[_0x1e63c7(0x152)]:String(_0x3043f3)};}}export function loadRawConfigLayers(_0x21b64e){const _0x59a286=a75_0x4c5faa;let _0x149156={},_0x2eed6d={},_0x2ca446,_0x58052e;try{_0x2ca446=resolveConfigPath(homedir());if(_0x2ca446){const _0x3bbbc8=readFileSync(_0x2ca446,{'encoding':'utf8'});if(_0x3bbbc8)_0x149156=JSON['parse'](_0x3bbbc8);}}catch{}try{const _0x5b5c68=_0x21b64e||process[_0x59a286(0x16d)]();_0x58052e=resolveConfigPath(_0x5b5c68);if(_0x58052e){const _0x5974fa=readFileSync(_0x58052e,{'encoding':_0x59a286(0x15f)});if(_0x5974fa)_0x2eed6d=JSON[_0x59a286(0x176)](_0x5974fa);}}catch{}return{'globalPath':_0x2ca446,'projectPath':_0x58052e,'globalConfig':_0x149156,'projectConfig':_0x2eed6d};}function mergeRawConfigLayers(_0x21174c){const _0x6dc57d=a75_0x4c5faa,{globalConfig:_0x5a21a4,projectConfig:_0x39fb1b}=_0x21174c;if(_0x39fb1b[_0x6dc57d(0x13a)]===![]){const _0x38bd91={..._0x39fb1b};return delete _0x38bd91[_0x6dc57d(0x13a)],_0x38bd91;}const _0x51e679={..._0x5a21a4,..._0x39fb1b};if('defaultApp'in _0x39fb1b)_0x51e679['defaultApp']=_0x39fb1b[_0x6dc57d(0x15c)];else _0x5a21a4[_0x6dc57d(0x15c)]&&(_0x51e679[_0x6dc57d(0x15c)]=_0x5a21a4[_0x6dc57d(0x15c)]);return _0x51e679;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x17d282){return mergeRawConfigLayers(loadRawConfigLayers(_0x17d282));}export function readRawConfigWithLayers(_0x5b8369){const _0x3347f1=loadRawConfigLayers(_0x5b8369);return{'config':mergeRawConfigLayers(_0x3347f1),'layers':_0x3347f1};}export function resolveDefaultAppSource(_0x39fb87){const _0x43a9c5=a75_0x4c5faa;if(_0x43a9c5(0x15c)in _0x39fb87[_0x43a9c5(0x180)])return'project';if(_0x39fb87['projectConfig'][_0x43a9c5(0x13a)]===![])return null;if(_0x39fb87[_0x43a9c5(0x177)][_0x43a9c5(0x15c)])return _0x43a9c5(0x179);return null;}function buildConfig(_0x377e9d,_0x3b4fb0){const _0x80601a=a75_0x4c5faa,_0x3ffab8=_0x377e9d[_0x80601a(0x15c)]||undefined,_0x1342f9=_0x3b4fb0[_0x80601a(0x157)]||env('APP')||undefined,_0x35a1c8=_0x1342f9||_0x3ffab8||undefined,_0x38ea11=env(_0x80601a(0x140))||_0x377e9d[_0x80601a(0x173)]||undefined,_0x6287a8=_0x3b4fb0[_0x80601a(0x16b)]||env(_0x80601a(0x151))||_0x377e9d['env']||DEFAULT_CONFIG_VALUES[_0x80601a(0x16b)],_0x100a9d=normalizeEnv(String(_0x6287a8)),_0x530fce=isDaily(_0x100a9d)?_0x80601a(0x175):isDev(_0x100a9d)?'development':_0x80601a(0x14e),_0xaca557=typeof _0x3b4fb0[_0x80601a(0x146)]===_0x80601a(0x150)?_0x3b4fb0[_0x80601a(0x146)]:undefined,_0x9616e2=env(_0x80601a(0x167)),_0xa23a6=_0x1342f9?undefined:_0x377e9d[_0x80601a(0x146)]||_0x377e9d[_0x80601a(0x157)]||undefined,_0x1aabf1=_0x1342f9||(_0xa23a6?undefined:_0x3ffab8),_0x168e91=resolveLocalAppAliasCode(_0x377e9d,_0x1aabf1),_0x35d9e3=resolveCachedAppCode(_0x1aabf1,_0x530fce,_0x38ea11),_0x3d01d2=_0xaca557||_0x9616e2||_0xa23a6||_0x168e91||_0x35d9e3||undefined,_0x3231a9=_0xaca557?_0x80601a(0x15e):_0x9616e2?_0x80601a(0x16b):_0xa23a6?_0x80601a(0x13b):_0x168e91?_0x80601a(0x165):_0x35d9e3?_0x80601a(0x13e):undefined,_0x7a7aaf=_0x377e9d['locale']||DEFAULT_CONFIG_VALUES['locale'],_0x178b9f=undefined,_0x57d1bc=_0x3b4fb0[_0x80601a(0x136)]||env(_0x80601a(0x15b))||_0x377e9d[_0x80601a(0x136)],_0x4f06f4=normalizeLegacyOutputFormat(_0x57d1bc),_0x65f1ce=env(_0x80601a(0x147))||_0x377e9d['pageSize'],_0x166e61=_0x65f1ce?Number(_0x65f1ce)||undefined:undefined,_0x565769=_0x377e9d[_0x80601a(0x14c)]||_0x377e9d[_0x80601a(0x14b)],_0x3b964f=_0x565769===_0x80601a(0x17b)||_0x565769===_0x80601a(0x13f)||_0x565769===_0x80601a(0x149)?_0x565769:DEFAULT_CONFIG_VALUES[_0x80601a(0x14c)],_0x3e97a1=env(_0x80601a(0x17c)),_0x497e97=_0x3e97a1==='1'||_0x3e97a1===_0x80601a(0x137);return{'appCode':typeof _0x3d01d2===_0x80601a(0x150)&&_0x3d01d2[_0x80601a(0x17a)]()?_0x3d01d2[_0x80601a(0x17a)]():undefined,'appCodeSource':_0x3231a9,'env':_0x530fce,'locale':_0x7a7aaf,'cookie':_0x178b9f,'accessKey':_0x38ea11,'format':_0x4f06f4,'pageSize':_0x166e61,'riskLevel':_0x3b964f,'verbose':_0x497e97,'defaultApp':_0x3ffab8,'currentApp':typeof _0x35a1c8===_0x80601a(0x150)?_0x35a1c8:undefined,'raw':_0x377e9d};}function env(_0x366f6a){return productEnv(_0x366f6a);}async function buildAuth(_0x15f496){const _0x47276e='',_0x17ed3c=!!_0x15f496['accessKey'];return{'cookie':_0x47276e,'isLoggedIn':_0x17ed3c,async 'getOrLogin'(){if(_0x17ed3c)return _0x47276e;throw CliErrors['authRequired']();}};}
|
|
1
|
+
const a75_0x462f07=a75_0x4688;(function(_0x413fac,_0x834420){const _0x2f1e26=a75_0x4688,_0xdbd137=_0x413fac();while(!![]){try{const _0x28843a=parseInt(_0x2f1e26(0x15b))/0x1*(-parseInt(_0x2f1e26(0x13c))/0x2)+parseInt(_0x2f1e26(0x154))/0x3+parseInt(_0x2f1e26(0x15c))/0x4*(-parseInt(_0x2f1e26(0x157))/0x5)+parseInt(_0x2f1e26(0x152))/0x6*(parseInt(_0x2f1e26(0x13d))/0x7)+parseInt(_0x2f1e26(0x13a))/0x8*(-parseInt(_0x2f1e26(0x143))/0x9)+-parseInt(_0x2f1e26(0x134))/0xa*(-parseInt(_0x2f1e26(0x11b))/0xb)+-parseInt(_0x2f1e26(0x130))/0xc*(-parseInt(_0x2f1e26(0x119))/0xd);if(_0x28843a===_0x834420)break;else _0xdbd137['push'](_0xdbd137['shift']());}catch(_0x3176fc){_0xdbd137['push'](_0xdbd137['shift']());}}}(a75_0xb730,0xb4c46));function a75_0x4688(_0x1e11f8,_0x32d9a6){_0x1e11f8=_0x1e11f8-0x119;const _0xb730f0=a75_0xb730();let _0x4688c2=_0xb730f0[_0x1e11f8];return _0x4688c2;}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['configFileNames'];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a75_0x462f07(0x11a)];function resolveConfigPath(_0x59f9ff){for(const _0x3d40d4 of CONFIG_NAMES){const _0x1b169e=resolve(_0x59f9ff,_0x3d40d4);if(existsSync(_0x1b169e))return _0x1b169e;}return undefined;}export function resolveWriteConfigPath(_0x5c88db){const _0x11d8d0=a75_0x462f07,_0x1421af=_0x5c88db==='project'?process[_0x11d8d0(0x15d)]():homedir(),_0x30b5bd=resolveConfigPath(_0x1421af);return _0x30b5bd??resolve(_0x1421af,NEW_CONFIG_NAME);}export function readConfigFile(_0x5db212){const _0x374d0b=a75_0x462f07;try{if(existsSync(_0x5db212)){const _0x4fc01e=readFileSync(_0x5db212,{'encoding':_0x374d0b(0x15a)});if(_0x4fc01e){const _0xb0748f=JSON['parse'](_0x4fc01e);return migrateOnlineEnv(_0x5db212,_0xb0748f),_0xb0748f;}}}catch{}return{};}function a75_0xb730(){const _0x136d79=['stringify','455022aGnRUN','online','ACCESS_KEY','values','read','empty','string','some','global','locale','APPCODE','top-level','slice','development','code','2720022UTvbBy','apps','4046352ELShzC','project','format','2843615hxXkKx','userDomain','stdout','utf8','929161EOWOht','4eFSUbf','cwd','true','pageSize','riskLevel','EPERM','stdin','EXDEV','env','join','projectConfig','skillHubDomain','accessKey','defaultApp','5809609VhvDaz','newConfigFileName','635723TilxTN','ENV','local-alias','missing','production','authRequired','setRawMode','.tmp','daily','isRaw','high-risk-write','argv','setLogPath','nonInteractive','appcode','VERBOSE','PAGE_SIZE','./constant/domain.js','object','raw','host','36HpCNLZ','trim','app','APP','10FngWXt','explicit','runtimeDomain','isTTY','parse','apiDomain','224dvutEg','find','2uQgixF','14TRKnnJ','write','FORMAT','inherit','EACCES'];a75_0xb730=function(){return _0x136d79;};return a75_0xb730();}function migrateOnlineEnv(_0x414b44,_0x25bd1c){const _0xe4cc9b=a75_0x462f07;let _0x2a4316=![];_0x25bd1c[_0xe4cc9b(0x164)]===_0xe4cc9b(0x144)&&(_0x25bd1c[_0xe4cc9b(0x164)]=_0xe4cc9b(0x11f),_0x2a4316=!![]);if(_0x25bd1c['apps']&&typeof _0x25bd1c[_0xe4cc9b(0x153)]===_0xe4cc9b(0x12d))for(const _0x9c3bd1 of Object[_0xe4cc9b(0x146)](_0x25bd1c[_0xe4cc9b(0x153)])){_0x9c3bd1&&_0x9c3bd1[_0xe4cc9b(0x164)]===_0xe4cc9b(0x144)&&(_0x9c3bd1[_0xe4cc9b(0x164)]=_0xe4cc9b(0x11f),_0x2a4316=!![]);}if(_0x2a4316)try{writeConfigFile(_0x414b44,_0x25bd1c);}catch{}}export function writeConfigFile(_0x598dc7,_0x42ee34){const _0x53811d=a75_0x462f07,_0x2d6c4e=dirname(_0x598dc7);!existsSync(_0x2d6c4e)&&mkdirSync(_0x2d6c4e,{'recursive':!![]});const _0x27b908=_0x598dc7+_0x53811d(0x122);try{writeFileSync(_0x27b908,JSON[_0x53811d(0x142)](_0x42ee34,null,0x2)+'\x0a',{'encoding':_0x53811d(0x15a),'mode':0x180});try{renameSync(_0x27b908,_0x598dc7);}catch(_0x402493){if(_0x402493[_0x53811d(0x151)]===_0x53811d(0x161)||_0x402493['code']===_0x53811d(0x163)||_0x402493[_0x53811d(0x151)]===_0x53811d(0x141)){writeFileSync(_0x598dc7,JSON[_0x53811d(0x142)](_0x42ee34,null,0x2)+'\x0a',{'encoding':_0x53811d(0x15a)});try{unlinkSync(_0x27b908);}catch{}}else throw _0x402493;}}catch(_0x8b5cdc){try{unlinkSync(_0x27b908);}catch{}throw _0x8b5cdc;}}export function isNonInteractiveMode(_0x37dcbe){const _0xd8d7eb=a75_0x462f07;return!!(_0x37dcbe[_0xd8d7eb(0x128)]||_0x37dcbe['ci']||productEnvNames('CI')[_0xd8d7eb(0x14a)](_0x21fb3b=>process.env[_0x21fb3b]===_0xd8d7eb(0x15e))||process.env.CI===_0xd8d7eb(0x15e)||!process[_0xd8d7eb(0x159)][_0xd8d7eb(0x137)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x323605=a75_0x462f07;if(!process[_0x323605(0x162)][_0x323605(0x137)])return![];try{const _0x42f0ac=process[_0x323605(0x162)][_0x323605(0x124)];return process[_0x323605(0x162)][_0x323605(0x121)](!![]),process['stdin'][_0x323605(0x121)](_0x42f0ac??![]),!![];}catch{return![];}}export async function createContext(_0x444b44){const _0x700836=a75_0x462f07,_0x304edf=readRawConfig(),_0x1972d9=buildConfig(_0x304edf,_0x444b44);await initGlobalEnvironment(_0x1972d9);const {getUserDomain:_0x566fdc,getApiDomain:_0xdc120c}=await import(_0x700836(0x12c)),_0x18d14d={'apiDomain':_0xdc120c(),'userDomain':_0x566fdc()},_0x59d281=await buildAuth(_0x1972d9);logger[_0x700836(0x127)](process['cwd']());const _0x1f3047=(CLI_BIN_NAME+'\x20'+process[_0x700836(0x126)][_0x700836(0x14f)](0x2)[_0x700836(0x165)]('\x20'))[_0x700836(0x131)]();logger['setRawCommand'](_0x1f3047);const _0x11ce31=isNonInteractiveMode(_0x444b44);return{'config':_0x1972d9,'auth':_0x59d281,'logger':logger,'env':_0x18d14d,'nonInteractive':_0x11ce31};}export function buildConfigFromFlags(_0xa751f6){return buildConfig(readRawConfig(),_0xa751f6);}export function getLocalAppAliases(_0x41496a){const _0x1b28a6=a75_0x462f07;return _0x41496a[_0x1b28a6(0x153)]&&typeof _0x41496a[_0x1b28a6(0x153)]===_0x1b28a6(0x12d)?_0x41496a[_0x1b28a6(0x153)]:{};}export function resolveLocalAppAliasCode(_0x54961f,_0x5a749d){const _0xa01c92=a75_0x462f07;if(!_0x5a749d)return undefined;const _0x515a5e=getLocalAppAliases(_0x54961f)[_0x5a749d],_0x32ce51=_0x515a5e?.[_0xa01c92(0x129)];return typeof _0x32ce51===_0xa01c92(0x149)&&_0x32ce51[_0xa01c92(0x131)]()?_0x32ce51[_0xa01c92(0x131)]():undefined;}export function readAppCodeFromConfig(){const _0x4194ec=a75_0x462f07,_0x23b2a8=readRawConfig(),_0x46cd2c=_0x23b2a8[_0x4194ec(0x129)]??_0x23b2a8[_0x4194ec(0x132)];if(typeof _0x46cd2c===_0x4194ec(0x149)&&_0x46cd2c[_0x4194ec(0x131)]())return _0x46cd2c['trim']();const _0x535590=resolveLocalAppAliasCode(_0x23b2a8,typeof _0x23b2a8[_0x4194ec(0x169)]==='string'?_0x23b2a8[_0x4194ec(0x169)]:undefined);if(_0x535590)return _0x535590;const _0x3ca1b9=normalizeEnv(String(_0x23b2a8[_0x4194ec(0x164)]||_0x4194ec(0x11f))),_0x1e0dd8=isDaily(_0x3ca1b9)?_0x4194ec(0x123):isDev(_0x3ca1b9)?_0x4194ec(0x150):_0x4194ec(0x11f),_0x1c6c34=resolveCachedAppCode(typeof _0x23b2a8[_0x4194ec(0x169)]===_0x4194ec(0x149)?_0x23b2a8['defaultApp']:undefined,_0x1e0dd8,typeof _0x23b2a8[_0x4194ec(0x168)]===_0x4194ec(0x149)?_0x23b2a8['accessKey']:undefined);if(_0x1c6c34)return _0x1c6c34;const _0x6f319e=Object[_0x4194ec(0x146)](getLocalAppAliases(_0x23b2a8))[_0x4194ec(0x13b)](_0x193df1=>_0x193df1?.[_0x4194ec(0x129)]);return typeof _0x6f319e?.[_0x4194ec(0x129)]===_0x4194ec(0x149)&&_0x6f319e[_0x4194ec(0x129)][_0x4194ec(0x131)]()?_0x6f319e[_0x4194ec(0x129)][_0x4194ec(0x131)]():undefined;}export function readScopedConfig(_0x4b7b6a){const _0x1b0da6=a75_0x462f07,_0x210ea1=_0x4b7b6a[_0x1b0da6(0x14b)]?_0x1b0da6(0x14b):_0x1b0da6(0x155);return readConfigFile(resolveWriteConfigPath(_0x210ea1));}export function writeScopedConfig(_0x2de89a,_0x550d22){const _0x4aee7b=a75_0x462f07,_0x4ccaef=_0x550d22['global']?_0x4aee7b(0x14b):_0x4aee7b(0x155);writeConfigFile(resolveWriteConfigPath(_0x4ccaef),_0x2de89a);}export async function initGlobalEnvironment(_0x45e349){const _0x2c8384=a75_0x462f07,{initEnv:_0x649f60}=await import('./constant/env.js');_0x649f60(_0x45e349[_0x2c8384(0x164)]);const {initDomains:_0x39f054}=await import(_0x2c8384(0x12c));_0x39f054({'apiDomain':_0x45e349[_0x2c8384(0x12e)][_0x2c8384(0x139)]||_0x45e349[_0x2c8384(0x12e)][_0x2c8384(0x12f)]||undefined,'userDomain':_0x45e349[_0x2c8384(0x12e)][_0x2c8384(0x158)]||undefined,'runtimeDomain':_0x45e349[_0x2c8384(0x12e)][_0x2c8384(0x136)]||undefined,'skillHubDomain':_0x45e349['raw'][_0x2c8384(0x167)]||undefined});}export function getProjectConfigPath(){const _0x1c7838=a75_0x462f07;return resolveConfigPath(process[_0x1c7838(0x15d)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x507349){const _0x56df9f=a75_0x462f07;if(!existsSync(_0x507349))return{'status':_0x56df9f(0x11e)};try{const _0x4e6e3a=readFileSync(_0x507349,{'encoding':_0x56df9f(0x15a)});if(!_0x4e6e3a?.[_0x56df9f(0x131)]())return{'status':_0x56df9f(0x148)};const _0x3f123e=JSON['parse'](_0x4e6e3a);return{'status':'ok','data':_0x3f123e};}catch(_0x1f7fe4){return{'status':'error','message':_0x1f7fe4 instanceof Error?_0x1f7fe4['message']:String(_0x1f7fe4)};}}export function loadRawConfigLayers(_0x26e70d){const _0x5b58d1=a75_0x462f07;let _0x3ac489={},_0x9e9b7d={},_0x18c297,_0x1750de;try{_0x18c297=resolveConfigPath(homedir());if(_0x18c297){const _0x59fe7d=readFileSync(_0x18c297,{'encoding':_0x5b58d1(0x15a)});if(_0x59fe7d)_0x3ac489=JSON['parse'](_0x59fe7d);}}catch{}try{const _0x4b0030=_0x26e70d||process[_0x5b58d1(0x15d)]();_0x1750de=resolveConfigPath(_0x4b0030);if(_0x1750de){const _0xdf4a00=readFileSync(_0x1750de,{'encoding':_0x5b58d1(0x15a)});if(_0xdf4a00)_0x9e9b7d=JSON[_0x5b58d1(0x138)](_0xdf4a00);}}catch{}return{'globalPath':_0x18c297,'projectPath':_0x1750de,'globalConfig':_0x3ac489,'projectConfig':_0x9e9b7d};}function mergeRawConfigLayers(_0x1628c2){const _0x106e9d=a75_0x462f07,{globalConfig:_0x5dee78,projectConfig:_0x283003}=_0x1628c2;if(_0x283003[_0x106e9d(0x140)]===![]){const _0x26dc48={..._0x283003};return delete _0x26dc48[_0x106e9d(0x140)],_0x26dc48;}const _0x5a3ac2={..._0x5dee78,..._0x283003};if(_0x106e9d(0x169)in _0x283003)_0x5a3ac2[_0x106e9d(0x169)]=_0x283003[_0x106e9d(0x169)];else _0x5dee78[_0x106e9d(0x169)]&&(_0x5a3ac2[_0x106e9d(0x169)]=_0x5dee78[_0x106e9d(0x169)]);return _0x5a3ac2;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x313d7d){return mergeRawConfigLayers(loadRawConfigLayers(_0x313d7d));}export function readRawConfigWithLayers(_0x24bb02){const _0x3d2463=loadRawConfigLayers(_0x24bb02);return{'config':mergeRawConfigLayers(_0x3d2463),'layers':_0x3d2463};}export function resolveDefaultAppSource(_0x2dae4b){const _0x3d9bba=a75_0x462f07;if(_0x3d9bba(0x169)in _0x2dae4b[_0x3d9bba(0x166)])return'project';if(_0x2dae4b[_0x3d9bba(0x166)]['inherit']===![])return null;if(_0x2dae4b['globalConfig']['defaultApp'])return _0x3d9bba(0x14b);return null;}function buildConfig(_0x270a88,_0x3eef70){const _0x5445a9=a75_0x462f07,_0x45b95f=_0x270a88[_0x5445a9(0x169)]||undefined,_0x552acb=_0x3eef70['app']||env(_0x5445a9(0x133))||undefined,_0x3ad578=_0x552acb||_0x45b95f||undefined,_0x134b7e=env(_0x5445a9(0x145))||_0x270a88[_0x5445a9(0x168)]||undefined,_0x109cbb=_0x3eef70[_0x5445a9(0x164)]||env(_0x5445a9(0x11c))||_0x270a88[_0x5445a9(0x164)]||DEFAULT_CONFIG_VALUES['env'],_0x4fa0c4=normalizeEnv(String(_0x109cbb)),_0x2f016a=isDaily(_0x4fa0c4)?_0x5445a9(0x123):isDev(_0x4fa0c4)?_0x5445a9(0x150):'production',_0x41c700=typeof _0x3eef70[_0x5445a9(0x129)]===_0x5445a9(0x149)?_0x3eef70['appcode']:undefined,_0xa2dc36=env(_0x5445a9(0x14d)),_0x45e1bb=_0x552acb?undefined:_0x270a88[_0x5445a9(0x129)]||_0x270a88[_0x5445a9(0x132)]||undefined,_0xd72d99=_0x552acb||(_0x45e1bb?undefined:_0x45b95f),_0x110eb8=resolveLocalAppAliasCode(_0x270a88,_0xd72d99),_0x3efe4c=resolveCachedAppCode(_0xd72d99,_0x2f016a,_0x134b7e),_0x54a201=_0x41c700||_0xa2dc36||_0x45e1bb||_0x110eb8||_0x3efe4c||undefined,_0x1e8c0a=_0x41c700?_0x5445a9(0x135):_0xa2dc36?_0x5445a9(0x164):_0x45e1bb?_0x5445a9(0x14e):_0x110eb8?_0x5445a9(0x11d):_0x3efe4c?'cache':undefined,_0x1107de=_0x270a88['locale']||DEFAULT_CONFIG_VALUES[_0x5445a9(0x14c)],_0xc82179=undefined,_0x4fb7c7=_0x3eef70[_0x5445a9(0x156)]||env(_0x5445a9(0x13f))||_0x270a88[_0x5445a9(0x156)],_0x3f0077=normalizeLegacyOutputFormat(_0x4fb7c7),_0x56247d=env(_0x5445a9(0x12b))||_0x270a88[_0x5445a9(0x15f)],_0x19ed5d=_0x56247d?Number(_0x56247d)||undefined:undefined,_0x77dac9=_0x270a88[_0x5445a9(0x160)]||_0x270a88['maxRisk'],_0x11c1d8=_0x77dac9===_0x5445a9(0x147)||_0x77dac9===_0x5445a9(0x13e)||_0x77dac9===_0x5445a9(0x125)?_0x77dac9:DEFAULT_CONFIG_VALUES['riskLevel'],_0x5508ca=env(_0x5445a9(0x12a)),_0x2051a2=_0x5508ca==='1'||_0x5508ca==='true';return{'appCode':typeof _0x54a201===_0x5445a9(0x149)&&_0x54a201[_0x5445a9(0x131)]()?_0x54a201['trim']():undefined,'appCodeSource':_0x1e8c0a,'env':_0x2f016a,'locale':_0x1107de,'cookie':_0xc82179,'accessKey':_0x134b7e,'format':_0x3f0077,'pageSize':_0x19ed5d,'riskLevel':_0x11c1d8,'verbose':_0x2051a2,'defaultApp':_0x45b95f,'currentApp':typeof _0x3ad578==='string'?_0x3ad578:undefined,'raw':_0x270a88};}function env(_0x309ac6){return productEnv(_0x309ac6);}async function buildAuth(_0x459e84){const _0x520618=a75_0x462f07,_0xf2df2a='',_0x48cb93=!!_0x459e84[_0x520618(0x168)];return{'cookie':_0xf2df2a,'isLoggedIn':_0x48cb93,async 'getOrLogin'(){const _0x3b48c4=_0x520618;if(_0x48cb93)return _0xf2df2a;throw CliErrors[_0x3b48c4(0x120)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4e7e3b,_0x41016c){const _0x39d45e=a76_0x348a,_0x5e25aa=_0x4e7e3b();while(!![]){try{const _0x946e99=parseInt(_0x39d45e(0xb3))/0x1+parseInt(_0x39d45e(0xf2))/0x2+-parseInt(_0x39d45e(0x127))/0x3*(parseInt(_0x39d45e(0xcc))/0x4)+-parseInt(_0x39d45e(0x118))/0x5*(-parseInt(_0x39d45e(0x14b))/0x6)+parseInt(_0x39d45e(0xcf))/0x7+-parseInt(_0x39d45e(0x101))/0x8*(parseInt(_0x39d45e(0x12d))/0x9)+parseInt(_0x39d45e(0x125))/0xa*(parseInt(_0x39d45e(0xcb))/0xb);if(_0x946e99===_0x41016c)break;else _0x5e25aa['push'](_0x5e25aa['shift']());}catch(_0x164b8f){_0x5e25aa['push'](_0x5e25aa['shift']());}}}(a76_0x1c5e,0xf3cfa));import{readFile}from'node:fs/promises';import{basename}from'node:path';function a76_0x1c5e(){const _0x21a97c=['?appCode=','url','scope','/api/cli/v1/skills/',',\x20name=','Request\x20timeout:\x20','6orSMMc','download','gmtModified','abort','status','805356qMgBBx','Configure\x20accessKey\x20in\x20','json','/run','topK','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','application/octet-stream','/client/sql/query','example','authRequired','isJson','NAMESPACE_ONLY','description','toString','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','skillName','Personal\x20BFF\x20not\x20found:\x20id=','warnings','/schedules','API\x20error\x20code:\x20','all','apiError','packageBase64','test','22ihggcP','4DwlLJW','/client/runtime-bff/personal/create','favorite','12031922caRYsw','PRIVATE','file','Toolbox\x20API\x20error','/versions/','trim','stringify','searchParams','/client/app/my-apps','string','resolvedSlug','tags','/client/queryFileUrl','/publish','summary','/client/artifact/','content','GET','Knowledge-base\x20entry\x20not\x20found:\x20id=','/update','valid','query','personal','visibility','appName','object','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','data','invokeSource','effective','BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','ownerPreviewVersion','text','skillCode','values','1648742ablQCb','success','/validate','/client/dataset/list','longTerm','type','Toolbox\x20API\x20error:\x20','/download','markdown','application/json','function','signal','Toolbox\x20error\x20code:\x20','/client/ocr','cursor','14529320OQMteQ','replace','arrayBuffer','/client/runtime-bff/personal/list?appCode=','set','boolean','/api/runtime/v1/namespaces/','company','/client/knowledge-base/personal/','skill','Check\x20your\x20credentials\x20and\x20try\x20again.','/client/dataset/get-driven-data?code=','AbortError','/client/artifact/list?','artifactType','isArray','Invalid\x20app\x20config\x20value:\x20key=','SkillHub\x20error\x20code:\x20','version','/client/knowledge-base/personal/create','API\x20error:\x20','/client/bff/endpoint/','/api/v1/skills/','1615430LUcZtD','/execute?appCode=','tableData','SkillHub\x20API\x20error:\x20','displayName','confirmWarnings','name','/client/uploadFile','SQL\x20query\x20not\x20found:\x20','errors','msg','POST','validation','911110VvJujs','/client/user/loginUserInfo','3117198rdKyZN','/api/node-toolbox/','errorMsg','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','Artifact\x20not\x20found:\x20id=','resolvedVersion','9OiPmJm','limit','SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/client/runtime-bff/personal/','application/zip','source','code','errorCode','from','entries','slug','error','items','base64','append','filter','message','namespace','size','appCode','Download\x20failed:\x20','find','newConfigFileName','functionName'];a76_0x1c5e=function(){return _0x21a97c;};return a76_0x1c5e();}import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{createRateLimitError,readRetryAfter,readRetryAfterSeconds}from'../framework/rate-limit.js';import{extractList}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x32f37e){_activeAK=_0x32f37e||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0x34b914){const _0x2ea6a7=a76_0x348a;for(const _0x215902 of _0x34b914){if(typeof _0x215902==='string'&&_0x215902[_0x2ea6a7(0xd4)]())return _0x215902['trim']();}return undefined;}async function decodeResponseBody(_0x45ea53){const _0x543c50=a76_0x348a;if(typeof _0x45ea53[_0x543c50(0xef)]===_0x543c50(0xfc))try{const _0x12c8f4=await _0x45ea53[_0x543c50(0xef)]();try{return{'isJson':!![],'data':parseLosslessJson(_0x12c8f4),'text':_0x12c8f4};}catch{return{'isJson':![],'text':_0x12c8f4[_0x543c50(0xd4)]()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x45ea53[_0x543c50(0xb5)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x3a60f3,_0x18d813,_0x54514a){const _0x31146c=a76_0x348a,_0x495360=_0x18d813&&typeof _0x18d813==='object'?_0x18d813:{},_0x2903d7=[_0x495360[_0x31146c(0x14f)],_0x495360[_0x31146c(0x133)]][_0x31146c(0x142)](_0x264514=>Number(_0x264514)===0x1ad),_0x174cef=createRateLimitError({'status':_0x3a60f3[_0x31146c(0x14f)]===0x1ad?_0x3a60f3[_0x31146c(0x14f)]:_0x2903d7??_0x3a60f3['status'],'errorCode':firstString(_0x495360['errorCode'],typeof _0x495360['code']===_0x31146c(0xd8)?_0x495360['code']:undefined),'message':firstString(_0x495360[_0x31146c(0x129)],_0x495360[_0x31146c(0x13d)],_0x495360[_0x31146c(0x122)],_0x54514a),'retryAfter':readRetryAfter(_0x3a60f3['headers'])??readRetryAfterSeconds(_0x18d813)});if(_0x174cef)throw _0x174cef;}async function apiRequest(_0x192f21,_0x3bd26f={}){const _0x167c3d=a76_0x348a,{method:method=_0x167c3d(0xe0),body:_0x1203de,headers:headers={},timeout:timeout=0x7530}=_0x3bd26f,_0x427208=_activeAK,_0x127530=getRuntimeDomain();if(!_0x427208)throw CliErrors[_0x167c3d(0xbc)](_0x167c3d(0xb4)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x16cbb4=''+_0x127530+_0x192f21,_0x9b50d1={'X-User-AK':_0x427208},_0xd43ac6=new AbortController(),_0x3c5296=setTimeout(()=>_0xd43ac6[_0x167c3d(0x14e)](),timeout);try{const _0x2e6797=await fetch(_0x16cbb4,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],..._0x9b50d1,...headers},'body':_0x1203de?JSON[_0x167c3d(0xd5)](_0x1203de):undefined,'signal':_0xd43ac6[_0x167c3d(0xfd)]}),_0x5b5200=await decodeResponseBody(_0x2e6797);if(!_0x5b5200['isJson']){throwIfRateLimited(_0x2e6797,undefined,_0x5b5200[_0x167c3d(0xef)]);throw CliErrors[_0x167c3d(0xc8)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x2e6797[_0x167c3d(0x14f)]+')',_0x2e6797[_0x167c3d(0x14f)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x34870d=_0x5b5200['data'];throwIfRateLimited(_0x2e6797,_0x34870d);if(!_0x2e6797['ok']||_0x34870d[_0x167c3d(0xf3)]===![])throw CliErrors['apiError'](_0x34870d[_0x167c3d(0x129)]||_0x34870d[_0x167c3d(0x13d)]||_0x167c3d(0x115)+_0x2e6797['status'],_0x34870d[_0x167c3d(0x134)]?_0x167c3d(0xc6)+_0x34870d[_0x167c3d(0x134)]:undefined);return _0x34870d;}catch(_0x44005d){if(_0x44005d instanceof Error&&_0x44005d[_0x167c3d(0x11e)]==='AbortError')throw CliErrors[_0x167c3d(0xc8)]('Request\x20timeout:\x20'+_0x16cbb4);throw _0x44005d;}finally{clearTimeout(_0x3c5296);}}async function apiBinaryRequest(_0x4bcb9d,_0x312268={}){const _0x1ac044=a76_0x348a,{method:method=_0x1ac044(0xe0),headers:headers={},timeout:timeout=0x7530}=_0x312268,_0x3235e3=_activeAK,_0x2cc7dd=getRuntimeDomain();if(!_0x3235e3)throw CliErrors[_0x1ac044(0xbc)](_0x1ac044(0xb4)+PRODUCT_CONFIG[_0x1ac044(0x143)]+'.');const _0x531028=''+_0x2cc7dd+_0x4bcb9d,_0x38003d=new AbortController(),_0x1cec00=setTimeout(()=>_0x38003d[_0x1ac044(0x14e)](),timeout);try{const _0x265be6=await fetch(_0x531028,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x1ac044(0xeb)],'X-User-AK':_0x3235e3,...headers},'signal':_0x38003d[_0x1ac044(0xfd)]});if(!_0x265be6['ok']){const _0x2aa605=await decodeResponseBody(_0x265be6),_0x3ec31c=_0x2aa605[_0x1ac044(0xea)]&&typeof _0x2aa605[_0x1ac044(0xea)]===_0x1ac044(0xe8)?_0x2aa605[_0x1ac044(0xea)]:{},_0x4bb853=firstString(_0x3ec31c['errorMsg'],_0x3ec31c[_0x1ac044(0x13d)],_0x3ec31c[_0x1ac044(0x134)],_0x2aa605[_0x1ac044(0xef)]);throwIfRateLimited(_0x265be6,_0x2aa605['data'],_0x4bb853);throw CliErrors['apiError'](_0x4bb853||_0x1ac044(0x115)+_0x265be6['status'],_0x1ac044(0x141)+_0x531028);}return Buffer[_0x1ac044(0x135)](await _0x265be6[_0x1ac044(0x103)]());}catch(_0x3d96fb){if(_0x3d96fb instanceof Error&&_0x3d96fb[_0x1ac044(0x11e)]===_0x1ac044(0x10d))throw CliErrors[_0x1ac044(0xc8)]('Request\x20timeout:\x20'+_0x531028);throw _0x3d96fb;}finally{clearTimeout(_0x1cec00);}}async function apiFormRequest(_0x12c646,_0x15997e,_0xbdbb7a={}){const _0x23f683=a76_0x348a,{timeout:timeout=0x7530}=_0xbdbb7a,_0x3b0d23=_activeAK,_0x2779c3=getRuntimeDomain();if(!_0x3b0d23)throw CliErrors['authRequired'](_0x23f683(0xb4)+PRODUCT_CONFIG[_0x23f683(0x143)]+'.');const _0x405c96=''+_0x2779c3+_0x12c646,_0x3aab82=new AbortController(),_0x270057=setTimeout(()=>_0x3aab82[_0x23f683(0x14e)](),timeout);try{const _0x42547f=await fetch(_0x405c96,{'method':_0x23f683(0x123),'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x3b0d23},'body':_0x15997e,'signal':_0x3aab82['signal']}),_0x580e98=await decodeResponseBody(_0x42547f);if(!_0x580e98['isJson']){throwIfRateLimited(_0x42547f,undefined,_0x580e98['text']);throw CliErrors['apiError'](_0x23f683(0xb8)+_0x42547f['status']+')',_0x42547f['status']>=0x190?_0x23f683(0x10b):undefined);}const _0x598a32=_0x580e98['data'];throwIfRateLimited(_0x42547f,_0x598a32);if(!_0x42547f['ok']||_0x598a32[_0x23f683(0xf3)]===![])throw CliErrors[_0x23f683(0xc8)](_0x598a32[_0x23f683(0x129)]||_0x598a32[_0x23f683(0x13d)]||_0x23f683(0x115)+_0x42547f[_0x23f683(0x14f)],_0x598a32[_0x23f683(0x134)]?_0x23f683(0xc6)+_0x598a32[_0x23f683(0x134)]:undefined);return _0x598a32;}catch(_0x5bb074){if(_0x5bb074 instanceof Error&&_0x5bb074[_0x23f683(0x11e)]===_0x23f683(0x10d))throw CliErrors[_0x23f683(0xc8)](_0x23f683(0x14a)+_0x405c96);throw _0x5bb074;}finally{clearTimeout(_0x270057);}}async function toolboxRequest(_0x4a899e,_0x376f8e,_0x6028f3={}){const _0x562b13=a76_0x348a,{method:method=_0x562b13(0xe0),headers:headers={},timeout:timeout=0x7530}=_0x6028f3,_0x29c462=_activeAK;if(!_0x29c462)throw CliErrors[_0x562b13(0xbc)](_0x562b13(0xb4)+PRODUCT_CONFIG[_0x562b13(0x143)]+'.');const _0x23dc21=getApiDomain()[_0x562b13(0x102)](/\/$/,''),_0x20670a=new URL(_0x4a899e,_0x23dc21+_0x562b13(0x128));if(_0x376f8e)for(const [_0x5047f6,_0xf7a627]of Object[_0x562b13(0x136)](_0x376f8e)){_0xf7a627!==undefined&&_0xf7a627!==null&&_0x20670a[_0x562b13(0xd6)][_0x562b13(0x105)](_0x5047f6,String(_0xf7a627));}const _0x33b4de=new AbortController(),_0x24bdb8=setTimeout(()=>_0x33b4de[_0x562b13(0x14e)](),timeout);try{const _0x122bf4=await fetch(_0x20670a,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x562b13(0xeb)],'X-User-AK':_0x29c462,...headers},'signal':_0x33b4de[_0x562b13(0xfd)]}),_0x77299f=await decodeResponseBody(_0x122bf4);if(!_0x77299f['isJson']){throwIfRateLimited(_0x122bf4,undefined,_0x77299f[_0x562b13(0xef)]);throw CliErrors[_0x562b13(0xc8)](_0x562b13(0xc1)+_0x122bf4['status']+')',_0x122bf4['status']>=0x190?_0x562b13(0x10b):undefined);}const _0x4360ea=_0x77299f[_0x562b13(0xea)];throwIfRateLimited(_0x122bf4,_0x4360ea);if(!_0x122bf4['ok']){const _0x15f90f=_0x4360ea&&typeof _0x4360ea==='object'?_0x4360ea:{};throw CliErrors[_0x562b13(0xc8)](_0x15f90f[_0x562b13(0x129)]||_0x15f90f[_0x562b13(0x13d)]||_0x562b13(0xf8)+_0x122bf4[_0x562b13(0x14f)],_0x15f90f[_0x562b13(0x134)]?_0x562b13(0xfe)+_0x15f90f[_0x562b13(0x134)]:undefined);}if(_0x4360ea&&typeof _0x4360ea===_0x562b13(0xe8)&&_0x562b13(0xf3)in _0x4360ea&&typeof _0x4360ea[_0x562b13(0xf3)]===_0x562b13(0x106)){const _0x46b946=_0x4360ea;if(!_0x46b946['success'])throw CliErrors[_0x562b13(0xc8)](_0x46b946['errorMsg']||_0x46b946[_0x562b13(0x13d)]||_0x562b13(0xd2),_0x46b946['errorCode']?'Toolbox\x20error\x20code:\x20'+_0x46b946['errorCode']:undefined);return _0x46b946['data'];}return _0x4360ea;}catch(_0x139e35){if(_0x139e35 instanceof Error&&_0x139e35[_0x562b13(0x11e)]==='AbortError')throw CliErrors[_0x562b13(0xc8)](_0x562b13(0x14a)+_0x20670a[_0x562b13(0xc0)]());throw _0x139e35;}finally{clearTimeout(_0x24bdb8);}}async function skillHubJsonRequest(_0x95f971,_0x16318e={}){const _0x332bb6=a76_0x348a,{method:method=_0x332bb6(0xe0),query:_0xaa663e,body:_0x3f89a6,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x16318e,_0x267754=_activeAK;if(!_0x267754)throw CliErrors['authRequired'](_0x332bb6(0xb4)+PRODUCT_CONFIG[_0x332bb6(0x143)]+'.');const _0x5d7c77=getSkillHubDomain()[_0x332bb6(0x102)](/\/$/,''),_0x340d0d=new URL(_0x95f971,_0x5d7c77+'/');if(_0xaa663e)for(const [_0xc28e17,_0x108b64]of Object[_0x332bb6(0x136)](_0xaa663e)){_0x108b64!==undefined&&_0x108b64!==null&&_0x340d0d[_0x332bb6(0xd6)][_0x332bb6(0x105)](_0xc28e17,String(_0x108b64));}const _0x2c3989=new AbortController(),_0x38f53a=setTimeout(()=>_0x2c3989[_0x332bb6(0x14e)](),timeout);try{const _0x5ab75b=await fetch(_0x340d0d[_0x332bb6(0xc0)](),{'method':method,'headers':{'Accept':_0x332bb6(0xfb),'X-Invoke-Source':PRODUCT_CONFIG[_0x332bb6(0xeb)],'X-User-AK':_0x267754,...headers},'body':_0x3f89a6,'signal':_0x2c3989[_0x332bb6(0xfd)]}),_0x1a462f=await decodeResponseBody(_0x5ab75b);if(!_0x1a462f[_0x332bb6(0xbd)]){if(allowNotFound&&_0x5ab75b['status']===0x194)return undefined;throwIfRateLimited(_0x5ab75b,undefined,_0x1a462f['text']);throw CliErrors[_0x332bb6(0xc8)](_0x332bb6(0x12f)+_0x5ab75b[_0x332bb6(0x14f)]+')',_0x5ab75b[_0x332bb6(0x14f)]>=0x190?_0x332bb6(0x10b):undefined);}const _0xe6ebfd=_0x1a462f['data'];throwIfRateLimited(_0x5ab75b,_0xe6ebfd);if(allowNotFound&&isSkillHubNotFoundResponse(_0x5ab75b['status'],_0xe6ebfd))return undefined;const _0x98d461=!_0x5ab75b['ok']||_0xe6ebfd?.[_0x332bb6(0xf3)]===![]||typeof _0xe6ebfd?.[_0x332bb6(0x133)]==='number'&&_0xe6ebfd['code']>=0x190;if(_0x98d461)throw CliErrors[_0x332bb6(0xc8)](_0xe6ebfd?.['errorMsg']||_0xe6ebfd?.[_0x332bb6(0x13d)]||_0xe6ebfd?.[_0x332bb6(0x122)]||_0x332bb6(0x11b)+_0x5ab75b[_0x332bb6(0x14f)],_0xe6ebfd?.[_0x332bb6(0x134)]?_0x332bb6(0x112)+_0xe6ebfd[_0x332bb6(0x134)]:undefined);return _0xe6ebfd?.[_0x332bb6(0xea)]??_0xe6ebfd;}catch(_0x10333c){if(_0x10333c instanceof Error&&_0x10333c[_0x332bb6(0x11e)]===_0x332bb6(0x10d))throw CliErrors[_0x332bb6(0xc8)](_0x332bb6(0x14a)+_0x340d0d[_0x332bb6(0xc0)]());throw _0x10333c;}finally{clearTimeout(_0x38f53a);}}function isSkillHubNotFoundResponse(_0x2c1d56,_0x286ab0){const _0xe6fe21=a76_0x348a;if(_0x2c1d56===0x194||_0x286ab0?.['code']===0x194)return!![];if(_0x2c1d56!==0x190&&_0x286ab0?.['code']!==0x190)return![];const _0x3a45ae=[_0x286ab0?.[_0xe6fe21(0x122)],_0x286ab0?.[_0xe6fe21(0x13d)],_0x286ab0?.[_0xe6fe21(0x129)],_0x286ab0?.[_0xe6fe21(0x138)]][_0xe6fe21(0x13c)](_0x5803b0=>typeof _0x5803b0===_0xe6fe21(0xd8))['join']('\x20');return/skill not found\b/i[_0xe6fe21(0xca)](_0x3a45ae);}async function skillHubBinaryRequest(_0x2160e4,_0x297e63={}){const _0x4f6d5e=a76_0x348a,{query:_0x5abef6,headers:headers={},timeout:timeout=0x7530}=_0x297e63,_0x5ae00d=_activeAK;if(!_0x5ae00d)throw CliErrors[_0x4f6d5e(0xbc)](_0x4f6d5e(0xb4)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x57eb01=getSkillHubDomain()[_0x4f6d5e(0x102)](/\/$/,''),_0x14cdd5=new URL(_0x2160e4,_0x57eb01+'/');if(_0x5abef6)for(const [_0x11f3a1,_0x5e6638]of Object[_0x4f6d5e(0x136)](_0x5abef6)){_0x5e6638!==undefined&&_0x5e6638!==null&&_0x14cdd5[_0x4f6d5e(0xd6)][_0x4f6d5e(0x105)](_0x11f3a1,String(_0x5e6638));}const _0x13b758=new AbortController(),_0xa3559d=setTimeout(()=>_0x13b758['abort'](),timeout);try{const _0x4c9d3d=await fetch(_0x14cdd5[_0x4f6d5e(0xc0)](),{'method':'GET','headers':{'Accept':_0x4f6d5e(0xb9),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x5ae00d,...headers},'signal':_0x13b758['signal']});if(!_0x4c9d3d['ok']){const _0x2ef289=await decodeResponseBody(_0x4c9d3d),_0x3483b1=_0x2ef289[_0x4f6d5e(0xea)]&&typeof _0x2ef289[_0x4f6d5e(0xea)]===_0x4f6d5e(0xe8)?_0x2ef289[_0x4f6d5e(0xea)]:{},_0x5af3bf=firstString(_0x3483b1[_0x4f6d5e(0x129)],_0x3483b1[_0x4f6d5e(0x13d)],_0x3483b1['msg'],_0x3483b1[_0x4f6d5e(0x134)],_0x2ef289[_0x4f6d5e(0xef)]);throwIfRateLimited(_0x4c9d3d,_0x2ef289['data'],_0x5af3bf);throw CliErrors[_0x4f6d5e(0xc8)](_0x5af3bf||'SkillHub\x20API\x20error:\x20'+_0x4c9d3d[_0x4f6d5e(0x14f)],'Download\x20failed:\x20'+_0x14cdd5['toString']());}return Buffer['from'](await _0x4c9d3d['arrayBuffer']());}catch(_0x1a9194){if(_0x1a9194 instanceof Error&&_0x1a9194[_0x4f6d5e(0x11e)]===_0x4f6d5e(0x10d))throw CliErrors[_0x4f6d5e(0xc8)](_0x4f6d5e(0x14a)+_0x14cdd5[_0x4f6d5e(0xc0)]());throw _0x1a9194;}finally{clearTimeout(_0xa3559d);}}export async function getBffEndpointContract(_0x5b5d8c,_0x4a6b69){const _0x39a13b=a76_0x348a;if(_0x4a6b69==='functions')throw CliErrors[_0x39a13b(0x124)](_0x39a13b(0xed)+_0x5b5d8c+',\x20name='+_0x4a6b69);const _0x1f81c2=await apiRequest(_0x39a13b(0x116)+encodeURIComponent(_0x5b5d8c)+'/'+encodeURIComponent(_0x4a6b69)),_0x17c2ab=_0x1f81c2[_0x39a13b(0xea)];if(!_0x17c2ab||typeof _0x17c2ab!==_0x39a13b(0xe8)||Array[_0x39a13b(0x110)](_0x17c2ab)||_0x17c2ab[_0x39a13b(0x140)]!==_0x5b5d8c||_0x17c2ab[_0x39a13b(0x144)]!==_0x4a6b69)throw CliErrors[_0x39a13b(0x124)]('BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode='+_0x5b5d8c+_0x39a13b(0x149)+_0x4a6b69);return{'appCode':_0x17c2ab[_0x39a13b(0x140)],'functionName':_0x17c2ab[_0x39a13b(0x144)],'description':_0x17c2ab[_0x39a13b(0xbf)],'version':_0x17c2ab[_0x39a13b(0x113)],'gmtModified':_0x17c2ab[_0x39a13b(0x14d)]};}export async function getSqlQueryInfo(_0x1ac951,_0x515cb8){const _0x4934d8=a76_0x348a,_0x4f889b=await apiRequest(_0x4934d8(0xba),{'method':'POST','body':{'appCode':_0x1ac951,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x515cb8}}),_0x68dc8=_0x4f889b[_0x4934d8(0xea)],_0x1032b6=_0x68dc8&&typeof _0x68dc8===_0x4934d8(0xe8)&&_0x4934d8(0x11a)in _0x68dc8?_0x68dc8[_0x4934d8(0x11a)]?.[0x0]:_0x68dc8&&typeof _0x68dc8===_0x4934d8(0xe8)&&'sqlCode'in _0x68dc8?_0x68dc8:undefined;if(!_0x1032b6)throw CliErrors[_0x4934d8(0x124)](_0x4934d8(0x120)+_0x515cb8);return _0x1032b6;}function isRemoteAppItem(_0x16cf66){const _0xcf7fcf=a76_0x348a;return!!_0x16cf66&&typeof _0x16cf66===_0xcf7fcf(0xe8)&&typeof _0x16cf66[_0xcf7fcf(0x140)]===_0xcf7fcf(0xd8)&&typeof _0x16cf66[_0xcf7fcf(0xe7)]===_0xcf7fcf(0xd8);}function extractRemoteAppItems(_0x2d5598){const _0x287582=a76_0x348a;if(Array[_0x287582(0x110)](_0x2d5598))return _0x2d5598['filter'](isRemoteAppItem);if(!_0x2d5598||typeof _0x2d5598!==_0x287582(0xe8))throw CliErrors[_0x287582(0xc8)](_0x287582(0xe9));const _0x358307=_0x2d5598;if(Array[_0x287582(0x110)](_0x358307[_0x287582(0x11a)]))return _0x358307[_0x287582(0x11a)][_0x287582(0x13c)](isRemoteAppItem);if(_0x358307['data']&&typeof _0x358307[_0x287582(0xea)]===_0x287582(0xe8)){const _0x281e2f=_0x358307[_0x287582(0xea)];if(Array['isArray'](_0x281e2f[_0x287582(0x11a)]))return _0x281e2f[_0x287582(0x11a)][_0x287582(0x13c)](isRemoteAppItem);}throw CliErrors[_0x287582(0xc8)](_0x287582(0x12a));}export async function getMyApps(){const _0x48533b=a76_0x348a,_0x3975e8=await apiRequest(_0x48533b(0xd7));return extractRemoteAppItems(_0x3975e8[_0x48533b(0xea)]);}export async function getLoginUserInfo(){const _0x575bdd=a76_0x348a,_0x437100=await apiRequest(_0x575bdd(0x126));if(!_0x437100['data']||typeof _0x437100['data']!=='object'||Array[_0x575bdd(0x110)](_0x437100[_0x575bdd(0xea)]))throw CliErrors[_0x575bdd(0xc8)]('Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.');return _0x437100[_0x575bdd(0xea)];}function runtimeSchedulePath(_0x3de173,_0x1b57a1=''){const _0x2a0b5e=a76_0x348a;return'/api/harness/apps/'+encodeURIComponent(_0x3de173)+_0x2a0b5e(0xc5)+_0x1b57a1;}export async function validateRuntimeSchedule(_0x1b1a08,_0x1ae5e1){const _0x54700a=a76_0x348a,_0x46377b=await apiRequest(runtimeSchedulePath(_0x1b1a08,_0x54700a(0xf4)),{'method':'POST','body':_0x1ae5e1});return _0x46377b['data'];}export async function createRuntimeSchedule(_0x8f60f0,_0x99a3c3){const _0x6e4434=a76_0x348a,_0x2f522c=await apiRequest(runtimeSchedulePath(_0x8f60f0),{'method':_0x6e4434(0x123),'body':_0x99a3c3});return _0x2f522c['data'];}export async function listRuntimeSchedules(_0x556617,_0x251345={}){const _0x26bde4=a76_0x348a,_0x33d762=new URLSearchParams();if(_0x251345[_0x26bde4(0x12e)]!==undefined)_0x33d762[_0x26bde4(0x105)](_0x26bde4(0x12e),String(_0x251345[_0x26bde4(0x12e)]));if(_0x251345[_0x26bde4(0x100)])_0x33d762[_0x26bde4(0x105)](_0x26bde4(0x100),_0x251345[_0x26bde4(0x100)]);const _0x25c55d=_0x33d762[_0x26bde4(0x13f)]>0x0?'?'+_0x33d762[_0x26bde4(0xc0)]():'',_0x2c26c2=await apiRequest(''+runtimeSchedulePath(_0x556617)+_0x25c55d);return _0x2c26c2['data'];}export async function getRuntimeSchedule(_0x1bfea1,_0x503df9){const _0x1440c8=a76_0x348a,_0xba976f=await apiRequest(runtimeSchedulePath(_0x1bfea1,'/'+encodeURIComponent(_0x503df9)));return _0xba976f[_0x1440c8(0xea)];}export async function deleteRuntimeSchedule(_0x51aa55,_0x2772bc){const _0x3d6ead=a76_0x348a,_0x4d4d8b=await apiRequest(runtimeSchedulePath(_0x51aa55,'/'+encodeURIComponent(_0x2772bc)),{'method':'DELETE'});return _0x4d4d8b[_0x3d6ead(0xea)];}export async function runRuntimeSchedule(_0x29ff6b,_0x594ae5){const _0x32f233=a76_0x348a,_0x26e8d7=await apiRequest(runtimeSchedulePath(_0x29ff6b,'/'+encodeURIComponent(_0x594ae5)+_0x32f233(0xb6)),{'method':_0x32f233(0x123)});return _0x26e8d7[_0x32f233(0xea)];}export async function listDatasets(_0xc89535,_0x48a978){const _0x4c45c9=a76_0x348a,_0x3854c8=await apiRequest(_0x4c45c9(0xf5),{'method':_0x4c45c9(0x123),'body':{'appCode':_0xc89535,..._0x48a978?.[_0x4c45c9(0x133)]&&{'code':_0x48a978['code']},..._0x48a978?.[_0x4c45c9(0x11e)]&&{'name':_0x48a978[_0x4c45c9(0x11e)]}}});return extractList(_0x3854c8[_0x4c45c9(0xea)]);}export async function getDatasetDetail(_0x1a0e1e){const _0x3b79bc=a76_0x348a,_0x324c76=await apiRequest(_0x3b79bc(0x10c)+encodeURIComponent(_0x1a0e1e));return _0x324c76[_0x3b79bc(0xea)];}export async function getDatasetSdkUsageDoc(_0x428edc,_0x22e08f){const _0x17a54a=a76_0x348a,_0x1240fd=await toolboxRequest('api-doc-generator',{'datasetCode':_0x428edc,'appCode':_0x22e08f});return typeof _0x1240fd?.[_0x17a54a(0xfa)]===_0x17a54a(0xd8)?_0x1240fd[_0x17a54a(0xfa)]:'';}export async function uploadRuntimeFile(_0x45f202,_0x22740d){const _0x17a372=a76_0x348a,_0x4c8ba7=await readFile(_0x22740d),_0x3b848b=new FormData();_0x3b848b[_0x17a372(0x13b)]('appCode',_0x45f202),_0x3b848b[_0x17a372(0x13b)]('file',new Blob([new Uint8Array(_0x4c8ba7)]),basename(_0x22740d));const _0x1b7a20=await apiFormRequest(_0x17a372(0x11f),_0x3b848b);return _0x1b7a20[_0x17a372(0xea)];}export async function queryRuntimeFileUrl(_0x271978,_0x16a838={}){const _0x534a1c=a76_0x348a,_0x3bac6d=await apiRequest(_0x534a1c(0xdb),{'method':'POST','body':{'filePath':_0x271978,'downloadFlag':_0x16a838[_0x534a1c(0x14c)]??![],..._0x16a838[_0x534a1c(0xf6)]?{'longTerm':!![]}:{}}});return _0x3bac6d[_0x534a1c(0xea)];}export async function recognizeRuntimeOcr(_0x38e077,_0x734268){const _0x8bf6d6=a76_0x348a,_0x584d0c=await apiRequest(_0x8bf6d6(0xff),{'method':_0x8bf6d6(0x123),'body':{'appCode':_0x38e077,'url':_0x734268[_0x8bf6d6(0x146)],'type':_0x734268[_0x8bf6d6(0xf7)]}});return _0x584d0c[_0x8bf6d6(0xea)];}export async function getRuntimeAppConfigByKey(_0x2ccbd4,_0x2a1bb0){const _0x16e522=a76_0x348a,_0x5d1b63=new URLSearchParams({'appCode':_0x2ccbd4,'key':_0x2a1bb0}),_0x3759fc=await apiRequest('/client/app-config/getByKey?'+_0x5d1b63[_0x16e522(0xc0)]());if(typeof _0x3759fc[_0x16e522(0xea)]!==_0x16e522(0xd8))throw CliErrors[_0x16e522(0x124)](_0x16e522(0x111)+_0x2a1bb0);return _0x3759fc[_0x16e522(0xea)];}export async function listRuntimeArtifacts(_0x4ff1ec,_0xd11178){const _0xc539f6=a76_0x348a,_0x4cad2d=new URLSearchParams({'appCode':_0x4ff1ec});if(_0xd11178?.[_0xc539f6(0x10f)])_0x4cad2d[_0xc539f6(0x105)]('artifactType',_0xd11178['artifactType']);if(_0xd11178?.['source'])_0x4cad2d[_0xc539f6(0x105)](_0xc539f6(0x132),_0xd11178[_0xc539f6(0x132)]);if(_0xd11178?.[_0xc539f6(0xce)]!==undefined)_0x4cad2d['set'](_0xc539f6(0xce),String(_0xd11178['favorite']));const _0x20f9e0=await apiRequest(_0xc539f6(0x10e)+_0x4cad2d[_0xc539f6(0xc0)]());return Array['isArray'](_0x20f9e0[_0xc539f6(0xea)])?_0x20f9e0[_0xc539f6(0xea)]:[];}export async function getRuntimeArtifact(_0x2e020b,_0x1f1670){const _0x3e939d=a76_0x348a,_0x300610=await apiRequest(_0x3e939d(0xde)+_0x2e020b+_0x3e939d(0x145)+encodeURIComponent(_0x1f1670));if(!_0x300610['data'])throw CliErrors['validation'](_0x3e939d(0x12b)+_0x2e020b);return _0x300610['data'];}export async function createRuntimeArtifact(_0x11ae8c,_0x2cb669){const _0x546758=a76_0x348a,_0x4ad341=await apiRequest('/client/artifact/create',{'method':'POST','body':{'appCode':_0x11ae8c,..._0x2cb669}});return _0x4ad341[_0x546758(0xea)];}export async function updateRuntimeArtifact(_0x5cb3a9,_0xd95cd9,_0x499bad){const _0x2ffb7f=a76_0x348a,_0xe4499=await apiRequest(_0x2ffb7f(0xde)+_0x5cb3a9+_0x2ffb7f(0xe2),{'method':'POST','body':{'appCode':_0xd95cd9,..._0x499bad}});return _0xe4499[_0x2ffb7f(0xea)];}export async function listPersonalBffs(_0x2cd13e){const _0x580096=a76_0x348a,_0x58408b=await apiRequest(_0x580096(0x104)+encodeURIComponent(_0x2cd13e));return Array[_0x580096(0x110)](_0x58408b[_0x580096(0xea)])?_0x58408b[_0x580096(0xea)]:[];}export async function getPersonalBff(_0x59edce,_0x17e909){const _0x1b85b9=a76_0x348a,_0x4e543a=await apiRequest(_0x1b85b9(0x130)+_0x59edce+_0x1b85b9(0x145)+encodeURIComponent(_0x17e909));if(!_0x4e543a[_0x1b85b9(0xea)])throw CliErrors[_0x1b85b9(0x124)](_0x1b85b9(0xc3)+_0x59edce);return _0x4e543a['data'];}export async function createPersonalBff(_0x2725d1,_0x12dabf){const _0x4791fd=a76_0x348a,_0xc29333=await apiRequest(_0x4791fd(0xcd),{'method':'POST','body':{'appCode':_0x2725d1,..._0x12dabf}});return _0xc29333[_0x4791fd(0xea)];}export async function updatePersonalBff(_0x463cf2,_0x35dfdd,_0x411fc5){const _0x58a638=a76_0x348a,_0x17a05a=await apiRequest(_0x58a638(0x130)+_0x463cf2+_0x58a638(0xe2),{'method':_0x58a638(0x123),'body':{'appCode':_0x35dfdd,..._0x411fc5}});return _0x17a05a[_0x58a638(0xea)];}export async function executePersonalBff(_0x54ba65,_0x1dfd76,_0x1f4180){const _0x495743=a76_0x348a,_0x40073a=await apiRequest(_0x495743(0x130)+_0x54ba65+_0x495743(0x119)+encodeURIComponent(_0x1dfd76),{'method':_0x495743(0x123),'body':_0x1f4180});return _0x40073a['data'];}export async function listPersonalKnowledgeBaseItems(_0x445a77){const _0x149c8a=a76_0x348a,_0x837a51=await apiRequest('/client/knowledge-base/personal/list?appCode='+encodeURIComponent(_0x445a77));return Array[_0x149c8a(0x110)](_0x837a51[_0x149c8a(0xea)])?_0x837a51['data']:[];}export async function getPersonalKnowledgeBaseItem(_0x34c7cb,_0x51f589){const _0x489c46=a76_0x348a,_0xaaf16=await apiRequest('/client/knowledge-base/personal/'+_0x34c7cb+'?appCode='+encodeURIComponent(_0x51f589));if(!_0xaaf16['data'])throw CliErrors[_0x489c46(0x124)](_0x489c46(0xe1)+_0x34c7cb);return _0xaaf16['data'];}export async function createPersonalKnowledgeBaseItem(_0x24a505,_0x42fe71){const _0x15aab6=a76_0x348a,_0xa1d67a=await apiRequest(_0x15aab6(0x114),{'method':_0x15aab6(0x123),'body':{'appCode':_0x24a505,..._0x42fe71}});return _0xa1d67a[_0x15aab6(0xea)];}export async function updatePersonalKnowledgeBaseItem(_0x37aa51,_0x41c9a5,_0x14153e){const _0x5a8d9d=a76_0x348a,_0x305e9d=await apiRequest(_0x5a8d9d(0x109)+_0x37aa51+_0x5a8d9d(0xe2),{'method':_0x5a8d9d(0x123),'body':{'appCode':_0x41c9a5,..._0x14153e}});return _0x305e9d['data'];}export async function searchKnowledgeBase(_0xd1351c,_0x842e48){const _0x112a90=a76_0x348a,_0x108aaa=await apiRequest('/client/knowledge-base/search',{'method':_0x112a90(0x123),'body':{'appCode':_0xd1351c,'query':_0x842e48[_0x112a90(0xe4)],..._0x842e48[_0x112a90(0xb7)]!==undefined?{'topK':_0x842e48['topK']}:{}}});return Array['isArray'](_0x108aaa['data'])?_0x108aaa[_0x112a90(0xea)]:[];}export async function getRuntimeSkillByCode(_0x3a1f82,_0x376894){const _0x17b8e4=a76_0x348a,_0x1ee45e=await skillHubJsonRequest(_0x17b8e4(0x117)+encodeURIComponent(_0x3a1f82)+'/'+encodeURIComponent(_0x376894),{'allowNotFound':!![]});return _0x1ee45e?skillHubRuntimeDetailToRuntimeSkill(_0x1ee45e):undefined;}export async function listRuntimeSkills(_0x18fa91){const _0x541833=a76_0x348a,_0x25ac76=await skillHubJsonRequest(_0x541833(0x107)+encodeURIComponent(_0x18fa91[_0x541833(0x140)])+'/skills',{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x18fa91['appCode'],_0x25ac76,_0x18fa91[_0x541833(0x147)]??'all',_0x18fa91[_0x541833(0x133)]);}export async function listPersonalRuntimeSkills(_0x221d52){const _0x1759da=a76_0x348a;return(await listRuntimeSkills({'appCode':_0x221d52,'scope':_0x1759da(0xe5)}))[_0x1759da(0xe5)];}export async function listCompanyRuntimeSkills(_0x2afa31){const _0x4ddc7e=a76_0x348a;return(await listRuntimeSkills({'appCode':_0x2afa31,'scope':_0x4ddc7e(0x108)}))[_0x4ddc7e(0x108)];}export async function listVisibleRuntimeSkills(_0x10e74d){const _0x452c08=a76_0x348a;return(await listRuntimeSkills({'appCode':_0x10e74d,'scope':_0x452c08(0xc7)}))['effective'];}export async function createPersonalRuntimeSkill(_0xc9026d,_0x2a4f21,_0x23d2fa={}){const _0x37f570=a76_0x348a;return publishRuntimeSkill(_0xc9026d,_0x2a4f21,{'visibility':_0x37f570(0xd0),'confirmWarnings':_0x23d2fa[_0x37f570(0x11d)]});}export async function updatePersonalRuntimeSkill(_0x2c186e,_0xd958a2,_0x4d6ec4,_0x2fb8e2={}){const _0x2cffb7=a76_0x348a;return publishRuntimeSkill(_0xd958a2,{..._0x4d6ec4,'skillCode':_0x4d6ec4['skillCode']??_0x2c186e},{'visibility':_0x2cffb7(0xd0),'confirmWarnings':_0x2fb8e2[_0x2cffb7(0x11d)]});}export async function publishCompanyRuntimeSkill(_0x1d88f7,_0x173a38,_0x7b5eb9={}){const _0x5507af=a76_0x348a;return publishRuntimeSkill(_0x1d88f7,_0x173a38,{'visibility':_0x5507af(0xbe),'confirmWarnings':_0x7b5eb9['confirmWarnings']});}export async function validateRuntimeSkillPublish(_0x6ad483,_0x313ccc,_0x27d9c6){const _0x270886=a76_0x348a,_0x105d73=buildRuntimeSkillPublishForm(_0x313ccc,_0x27d9c6[_0x270886(0xe6)]),_0x14b663=await skillHubJsonRequest(_0x270886(0x148)+encodeURIComponent(_0x6ad483)+'/publish/validate',{'method':_0x270886(0x123),'body':_0x105d73});return{'valid':_0x14b663[_0x270886(0xe3)]===!![],'errors':Array[_0x270886(0x110)](_0x14b663[_0x270886(0x121)])?_0x14b663['errors']:[],'warnings':Array[_0x270886(0x110)](_0x14b663[_0x270886(0xc4)])?_0x14b663['warnings']:[],'resolvedSlug':_0x14b663[_0x270886(0xd9)],'resolvedVersion':_0x14b663[_0x270886(0x12c)]};}export async function downloadRuntimeSkillPackage(_0x5f5573,_0x241e96,_0x3ed19c,_0x284a79){const _0x2c95ee=a76_0x348a;void _0x5f5573;const _0x44f6fa=_0x284a79?_0x2c95ee(0x148)+encodeURIComponent(_0x3ed19c)+'/'+encodeURIComponent(_0x241e96)+_0x2c95ee(0xd3)+encodeURIComponent(_0x284a79)+'/download':'/api/cli/v1/skills/'+encodeURIComponent(_0x3ed19c)+'/'+encodeURIComponent(_0x241e96)+_0x2c95ee(0xf9);return skillHubBinaryRequest(_0x44f6fa);}async function publishRuntimeSkill(_0x318463,_0x5e9f48,_0x15a785){const _0x1a023b=a76_0x348a,_0x50b635=buildRuntimeSkillPublishForm(_0x5e9f48,_0x15a785[_0x1a023b(0xe6)]),_0x454fc2=await skillHubJsonRequest(_0x1a023b(0x148)+encodeURIComponent(_0x318463)+_0x1a023b(0xdc),{'method':_0x1a023b(0x123),'query':{'confirmWarnings':_0x15a785[_0x1a023b(0x11d)]===!![]?!![]:undefined},'body':_0x50b635});return{'appCode':_0x454fc2[_0x1a023b(0x13e)]??_0x318463,'skillCode':_0x454fc2[_0x1a023b(0x137)]??_0x5e9f48[_0x1a023b(0xf0)]??'','skillName':_0x5e9f48[_0x1a023b(0xc2)]??_0x454fc2[_0x1a023b(0x137)]??_0x5e9f48[_0x1a023b(0xf0)],'description':_0x5e9f48[_0x1a023b(0xbf)],'scope':skillHubVisibilityToScope(_0x454fc2[_0x1a023b(0xe6)]??_0x15a785[_0x1a023b(0xe6)])??_0x1a023b(0xe5),'version':_0x454fc2['version']??_0x5e9f48[_0x1a023b(0x113)],'tags':_0x5e9f48[_0x1a023b(0xda)],'content':_0x5e9f48[_0x1a023b(0xdf)]};}function buildRuntimeSkillPublishForm(_0x453c2c,_0x2512d9){const _0x4f7d93=a76_0x348a,_0x50ab86=new FormData();return _0x50ab86[_0x4f7d93(0x105)](_0x4f7d93(0xd1),runtimeSkillPackageFile(_0x453c2c)),_0x453c2c[_0x4f7d93(0xc2)]?.[_0x4f7d93(0xd4)]()&&_0x50ab86['set'](_0x4f7d93(0x11c),_0x453c2c[_0x4f7d93(0xc2)][_0x4f7d93(0xd4)]()),_0x50ab86[_0x4f7d93(0x105)](_0x4f7d93(0xe6),_0x2512d9),_0x50ab86;}function a76_0x348a(_0x23f2cc,_0xb3bd53){_0x23f2cc=_0x23f2cc-0xb3;const _0x1c5e11=a76_0x1c5e();let _0x348ab8=_0x1c5e11[_0x23f2cc];return _0x348ab8;}function runtimeSkillPackageFile(_0x58b117){const _0x207db5=a76_0x348a;if(!_0x58b117[_0x207db5(0xc9)])throw CliErrors[_0x207db5(0x124)]('Missing\x20Skill\x20package\x20payload.');const _0x4fb919=Buffer[_0x207db5(0x135)](_0x58b117[_0x207db5(0xc9)],_0x207db5(0x13a)),_0x18fa26=new Blob([_0x4fb919],{'type':_0x207db5(0x131)}),_0x50c7ce=(_0x58b117[_0x207db5(0xf0)]||_0x207db5(0x10a))+'.zip';if(typeof File!=='undefined')return new File([_0x18fa26],_0x50c7ce,{'type':_0x207db5(0x131)});return _0x18fa26;}function normalizeSkillHubRuntimeListResponse(_0x4e9168,_0x5b8196,_0x31b135,_0x31f7a1){const _0xf20d33=a76_0x348a,_0x5769d1=Array[_0xf20d33(0x110)](_0x5b8196)?_0x5b8196:Array[_0xf20d33(0x110)](_0x5b8196?.[_0xf20d33(0x139)])?_0x5b8196[_0xf20d33(0x139)]:[],_0x427192=_0x31f7a1?.['trim'](),_0x32dd05=_0x5769d1[_0xf20d33(0x13c)](_0x2229ee=>!_0x427192||_0x2229ee[_0xf20d33(0x137)]===_0x427192)['map'](skillHubRuntimeItemToRuntimeSkill)[_0xf20d33(0x13c)](_0x1336fb=>Boolean(_0x1336fb)),_0x53b4e0=_0x32dd05[_0xf20d33(0x13c)](_0x39bb32=>_0x39bb32[_0xf20d33(0x147)]==='personal'),_0x2da9b1=_0x32dd05['filter'](_0x25bfe4=>_0x25bfe4[_0xf20d33(0x147)]===_0xf20d33(0x108));return{'appCode':_0x4e9168,'personal':_0x31b135===_0xf20d33(0x108)?[]:_0x53b4e0,'company':_0x31b135===_0xf20d33(0xe5)?[]:_0x2da9b1,'effective':buildEffectiveRuntimeSkills(_0x53b4e0,_0x2da9b1,_0x31b135)};}function skillHubRuntimeItemToRuntimeSkill(_0x181374){const _0x17dce6=a76_0x348a,_0x597f5d=_0x181374[_0x17dce6(0x137)]?.['trim'](),_0x4ede1e=skillHubVisibilityToScope(_0x181374['visibility']);if(!_0x597f5d||!_0x4ede1e)return undefined;return{'id':_0x181374['id'],'appCode':_0x181374[_0x17dce6(0x13e)],'skillCode':_0x597f5d,'skillName':_0x181374[_0x17dce6(0x11c)]??_0x597f5d,'description':_0x181374[_0x17dce6(0xdd)],'scope':_0x4ede1e,'version':skillHubRuntimeItemVersion(_0x181374),'status':_0x181374[_0x17dce6(0x14f)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x2f6235){const _0x404ca8=a76_0x348a,_0x44dd0a=_0x2f6235[_0x404ca8(0x137)]?.['trim']();if(!_0x44dd0a)return undefined;return{'id':_0x2f6235['id'],'appCode':_0x2f6235[_0x404ca8(0x13e)],'skillCode':_0x44dd0a,'skillName':_0x2f6235[_0x404ca8(0x11c)]??_0x44dd0a,'description':_0x2f6235[_0x404ca8(0xdd)],'example':_0x2f6235[_0x404ca8(0xbb)],'scope':skillHubVisibilityToScope(_0x2f6235[_0x404ca8(0xe6)])??_0x2f6235[_0x404ca8(0xe6)]?.['toLowerCase'](),'version':skillHubRuntimeItemVersion(_0x2f6235),'status':_0x2f6235[_0x404ca8(0x14f)]};}function skillHubVisibilityToScope(_0x3d61af){const _0x18c131=a76_0x348a;if(_0x3d61af==='PRIVATE')return _0x18c131(0xe5);if(_0x3d61af==='NAMESPACE_ONLY')return'company';return undefined;}function skillHubRuntimeItemVersion(_0x53923d){const _0x4f82d0=a76_0x348a;return _0x53923d['publishedVersion']?.['version']??_0x53923d['headlineVersion']?.['version']??_0x53923d[_0x4f82d0(0xee)]?.[_0x4f82d0(0x113)];}function buildEffectiveRuntimeSkills(_0x3478ff,_0x5d42cc,_0x5c1051){const _0x59a8fd=a76_0x348a;if(_0x5c1051===_0x59a8fd(0xe5))return _0x3478ff;if(_0x5c1051===_0x59a8fd(0x108))return _0x5d42cc;const _0x564678=new Map();for(const _0x5d0cf0 of _0x5d42cc){_0x564678[_0x59a8fd(0x105)](_0x5d0cf0[_0x59a8fd(0xf0)],_0x5d0cf0);}for(const _0x1e63a7 of _0x3478ff){_0x564678[_0x59a8fd(0x105)](_0x1e63a7[_0x59a8fd(0xf0)],_0x1e63a7);}return Array['from'](_0x564678[_0x59a8fd(0xf1)]());}function normalizeRuntimeSkillListResponse(_0x48a737,_0x20aac1){const _0x2f4485=a76_0x348a;if(Array[_0x2f4485(0x110)](_0x20aac1)){const _0xed7b18=_0x20aac1[_0x2f4485(0x13c)](_0x210a4d=>_0x210a4d[_0x2f4485(0x147)]===_0x2f4485(0xe5)),_0x56fe78=_0x20aac1[_0x2f4485(0x13c)](_0xa61f2=>_0xa61f2[_0x2f4485(0x147)]==='company');return{'appCode':_0x48a737,'personal':_0xed7b18,'company':_0x56fe78,'effective':[..._0x56fe78,..._0xed7b18]};}return{'appCode':_0x20aac1?.[_0x2f4485(0x140)]??_0x48a737,'personal':Array[_0x2f4485(0x110)](_0x20aac1?.[_0x2f4485(0xe5)])?_0x20aac1['personal']:[],'company':Array[_0x2f4485(0x110)](_0x20aac1?.[_0x2f4485(0x108)])?_0x20aac1[_0x2f4485(0x108)]:[],'effective':Array[_0x2f4485(0x110)](_0x20aac1?.['effective'])?_0x20aac1[_0x2f4485(0xec)]:[]};}
|
|
1
|
+
(function(_0x43ec74,_0x3df368){const _0x34ae0a=a76_0x4f0d,_0x1a791a=_0x43ec74();while(!![]){try{const _0x241afe=parseInt(_0x34ae0a(0xfd))/0x1*(parseInt(_0x34ae0a(0x127))/0x2)+parseInt(_0x34ae0a(0x152))/0x3*(parseInt(_0x34ae0a(0xdc))/0x4)+parseInt(_0x34ae0a(0xe0))/0x5*(-parseInt(_0x34ae0a(0x13a))/0x6)+parseInt(_0x34ae0a(0x14b))/0x7*(parseInt(_0x34ae0a(0x136))/0x8)+-parseInt(_0x34ae0a(0x165))/0x9*(parseInt(_0x34ae0a(0x132))/0xa)+parseInt(_0x34ae0a(0xf4))/0xb+-parseInt(_0x34ae0a(0x159))/0xc;if(_0x241afe===_0x3df368)break;else _0x1a791a['push'](_0x1a791a['shift']());}catch(_0xcffde0){_0x1a791a['push'](_0x1a791a['shift']());}}}(a76_0xd2fa,0xe4aa8));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{createRateLimitError,readRetryAfter,readRetryAfterSeconds}from'../framework/rate-limit.js';import{extractList}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x205d4b){_activeAK=_0x205d4b||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0x5eed21){const _0x109870=a76_0x4f0d;for(const _0x4473cc of _0x5eed21){if(typeof _0x4473cc===_0x109870(0xe4)&&_0x4473cc[_0x109870(0xf9)]())return _0x4473cc[_0x109870(0xf9)]();}return undefined;}async function decodeResponseBody(_0x204521){const _0x37a7c7=a76_0x4f0d;if(typeof _0x204521[_0x37a7c7(0x12a)]==='function')try{const _0x19f2d1=await _0x204521[_0x37a7c7(0x12a)]();try{return{'isJson':!![],'data':parseLosslessJson(_0x19f2d1),'text':_0x19f2d1};}catch{return{'isJson':![],'text':_0x19f2d1[_0x37a7c7(0xf9)]()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x204521[_0x37a7c7(0xf5)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x4a1b36,_0x112df6,_0x53e1b1){const _0x12bac6=a76_0x4f0d,_0x26d5bf=_0x112df6&&typeof _0x112df6===_0x12bac6(0xf6)?_0x112df6:{},_0x32714b=[_0x26d5bf[_0x12bac6(0x15b)],_0x26d5bf[_0x12bac6(0x11c)]][_0x12bac6(0x124)](_0x455698=>Number(_0x455698)===0x1ad),_0x38c789=createRateLimitError({'status':_0x4a1b36[_0x12bac6(0x15b)]===0x1ad?_0x4a1b36['status']:_0x32714b??_0x4a1b36[_0x12bac6(0x15b)],'errorCode':firstString(_0x26d5bf[_0x12bac6(0x15c)],typeof _0x26d5bf[_0x12bac6(0x11c)]===_0x12bac6(0xe4)?_0x26d5bf[_0x12bac6(0x11c)]:undefined),'message':firstString(_0x26d5bf[_0x12bac6(0x123)],_0x26d5bf[_0x12bac6(0x161)],_0x26d5bf[_0x12bac6(0x14c)],_0x53e1b1),'retryAfter':readRetryAfter(_0x4a1b36[_0x12bac6(0xed)])??readRetryAfterSeconds(_0x112df6)});if(_0x38c789)throw _0x38c789;}async function apiRequest(_0x6473a1,_0x295430={}){const _0x1f8f42=a76_0x4f0d,{method:method=_0x1f8f42(0xf7),body:_0x722200,headers:headers={},timeout:timeout=0x7530}=_0x295430,_0x2ee5c2=_activeAK,_0x3a6f44=getRuntimeDomain();if(!_0x2ee5c2)throw CliErrors[_0x1f8f42(0x14f)](_0x1f8f42(0x16c)+PRODUCT_CONFIG[_0x1f8f42(0x154)]+'.');const _0x45eac3=''+_0x3a6f44+_0x6473a1,_0xa0cc91={'X-User-AK':_0x2ee5c2},_0x4db0ae=new AbortController(),_0x5598f6=setTimeout(()=>_0x4db0ae[_0x1f8f42(0x158)](),timeout);try{const _0x2082c6=await fetch(_0x45eac3,{'method':method,'headers':{'Content-Type':_0x1f8f42(0x142),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],..._0xa0cc91,...headers},'body':_0x722200?JSON[_0x1f8f42(0xfc)](_0x722200):undefined,'signal':_0x4db0ae[_0x1f8f42(0x113)]}),_0x1f65fb=await decodeResponseBody(_0x2082c6);if(!_0x1f65fb['isJson']){throwIfRateLimited(_0x2082c6,undefined,_0x1f65fb[_0x1f8f42(0x12a)]);throw CliErrors[_0x1f8f42(0x103)](_0x1f8f42(0x101)+_0x2082c6[_0x1f8f42(0x15b)]+')',_0x2082c6[_0x1f8f42(0x15b)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x2958cd=_0x1f65fb[_0x1f8f42(0x133)];throwIfRateLimited(_0x2082c6,_0x2958cd);if(!_0x2082c6['ok']||_0x2958cd[_0x1f8f42(0xe5)]===![])throw CliErrors[_0x1f8f42(0x103)](_0x2958cd['errorMsg']||_0x2958cd['message']||_0x1f8f42(0x14a)+_0x2082c6[_0x1f8f42(0x15b)],_0x2958cd[_0x1f8f42(0x15c)]?_0x1f8f42(0x134)+_0x2958cd[_0x1f8f42(0x15c)]:undefined);return _0x2958cd;}catch(_0x3e619b){if(_0x3e619b instanceof Error&&_0x3e619b[_0x1f8f42(0xec)]===_0x1f8f42(0x138))throw CliErrors[_0x1f8f42(0x103)](_0x1f8f42(0xdb)+_0x45eac3);throw _0x3e619b;}finally{clearTimeout(_0x5598f6);}}async function apiBinaryRequest(_0x977321,_0x33916b={}){const _0x41d676=a76_0x4f0d,{method:method=_0x41d676(0xf7),headers:headers={},timeout:timeout=0x7530}=_0x33916b,_0x38f02f=_activeAK,_0x102f29=getRuntimeDomain();if(!_0x38f02f)throw CliErrors[_0x41d676(0x14f)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x41d676(0x154)]+'.');const _0x3a6d72=''+_0x102f29+_0x977321,_0x4abfcd=new AbortController(),_0x344561=setTimeout(()=>_0x4abfcd[_0x41d676(0x158)](),timeout);try{const _0xef9681=await fetch(_0x3a6d72,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x41d676(0x12f)],'X-User-AK':_0x38f02f,...headers},'signal':_0x4abfcd[_0x41d676(0x113)]});if(!_0xef9681['ok']){const _0x3ee6da=await decodeResponseBody(_0xef9681),_0x23de69=_0x3ee6da[_0x41d676(0x133)]&&typeof _0x3ee6da[_0x41d676(0x133)]===_0x41d676(0xf6)?_0x3ee6da[_0x41d676(0x133)]:{},_0x23be6c=firstString(_0x23de69[_0x41d676(0x123)],_0x23de69['message'],_0x23de69[_0x41d676(0x15c)],_0x3ee6da[_0x41d676(0x12a)]);throwIfRateLimited(_0xef9681,_0x3ee6da['data'],_0x23be6c);throw CliErrors[_0x41d676(0x103)](_0x23be6c||_0x41d676(0x14a)+_0xef9681[_0x41d676(0x15b)],_0x41d676(0x16e)+_0x3a6d72);}return Buffer['from'](await _0xef9681[_0x41d676(0x12e)]());}catch(_0x514ea3){if(_0x514ea3 instanceof Error&&_0x514ea3['name']===_0x41d676(0x138))throw CliErrors[_0x41d676(0x103)]('Request\x20timeout:\x20'+_0x3a6d72);throw _0x514ea3;}finally{clearTimeout(_0x344561);}}async function apiFormRequest(_0xc7c85e,_0x532683,_0x50d2e6={}){const _0x43ad56=a76_0x4f0d,{timeout:timeout=0x7530}=_0x50d2e6,_0x269375=_activeAK,_0x4ad876=getRuntimeDomain();if(!_0x269375)throw CliErrors[_0x43ad56(0x14f)](_0x43ad56(0x16c)+PRODUCT_CONFIG[_0x43ad56(0x154)]+'.');const _0x3f942a=''+_0x4ad876+_0xc7c85e,_0x3047c4=new AbortController(),_0x1c1eef=setTimeout(()=>_0x3047c4['abort'](),timeout);try{const _0x156db4=await fetch(_0x3f942a,{'method':_0x43ad56(0x131),'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x43ad56(0x12f)],'X-User-AK':_0x269375},'body':_0x532683,'signal':_0x3047c4[_0x43ad56(0x113)]}),_0x36440f=await decodeResponseBody(_0x156db4);if(!_0x36440f[_0x43ad56(0x15f)]){throwIfRateLimited(_0x156db4,undefined,_0x36440f[_0x43ad56(0x12a)]);throw CliErrors[_0x43ad56(0x103)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x156db4[_0x43ad56(0x15b)]+')',_0x156db4[_0x43ad56(0x15b)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x507a4c=_0x36440f[_0x43ad56(0x133)];throwIfRateLimited(_0x156db4,_0x507a4c);if(!_0x156db4['ok']||_0x507a4c['success']===![])throw CliErrors[_0x43ad56(0x103)](_0x507a4c[_0x43ad56(0x123)]||_0x507a4c[_0x43ad56(0x161)]||_0x43ad56(0x14a)+_0x156db4[_0x43ad56(0x15b)],_0x507a4c[_0x43ad56(0x15c)]?'API\x20error\x20code:\x20'+_0x507a4c['errorCode']:undefined);return _0x507a4c;}catch(_0x8f116c){if(_0x8f116c instanceof Error&&_0x8f116c['name']===_0x43ad56(0x138))throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x3f942a);throw _0x8f116c;}finally{clearTimeout(_0x1c1eef);}}async function toolboxRequest(_0x2d941e,_0xd2250a,_0x765cf9={}){const _0x3d5824=a76_0x4f0d,{method:method=_0x3d5824(0xf7),headers:headers={},timeout:timeout=0x7530}=_0x765cf9,_0x1eb61d=_activeAK;if(!_0x1eb61d)throw CliErrors['authRequired'](_0x3d5824(0x16c)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x46d9c2=getApiDomain()[_0x3d5824(0xf8)](/\/$/,''),_0x5ec346=new URL(_0x2d941e,_0x46d9c2+'/api/node-toolbox/');if(_0xd2250a)for(const [_0x3ca0e7,_0xecb0a2]of Object[_0x3d5824(0x150)](_0xd2250a)){_0xecb0a2!==undefined&&_0xecb0a2!==null&&_0x5ec346[_0x3d5824(0x16a)]['set'](_0x3ca0e7,String(_0xecb0a2));}const _0xebae60=new AbortController(),_0x5fdfc2=setTimeout(()=>_0xebae60['abort'](),timeout);try{const _0x191850=await fetch(_0x5ec346,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x3d5824(0x12f)],'X-User-AK':_0x1eb61d,...headers},'signal':_0xebae60[_0x3d5824(0x113)]}),_0x492b30=await decodeResponseBody(_0x191850);if(!_0x492b30[_0x3d5824(0x15f)]){throwIfRateLimited(_0x191850,undefined,_0x492b30['text']);throw CliErrors[_0x3d5824(0x103)](_0x3d5824(0x160)+_0x191850[_0x3d5824(0x15b)]+')',_0x191850[_0x3d5824(0x15b)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x2558db=_0x492b30[_0x3d5824(0x133)];throwIfRateLimited(_0x191850,_0x2558db);if(!_0x191850['ok']){const _0x39ca12=_0x2558db&&typeof _0x2558db===_0x3d5824(0xf6)?_0x2558db:{};throw CliErrors['apiError'](_0x39ca12[_0x3d5824(0x123)]||_0x39ca12[_0x3d5824(0x161)]||_0x3d5824(0x11a)+_0x191850[_0x3d5824(0x15b)],_0x39ca12[_0x3d5824(0x15c)]?'Toolbox\x20error\x20code:\x20'+_0x39ca12[_0x3d5824(0x15c)]:undefined);}if(_0x2558db&&typeof _0x2558db===_0x3d5824(0xf6)&&_0x3d5824(0xe5)in _0x2558db&&typeof _0x2558db[_0x3d5824(0xe5)]==='boolean'){const _0x6b696f=_0x2558db;if(!_0x6b696f[_0x3d5824(0xe5)])throw CliErrors['apiError'](_0x6b696f['errorMsg']||_0x6b696f[_0x3d5824(0x161)]||_0x3d5824(0x13c),_0x6b696f[_0x3d5824(0x15c)]?_0x3d5824(0xdd)+_0x6b696f[_0x3d5824(0x15c)]:undefined);return _0x6b696f['data'];}return _0x2558db;}catch(_0x391de4){if(_0x391de4 instanceof Error&&_0x391de4[_0x3d5824(0xec)]===_0x3d5824(0x138))throw CliErrors['apiError'](_0x3d5824(0xdb)+_0x5ec346[_0x3d5824(0x156)]());throw _0x391de4;}finally{clearTimeout(_0x5fdfc2);}}async function skillHubJsonRequest(_0x5a00a8,_0x369d01={}){const _0x49aff3=a76_0x4f0d,{method:method=_0x49aff3(0xf7),query:_0x478e5b,body:_0x4e3b63,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x369d01,_0xf617b6=_activeAK;if(!_0xf617b6)throw CliErrors[_0x49aff3(0x14f)](_0x49aff3(0x16c)+PRODUCT_CONFIG[_0x49aff3(0x154)]+'.');const _0x3c2934=getSkillHubDomain()[_0x49aff3(0xf8)](/\/$/,''),_0x487d3e=new URL(_0x5a00a8,_0x3c2934+'/');if(_0x478e5b)for(const [_0x17c5df,_0x224a64]of Object['entries'](_0x478e5b)){_0x224a64!==undefined&&_0x224a64!==null&&_0x487d3e[_0x49aff3(0x16a)][_0x49aff3(0x112)](_0x17c5df,String(_0x224a64));}const _0x5c2644=new AbortController(),_0x2f5c46=setTimeout(()=>_0x5c2644['abort'](),timeout);try{const _0x1dcb87=await fetch(_0x487d3e[_0x49aff3(0x156)](),{'method':method,'headers':{'Accept':_0x49aff3(0x142),'X-Invoke-Source':PRODUCT_CONFIG[_0x49aff3(0x12f)],'X-User-AK':_0xf617b6,...headers},'body':_0x4e3b63,'signal':_0x5c2644[_0x49aff3(0x113)]}),_0x586b2b=await decodeResponseBody(_0x1dcb87);if(!_0x586b2b['isJson']){if(allowNotFound&&_0x1dcb87[_0x49aff3(0x15b)]===0x194)return undefined;throwIfRateLimited(_0x1dcb87,undefined,_0x586b2b[_0x49aff3(0x12a)]);throw CliErrors['apiError']('SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1dcb87[_0x49aff3(0x15b)]+')',_0x1dcb87[_0x49aff3(0x15b)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x3e466a=_0x586b2b[_0x49aff3(0x133)];throwIfRateLimited(_0x1dcb87,_0x3e466a);if(allowNotFound&&isSkillHubNotFoundResponse(_0x1dcb87[_0x49aff3(0x15b)],_0x3e466a))return undefined;const _0x2cc5b0=!_0x1dcb87['ok']||_0x3e466a?.[_0x49aff3(0xe5)]===![]||typeof _0x3e466a?.['code']===_0x49aff3(0x108)&&_0x3e466a[_0x49aff3(0x11c)]>=0x190;if(_0x2cc5b0)throw CliErrors[_0x49aff3(0x103)](_0x3e466a?.[_0x49aff3(0x123)]||_0x3e466a?.[_0x49aff3(0x161)]||_0x3e466a?.[_0x49aff3(0x14c)]||_0x49aff3(0x100)+_0x1dcb87[_0x49aff3(0x15b)],_0x3e466a?.[_0x49aff3(0x15c)]?_0x49aff3(0x107)+_0x3e466a[_0x49aff3(0x15c)]:undefined);return _0x3e466a?.[_0x49aff3(0x133)]??_0x3e466a;}catch(_0x48d5ea){if(_0x48d5ea instanceof Error&&_0x48d5ea[_0x49aff3(0xec)]===_0x49aff3(0x138))throw CliErrors['apiError'](_0x49aff3(0xdb)+_0x487d3e[_0x49aff3(0x156)]());throw _0x48d5ea;}finally{clearTimeout(_0x2f5c46);}}function isSkillHubNotFoundResponse(_0x409296,_0x1da861){const _0x59eb08=a76_0x4f0d;if(_0x409296===0x194||_0x1da861?.[_0x59eb08(0x11c)]===0x194)return!![];if(_0x409296!==0x190&&_0x1da861?.[_0x59eb08(0x11c)]!==0x190)return![];const _0x12c47f=[_0x1da861?.[_0x59eb08(0x14c)],_0x1da861?.[_0x59eb08(0x161)],_0x1da861?.[_0x59eb08(0x123)],_0x1da861?.[_0x59eb08(0xfb)]][_0x59eb08(0xe1)](_0x1418c9=>typeof _0x1418c9==='string')[_0x59eb08(0xfe)]('\x20');return/skill not found\b/i[_0x59eb08(0x15e)](_0x12c47f);}async function skillHubBinaryRequest(_0x261c9e,_0x1d2647={}){const _0x1a17f2=a76_0x4f0d,{query:_0x2a293f,headers:headers={},timeout:timeout=0x7530}=_0x1d2647,_0x2048b4=_activeAK;if(!_0x2048b4)throw CliErrors[_0x1a17f2(0x14f)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x1a17f2(0x154)]+'.');const _0x453ae8=getSkillHubDomain()[_0x1a17f2(0xf8)](/\/$/,''),_0x2ade14=new URL(_0x261c9e,_0x453ae8+'/');if(_0x2a293f)for(const [_0x1c20fb,_0x30bd54]of Object[_0x1a17f2(0x150)](_0x2a293f)){_0x30bd54!==undefined&&_0x30bd54!==null&&_0x2ade14[_0x1a17f2(0x16a)][_0x1a17f2(0x112)](_0x1c20fb,String(_0x30bd54));}const _0x443ffc=new AbortController(),_0x5c3f43=setTimeout(()=>_0x443ffc[_0x1a17f2(0x158)](),timeout);try{const _0x3cdbc7=await fetch(_0x2ade14['toString'](),{'method':_0x1a17f2(0xf7),'headers':{'Accept':_0x1a17f2(0xeb),'X-Invoke-Source':PRODUCT_CONFIG[_0x1a17f2(0x12f)],'X-User-AK':_0x2048b4,...headers},'signal':_0x443ffc['signal']});if(!_0x3cdbc7['ok']){const _0x5930de=await decodeResponseBody(_0x3cdbc7),_0x5cc951=_0x5930de[_0x1a17f2(0x133)]&&typeof _0x5930de['data']===_0x1a17f2(0xf6)?_0x5930de[_0x1a17f2(0x133)]:{},_0x100dbf=firstString(_0x5cc951[_0x1a17f2(0x123)],_0x5cc951[_0x1a17f2(0x161)],_0x5cc951['msg'],_0x5cc951['errorCode'],_0x5930de['text']);throwIfRateLimited(_0x3cdbc7,_0x5930de[_0x1a17f2(0x133)],_0x100dbf);throw CliErrors[_0x1a17f2(0x103)](_0x100dbf||_0x1a17f2(0x100)+_0x3cdbc7['status'],_0x1a17f2(0x16e)+_0x2ade14['toString']());}return Buffer[_0x1a17f2(0x12d)](await _0x3cdbc7['arrayBuffer']());}catch(_0x40a4d1){if(_0x40a4d1 instanceof Error&&_0x40a4d1[_0x1a17f2(0xec)]===_0x1a17f2(0x138))throw CliErrors[_0x1a17f2(0x103)](_0x1a17f2(0xdb)+_0x2ade14[_0x1a17f2(0x156)]());throw _0x40a4d1;}finally{clearTimeout(_0x5c3f43);}}export async function getBffEndpointContract(_0x3b204b,_0x5c933e){const _0x382eca=a76_0x4f0d;if(_0x5c933e===_0x382eca(0x12b))throw CliErrors[_0x382eca(0x115)](_0x382eca(0x126)+_0x3b204b+',\x20name='+_0x5c933e);const _0x4bf7e7=await apiRequest(_0x382eca(0x13e)+encodeURIComponent(_0x3b204b)+'/'+encodeURIComponent(_0x5c933e)),_0x2d8967=_0x4bf7e7[_0x382eca(0x133)];if(!_0x2d8967||typeof _0x2d8967!==_0x382eca(0xf6)||Array[_0x382eca(0x130)](_0x2d8967)||_0x2d8967[_0x382eca(0x14d)]!==_0x3b204b||_0x2d8967[_0x382eca(0x114)]!==_0x5c933e)throw CliErrors[_0x382eca(0x115)](_0x382eca(0x126)+_0x3b204b+_0x382eca(0x153)+_0x5c933e);return{'appCode':_0x2d8967[_0x382eca(0x14d)],'functionName':_0x2d8967['functionName'],'description':_0x2d8967['description'],'version':_0x2d8967[_0x382eca(0xf3)],'gmtModified':_0x2d8967['gmtModified']};}export async function getSqlQueryInfo(_0x591b52,_0x1b8ef7){const _0x5273bc=a76_0x4f0d,_0x2cd9c6=await apiRequest(_0x5273bc(0xe2),{'method':'POST','body':{'appCode':_0x591b52,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x1b8ef7}}),_0x404d9d=_0x2cd9c6[_0x5273bc(0x133)],_0x284728=_0x404d9d&&typeof _0x404d9d===_0x5273bc(0xf6)&&_0x5273bc(0x169)in _0x404d9d?_0x404d9d[_0x5273bc(0x169)]?.[0x0]:_0x404d9d&&typeof _0x404d9d==='object'&&_0x5273bc(0xea)in _0x404d9d?_0x404d9d:undefined;if(!_0x284728)throw CliErrors[_0x5273bc(0x115)]('SQL\x20query\x20not\x20found:\x20'+_0x1b8ef7);return _0x284728;}function isRemoteAppItem(_0x4c574d){const _0x26edc3=a76_0x4f0d;return!!_0x4c574d&&typeof _0x4c574d===_0x26edc3(0xf6)&&typeof _0x4c574d[_0x26edc3(0x14d)]==='string'&&typeof _0x4c574d['appName']==='string';}function extractRemoteAppItems(_0x38d716){const _0x4c7791=a76_0x4f0d;if(Array[_0x4c7791(0x130)](_0x38d716))return _0x38d716['filter'](isRemoteAppItem);if(!_0x38d716||typeof _0x38d716!=='object')throw CliErrors['apiError'](_0x4c7791(0x162));const _0x36ea87=_0x38d716;if(Array[_0x4c7791(0x130)](_0x36ea87[_0x4c7791(0x169)]))return _0x36ea87[_0x4c7791(0x169)][_0x4c7791(0xe1)](isRemoteAppItem);if(_0x36ea87[_0x4c7791(0x133)]&&typeof _0x36ea87[_0x4c7791(0x133)]===_0x4c7791(0xf6)){const _0x3d5722=_0x36ea87['data'];if(Array['isArray'](_0x3d5722[_0x4c7791(0x169)]))return _0x3d5722['tableData'][_0x4c7791(0xe1)](isRemoteAppItem);}throw CliErrors[_0x4c7791(0x103)]('Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.');}export async function getMyApps(){const _0x56a82e=a76_0x4f0d,_0x384ab6=await apiRequest('/client/app/my-apps');return extractRemoteAppItems(_0x384ab6[_0x56a82e(0x133)]);}export async function getLoginUserInfo(){const _0x4c4634=a76_0x4f0d,_0x337d04=await apiRequest(_0x4c4634(0x149));if(!_0x337d04[_0x4c4634(0x133)]||typeof _0x337d04[_0x4c4634(0x133)]!==_0x4c4634(0xf6)||Array[_0x4c4634(0x130)](_0x337d04[_0x4c4634(0x133)]))throw CliErrors[_0x4c4634(0x103)](_0x4c4634(0x118));return _0x337d04[_0x4c4634(0x133)];}function runtimeSchedulePath(_0x587c11,_0x275097=''){const _0xa84f95=a76_0x4f0d;return _0xa84f95(0x15a)+encodeURIComponent(_0x587c11)+'/schedules'+_0x275097;}export async function validateRuntimeSchedule(_0x73332b,_0x263cc9){const _0x390669=a76_0x4f0d,_0x1f1768=await apiRequest(runtimeSchedulePath(_0x73332b,'/validate'),{'method':_0x390669(0x131),'body':_0x263cc9});return _0x1f1768[_0x390669(0x133)];}export async function createRuntimeSchedule(_0x583bc8,_0x46017d){const _0x2d98a1=a76_0x4f0d,_0x3d2a0b=await apiRequest(runtimeSchedulePath(_0x583bc8),{'method':_0x2d98a1(0x131),'body':_0x46017d});return _0x3d2a0b[_0x2d98a1(0x133)];}export async function listRuntimeSchedules(_0x17f7f9,_0x37590d={}){const _0x5601a2=a76_0x4f0d,_0xdf9508=new URLSearchParams();if(_0x37590d['limit']!==undefined)_0xdf9508['set'](_0x5601a2(0x140),String(_0x37590d[_0x5601a2(0x140)]));if(_0x37590d[_0x5601a2(0x11e)])_0xdf9508['set'](_0x5601a2(0x11e),_0x37590d['cursor']);const _0x4e1feb=_0xdf9508['size']>0x0?'?'+_0xdf9508[_0x5601a2(0x156)]():'',_0x95c1fc=await apiRequest(''+runtimeSchedulePath(_0x17f7f9)+_0x4e1feb);return _0x95c1fc['data'];}export async function getRuntimeSchedule(_0x2ea4c2,_0x5e5e1d){const _0x1c0bea=await apiRequest(runtimeSchedulePath(_0x2ea4c2,'/'+encodeURIComponent(_0x5e5e1d)));return _0x1c0bea['data'];}export async function deleteRuntimeSchedule(_0x202132,_0x1150b3){const _0x5370a6=a76_0x4f0d,_0x530232=await apiRequest(runtimeSchedulePath(_0x202132,'/'+encodeURIComponent(_0x1150b3)),{'method':_0x5370a6(0x139)});return _0x530232[_0x5370a6(0x133)];}export async function runRuntimeSchedule(_0x3f590c,_0x468af5){const _0x34c388=a76_0x4f0d,_0x1ad055=await apiRequest(runtimeSchedulePath(_0x3f590c,'/'+encodeURIComponent(_0x468af5)+'/run'),{'method':'POST'});return _0x1ad055[_0x34c388(0x133)];}function a76_0x4f0d(_0x1bdfa5,_0x307f52){_0x1bdfa5=_0x1bdfa5-0xdb;const _0xd2fa66=a76_0xd2fa();let _0x4f0de0=_0xd2fa66[_0x1bdfa5];return _0x4f0de0;}export async function listDatasets(_0x1758bb,_0x569d58){const _0x1ee086=a76_0x4f0d,_0xf75ddd=await apiRequest(_0x1ee086(0x168),{'method':'POST','body':{'appCode':_0x1758bb,..._0x569d58?.[_0x1ee086(0x11c)]&&{'code':_0x569d58['code']},..._0x569d58?.[_0x1ee086(0xec)]&&{'name':_0x569d58[_0x1ee086(0xec)]}}});return extractList(_0xf75ddd['data']);}function a76_0xd2fa(){const _0x2d869e=['error','stringify','374091aMeJjx','join','valid','SkillHub\x20API\x20error:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','personal','apiError','map','company','Knowledge-base\x20entry\x20not\x20found:\x20id=','SkillHub\x20error\x20code:\x20','number','/client/runtime-bff/personal/','Missing\x20Skill\x20package\x20payload.','?appCode=','ownerPreviewVersion','confirmWarnings','/client/knowledge-base/personal/create','application/zip','headlineVersion','favorite','set','signal','functionName','validation','/client/ocr','append','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','/download','Toolbox\x20API\x20error:\x20','visibility','code','skillCode','cursor','/client/artifact/list?','warnings','/client/queryFileUrl','file','errorMsg','find','all','BFF\x20function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','4kclKDw','artifactType','/api/v1/skills/','text','functions','resolvedSlug','from','arrayBuffer','invokeSource','isArray','POST','30aTrkWQ','data','API\x20error\x20code:\x20','Personal\x20BFF\x20not\x20found:\x20id=','1401072kckPPN','/update','AbortError','DELETE','18QVtjVr','PRIVATE','Toolbox\x20API\x20error','/client/artifact/','/client/bff/endpoint/','summary','limit','download','application/json','example','slug','/client/app-config/getByKey?','scope','topK','/publish/validate','/client/user/loginUserInfo','API\x20error:\x20','49oJpkws','msg','appCode','displayName','authRequired','entries','skillName','268929BqBqoa',',\x20name=','newConfigFileName','errors','toString','/api/cli/v1/skills/','abort','4128372MBWYkZ','/api/harness/apps/','status','errorCode','Artifact\x20not\x20found:\x20id=','test','isJson','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','message','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','Invalid\x20app\x20config\x20value:\x20key=','/client/runtime-bff/personal/create','4764033kLPEpy','/client/artifact/create','publishedVersion','/client/dataset/list','tableData','searchParams','.zip','Configure\x20accessKey\x20in\x20','url','Download\x20failed:\x20','/client/uploadFile','Request\x20timeout:\x20','40QBBIoJ','Toolbox\x20error\x20code:\x20','/client/knowledge-base/personal/list?appCode=','namespace','1199915lohHhT','filter','/client/sql/query','source','string','success','items','/publish','/execute?appCode=','effective','sqlCode','application/octet-stream','name','headers','tags','markdown','api-doc-generator','/client/knowledge-base/personal/','description','version','7898627vHJvee','json','object','GET','replace','trim','/versions/'];a76_0xd2fa=function(){return _0x2d869e;};return a76_0xd2fa();}export async function getDatasetDetail(_0x376bbb){const _0x1de1fc=a76_0x4f0d,_0x52b0fa=await apiRequest('/client/dataset/get-driven-data?code='+encodeURIComponent(_0x376bbb));return _0x52b0fa[_0x1de1fc(0x133)];}export async function getDatasetSdkUsageDoc(_0x218f37,_0x23a580){const _0x209cc9=a76_0x4f0d,_0x536f29=await toolboxRequest(_0x209cc9(0xf0),{'datasetCode':_0x218f37,'appCode':_0x23a580});return typeof _0x536f29?.[_0x209cc9(0xef)]===_0x209cc9(0xe4)?_0x536f29[_0x209cc9(0xef)]:'';}export async function uploadRuntimeFile(_0x373359,_0x433cff){const _0x1c156d=a76_0x4f0d,_0x5c95ec=await readFile(_0x433cff),_0x480368=new FormData();_0x480368['append'](_0x1c156d(0x14d),_0x373359),_0x480368[_0x1c156d(0x117)]('file',new Blob([new Uint8Array(_0x5c95ec)]),basename(_0x433cff));const _0x4692ea=await apiFormRequest(_0x1c156d(0x16f),_0x480368);return _0x4692ea[_0x1c156d(0x133)];}export async function queryRuntimeFileUrl(_0x4555fb,_0x4bab7b={}){const _0x3dcf9f=a76_0x4f0d,_0x1fe403=await apiRequest(_0x3dcf9f(0x121),{'method':_0x3dcf9f(0x131),'body':{'filePath':_0x4555fb,'downloadFlag':_0x4bab7b[_0x3dcf9f(0x141)]??![],..._0x4bab7b['longTerm']?{'longTerm':!![]}:{}}});return _0x1fe403[_0x3dcf9f(0x133)];}export async function recognizeRuntimeOcr(_0x19e316,_0x21af73){const _0x305644=a76_0x4f0d,_0x43f9b4=await apiRequest(_0x305644(0x116),{'method':_0x305644(0x131),'body':{'appCode':_0x19e316,'url':_0x21af73[_0x305644(0x16d)],'type':_0x21af73['type']}});return _0x43f9b4['data'];}export async function getRuntimeAppConfigByKey(_0x2c9e26,_0x16f1c2){const _0xc10b20=a76_0x4f0d,_0xbfa2fa=new URLSearchParams({'appCode':_0x2c9e26,'key':_0x16f1c2}),_0x426ea2=await apiRequest(_0xc10b20(0x145)+_0xbfa2fa[_0xc10b20(0x156)]());if(typeof _0x426ea2['data']!==_0xc10b20(0xe4))throw CliErrors[_0xc10b20(0x115)](_0xc10b20(0x163)+_0x16f1c2);return _0x426ea2[_0xc10b20(0x133)];}export async function listRuntimeArtifacts(_0x20ce11,_0x1ed493){const _0x52a5a5=a76_0x4f0d,_0x1fe6cc=new URLSearchParams({'appCode':_0x20ce11});if(_0x1ed493?.['artifactType'])_0x1fe6cc[_0x52a5a5(0x112)](_0x52a5a5(0x128),_0x1ed493[_0x52a5a5(0x128)]);if(_0x1ed493?.['source'])_0x1fe6cc['set'](_0x52a5a5(0xe3),_0x1ed493['source']);if(_0x1ed493?.[_0x52a5a5(0x111)]!==undefined)_0x1fe6cc['set'](_0x52a5a5(0x111),String(_0x1ed493[_0x52a5a5(0x111)]));const _0x25db03=await apiRequest(_0x52a5a5(0x11f)+_0x1fe6cc['toString']());return Array[_0x52a5a5(0x130)](_0x25db03[_0x52a5a5(0x133)])?_0x25db03[_0x52a5a5(0x133)]:[];}export async function getRuntimeArtifact(_0x41ed0e,_0x4a30f3){const _0x32c517=a76_0x4f0d,_0x59c5f6=await apiRequest(_0x32c517(0x13d)+_0x41ed0e+_0x32c517(0x10b)+encodeURIComponent(_0x4a30f3));if(!_0x59c5f6[_0x32c517(0x133)])throw CliErrors['validation'](_0x32c517(0x15d)+_0x41ed0e);return _0x59c5f6['data'];}export async function createRuntimeArtifact(_0x325776,_0x162bc4){const _0x416831=a76_0x4f0d,_0x2f69af=await apiRequest(_0x416831(0x166),{'method':_0x416831(0x131),'body':{'appCode':_0x325776,..._0x162bc4}});return _0x2f69af[_0x416831(0x133)];}export async function updateRuntimeArtifact(_0x36693f,_0x573132,_0xf2b482){const _0x28064b=a76_0x4f0d,_0x163ec9=await apiRequest(_0x28064b(0x13d)+_0x36693f+'/update',{'method':'POST','body':{'appCode':_0x573132,..._0xf2b482}});return _0x163ec9[_0x28064b(0x133)];}export async function listPersonalBffs(_0x3868d1){const _0x14cbda=a76_0x4f0d,_0x252f61=await apiRequest('/client/runtime-bff/personal/list?appCode='+encodeURIComponent(_0x3868d1));return Array[_0x14cbda(0x130)](_0x252f61[_0x14cbda(0x133)])?_0x252f61[_0x14cbda(0x133)]:[];}export async function getPersonalBff(_0x432a67,_0x35c029){const _0x5243f2=a76_0x4f0d,_0x1cbc5f=await apiRequest('/client/runtime-bff/personal/'+_0x432a67+'?appCode='+encodeURIComponent(_0x35c029));if(!_0x1cbc5f[_0x5243f2(0x133)])throw CliErrors[_0x5243f2(0x115)](_0x5243f2(0x135)+_0x432a67);return _0x1cbc5f['data'];}export async function createPersonalBff(_0x207459,_0x541a9c){const _0x5befb4=a76_0x4f0d,_0x38675c=await apiRequest(_0x5befb4(0x164),{'method':_0x5befb4(0x131),'body':{'appCode':_0x207459,..._0x541a9c}});return _0x38675c[_0x5befb4(0x133)];}export async function updatePersonalBff(_0xcfdb4d,_0x584401,_0x78cfa1){const _0xb57e01=a76_0x4f0d,_0x169f4f=await apiRequest(_0xb57e01(0x109)+_0xcfdb4d+'/update',{'method':'POST','body':{'appCode':_0x584401,..._0x78cfa1}});return _0x169f4f[_0xb57e01(0x133)];}export async function executePersonalBff(_0x28a199,_0x335784,_0x557c2c){const _0x3beb9f=a76_0x4f0d,_0x24c294=await apiRequest('/client/runtime-bff/personal/'+_0x28a199+_0x3beb9f(0xe8)+encodeURIComponent(_0x335784),{'method':'POST','body':_0x557c2c});return _0x24c294[_0x3beb9f(0x133)];}export async function listPersonalKnowledgeBaseItems(_0x1dab33){const _0x12c92b=a76_0x4f0d,_0x10a97d=await apiRequest(_0x12c92b(0xde)+encodeURIComponent(_0x1dab33));return Array[_0x12c92b(0x130)](_0x10a97d[_0x12c92b(0x133)])?_0x10a97d[_0x12c92b(0x133)]:[];}export async function getPersonalKnowledgeBaseItem(_0x41f1a3,_0x274332){const _0x431bc0=a76_0x4f0d,_0x2785eb=await apiRequest(_0x431bc0(0xf1)+_0x41f1a3+_0x431bc0(0x10b)+encodeURIComponent(_0x274332));if(!_0x2785eb['data'])throw CliErrors[_0x431bc0(0x115)](_0x431bc0(0x106)+_0x41f1a3);return _0x2785eb[_0x431bc0(0x133)];}export async function createPersonalKnowledgeBaseItem(_0x3b59cc,_0x19f90f){const _0x287e8e=a76_0x4f0d,_0x245db2=await apiRequest(_0x287e8e(0x10e),{'method':_0x287e8e(0x131),'body':{'appCode':_0x3b59cc,..._0x19f90f}});return _0x245db2[_0x287e8e(0x133)];}export async function updatePersonalKnowledgeBaseItem(_0x552561,_0x8a2841,_0x25bf77){const _0x34a657=a76_0x4f0d,_0x5dca7e=await apiRequest(_0x34a657(0xf1)+_0x552561+_0x34a657(0x137),{'method':_0x34a657(0x131),'body':{'appCode':_0x8a2841,..._0x25bf77}});return _0x5dca7e[_0x34a657(0x133)];}export async function searchKnowledgeBase(_0x42ff46,_0x58edfd){const _0x3afe3f=a76_0x4f0d,_0x79babd=await apiRequest('/client/knowledge-base/search',{'method':'POST','body':{'appCode':_0x42ff46,'query':_0x58edfd['query'],..._0x58edfd[_0x3afe3f(0x147)]!==undefined?{'topK':_0x58edfd[_0x3afe3f(0x147)]}:{}}});return Array[_0x3afe3f(0x130)](_0x79babd[_0x3afe3f(0x133)])?_0x79babd[_0x3afe3f(0x133)]:[];}export async function getRuntimeSkillByCode(_0x407185,_0x278614){const _0x7ce3ad=a76_0x4f0d,_0x1dbd32=await skillHubJsonRequest(_0x7ce3ad(0x129)+encodeURIComponent(_0x407185)+'/'+encodeURIComponent(_0x278614),{'allowNotFound':!![]});return _0x1dbd32?skillHubRuntimeDetailToRuntimeSkill(_0x1dbd32):undefined;}export async function listRuntimeSkills(_0x29c1ec){const _0x1e6678=a76_0x4f0d,_0x2d2e58=await skillHubJsonRequest('/api/runtime/v1/namespaces/'+encodeURIComponent(_0x29c1ec[_0x1e6678(0x14d)])+'/skills',{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x29c1ec[_0x1e6678(0x14d)],_0x2d2e58,_0x29c1ec[_0x1e6678(0x146)]??_0x1e6678(0x125),_0x29c1ec['code']);}export async function listPersonalRuntimeSkills(_0xc63e98){const _0x1d412e=a76_0x4f0d;return(await listRuntimeSkills({'appCode':_0xc63e98,'scope':_0x1d412e(0x102)}))[_0x1d412e(0x102)];}export async function listCompanyRuntimeSkills(_0x281a09){const _0x25d9fa=a76_0x4f0d;return(await listRuntimeSkills({'appCode':_0x281a09,'scope':_0x25d9fa(0x105)}))[_0x25d9fa(0x105)];}export async function listVisibleRuntimeSkills(_0x3aa901){const _0x4cb379=a76_0x4f0d;return(await listRuntimeSkills({'appCode':_0x3aa901,'scope':_0x4cb379(0x125)}))[_0x4cb379(0xe9)];}export async function createPersonalRuntimeSkill(_0xf16333,_0x18d385,_0x6a7448={}){const _0x49edf8=a76_0x4f0d;return publishRuntimeSkill(_0xf16333,_0x18d385,{'visibility':_0x49edf8(0x13b),'confirmWarnings':_0x6a7448['confirmWarnings']});}export async function updatePersonalRuntimeSkill(_0x2a2528,_0x586d20,_0x588894,_0x513cd2={}){const _0x48d1a3=a76_0x4f0d;return publishRuntimeSkill(_0x586d20,{..._0x588894,'skillCode':_0x588894[_0x48d1a3(0x11d)]??_0x2a2528},{'visibility':_0x48d1a3(0x13b),'confirmWarnings':_0x513cd2[_0x48d1a3(0x10d)]});}export async function publishCompanyRuntimeSkill(_0x1e495f,_0x346235,_0x1a0732={}){const _0x5a836f=a76_0x4f0d;return publishRuntimeSkill(_0x1e495f,_0x346235,{'visibility':'NAMESPACE_ONLY','confirmWarnings':_0x1a0732[_0x5a836f(0x10d)]});}export async function validateRuntimeSkillPublish(_0x1d95b0,_0x1c08fc,_0x1370a3){const _0x5eb6d5=a76_0x4f0d,_0x249f25=buildRuntimeSkillPublishForm(_0x1c08fc,_0x1370a3[_0x5eb6d5(0x11b)]),_0x1a6893=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0x1d95b0)+_0x5eb6d5(0x148),{'method':_0x5eb6d5(0x131),'body':_0x249f25});return{'valid':_0x1a6893[_0x5eb6d5(0xff)]===!![],'errors':Array[_0x5eb6d5(0x130)](_0x1a6893[_0x5eb6d5(0x155)])?_0x1a6893['errors']:[],'warnings':Array[_0x5eb6d5(0x130)](_0x1a6893[_0x5eb6d5(0x120)])?_0x1a6893[_0x5eb6d5(0x120)]:[],'resolvedSlug':_0x1a6893[_0x5eb6d5(0x12c)],'resolvedVersion':_0x1a6893['resolvedVersion']};}export async function downloadRuntimeSkillPackage(_0xf5cb8c,_0x1ecb74,_0x1e3e30,_0x4d58d2){const _0x48f789=a76_0x4f0d;void _0xf5cb8c;const _0x475912=_0x4d58d2?_0x48f789(0x157)+encodeURIComponent(_0x1e3e30)+'/'+encodeURIComponent(_0x1ecb74)+_0x48f789(0xfa)+encodeURIComponent(_0x4d58d2)+_0x48f789(0x119):'/api/cli/v1/skills/'+encodeURIComponent(_0x1e3e30)+'/'+encodeURIComponent(_0x1ecb74)+_0x48f789(0x119);return skillHubBinaryRequest(_0x475912);}async function publishRuntimeSkill(_0x425b8f,_0x114514,_0x23f82e){const _0x50118d=a76_0x4f0d,_0x3d2f36=buildRuntimeSkillPublishForm(_0x114514,_0x23f82e['visibility']),_0x30e2e7=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0x425b8f)+_0x50118d(0xe7),{'method':_0x50118d(0x131),'query':{'confirmWarnings':_0x23f82e[_0x50118d(0x10d)]===!![]?!![]:undefined},'body':_0x3d2f36});return{'appCode':_0x30e2e7[_0x50118d(0xdf)]??_0x425b8f,'skillCode':_0x30e2e7['slug']??_0x114514['skillCode']??'','skillName':_0x114514[_0x50118d(0x151)]??_0x30e2e7[_0x50118d(0x144)]??_0x114514[_0x50118d(0x11d)],'description':_0x114514[_0x50118d(0xf2)],'scope':skillHubVisibilityToScope(_0x30e2e7['visibility']??_0x23f82e[_0x50118d(0x11b)])??'personal','version':_0x30e2e7['version']??_0x114514['version'],'tags':_0x114514[_0x50118d(0xee)],'content':_0x114514['content']};}function buildRuntimeSkillPublishForm(_0x3ca2f2,_0x2d0937){const _0x5d8be2=a76_0x4f0d,_0x4073d5=new FormData();return _0x4073d5[_0x5d8be2(0x112)](_0x5d8be2(0x122),runtimeSkillPackageFile(_0x3ca2f2)),_0x3ca2f2[_0x5d8be2(0x151)]?.['trim']()&&_0x4073d5[_0x5d8be2(0x112)]('displayName',_0x3ca2f2[_0x5d8be2(0x151)][_0x5d8be2(0xf9)]()),_0x4073d5[_0x5d8be2(0x112)](_0x5d8be2(0x11b),_0x2d0937),_0x4073d5;}function runtimeSkillPackageFile(_0x219d14){const _0x581f30=a76_0x4f0d;if(!_0x219d14['packageBase64'])throw CliErrors['validation'](_0x581f30(0x10a));const _0x229cd0=Buffer['from'](_0x219d14['packageBase64'],'base64'),_0x19e169=new Blob([_0x229cd0],{'type':_0x581f30(0x10f)}),_0x29da50=(_0x219d14[_0x581f30(0x11d)]||'skill')+_0x581f30(0x16b);if(typeof File!=='undefined')return new File([_0x19e169],_0x29da50,{'type':_0x581f30(0x10f)});return _0x19e169;}function normalizeSkillHubRuntimeListResponse(_0x133c40,_0x27af19,_0x198903,_0x407d87){const _0x582e0f=a76_0x4f0d,_0x1532fb=Array[_0x582e0f(0x130)](_0x27af19)?_0x27af19:Array['isArray'](_0x27af19?.[_0x582e0f(0xe6)])?_0x27af19[_0x582e0f(0xe6)]:[],_0x539cf9=_0x407d87?.[_0x582e0f(0xf9)](),_0x1758c1=_0x1532fb[_0x582e0f(0xe1)](_0xb99ec5=>!_0x539cf9||_0xb99ec5['slug']===_0x539cf9)[_0x582e0f(0x104)](skillHubRuntimeItemToRuntimeSkill)['filter'](_0x1599a=>Boolean(_0x1599a)),_0x97e01e=_0x1758c1[_0x582e0f(0xe1)](_0x6d9740=>_0x6d9740['scope']===_0x582e0f(0x102)),_0x433b36=_0x1758c1[_0x582e0f(0xe1)](_0x561a56=>_0x561a56[_0x582e0f(0x146)]===_0x582e0f(0x105));return{'appCode':_0x133c40,'personal':_0x198903===_0x582e0f(0x105)?[]:_0x97e01e,'company':_0x198903===_0x582e0f(0x102)?[]:_0x433b36,'effective':buildEffectiveRuntimeSkills(_0x97e01e,_0x433b36,_0x198903)};}function skillHubRuntimeItemToRuntimeSkill(_0x3be1e1){const _0x4251f4=a76_0x4f0d,_0x2ad05e=_0x3be1e1[_0x4251f4(0x144)]?.[_0x4251f4(0xf9)](),_0x3a5a08=skillHubVisibilityToScope(_0x3be1e1['visibility']);if(!_0x2ad05e||!_0x3a5a08)return undefined;return{'id':_0x3be1e1['id'],'appCode':_0x3be1e1['namespace'],'skillCode':_0x2ad05e,'skillName':_0x3be1e1[_0x4251f4(0x14e)]??_0x2ad05e,'description':_0x3be1e1[_0x4251f4(0x13f)],'scope':_0x3a5a08,'version':skillHubRuntimeItemVersion(_0x3be1e1),'status':_0x3be1e1[_0x4251f4(0x15b)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x4bdb0e){const _0x1be41a=a76_0x4f0d,_0x2ee1ac=_0x4bdb0e[_0x1be41a(0x144)]?.[_0x1be41a(0xf9)]();if(!_0x2ee1ac)return undefined;return{'id':_0x4bdb0e['id'],'appCode':_0x4bdb0e['namespace'],'skillCode':_0x2ee1ac,'skillName':_0x4bdb0e[_0x1be41a(0x14e)]??_0x2ee1ac,'description':_0x4bdb0e['summary'],'example':_0x4bdb0e[_0x1be41a(0x143)],'scope':skillHubVisibilityToScope(_0x4bdb0e['visibility'])??_0x4bdb0e['visibility']?.['toLowerCase'](),'version':skillHubRuntimeItemVersion(_0x4bdb0e),'status':_0x4bdb0e[_0x1be41a(0x15b)]};}function skillHubVisibilityToScope(_0x4b8d70){const _0x4662fc=a76_0x4f0d;if(_0x4b8d70==='PRIVATE')return'personal';if(_0x4b8d70==='NAMESPACE_ONLY')return _0x4662fc(0x105);return undefined;}function skillHubRuntimeItemVersion(_0x2d217c){const _0x1669d1=a76_0x4f0d;return _0x2d217c[_0x1669d1(0x167)]?.['version']??_0x2d217c[_0x1669d1(0x110)]?.['version']??_0x2d217c[_0x1669d1(0x10c)]?.['version'];}function buildEffectiveRuntimeSkills(_0x376292,_0x532102,_0x12472e){const _0x5bd6d4=a76_0x4f0d;if(_0x12472e===_0x5bd6d4(0x102))return _0x376292;if(_0x12472e==='company')return _0x532102;const _0x4e27d5=new Map();for(const _0x1de9d8 of _0x532102){_0x4e27d5[_0x5bd6d4(0x112)](_0x1de9d8[_0x5bd6d4(0x11d)],_0x1de9d8);}for(const _0x7fad4d of _0x376292){_0x4e27d5[_0x5bd6d4(0x112)](_0x7fad4d[_0x5bd6d4(0x11d)],_0x7fad4d);}return Array[_0x5bd6d4(0x12d)](_0x4e27d5['values']());}function normalizeRuntimeSkillListResponse(_0xf96451,_0x4c141f){const _0x3aa8d6=a76_0x4f0d;if(Array['isArray'](_0x4c141f)){const _0x283a44=_0x4c141f[_0x3aa8d6(0xe1)](_0x2429a8=>_0x2429a8['scope']===_0x3aa8d6(0x102)),_0xc6128e=_0x4c141f[_0x3aa8d6(0xe1)](_0x4a6af8=>_0x4a6af8[_0x3aa8d6(0x146)]==='company');return{'appCode':_0xf96451,'personal':_0x283a44,'company':_0xc6128e,'effective':[..._0xc6128e,..._0x283a44]};}return{'appCode':_0x4c141f?.[_0x3aa8d6(0x14d)]??_0xf96451,'personal':Array['isArray'](_0x4c141f?.[_0x3aa8d6(0x102)])?_0x4c141f[_0x3aa8d6(0x102)]:[],'company':Array[_0x3aa8d6(0x130)](_0x4c141f?.['company'])?_0x4c141f[_0x3aa8d6(0x105)]:[],'effective':Array[_0x3aa8d6(0x130)](_0x4c141f?.[_0x3aa8d6(0xe9)])?_0x4c141f[_0x3aa8d6(0xe9)]:[]};}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x174766,_0x130946){const _0x21fe7c=a77_0x45a2,_0x508a16=_0x174766();while(!![]){try{const _0x1fe4a9=parseInt(_0x21fe7c(0xb6))/0x1*(parseInt(_0x21fe7c(0xa9))/0x2)+parseInt(_0x21fe7c(0xad))/0x3+-parseInt(_0x21fe7c(0xb5))/0x4*(parseInt(_0x21fe7c(0xa8))/0x5)+parseInt(_0x21fe7c(0xbb))/0x6*(parseInt(_0x21fe7c(0xb1))/0x7)+parseInt(_0x21fe7c(0xb8))/0x8*(parseInt(_0x21fe7c(0xb9))/0x9)+-parseInt(_0x21fe7c(0xba))/0xa*(parseInt(_0x21fe7c(0xb4))/0xb)+-parseInt(_0x21fe7c(0xa7))/0xc*(parseInt(_0x21fe7c(0xaf))/0xd);if(_0x1fe4a9===_0x130946)break;else _0x508a16['push'](_0x508a16['shift']());}catch(_0xc57c74){_0x508a16['push'](_0x508a16['shift']());}}}(a77_0x163d,0xcd2bc));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a77_0x45a2(_0x416d46,_0x31395f){_0x416d46=_0x416d46-0xa7;const _0x163dca=a77_0x163d();let _0x45a25c=_0x163dca[_0x416d46];return _0x45a25c;}export async function listDatabases(_0x1b9d05){const _0x46284d=a77_0x45a2;if(cache[_0x46284d(0xaa)](_0x1b9d05))return cache[_0x46284d(0xab)](_0x1b9d05);const _0x2ed86b=await listDatasets(_0x1b9d05),_0x88c828=new Map();for(const _0x3d3755 of _0x2ed86b){const _0x233232=_0x3d3755['dbtableConfig'];_0x233232?.[_0x46284d(0xb3)]!=null&&_0x88c828[_0x46284d(0xb2)](_0x233232[_0x46284d(0xb3)],_0x233232['dbName']??'db-'+_0x233232['dbId']);}const _0x4f31c7=[..._0x88c828[_0x46284d(0xae)]()][_0x46284d(0xac)](([_0x3539ae,_0x37f7f9])=>({'dbId':_0x3539ae,'dbName':_0x37f7f9}));return cache[_0x46284d(0xb2)](_0x1b9d05,_0x4f31c7),_0x4f31c7;}function a77_0x163d(){const _0x3307e2=['1154960xDAoTk','36XOlHfr','10vtCOUS','366BygkuA','19686936AJwysw','205fHXNCw','4pnnnKM','has','get','map','4254678fnDSKn','entries','26WGCXOe','find','166999SNoJJk','set','dbId','964469fRnrvr','46912HkHGSI','619540aLVdvn','dbName'];a77_0x163d=function(){return _0x3307e2;};return a77_0x163d();}export async function getDbName(_0x226af5,_0x22e46b){const _0x1d397b=a77_0x45a2;try{const _0x13a2e8=await listDatabases(_0x226af5);return _0x13a2e8[_0x1d397b(0xb0)](_0x3976af=>_0x3976af[_0x1d397b(0xb3)]===_0x22e46b)?.[_0x1d397b(0xb7)];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b385b,_0x6e4e2b){const _0x434533=a78_0x300c,_0x132f9e=_0x1b385b();while(!![]){try{const _0x2c8ad0=-parseInt(_0x434533(0x1ba))/0x1*(-parseInt(_0x434533(0x1d5))/0x2)+-parseInt(_0x434533(0x1bc))/0x3+-parseInt(_0x434533(0x1cb))/0x4+parseInt(_0x434533(0x1cf))/0x5+parseInt(_0x434533(0x1d7))/0x6*(-parseInt(_0x434533(0x1b6))/0x7)+-parseInt(_0x434533(0x1ca))/0x8+parseInt(_0x434533(0x1c6))/0x9*(parseInt(_0x434533(0x1b9))/0xa);if(_0x2c8ad0===_0x6e4e2b)break;else _0x132f9e['push'](_0x132f9e['shift']());}catch(_0x21c712){_0x132f9e['push'](_0x132f9e['shift']());}}}(a78_0xf552,0xc5a63));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';function a78_0x300c(_0x3f8216,_0x527acd){_0x3f8216=_0x3f8216-0x1b4;const _0xf552b6=a78_0xf552();let _0x300c5f=_0xf552b6[_0x3f8216];return _0x300c5f;}import{parseBatchCreateItemsFromParams}from'../utils/params.js';import{installLosslessJsonResponseParser}from'../utils/lossless-json.js';let _client,restoreResponseJsonParser;export function initSdkClient(_0x3d3f2b){const _0x30d0c6=a78_0x300c;restoreResponseJsonParser??=installLosslessJsonResponseParser();try{_client=createClient({'appCode':_0x3d3f2b[_0x30d0c6(0x1c1)],'env':_0x3d3f2b[_0x30d0c6(0x1bd)],'authMode':_0x3d3f2b['authMode'],..._0x3d3f2b['accessKey']?{'accessKey':_0x3d3f2b[_0x30d0c6(0x1bf)]}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x30d0c6(0x1d1)]}}});}catch(_0x2cf7eb){clearSdkClient();throw _0x2cf7eb;}}export function clearSdkClient(){_client=undefined,restoreResponseJsonParser?.(),restoreResponseJsonParser=undefined;}function ensureClient(){if(!_client)throw new Error('SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.');return _client;}function normalizeAggregateParams(_0x278836){const _0x986d0b=a78_0x300c,_0x26ed50=_0x278836['aggregate'];if(_0x26ed50===undefined)return _0x278836;if(!Array[_0x986d0b(0x1d4)](_0x26ed50))throw CliErrors[_0x986d0b(0x1c5)](_0x986d0b(0x1ce));return{..._0x278836,'aggregate':_0x26ed50['map']((_0x382d7c,_0x343e24)=>{const _0x5a0f6c=_0x986d0b;if(!_0x382d7c||typeof _0x382d7c!=='object'||Array['isArray'](_0x382d7c))throw CliErrors[_0x5a0f6c(0x1c5)](_0x5a0f6c(0x1b5)+_0x343e24+_0x5a0f6c(0x1b8));const _0x36a756=_0x382d7c[_0x5a0f6c(0x1c4)]??_0x382d7c[_0x5a0f6c(0x1c7)];if(typeof _0x36a756!==_0x5a0f6c(0x1d0)||_0x36a756[_0x5a0f6c(0x1d3)]()==='')throw CliErrors[_0x5a0f6c(0x1c5)]('data\x20aggregate\x20--params.aggregate['+_0x343e24+_0x5a0f6c(0x1d8));const _0x14480f={..._0x382d7c,'column':_0x36a756};return delete _0x14480f[_0x5a0f6c(0x1c7)],_0x14480f;})};}function a78_0xf552(){const _0xb3e04e=['appCode','aggregate','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','column','validation','544689knPOuO','field','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27\x20or\x20\x27{\x22id\x22:[1,2,3],\x22name\x22:\x22new\x22}\x27','delete','2973416cQnwfF','5555768urwDkt','sql','models','data\x20aggregate\x20--params.aggregate\x20must\x20be\x20an\x20array.','5688905Xcddqu','string','invokeSource','SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22','trim','isArray','21454AKIOgW','execute','4716PsMZZb',']\x20requires\x20\x22column\x22;\x20\x22field\x22\x20is\x20accepted\x20only\x20as\x20a\x20deprecated\x20alias.','\x22.\x20','data\x20aggregate\x20--params.aggregate[','7322yNxoCC','batchCreate',']\x20must\x20be\x20an\x20object.','430tqfALn','89CUADsS','getOne','3907623IPyXhR','env','update','accessKey','Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.'];a78_0xf552=function(){return _0xb3e04e;};return a78_0xf552();}export async function executeData(_0x234acd,_0x36b160,_0x9c21c6){const _0x42bb14=a78_0x300c,_0x5dfe5a=ensureClient(),_0x485945='dataset_'+_0x234acd,_0xb1ac6d=_0x5dfe5a[_0x42bb14(0x1cd)][_0x485945];if(!_0xb1ac6d||typeof _0xb1ac6d[_0x36b160]!=='function')throw new Error(_0x42bb14(0x1d2)+_0x36b160+_0x42bb14(0x1b4)+_0x42bb14(0x1c0));if(_0x36b160==='batchCreate')return _0xb1ac6d[_0x42bb14(0x1b7)](parseBatchCreateItemsFromParams(_0x9c21c6));const _0x586b82=_0x9c21c6!==undefined&&_0x9c21c6!==null&&!Array['isArray'](_0x9c21c6)?_0x9c21c6:{};switch(_0x36b160){case _0x42bb14(0x1bb):{const _0x25394f=_0x586b82['id'];if(_0x25394f===undefined||_0x25394f===null)throw new Error(_0x42bb14(0x1c3));return _0xb1ac6d['getOne'](_0x25394f);}case'update':{const {id:_0x4d7726,..._0x23fcd1}=_0x586b82;if(_0x4d7726===undefined||_0x4d7726===null)throw new Error(_0x42bb14(0x1c8));return _0xb1ac6d[_0x42bb14(0x1be)](_0x4d7726,_0x23fcd1);}case _0x42bb14(0x1c9):{const _0x14ae50=_0x586b82['id'];if(_0x14ae50===undefined||_0x14ae50===null)throw new Error('delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27');return _0xb1ac6d[_0x42bb14(0x1c9)](_0x14ae50);}case _0x42bb14(0x1c2):return _0xb1ac6d[_0x42bb14(0x1c2)](normalizeAggregateParams(_0x586b82));default:return _0xb1ac6d[_0x36b160](_0x586b82);}}export async function executeSdkSql(_0x11992a,_0x580e45){const _0x39f19c=a78_0x300c,_0x349238=ensureClient();return _0x349238[_0x39f19c(0x1cc)]['execute']({'sqlCode':_0x11992a,'params':_0x580e45});}export async function executeSdkBff(_0x5161cd,_0x38b829){const _0x4d8dcf=a78_0x300c,_0x157db3=ensureClient();return _0x157db3['bff'][_0x4d8dcf(0x1d6)]({'scriptName':_0x5161cd,'params':_0x38b829});}
|