@lovrabet/lovrabet-cli 2.2.7 → 2.3.0-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.d.ts +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +12 -0
- package/lib/commands/config/init.js +1 -0
- package/lib/commands/config/shared.d.ts +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +11 -0
- package/lib/config/domain-config.js +1 -0
- package/lib/config/schema.d.ts +7 -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.d.ts +4 -0
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +10 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.d.ts +52 -14
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.d.ts +15 -0
- package/lib/constant/region.js +1 -0
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.d.ts +2 -0
- package/lib/constant/url.js +1 -1
- package/lib/context.d.ts +2 -6
- 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.d.ts +2 -0
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.d.ts +3 -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/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.d.ts +15 -0
- package/lib/utils/access-key-redaction.js +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.d.ts +12 -0
- package/lib/utils/cli-version-check.js +1 -0
- package/lib/utils/cli-version-policy.d.ts +12 -0
- package/lib/utils/cli-version-policy.js +1 -0
- 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.d.ts +2 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -1
- package/skills/lovrabet/SKILL.md +11 -12
- package/skills/lovrabet/guides/troubleshooting.md +12 -8
- package/skills/lovrabet/references/lovrabet-app.md +1 -1
- package/skills/lovrabet/references/lovrabet-auth.md +7 -25
- package/skills/lovrabet/references/lovrabet-config-commands.md +42 -5
- package/skills/lovrabet/references/lovrabet-config.md +25 -5
- package/skills/lovrabet.manifest.json +3 -3
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a96_0x49cde4=a96_0xfa78;(function(_0x16854c,_0x363c48){const _0x405d91=a96_0xfa78,_0x583a69=_0x16854c();while(!![]){try{const _0x1b09d9=parseInt(_0x405d91(0x171))/0x1+parseInt(_0x405d91(0x170))/0x2*(-parseInt(_0x405d91(0x176))/0x3)+-parseInt(_0x405d91(0x173))/0x4+parseInt(_0x405d91(0x172))/0x5+-parseInt(_0x405d91(0x16b))/0x6*(parseInt(_0x405d91(0x175))/0x7)+-parseInt(_0x405d91(0x16a))/0x8*(parseInt(_0x405d91(0x16c))/0x9)+parseInt(_0x405d91(0x16e))/0xa;if(_0x1b09d9===_0x363c48)break;else _0x583a69['push'](_0x583a69['shift']());}catch(_0x1599c7){_0x583a69['push'](_0x583a69['shift']());}}}(a96_0x42c4,0xce9f5));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=['production',a96_0x49cde4(0x174),a96_0x49cde4(0x16d)];export function normalizeEnv(_0x35de54){const _0x1db8a2=a96_0x49cde4;return _0x35de54===_0x1db8a2(0x177)?_0x1db8a2(0x16f):_0x35de54;}export function isProduction(_0x125ec3){const _0x71ca46=a96_0x49cde4;return normalizeEnv(_0x125ec3)===_0x71ca46(0x16f);}function a96_0xfa78(_0x17bc6a,_0x1baeeb){_0x17bc6a=_0x17bc6a-0x16a;const _0x42c411=a96_0x42c4();let _0xfa781a=_0x42c411[_0x17bc6a];return _0xfa781a;}export function isDaily(_0x5e6951){return normalizeEnv(_0x5e6951)==='daily';}export function isDev(_0x43b0bd){const _0x450d45=a96_0x49cde4,_0x16763d=normalizeEnv(_0x43b0bd);return _0x16763d===_0x450d45(0x174)||_0x16763d==='dev';}function a96_0x42c4(){const _0x38d331=['2512242XJFVvA','9qtTBdJ','daily','20675650zgWkVG','production','2CfemZD','1010117zCMflr','2429755zebNEK','907508CkcvHS','development','21mbGzDd','1388703qmpmnn','online','6171272HUdcfu'];a96_0x42c4=function(){return _0x38d331;};return a96_0x42c4();}let env=normalizeEnv(productEnv('ENV')||a96_0x49cde4(0x16f));export function getEnv(){return env;}export function initEnv(_0x158b22){env=normalizeEnv(_0x158b22);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a97_0x5a7fb3=a97_0x5cc0;function a97_0x5cc0(_0x49c7b2,_0x4d094a){_0x49c7b2=_0x49c7b2-0xb3;const _0x4f201a=a97_0x4f20();let _0x5cc0f5=_0x4f201a[_0x49c7b2];return _0x5cc0f5;}(function(_0x267df6,_0x5b6b1c){const _0x57c70f=a97_0x5cc0,_0x4c26e0=_0x267df6();while(!![]){try{const _0x3a763e=-parseInt(_0x57c70f(0xbd))/0x1*(-parseInt(_0x57c70f(0xbc))/0x2)+parseInt(_0x57c70f(0xbe))/0x3+-parseInt(_0x57c70f(0xb8))/0x4*(parseInt(_0x57c70f(0xb6))/0x5)+-parseInt(_0x57c70f(0xb9))/0x6*(parseInt(_0x57c70f(0xbb))/0x7)+-parseInt(_0x57c70f(0xb7))/0x8*(-parseInt(_0x57c70f(0xc0))/0x9)+parseInt(_0x57c70f(0xb5))/0xa*(parseInt(_0x57c70f(0xba))/0xb)+-parseInt(_0x57c70f(0xb4))/0xc*(parseInt(_0x57c70f(0xbf))/0xd);if(_0x3a763e===_0x5b6b1c)break;else _0x4c26e0['push'](_0x4c26e0['shift']());}catch(_0x2e94ea){_0x4c26e0['push'](_0x4c26e0['shift']());}}}(a97_0x4f20,0x588d6));export const OUTPUT_FORMAT_VALUES=[a97_0x5a7fb3(0xb3),a97_0x5a7fb3(0xc1),'compress'];function a97_0x4f20(){const _0x563703=['2lMkVwx','1691937MvDOCV','52GMNCHe','27tIzpKT','pretty','json','369348owljYG','319030nZxNfI','20mUehXI','472664STzHNO','369768voERNS','426blkeAu','11WWgBHx','777lDPIuy','90344ZBNkOL'];a97_0x4f20=function(){return _0x563703;};return a97_0x4f20();}
|
|
@@ -34,12 +34,14 @@ export declare const PRODUCT_CONFIG: {
|
|
|
34
34
|
readonly globalSkillName: "lovrabet";
|
|
35
35
|
/** Npm registry base URL used for update dist-tag resolution. */
|
|
36
36
|
readonly npmRegistryBaseUrl: "https://registry.npmjs.org";
|
|
37
|
+
/** Public CDN origin used for Runtime CLI operational policy files. */
|
|
38
|
+
readonly cliCdnBaseUrl: "https://g.lovrabet.com";
|
|
37
39
|
/** Main environment variable prefix, without trailing underscore. */
|
|
38
40
|
readonly envPrefix: "LOVRABET";
|
|
39
41
|
/** Compatibility environment prefixes checked after `envPrefix`. */
|
|
40
42
|
readonly legacyEnvPrefixes: readonly ["RABETBASE"];
|
|
41
|
-
/**
|
|
42
|
-
readonly configFileNames: readonly [".lovrabet.json"
|
|
43
|
+
/** Runtime CLI's only config file; Rabetbase config is a separate concern. */
|
|
44
|
+
readonly configFileNames: readonly [".lovrabet.json"];
|
|
43
45
|
/** Config file name used for new writes. */
|
|
44
46
|
readonly newConfigFileName: ".lovrabet.json";
|
|
45
47
|
/** Per-user home directory name used for caches. */
|
|
@@ -52,19 +54,55 @@ export declare const PRODUCT_CONFIG: {
|
|
|
52
54
|
readonly userCenterDisplayName: "Lovrabet User Center";
|
|
53
55
|
/** Env var suffix for skipping `npx skills add`. */
|
|
54
56
|
readonly skipNpxSkillsEnvSuffix: "SKIP_NPX_SKILLS";
|
|
55
|
-
/**
|
|
56
|
-
readonly
|
|
57
|
-
readonly
|
|
58
|
-
readonly
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
/** Built-in official node profiles. Config file overrides still take precedence. */
|
|
58
|
+
readonly regionDomains: {
|
|
59
|
+
readonly cn: {
|
|
60
|
+
readonly production: {
|
|
61
|
+
readonly user: "https://user.lovrabet.com";
|
|
62
|
+
readonly api: "https://api.lovrabet.com";
|
|
63
|
+
readonly runtime: "https://runtime.lovrabet.com";
|
|
64
|
+
readonly skill: "https://skills.lovrabet.com";
|
|
65
|
+
readonly kb: "https://runtime.lovrabet.com";
|
|
66
|
+
};
|
|
67
|
+
readonly nonProduction: {
|
|
68
|
+
readonly user: "https://user-daily.lovrabet.com";
|
|
69
|
+
readonly api: "https://daily-api.lovrabet.com";
|
|
70
|
+
readonly runtime: "https://daily-runtime.lovrabet.com";
|
|
71
|
+
readonly skill: "https://skills-daily.lovrabet.com";
|
|
72
|
+
readonly kb: "https://daily-runtime.lovrabet.com";
|
|
73
|
+
};
|
|
62
74
|
};
|
|
63
|
-
readonly
|
|
64
|
-
readonly
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
readonly id: {
|
|
76
|
+
readonly production: {
|
|
77
|
+
readonly user: "https://user.lovrabet.id";
|
|
78
|
+
readonly api: "https://api.lovrabet.id";
|
|
79
|
+
readonly runtime: "https://runtime.lovrabet.id";
|
|
80
|
+
readonly skill: "https://skills.lovrabet.id";
|
|
81
|
+
readonly kb: "https://runtime.lovrabet.id";
|
|
82
|
+
};
|
|
83
|
+
readonly nonProduction: {
|
|
84
|
+
readonly user: "https://user-daily.lovrabet.id";
|
|
85
|
+
readonly api: "https://daily-api.lovrabet.id";
|
|
86
|
+
readonly runtime: "https://daily-runtime.lovrabet.id";
|
|
87
|
+
readonly skill: "https://skills-daily.lovrabet.id";
|
|
88
|
+
readonly kb: "https://daily-runtime.lovrabet.id";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly global: {
|
|
92
|
+
readonly production: {
|
|
93
|
+
readonly user: "https://user.lovrabet.ai";
|
|
94
|
+
readonly api: "https://api.lovrabet.ai";
|
|
95
|
+
readonly runtime: "https://runtime.lovrabet.ai";
|
|
96
|
+
readonly skill: "https://skills.lovrabet.ai";
|
|
97
|
+
readonly kb: "https://runtime.lovrabet.ai";
|
|
98
|
+
};
|
|
99
|
+
readonly nonProduction: {
|
|
100
|
+
readonly user: "https://user-daily.lovrabet.ai";
|
|
101
|
+
readonly api: "https://daily-api.lovrabet.ai";
|
|
102
|
+
readonly runtime: "https://daily-runtime.lovrabet.ai";
|
|
103
|
+
readonly skill: "https://skills-daily.lovrabet.ai";
|
|
104
|
+
readonly kb: "https://daily-runtime.lovrabet.ai";
|
|
105
|
+
};
|
|
68
106
|
};
|
|
69
107
|
};
|
|
70
108
|
/** User center path for creating an AccessKey. */
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a98_0x40f711=a98_0x5385;function a98_0x4eb8(){const _0x5bb019=['/user/ak','.lovrabet.json','17639838YTDkTs','https://runtime.lovrabet.ai','https://g.lovrabet.com','https://skills-daily.lovrabet.id','3224697Yvdiap','git@codeup.aliyun.com:yuntoo/open/lovrabet-runtime-cli.git','https://user.lovrabet.id','1192073HKbYya','LOVRABET','legacyEnvPrefixes','lovrabet','lovrabet/lovrabet-cli','https://registry.npmjs.org','https://daily-api.lovrabet.ai','2442694ruyyiT','https://user-daily.lovrabet.com','https://daily-api.lovrabet.id','RABETBASE','775575whPLWD','https://skills-daily.lovrabet.com','https://skills.lovrabet.ai','https://daily-runtime.lovrabet.com','https://daily-runtime.lovrabet.id','https://user-daily.lovrabet.id','https://daily-api.lovrabet.com','https://runtime.lovrabet.id','https://user.lovrabet.ai','https://api.lovrabet.id','https://skills.lovrabet.id','@lovrabet/lovrabet-cli','8bKWmQj','https://user.lovrabet.com','.lovrabet-runtime.log','cli:lovrabet-runtime','5000064RZwCjC','208965NRkQef','https://skills.lovrabet.com','https://runtime.lovrabet.com','map','https://daily-runtime.lovrabet.ai','40BMFWAO'];a98_0x4eb8=function(){return _0x5bb019;};return a98_0x4eb8();}(function(_0x292f0f,_0x14b6d3){const _0x50a090=a98_0x5385,_0x4c05d8=_0x292f0f();while(!![]){try{const _0x356ceb=parseInt(_0x50a090(0x1a5))/0x1+parseInt(_0x50a090(0x1ac))/0x2+parseInt(_0x50a090(0x1b0))/0x3+-parseInt(_0x50a090(0x1c6))/0x4*(parseInt(_0x50a090(0x1c1))/0x5)+parseInt(_0x50a090(0x1c0))/0x6+-parseInt(_0x50a090(0x1cd))/0x7*(parseInt(_0x50a090(0x1bc))/0x8)+-parseInt(_0x50a090(0x1c9))/0x9;if(_0x356ceb===_0x14b6d3)break;else _0x4c05d8['push'](_0x4c05d8['shift']());}catch(_0x39ebdf){_0x4c05d8['push'](_0x4c05d8['shift']());}}}(a98_0x4eb8,0xa2c52));export const PRODUCT_CONFIG={'cliBinName':a98_0x40f711(0x1a8),'cliDisplayName':'Lovrabet\x20Runtime\x20CLI','npmPackageName':a98_0x40f711(0x1bb),'skillSource':a98_0x40f711(0x1a9),'internalSkillSource':a98_0x40f711(0x1a3),'globalSkillName':a98_0x40f711(0x1a8),'npmRegistryBaseUrl':a98_0x40f711(0x1aa),'cliCdnBaseUrl':a98_0x40f711(0x1cb),'envPrefix':a98_0x40f711(0x1a6),'legacyEnvPrefixes':[a98_0x40f711(0x1af)],'configFileNames':[a98_0x40f711(0x1c8)],'newConfigFileName':a98_0x40f711(0x1c8),'homeDirName':'.lovrabet','logFileName':a98_0x40f711(0x1be),'invokeSource':a98_0x40f711(0x1bf),'userCenterDisplayName':'Lovrabet\x20User\x20Center','skipNpxSkillsEnvSuffix':'SKIP_NPX_SKILLS','regionDomains':{'cn':{'production':{'user':a98_0x40f711(0x1bd),'api':'https://api.lovrabet.com','runtime':a98_0x40f711(0x1c3),'skill':a98_0x40f711(0x1c2),'kb':a98_0x40f711(0x1c3)},'nonProduction':{'user':a98_0x40f711(0x1ad),'api':a98_0x40f711(0x1b6),'runtime':a98_0x40f711(0x1b3),'skill':a98_0x40f711(0x1b1),'kb':a98_0x40f711(0x1b3)}},'id':{'production':{'user':a98_0x40f711(0x1a4),'api':a98_0x40f711(0x1b9),'runtime':a98_0x40f711(0x1b7),'skill':a98_0x40f711(0x1ba),'kb':'https://runtime.lovrabet.id'},'nonProduction':{'user':a98_0x40f711(0x1b5),'api':a98_0x40f711(0x1ae),'runtime':'https://daily-runtime.lovrabet.id','skill':a98_0x40f711(0x1cc),'kb':a98_0x40f711(0x1b4)}},'global':{'production':{'user':a98_0x40f711(0x1b8),'api':'https://api.lovrabet.ai','runtime':a98_0x40f711(0x1ca),'skill':a98_0x40f711(0x1b2),'kb':'https://runtime.lovrabet.ai'},'nonProduction':{'user':'https://user-daily.lovrabet.ai','api':a98_0x40f711(0x1ab),'runtime':a98_0x40f711(0x1c5),'skill':'https://skills-daily.lovrabet.ai','kb':'https://daily-runtime.lovrabet.ai'}}},'accessKeyCreatePath':a98_0x40f711(0x1c7)};export function productEnvName(_0x452cbe){return PRODUCT_CONFIG['envPrefix']+'_'+_0x452cbe;}function a98_0x5385(_0x31e518,_0x3fc21d){_0x31e518=_0x31e518-0x1a3;const _0x4eb8a2=a98_0x4eb8();let _0x5385d7=_0x4eb8a2[_0x31e518];return _0x5385d7;}export function productEnvNames(_0x189918){const _0x7470f8=a98_0x40f711;return[productEnvName(_0x189918),...PRODUCT_CONFIG[_0x7470f8(0x1a7)][_0x7470f8(0x1c4)](_0x549aee=>_0x549aee+'_'+_0x189918)];}export function productEnv(_0x16b433){for(const _0x475d3c of productEnvNames(_0x16b433)){const _0x211eb6=process.env[_0x475d3c];if(_0x211eb6!==undefined)return _0x211eb6;}return undefined;}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Lovrabet deployment-region constants and normalization.
|
|
3
|
+
*
|
|
4
|
+
* A region selects the default Lovrabet domain suffix. Explicit domain overrides
|
|
5
|
+
* remain authoritative, so private deployments can combine a public platform
|
|
6
|
+
* region with an enterprise-local runtime endpoint.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LOVRABET_REGION_VALUES: readonly ["cn", "id", "global"];
|
|
9
|
+
/** Regions currently available for new CLI configuration. */
|
|
10
|
+
export declare const ENABLED_LOVRABET_REGION_VALUES: readonly ["cn", "id"];
|
|
11
|
+
export type LovrabetRegion = (typeof LOVRABET_REGION_VALUES)[number];
|
|
12
|
+
export declare const DEFAULT_LOVRABET_REGION: LovrabetRegion;
|
|
13
|
+
export declare function isLovrabetRegion(value: unknown): value is LovrabetRegion;
|
|
14
|
+
export declare function isEnabledLovrabetRegion(value: unknown): value is "cn" | "id";
|
|
15
|
+
export declare function normalizeLovrabetRegion(value: unknown): LovrabetRegion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a99_0x5819(_0x1738ba,_0x49966a){_0x1738ba=_0x1738ba-0xb3;const _0x3ac511=a99_0x3ac5();let _0x5819eb=_0x3ac511[_0x1738ba];return _0x5819eb;}const a99_0x7f6883=a99_0x5819;(function(_0x112400,_0x55a6bf){const _0x1dc6f0=a99_0x5819,_0x23310b=_0x112400();while(!![]){try{const _0x1b34df=-parseInt(_0x1dc6f0(0xbc))/0x1*(parseInt(_0x1dc6f0(0xbd))/0x2)+-parseInt(_0x1dc6f0(0xb8))/0x3+-parseInt(_0x1dc6f0(0xb9))/0x4+parseInt(_0x1dc6f0(0xb6))/0x5*(parseInt(_0x1dc6f0(0xbe))/0x6)+-parseInt(_0x1dc6f0(0xba))/0x7+parseInt(_0x1dc6f0(0xbf))/0x8*(parseInt(_0x1dc6f0(0xb5))/0x9)+parseInt(_0x1dc6f0(0xb4))/0xa;if(_0x1b34df===_0x55a6bf)break;else _0x23310b['push'](_0x23310b['shift']());}catch(_0x39e0ed){_0x23310b['push'](_0x23310b['shift']());}}}(a99_0x3ac5,0x6dfb4));function a99_0x3ac5(){const _0xfb8aea=['3337019OnCGid','global','1GFizdL','1588438UxPsjB','126QvXMhn','5924744opdfkM','indonesia','china','12113900yKYGQU','9QlglCm','181285hePkCZ','string','1950882NtUCaQ','1366664qrRIkJ'];a99_0x3ac5=function(){return _0xfb8aea;};return a99_0x3ac5();}export const LOVRABET_REGION_VALUES=['cn','id',a99_0x7f6883(0xbb)];export const ENABLED_LOVRABET_REGION_VALUES=['cn','id'];export const DEFAULT_LOVRABET_REGION='cn';export function isLovrabetRegion(_0x1eb11e){const _0xe99402=a99_0x7f6883;return typeof _0x1eb11e===_0xe99402(0xb7)&&LOVRABET_REGION_VALUES['includes'](_0x1eb11e);}export function isEnabledLovrabetRegion(_0x22aaae){const _0x12220c=a99_0x7f6883;return typeof _0x22aaae===_0x12220c(0xb7)&&ENABLED_LOVRABET_REGION_VALUES['includes'](_0x22aaae);}export function normalizeLovrabetRegion(_0x26b18d){const _0x3bed14=a99_0x7f6883;if(_0x26b18d===_0x3bed14(0xb3))return'cn';if(_0x26b18d===_0x3bed14(0xc0))return'id';return isLovrabetRegion(_0x26b18d)?_0x26b18d:DEFAULT_LOVRABET_REGION;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a100_0x10e0(_0x4e577d,_0x4d7c40){_0x4e577d=_0x4e577d-0x1ef;const _0x12db32=a100_0x12db();let _0x10e074=_0x12db32[_0x4e577d];return _0x10e074;}const a100_0x253ac7=a100_0x10e0;(function(_0x54cbc3,_0x5db750){const _0x47980b=a100_0x10e0,_0x275ed6=_0x54cbc3();while(!![]){try{const _0x399edd=-parseInt(_0x47980b(0x1f1))/0x1*(parseInt(_0x47980b(0x1f3))/0x2)+-parseInt(_0x47980b(0x1f9))/0x3*(-parseInt(_0x47980b(0x1f2))/0x4)+-parseInt(_0x47980b(0x1fa))/0x5+parseInt(_0x47980b(0x1f4))/0x6*(parseInt(_0x47980b(0x1ef))/0x7)+-parseInt(_0x47980b(0x1f6))/0x8+-parseInt(_0x47980b(0x1f7))/0x9+parseInt(_0x47980b(0x1f5))/0xa;if(_0x399edd===_0x5db750)break;else _0x275ed6['push'](_0x275ed6['shift']());}catch(_0xc1e9f1){_0x275ed6['push'](_0x275ed6['shift']());}}}(a100_0x12db,0xd9947));export const RISK_LEVEL_VALUES=[a100_0x253ac7(0x1f0),a100_0x253ac7(0x1f8),'high-risk-write'];function a100_0x12db(){const _0x2c9b61=['80686dMFGjv','3288sUebQD','49269360OSpOoX','1309320zEIEpV','13948839fbwmuP','write','75KFyHJa','7171760sqwVlz','1687pwKLmA','read','38PPGuyO','82100UCbDIz'];a100_0x12db=function(){return _0x2c9b61;};return a100_0x12db();}
|
package/lib/constant/url.d.ts
CHANGED
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* and diagnostics. Keeping them in one module prevents drift when the same URL
|
|
6
6
|
* is reused across multiple commands.
|
|
7
7
|
*/
|
|
8
|
+
import { type LovrabetRegion } from "../constant/region.js";
|
|
8
9
|
/**
|
|
9
10
|
* Self-service page where users can create an AccessKey.
|
|
10
11
|
*
|
|
11
12
|
* Why this stays production-scoped: AccessKey creation is managed in the main
|
|
12
13
|
* user center rather than the runtime environment-specific backends.
|
|
13
14
|
*/
|
|
15
|
+
export declare function getUserAccessKeyCreateUrl(region?: LovrabetRegion): string;
|
|
14
16
|
export declare const USER_ACCESS_KEY_CREATE_URL: string;
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1247bf,_0x366169){const _0x1000e0=a101_0x215f,_0x4aa6c4=_0x1247bf();while(!![]){try{const _0x13d8dd=parseInt(_0x1000e0(0x1ba))/0x1*(-parseInt(_0x1000e0(0x1c2))/0x2)+-parseInt(_0x1000e0(0x1b8))/0x3*(parseInt(_0x1000e0(0x1b7))/0x4)+parseInt(_0x1000e0(0x1bb))/0x5*(parseInt(_0x1000e0(0x1be))/0x6)+-parseInt(_0x1000e0(0x1b6))/0x7*(parseInt(_0x1000e0(0x1bc))/0x8)+parseInt(_0x1000e0(0x1c3))/0x9*(-parseInt(_0x1000e0(0x1b9))/0xa)+-parseInt(_0x1000e0(0x1c4))/0xb*(-parseInt(_0x1000e0(0x1c1))/0xc)+-parseInt(_0x1000e0(0x1bd))/0xd*(-parseInt(_0x1000e0(0x1c0))/0xe);if(_0x13d8dd===_0x366169)break;else _0x4aa6c4['push'](_0x4aa6c4['shift']());}catch(_0x5ae20a){_0x4aa6c4['push'](_0x4aa6c4['shift']());}}}(a101_0xc4c2,0x20e86));import{PRODUCT_CONFIG}from'../constant/product.js';import{DEFAULT_LOVRABET_REGION}from'../constant/region.js';export function getUserAccessKeyCreateUrl(_0x699541=DEFAULT_LOVRABET_REGION){const _0x5b2b18=a101_0x215f,_0x5fc3e9=PRODUCT_CONFIG[_0x5b2b18(0x1bf)][_0x699541][_0x5b2b18(0x1b5)][_0x5b2b18(0x1c5)];return''+_0x5fc3e9+PRODUCT_CONFIG[_0x5b2b18(0x1c6)];}function a101_0xc4c2(){const _0x158843=['412VdgAjy','4209dHxpGU','4510FGDEKd','1MjgfyT','31385OaqJLM','24nhUkLR','13pLppqn','36odJfIx','regionDomains','6058696mePHJs','12YgEjFj','76958egEeZT','1089EcAVUx','1713745LLUnXP','user','accessKeyCreatePath','production','592368YlHOuQ'];a101_0xc4c2=function(){return _0x158843;};return a101_0xc4c2();}function a101_0x215f(_0x14fc7a,_0x3ab435){_0x14fc7a=_0x14fc7a-0x1b5;const _0xc4c289=a101_0xc4c2();let _0x215ff3=_0xc4c289[_0x14fc7a];return _0x215ff3;}export const USER_ACCESS_KEY_CREATE_URL=getUserAccessKeyCreateUrl();
|
package/lib/context.d.ts
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
* 3. Tests can mock `readRawConfig` to simulate different config states.
|
|
16
16
|
*
|
|
17
17
|
* Key design decisions:
|
|
18
|
-
* -
|
|
19
|
-
* isolating the project from accidental global config pollution.
|
|
18
|
+
* - Project config always overlays global config with standard key precedence.
|
|
20
19
|
* - `appCode` is resolved from explicit flags, top-level config, or the named
|
|
21
20
|
* local app profile selected by `defaultApp`.
|
|
22
21
|
* - Atomic writes (temp file + rename) prevent config corruption on crashes.
|
|
@@ -109,10 +108,7 @@ export interface LocalAppAliasProfile {
|
|
|
109
108
|
/**
|
|
110
109
|
* Determines the write target for a scoped config operation.
|
|
111
110
|
*
|
|
112
|
-
*
|
|
113
|
-
* we update it in place rather than creating a second file. Only if no file exists
|
|
114
|
-
* do we create the new name. This avoids littering `~` with `.lovrabetrc` and
|
|
115
|
-
* `.lovrabet.json` side by side.
|
|
111
|
+
* The target is always `.lovrabet.json`; foreign or legacy files are ignored.
|
|
116
112
|
*/
|
|
117
113
|
export declare function resolveWriteConfigPath(scope: "project" | "global"): string;
|
|
118
114
|
/**
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a99_0x5642bd=a99_0x2373;(function(_0x4230af,_0x2e69f0){const _0x47c013=a99_0x2373,_0x44fa99=_0x4230af();while(!![]){try{const _0x43e864=-parseInt(_0x47c013(0x110))/0x1*(-parseInt(_0x47c013(0x124))/0x2)+parseInt(_0x47c013(0x112))/0x3*(-parseInt(_0x47c013(0x107))/0x4)+parseInt(_0x47c013(0x121))/0x5+parseInt(_0x47c013(0xfd))/0x6+-parseInt(_0x47c013(0x132))/0x7*(parseInt(_0x47c013(0x102))/0x8)+-parseInt(_0x47c013(0x116))/0x9*(parseInt(_0x47c013(0x12b))/0xa)+parseInt(_0x47c013(0x13a))/0xb*(parseInt(_0x47c013(0x134))/0xc);if(_0x43e864===_0x2e69f0)break;else _0x44fa99['push'](_0x44fa99['shift']());}catch(_0x119f70){_0x44fa99['push'](_0x44fa99['shift']());}}}(a99_0x1dd4,0xce606));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';function a99_0x1dd4(){const _0x2f6578=['stdin','132ZOmDaK','accessKey','explicit','some','setRawCommand','string','maxRisk','error','isRaw','136627PvSoDT','./constant/domain.js','55386aGNdwP','production','message','configFileNames','2061387HCiQPm','true','object','high-risk-write','app','newConfigFileName','setRawMode','project','locale','online','EXDEV','358220QVcZeF','write','pageSize','6EyvDWo','trim','inherit','isTTY','global','runtimeDomain','development','10vJfeTL','setLogPath','defaultApp','cwd','projectConfig','find','EPERM','28cIHrGM','globalConfig','168kfMtEH','EACCES','skillHubDomain','FORMAT','env','userDomain','1094434CLtxGO','apps','stringify','utf8','nonInteractive','apiDomain','daily','appcode','riskLevel','./constant/env.js','PAGE_SIZE','missing','empty','read','raw','APP','5462676uDzKlF','parse','code','VERBOSE','format','2202560hNNBoS','join','ENV','values'];a99_0x1dd4=function(){return _0x2f6578;};return a99_0x1dd4();}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[a99_0x5642bd(0x115)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a99_0x5642bd(0x11b)];function resolveConfigPath(_0x1548ff){for(const _0xf02a7a of CONFIG_NAMES){const _0x5cc73b=resolve(_0x1548ff,_0xf02a7a);if(existsSync(_0x5cc73b))return _0x5cc73b;}return undefined;}export function resolveWriteConfigPath(_0x5a088b){const _0x538cf7=a99_0x5642bd,_0x412740=_0x5a088b===_0x538cf7(0x11d)?process[_0x538cf7(0x12e)]():homedir(),_0x1aa00b=resolveConfigPath(_0x412740);return _0x1aa00b??resolve(_0x412740,NEW_CONFIG_NAME);}export function readConfigFile(_0x40744b){const _0x153cf6=a99_0x5642bd;try{if(existsSync(_0x40744b)){const _0x3cbfe5=readFileSync(_0x40744b,{'encoding':_0x153cf6(0x13d)});if(_0x3cbfe5){const _0x5a6d78=JSON[_0x153cf6(0xfe)](_0x3cbfe5);return migrateOnlineEnv(_0x40744b,_0x5a6d78),_0x5a6d78;}}}catch{}return{};}function migrateOnlineEnv(_0x1f9c5f,_0x45e1a3){const _0x1b7a4f=a99_0x5642bd;let _0x3baac6=![];_0x45e1a3['env']===_0x1b7a4f(0x11f)&&(_0x45e1a3[_0x1b7a4f(0x138)]=_0x1b7a4f(0x113),_0x3baac6=!![]);if(_0x45e1a3['apps']&&typeof _0x45e1a3['apps']===_0x1b7a4f(0x118))for(const _0x19e461 of Object[_0x1b7a4f(0x105)](_0x45e1a3[_0x1b7a4f(0x13b)])){_0x19e461&&_0x19e461[_0x1b7a4f(0x138)]==='online'&&(_0x19e461[_0x1b7a4f(0x138)]=_0x1b7a4f(0x113),_0x3baac6=!![]);}if(_0x3baac6)try{writeConfigFile(_0x1f9c5f,_0x45e1a3);}catch{}}export function writeConfigFile(_0x56e247,_0x53f52b){const _0x4dc3b5=a99_0x5642bd,_0x566052=dirname(_0x56e247);!existsSync(_0x566052)&&mkdirSync(_0x566052,{'recursive':!![]});const _0x30a625=_0x56e247+'.tmp';try{writeFileSync(_0x30a625,JSON[_0x4dc3b5(0x13c)](_0x53f52b,null,0x2)+'\x0a',{'encoding':_0x4dc3b5(0x13d),'mode':0x180});try{renameSync(_0x30a625,_0x56e247);}catch(_0x574806){if(_0x574806['code']===_0x4dc3b5(0x131)||_0x574806[_0x4dc3b5(0xff)]===_0x4dc3b5(0x120)||_0x574806[_0x4dc3b5(0xff)]===_0x4dc3b5(0x135)){writeFileSync(_0x56e247,JSON['stringify'](_0x53f52b,null,0x2)+'\x0a',{'encoding':_0x4dc3b5(0x13d)});try{unlinkSync(_0x30a625);}catch{}}else throw _0x574806;}}catch(_0x33ed3d){try{unlinkSync(_0x30a625);}catch{}throw _0x33ed3d;}}export function isNonInteractiveMode(_0x52b360){const _0x27b9bf=a99_0x5642bd;return!!(_0x52b360[_0x27b9bf(0x13e)]||_0x52b360['ci']||productEnvNames('CI')[_0x27b9bf(0x10a)](_0x544a3e=>process.env[_0x544a3e]===_0x27b9bf(0x117))||process.env.CI===_0x27b9bf(0x117)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x269606=a99_0x5642bd;if(!process[_0x269606(0x106)][_0x269606(0x127)])return![];try{const _0xd8d972=process['stdin'][_0x269606(0x10f)];return process[_0x269606(0x106)][_0x269606(0x11c)](!![]),process['stdin'][_0x269606(0x11c)](_0xd8d972??![]),!![];}catch{return![];}}export async function createContext(_0x312461){const _0x10291f=a99_0x5642bd,_0x5df9fd=readRawConfig(),_0x21d681=buildConfig(_0x5df9fd,_0x312461);await initGlobalEnvironment(_0x21d681);const {getUserDomain:_0xbb4034,getApiDomain:_0x56aa9d}=await import(_0x10291f(0x111)),_0x2fd144={'apiDomain':_0x56aa9d(),'userDomain':_0xbb4034()},_0x11843c=await buildAuth(_0x21d681);logger[_0x10291f(0x12c)](process[_0x10291f(0x12e)]());const _0x1a73ef=(CLI_BIN_NAME+'\x20'+process['argv']['slice'](0x2)[_0x10291f(0x103)]('\x20'))[_0x10291f(0x125)]();logger[_0x10291f(0x10b)](_0x1a73ef);const _0x1b9da2=isNonInteractiveMode(_0x312461);return{'config':_0x21d681,'auth':_0x11843c,'logger':logger,'env':_0x2fd144,'nonInteractive':_0x1b9da2};}export function buildConfigFromFlags(_0x385a46){return buildConfig(readRawConfig(),_0x385a46);}export function getLocalAppAliases(_0x285481){const _0x46e0c4=a99_0x5642bd;return _0x285481[_0x46e0c4(0x13b)]&&typeof _0x285481[_0x46e0c4(0x13b)]==='object'?_0x285481['apps']:{};}export function resolveLocalAppAliasCode(_0x3fea20,_0x3bb534){const _0x4c5d90=a99_0x5642bd;if(!_0x3bb534)return undefined;const _0xbc8097=getLocalAppAliases(_0x3fea20)[_0x3bb534],_0x2f06c0=_0xbc8097?.[_0x4c5d90(0x141)];return typeof _0x2f06c0===_0x4c5d90(0x10c)&&_0x2f06c0[_0x4c5d90(0x125)]()?_0x2f06c0[_0x4c5d90(0x125)]():undefined;}export function readAppCodeFromConfig(){const _0x545dd5=a99_0x5642bd,_0x2bb2fa=readRawConfig(),_0x55bebf=_0x2bb2fa['appcode']??_0x2bb2fa[_0x545dd5(0x11a)];if(typeof _0x55bebf==='string'&&_0x55bebf[_0x545dd5(0x125)]())return _0x55bebf['trim']();const _0x3438b3=resolveLocalAppAliasCode(_0x2bb2fa,typeof _0x2bb2fa['defaultApp']==='string'?_0x2bb2fa[_0x545dd5(0x12d)]:undefined);if(_0x3438b3)return _0x3438b3;const _0x2129fd=normalizeEnv(String(_0x2bb2fa[_0x545dd5(0x138)]||'production')),_0x405263=isDaily(_0x2129fd)?_0x545dd5(0x140):isDev(_0x2129fd)?_0x545dd5(0x12a):_0x545dd5(0x113),_0x1b924c=resolveCachedAppCode(typeof _0x2bb2fa[_0x545dd5(0x12d)]==='string'?_0x2bb2fa[_0x545dd5(0x12d)]:undefined,_0x405263,typeof _0x2bb2fa[_0x545dd5(0x108)]===_0x545dd5(0x10c)?_0x2bb2fa[_0x545dd5(0x108)]:undefined);if(_0x1b924c)return _0x1b924c;const _0x233f3b=Object[_0x545dd5(0x105)](getLocalAppAliases(_0x2bb2fa))[_0x545dd5(0x130)](_0x161de4=>_0x161de4?.['appcode']);return typeof _0x233f3b?.[_0x545dd5(0x141)]===_0x545dd5(0x10c)&&_0x233f3b['appcode'][_0x545dd5(0x125)]()?_0x233f3b[_0x545dd5(0x141)][_0x545dd5(0x125)]():undefined;}export function readScopedConfig(_0x249576){const _0x5f0aae=a99_0x5642bd,_0x271952=_0x249576[_0x5f0aae(0x128)]?_0x5f0aae(0x128):_0x5f0aae(0x11d);return readConfigFile(resolveWriteConfigPath(_0x271952));}export function writeScopedConfig(_0xd60821,_0x33d2a2){const _0x5da973=a99_0x5642bd,_0x2d5361=_0x33d2a2[_0x5da973(0x128)]?_0x5da973(0x128):_0x5da973(0x11d);writeConfigFile(resolveWriteConfigPath(_0x2d5361),_0xd60821);}function a99_0x2373(_0x37631d,_0x52e8de){_0x37631d=_0x37631d-0xf6;const _0x1dd421=a99_0x1dd4();let _0x2373e5=_0x1dd421[_0x37631d];return _0x2373e5;}export async function initGlobalEnvironment(_0x112590){const _0x3d255a=a99_0x5642bd,{initEnv:_0x242016}=await import(_0x3d255a(0xf6));_0x242016(_0x112590[_0x3d255a(0x138)]);const {initDomains:_0x4fe375}=await import('./constant/domain.js');_0x4fe375({'apiDomain':_0x112590[_0x3d255a(0xfb)][_0x3d255a(0x13f)]||_0x112590['raw']['host']||undefined,'userDomain':_0x112590[_0x3d255a(0xfb)][_0x3d255a(0x139)]||undefined,'runtimeDomain':_0x112590['raw'][_0x3d255a(0x129)]||undefined,'skillHubDomain':_0x112590['raw'][_0x3d255a(0x136)]||undefined});}export function getProjectConfigPath(){const _0x3f5c21=a99_0x5642bd;return resolveConfigPath(process[_0x3f5c21(0x12e)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x161b71){const _0x2e3f65=a99_0x5642bd;if(!existsSync(_0x161b71))return{'status':_0x2e3f65(0xf8)};try{const _0x3f5263=readFileSync(_0x161b71,{'encoding':_0x2e3f65(0x13d)});if(!_0x3f5263?.[_0x2e3f65(0x125)]())return{'status':_0x2e3f65(0xf9)};const _0x58461e=JSON['parse'](_0x3f5263);return{'status':'ok','data':_0x58461e};}catch(_0x348390){return{'status':_0x2e3f65(0x10e),'message':_0x348390 instanceof Error?_0x348390[_0x2e3f65(0x114)]:String(_0x348390)};}}export function loadRawConfigLayers(_0x39bf95){const _0x388ee3=a99_0x5642bd;let _0x4ba324={},_0x66f2d1={},_0xbee88e,_0x58c4ed;try{_0xbee88e=resolveConfigPath(homedir());if(_0xbee88e){const _0x53e3ce=readFileSync(_0xbee88e,{'encoding':_0x388ee3(0x13d)});if(_0x53e3ce)_0x4ba324=JSON[_0x388ee3(0xfe)](_0x53e3ce);}}catch{}try{const _0x31dd02=_0x39bf95||process[_0x388ee3(0x12e)]();_0x58c4ed=resolveConfigPath(_0x31dd02);if(_0x58c4ed){const _0x5232d5=readFileSync(_0x58c4ed,{'encoding':'utf8'});if(_0x5232d5)_0x66f2d1=JSON['parse'](_0x5232d5);}}catch{}return{'globalPath':_0xbee88e,'projectPath':_0x58c4ed,'globalConfig':_0x4ba324,'projectConfig':_0x66f2d1};}function mergeRawConfigLayers(_0x81ea5c){const _0x209441=a99_0x5642bd,{globalConfig:_0x4872d5,projectConfig:_0x46305f}=_0x81ea5c;if(_0x46305f[_0x209441(0x126)]===![]){const _0x30732a={..._0x46305f};return delete _0x30732a[_0x209441(0x126)],_0x30732a;}const _0x54e682={..._0x4872d5,..._0x46305f};if(_0x209441(0x12d)in _0x46305f)_0x54e682[_0x209441(0x12d)]=_0x46305f['defaultApp'];else _0x4872d5['defaultApp']&&(_0x54e682[_0x209441(0x12d)]=_0x4872d5[_0x209441(0x12d)]);return _0x54e682;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x2134ac){return mergeRawConfigLayers(loadRawConfigLayers(_0x2134ac));}export function readRawConfigWithLayers(_0x1b973e){const _0x41988a=loadRawConfigLayers(_0x1b973e);return{'config':mergeRawConfigLayers(_0x41988a),'layers':_0x41988a};}export function resolveDefaultAppSource(_0x4ef5ea){const _0x4220b5=a99_0x5642bd;if('defaultApp'in _0x4ef5ea[_0x4220b5(0x12f)])return _0x4220b5(0x11d);if(_0x4ef5ea[_0x4220b5(0x12f)][_0x4220b5(0x126)]===![])return null;if(_0x4ef5ea[_0x4220b5(0x133)][_0x4220b5(0x12d)])return _0x4220b5(0x128);return null;}function buildConfig(_0x46dddb,_0xa3d0e6){const _0x108a3b=a99_0x5642bd,_0x405398=_0x46dddb[_0x108a3b(0x12d)]||undefined,_0x25bcce=_0xa3d0e6[_0x108a3b(0x11a)]||env(_0x108a3b(0xfc))||undefined,_0x370de7=_0x25bcce||_0x405398||undefined,_0x31353b=env('ACCESS_KEY')||_0x46dddb['accessKey']||undefined,_0x448144=_0xa3d0e6[_0x108a3b(0x138)]||env(_0x108a3b(0x104))||_0x46dddb['env']||DEFAULT_CONFIG_VALUES['env'],_0x45b8a9=normalizeEnv(String(_0x448144)),_0x4be08a=isDaily(_0x45b8a9)?_0x108a3b(0x140):isDev(_0x45b8a9)?'development':'production',_0xb1ea02=typeof _0xa3d0e6[_0x108a3b(0x141)]===_0x108a3b(0x10c)?_0xa3d0e6[_0x108a3b(0x141)]:undefined,_0x2c2fc5=env('APPCODE'),_0x161ecd=_0x25bcce?undefined:_0x46dddb[_0x108a3b(0x141)]||_0x46dddb[_0x108a3b(0x11a)]||undefined,_0x10e4ac=_0x25bcce||(_0x161ecd?undefined:_0x405398),_0x37916a=resolveLocalAppAliasCode(_0x46dddb,_0x10e4ac),_0x4f60a2=resolveCachedAppCode(_0x10e4ac,_0x4be08a,_0x31353b),_0x3c6856=_0xb1ea02||_0x2c2fc5||_0x161ecd||_0x37916a||_0x4f60a2||undefined,_0x44c02c=_0xb1ea02?_0x108a3b(0x109):_0x2c2fc5?_0x108a3b(0x138):_0x161ecd?'top-level':_0x37916a?'local-alias':_0x4f60a2?'cache':undefined,_0x57c33d=_0x46dddb[_0x108a3b(0x11e)]||DEFAULT_CONFIG_VALUES[_0x108a3b(0x11e)],_0xe2a8e0=undefined,_0x3f5784=_0xa3d0e6[_0x108a3b(0x101)]||env(_0x108a3b(0x137))||_0x46dddb[_0x108a3b(0x101)],_0x3cfb7d=normalizeLegacyOutputFormat(_0x3f5784),_0x5c6c24=env(_0x108a3b(0xf7))||_0x46dddb[_0x108a3b(0x123)],_0x230e11=_0x5c6c24?Number(_0x5c6c24)||undefined:undefined,_0x210605=_0x46dddb[_0x108a3b(0x142)]||_0x46dddb[_0x108a3b(0x10d)],_0x3604e3=_0x210605===_0x108a3b(0xfa)||_0x210605===_0x108a3b(0x122)||_0x210605===_0x108a3b(0x119)?_0x210605:DEFAULT_CONFIG_VALUES[_0x108a3b(0x142)],_0x413ef7=env(_0x108a3b(0x100)),_0x31bc99=_0x413ef7==='1'||_0x413ef7===_0x108a3b(0x117);return{'appCode':typeof _0x3c6856==='string'&&_0x3c6856[_0x108a3b(0x125)]()?_0x3c6856[_0x108a3b(0x125)]():undefined,'appCodeSource':_0x44c02c,'env':_0x4be08a,'locale':_0x57c33d,'cookie':_0xe2a8e0,'accessKey':_0x31353b,'format':_0x3cfb7d,'pageSize':_0x230e11,'riskLevel':_0x3604e3,'verbose':_0x31bc99,'defaultApp':_0x405398,'currentApp':typeof _0x370de7===_0x108a3b(0x10c)?_0x370de7:undefined,'raw':_0x46dddb};}function env(_0x36eb0b){return productEnv(_0x36eb0b);}async function buildAuth(_0x4aef15){const _0x406c4e='',_0xc1d438=!!_0x4aef15['accessKey'];return{'cookie':_0x406c4e,'isLoggedIn':_0xc1d438,async 'getOrLogin'(){if(_0xc1d438)return _0x406c4e;throw CliErrors['authRequired']();}};}
|
|
1
|
+
const a102_0x777755=a102_0x3d0c;(function(_0x2554c8,_0x4df0c8){const _0x4295fa=a102_0x3d0c,_0x503836=_0x2554c8();while(!![]){try{const _0x220539=-parseInt(_0x4295fa(0x7b))/0x1*(parseInt(_0x4295fa(0xa3))/0x2)+parseInt(_0x4295fa(0xb9))/0x3+parseInt(_0x4295fa(0x8a))/0x4+parseInt(_0x4295fa(0x88))/0x5*(-parseInt(_0x4295fa(0x82))/0x6)+-parseInt(_0x4295fa(0x9f))/0x7+parseInt(_0x4295fa(0x85))/0x8+parseInt(_0x4295fa(0x87))/0x9*(parseInt(_0x4295fa(0xbf))/0xa);if(_0x220539===_0x4df0c8)break;else _0x503836['push'](_0x503836['shift']());}catch(_0x3752be){_0x503836['push'](_0x503836['shift']());}}}(a102_0x7ed4,0x9bd0b));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';function a102_0x7ed4(){const _0x5f2836=['project','argv','439BrXBfT','values','global','skillHubDomain','true','development','accessKey','5274588uAIiXW','userDomain','isTTY','7882736WEsyQp','code','195417TopSRI','5oVsxMo','apiDomain','1240568ixkUlS','stdout','object','platformDomain','runtimeDomain','empty','join','host','PAGE_SIZE','production','EXDEV','apps','authRequired','utf8','stringify','slice','inherit','./constant/env.js','ENV','setRawCommand','kbDomain','4406850vxzLTi','isRaw','FORMAT','.tmp','4528AbrrWQ','trim','EACCES','agentDomain','defaultApp','projectConfig','cwd','error','APP','EPERM','some','format','missing','local-alias','parse','appcode','env','locale','string','maxRisk','setRawMode','ACCESS_KEY','2604582PBNxGW','find','riskLevel','setLogPath','stdin','cache','450MzkAwu','globalConfig','./constant/domain.js','high-risk-write','newConfigFileName','raw','skillDomain','online','daily','app','pageSize'];a102_0x7ed4=function(){return _0x5f2836;};return a102_0x7ed4();}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';import{normalizeLovrabetRegion}from'./constant/region.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG['configFileNames'];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a102_0x777755(0xc3)];function resolveConfigPath(_0x684b00){for(const _0x1bee51 of CONFIG_NAMES){const _0x248d21=resolve(_0x684b00,_0x1bee51);if(existsSync(_0x248d21))return _0x248d21;}return undefined;}export function resolveWriteConfigPath(_0x12740b){const _0x38e4d3=a102_0x777755,_0xa7577a=_0x12740b===_0x38e4d3(0x79)?process[_0x38e4d3(0xa9)]():homedir(),_0x3e2779=resolveConfigPath(_0xa7577a);return _0x3e2779??resolve(_0xa7577a,NEW_CONFIG_NAME);}export function readConfigFile(_0x21b903){const _0x3f8e73=a102_0x777755;try{if(existsSync(_0x21b903)){const _0x4a6d77=readFileSync(_0x21b903,{'encoding':_0x3f8e73(0x97)});if(_0x4a6d77){const _0x3cc571=JSON[_0x3f8e73(0xb1)](_0x4a6d77);return migrateOnlineEnv(_0x21b903,_0x3cc571),_0x3cc571;}}}catch{}return{};}function migrateOnlineEnv(_0x26bbc2,_0x52da19){const _0x230377=a102_0x777755;let _0x3f4149=![];_0x52da19[_0x230377(0xb3)]===_0x230377(0x75)&&(_0x52da19[_0x230377(0xb3)]=_0x230377(0x93),_0x3f4149=!![]);if(_0x52da19['apps']&&typeof _0x52da19[_0x230377(0x95)]===_0x230377(0x8c))for(const _0x15b02f of Object['values'](_0x52da19[_0x230377(0x95)])){_0x15b02f&&_0x15b02f[_0x230377(0xb3)]==='online'&&(_0x15b02f[_0x230377(0xb3)]='production',_0x3f4149=!![]);}if(_0x3f4149)try{writeConfigFile(_0x26bbc2,_0x52da19);}catch{}}export function writeConfigFile(_0x5cd837,_0x106625){const _0x4eedc4=a102_0x777755,_0x61a38b=dirname(_0x5cd837);!existsSync(_0x61a38b)&&mkdirSync(_0x61a38b,{'recursive':!![]});const _0x2cd180=_0x5cd837+_0x4eedc4(0xa2);try{writeFileSync(_0x2cd180,JSON[_0x4eedc4(0x98)](_0x106625,null,0x2)+'\x0a',{'encoding':_0x4eedc4(0x97),'mode':0x180});try{renameSync(_0x2cd180,_0x5cd837);}catch(_0x2271f4){if(_0x2271f4[_0x4eedc4(0x86)]===_0x4eedc4(0xac)||_0x2271f4[_0x4eedc4(0x86)]===_0x4eedc4(0x94)||_0x2271f4[_0x4eedc4(0x86)]===_0x4eedc4(0xa5)){writeFileSync(_0x5cd837,JSON[_0x4eedc4(0x98)](_0x106625,null,0x2)+'\x0a',{'encoding':_0x4eedc4(0x97)});try{unlinkSync(_0x2cd180);}catch{}}else throw _0x2271f4;}}catch(_0x5ec5a0){try{unlinkSync(_0x2cd180);}catch{}throw _0x5ec5a0;}}export function isNonInteractiveMode(_0x109435){const _0xee0f6d=a102_0x777755;return!!(_0x109435['nonInteractive']||_0x109435['ci']||productEnvNames('CI')[_0xee0f6d(0xad)](_0xa37591=>process.env[_0xa37591]===_0xee0f6d(0x7f))||process.env.CI===_0xee0f6d(0x7f)||!process[_0xee0f6d(0x8b)][_0xee0f6d(0x84)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x19483a=a102_0x777755;if(!process[_0x19483a(0xbd)][_0x19483a(0x84)])return![];try{const _0x35b06e=process['stdin'][_0x19483a(0xa0)];return process[_0x19483a(0xbd)][_0x19483a(0xb7)](!![]),process['stdin'][_0x19483a(0xb7)](_0x35b06e??![]),!![];}catch{return![];}}export async function createContext(_0x2d7564){const _0x42421a=a102_0x777755,_0x43be01=readRawConfig(),_0x419713=buildConfig(_0x43be01,_0x2d7564);await initGlobalEnvironment(_0x419713);const {getUserDomain:_0x493072,getApiDomain:_0x3dcda6}=await import('./constant/domain.js'),_0x397078={'apiDomain':_0x3dcda6(),'userDomain':_0x493072()},_0x568932=await buildAuth(_0x419713);logger[_0x42421a(0xbc)](process['cwd']());const _0x541630=(CLI_BIN_NAME+'\x20'+process[_0x42421a(0x7a)][_0x42421a(0x99)](0x2)[_0x42421a(0x90)]('\x20'))['trim']();logger[_0x42421a(0x9d)](_0x541630);const _0x3ae87f=isNonInteractiveMode(_0x2d7564);return{'config':_0x419713,'auth':_0x568932,'logger':logger,'env':_0x397078,'nonInteractive':_0x3ae87f};}export function buildConfigFromFlags(_0x34c9f5){return buildConfig(readRawConfig(),_0x34c9f5);}export function getLocalAppAliases(_0x53fa04){const _0x47edbb=a102_0x777755;return _0x53fa04[_0x47edbb(0x95)]&&typeof _0x53fa04[_0x47edbb(0x95)]===_0x47edbb(0x8c)?_0x53fa04[_0x47edbb(0x95)]:{};}export function resolveLocalAppAliasCode(_0x4cd1aa,_0x45f89a){const _0xcb3390=a102_0x777755;if(!_0x45f89a)return undefined;const _0x5ca2e5=getLocalAppAliases(_0x4cd1aa)[_0x45f89a],_0xada916=_0x5ca2e5?.[_0xcb3390(0xb2)];return typeof _0xada916===_0xcb3390(0xb5)&&_0xada916[_0xcb3390(0xa4)]()?_0xada916[_0xcb3390(0xa4)]():undefined;}export function readAppCodeFromConfig(){const _0x39f8a6=a102_0x777755,_0x4c2a47=readRawConfig(),_0x477a15=_0x4c2a47[_0x39f8a6(0xb2)]??_0x4c2a47[_0x39f8a6(0x77)];if(typeof _0x477a15===_0x39f8a6(0xb5)&&_0x477a15[_0x39f8a6(0xa4)]())return _0x477a15[_0x39f8a6(0xa4)]();const _0x20c026=resolveLocalAppAliasCode(_0x4c2a47,typeof _0x4c2a47[_0x39f8a6(0xa7)]===_0x39f8a6(0xb5)?_0x4c2a47[_0x39f8a6(0xa7)]:undefined);if(_0x20c026)return _0x20c026;const _0x1a28c9=normalizeEnv(String(_0x4c2a47[_0x39f8a6(0xb3)]||'production')),_0x25e645=isDaily(_0x1a28c9)?_0x39f8a6(0x76):isDev(_0x1a28c9)?'development':_0x39f8a6(0x93),_0x5c4ae6=resolveCachedAppCode(typeof _0x4c2a47['defaultApp']===_0x39f8a6(0xb5)?_0x4c2a47['defaultApp']:undefined,_0x25e645,typeof _0x4c2a47[_0x39f8a6(0x81)]==='string'?_0x4c2a47[_0x39f8a6(0x81)]:undefined);if(_0x5c4ae6)return _0x5c4ae6;const _0x6b7de4=Object[_0x39f8a6(0x7c)](getLocalAppAliases(_0x4c2a47))[_0x39f8a6(0xba)](_0x26423c=>_0x26423c?.[_0x39f8a6(0xb2)]);return typeof _0x6b7de4?.['appcode']===_0x39f8a6(0xb5)&&_0x6b7de4[_0x39f8a6(0xb2)][_0x39f8a6(0xa4)]()?_0x6b7de4['appcode'][_0x39f8a6(0xa4)]():undefined;}export function readScopedConfig(_0x44b0b1){const _0x4a0f90=a102_0x777755,_0x1d9fde=_0x44b0b1[_0x4a0f90(0x7d)]?'global':_0x4a0f90(0x79);return readConfigFile(resolveWriteConfigPath(_0x1d9fde));}function a102_0x3d0c(_0x5ca30,_0x27bad7){_0x5ca30=_0x5ca30-0x73;const _0x7ed470=a102_0x7ed4();let _0x3d0c4e=_0x7ed470[_0x5ca30];return _0x3d0c4e;}export function writeScopedConfig(_0x5a67fd,_0x73b34e){const _0xa3718c=a102_0x777755,_0x5c58a2=_0x73b34e[_0xa3718c(0x7d)]?_0xa3718c(0x7d):_0xa3718c(0x79);writeConfigFile(resolveWriteConfigPath(_0x5c58a2),_0x5a67fd);}export async function initGlobalEnvironment(_0x5c8eae){const _0x60c339=a102_0x777755,{initEnv:_0x3734ed}=await import(_0x60c339(0x9b));_0x3734ed(_0x5c8eae[_0x60c339(0xb3)]);const {initDomains:_0x5d2942}=await import(_0x60c339(0xc1));_0x5d2942({'apiDomain':_0x5c8eae['raw'][_0x60c339(0x89)]||_0x5c8eae['raw'][_0x60c339(0x91)]||undefined,'userDomain':_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x83)]||undefined,'runtimeDomain':_0x5c8eae['raw'][_0x60c339(0x8e)]||undefined,'skillDomain':_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x74)]||_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x7e)]||_0x5c8eae['raw'][_0x60c339(0xa6)]||_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x8d)]||undefined,'kbDomain':_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x9e)]||_0x5c8eae[_0x60c339(0x73)]['agentDomain']||_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x8d)]||_0x5c8eae[_0x60c339(0x73)][_0x60c339(0x8e)]||undefined,'region':normalizeLovrabetRegion(_0x5c8eae['raw']['region'])});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x3261d2){const _0x2544fd=a102_0x777755;if(!existsSync(_0x3261d2))return{'status':_0x2544fd(0xaf)};try{const _0x1c571b=readFileSync(_0x3261d2,{'encoding':_0x2544fd(0x97)});if(!_0x1c571b?.[_0x2544fd(0xa4)]())return{'status':_0x2544fd(0x8f)};const _0x3a577e=JSON['parse'](_0x1c571b);return{'status':'ok','data':_0x3a577e};}catch(_0x31539b){return{'status':_0x2544fd(0xaa),'message':_0x31539b instanceof Error?_0x31539b['message']:String(_0x31539b)};}}export function loadRawConfigLayers(_0x4e5949){const _0x3b4479=a102_0x777755;let _0x551d22={},_0x403339={},_0x24705c,_0x3a595a;try{_0x24705c=resolveConfigPath(homedir());if(_0x24705c){const _0x14ed79=readFileSync(_0x24705c,{'encoding':_0x3b4479(0x97)});if(_0x14ed79)_0x551d22=JSON[_0x3b4479(0xb1)](_0x14ed79);}}catch{}try{const _0x1dc6b9=_0x4e5949||process[_0x3b4479(0xa9)]();_0x3a595a=resolveConfigPath(_0x1dc6b9);if(_0x3a595a){const _0x5311d4=readFileSync(_0x3a595a,{'encoding':'utf8'});if(_0x5311d4)_0x403339=JSON[_0x3b4479(0xb1)](_0x5311d4);}}catch{}return{'globalPath':_0x24705c,'projectPath':_0x3a595a,'globalConfig':_0x551d22,'projectConfig':_0x403339};}function mergeRawConfigLayers(_0x3598cf){const _0x7740ff=a102_0x777755,{globalConfig:_0xa4738b,projectConfig:_0x23f91b}=_0x3598cf,_0x1b38bf={..._0xa4738b,..._0x23f91b};delete _0x1b38bf[_0x7740ff(0x9a)];if('defaultApp'in _0x23f91b)_0x1b38bf[_0x7740ff(0xa7)]=_0x23f91b[_0x7740ff(0xa7)];else _0xa4738b[_0x7740ff(0xa7)]&&(_0x1b38bf[_0x7740ff(0xa7)]=_0xa4738b[_0x7740ff(0xa7)]);return _0x1b38bf;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x47e21e){return mergeRawConfigLayers(loadRawConfigLayers(_0x47e21e));}export function readRawConfigWithLayers(_0x1747ea){const _0x9b945b=loadRawConfigLayers(_0x1747ea);return{'config':mergeRawConfigLayers(_0x9b945b),'layers':_0x9b945b};}export function resolveDefaultAppSource(_0xee9c9d){const _0x610e2e=a102_0x777755;if(_0x610e2e(0xa7)in _0xee9c9d[_0x610e2e(0xa8)])return _0x610e2e(0x79);if(_0xee9c9d[_0x610e2e(0xc0)][_0x610e2e(0xa7)])return _0x610e2e(0x7d);return null;}function buildConfig(_0x630716,_0x386ed0){const _0x543bc1=a102_0x777755,_0x17be4f=_0x630716[_0x543bc1(0xa7)]||undefined,_0x21e006=_0x386ed0[_0x543bc1(0x77)]||env(_0x543bc1(0xab))||undefined,_0x2c6547=_0x21e006||_0x17be4f||undefined,_0x19f002=env(_0x543bc1(0xb8))||_0x630716['accessKey']||undefined,_0x94efbc=_0x386ed0[_0x543bc1(0xb3)]||env(_0x543bc1(0x9c))||_0x630716[_0x543bc1(0xb3)]||DEFAULT_CONFIG_VALUES[_0x543bc1(0xb3)],_0x4baeb1=normalizeEnv(String(_0x94efbc)),_0x9bce23=isDaily(_0x4baeb1)?'daily':isDev(_0x4baeb1)?_0x543bc1(0x80):_0x543bc1(0x93),_0x5ac85c=typeof _0x386ed0['appcode']===_0x543bc1(0xb5)?_0x386ed0[_0x543bc1(0xb2)]:undefined,_0x1baa0c=env('APPCODE'),_0xff522d=_0x21e006?undefined:_0x630716[_0x543bc1(0xb2)]||_0x630716[_0x543bc1(0x77)]||undefined,_0x3f18e9=_0x21e006||(_0xff522d?undefined:_0x17be4f),_0x3fdd7b=resolveLocalAppAliasCode(_0x630716,_0x3f18e9),_0x2dd43d=resolveCachedAppCode(_0x3f18e9,_0x9bce23,_0x19f002),_0x10ad0a=_0x5ac85c||_0x1baa0c||_0xff522d||_0x3fdd7b||_0x2dd43d||undefined,_0x2e98e6=_0x5ac85c?'explicit':_0x1baa0c?_0x543bc1(0xb3):_0xff522d?'top-level':_0x3fdd7b?_0x543bc1(0xb0):_0x2dd43d?_0x543bc1(0xbe):undefined,_0x258082=_0x630716['locale']||DEFAULT_CONFIG_VALUES[_0x543bc1(0xb4)],_0x3ddf6b=undefined,_0xea747=_0x386ed0[_0x543bc1(0xae)]||env(_0x543bc1(0xa1))||_0x630716[_0x543bc1(0xae)],_0x465072=normalizeLegacyOutputFormat(_0xea747),_0x51940d=env(_0x543bc1(0x92))||_0x630716[_0x543bc1(0x78)],_0x28ee4f=_0x51940d?Number(_0x51940d)||undefined:undefined,_0x4c453a=_0x630716[_0x543bc1(0xbb)]||_0x630716[_0x543bc1(0xb6)],_0x5a2f3e=_0x4c453a==='read'||_0x4c453a==='write'||_0x4c453a===_0x543bc1(0xc2)?_0x4c453a:DEFAULT_CONFIG_VALUES[_0x543bc1(0xbb)],_0x1d46ef=env('VERBOSE'),_0xfe81b5=_0x1d46ef==='1'||_0x1d46ef===_0x543bc1(0x7f);return{'appCode':typeof _0x10ad0a===_0x543bc1(0xb5)&&_0x10ad0a['trim']()?_0x10ad0a['trim']():undefined,'appCodeSource':_0x2e98e6,'env':_0x9bce23,'locale':_0x258082,'cookie':_0x3ddf6b,'accessKey':_0x19f002,'format':_0x465072,'pageSize':_0x28ee4f,'riskLevel':_0x5a2f3e,'verbose':_0xfe81b5,'defaultApp':_0x17be4f,'currentApp':typeof _0x2c6547===_0x543bc1(0xb5)?_0x2c6547:undefined,'raw':_0x630716};}function env(_0x36237b){return productEnv(_0x36237b);}async function buildAuth(_0x5998d4){const _0x552dff=a102_0x777755,_0x1d263e='',_0x63df85=!!_0x5998d4[_0x552dff(0x81)];return{'cookie':_0x1d263e,'isLoggedIn':_0x63df85,async 'getOrLogin'(){const _0x565db0=_0x552dff;if(_0x63df85)return _0x1d263e;throw CliErrors[_0x565db0(0x96)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a100_0x2f6598=a100_0x1259;(function(_0x56b7c4,_0x6dcc0f){const _0x1f49b3=a100_0x1259,_0x1b0ae2=_0x56b7c4();while(!![]){try{const _0x56affe=parseInt(_0x1f49b3(0x217))/0x1+-parseInt(_0x1f49b3(0x27c))/0x2+parseInt(_0x1f49b3(0x218))/0x3+-parseInt(_0x1f49b3(0x215))/0x4+parseInt(_0x1f49b3(0x25a))/0x5+parseInt(_0x1f49b3(0x24f))/0x6*(parseInt(_0x1f49b3(0x214))/0x7)+-parseInt(_0x1f49b3(0x23d))/0x8*(-parseInt(_0x1f49b3(0x297))/0x9);if(_0x56affe===_0x6dcc0f)break;else _0x1b0ae2['push'](_0x1b0ae2['shift']());}catch(_0x3ee223){_0x1b0ae2['push'](_0x1b0ae2['shift']());}}}(a100_0xf3d7,0x4b3fd));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,extractPaging}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x556199){_activeAK=_0x556199||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0x5edf17){const _0x2b51bb=a100_0x1259;for(const _0x16199d of _0x5edf17){if(typeof _0x16199d===_0x2b51bb(0x202)&&_0x16199d[_0x2b51bb(0x299)]())return _0x16199d[_0x2b51bb(0x299)]();}return undefined;}async function decodeResponseBody(_0x489539){const _0x132c7b=a100_0x1259;if(typeof _0x489539[_0x132c7b(0x286)]==='function')try{const _0x44cb07=await _0x489539[_0x132c7b(0x286)]();try{return{'isJson':!![],'data':parseLosslessJson(_0x44cb07),'text':_0x44cb07};}catch{return{'isJson':![],'text':_0x44cb07[_0x132c7b(0x299)]()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x489539[_0x132c7b(0x22a)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x276e3e,_0xcf45a1,_0xecd94a){const _0xe79da0=a100_0x1259,_0x3db22f=_0xcf45a1&&typeof _0xcf45a1===_0xe79da0(0x219)?_0xcf45a1:{},_0x37db11=[_0x3db22f[_0xe79da0(0x211)],_0x3db22f[_0xe79da0(0x27f)]][_0xe79da0(0x248)](_0x468c2=>Number(_0x468c2)===0x1ad),_0x361673=createRateLimitError({'status':_0x276e3e[_0xe79da0(0x211)]===0x1ad?_0x276e3e[_0xe79da0(0x211)]:_0x37db11??_0x276e3e[_0xe79da0(0x211)],'errorCode':firstString(_0x3db22f[_0xe79da0(0x238)],typeof _0x3db22f[_0xe79da0(0x27f)]===_0xe79da0(0x202)?_0x3db22f[_0xe79da0(0x27f)]:undefined),'message':firstString(_0x3db22f[_0xe79da0(0x271)],_0x3db22f['message'],_0x3db22f['msg'],_0xecd94a),'retryAfter':readRetryAfter(_0x276e3e['headers'])??readRetryAfterSeconds(_0xcf45a1)});if(_0x361673)throw _0x361673;}async function apiRequest(_0x168cdb,_0x222168={}){const _0x3eed88=a100_0x1259,{method:method=_0x3eed88(0x22f),body:_0x5c854b,headers:headers={},timeout:timeout=0x7530,domain:domain=_0x3eed88(0x237)}=_0x222168,_0x621c4f=_activeAK,_0x1e7da1=domain===_0x3eed88(0x22d)?getApiDomain():getRuntimeDomain();if(!_0x621c4f)throw CliErrors[_0x3eed88(0x247)](_0x3eed88(0x23e)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x1d2c07=''+_0x1e7da1+_0x168cdb,_0x2b49f5={'X-User-AK':_0x621c4f},_0x3f1480=new AbortController(),_0x170d93=setTimeout(()=>_0x3f1480[_0x3eed88(0x21f)](),timeout);try{const _0x5b2169=await fetch(_0x1d2c07,{'method':method,'headers':{'Content-Type':_0x3eed88(0x205),'X-Invoke-Source':PRODUCT_CONFIG[_0x3eed88(0x21e)],..._0x2b49f5,...headers},'body':_0x5c854b?JSON['stringify'](_0x5c854b):undefined,'signal':_0x3f1480[_0x3eed88(0x26e)]}),_0x407532=await decodeResponseBody(_0x5b2169);if(!_0x407532[_0x3eed88(0x24e)]){throwIfRateLimited(_0x5b2169,undefined,_0x407532[_0x3eed88(0x286)]);throw CliErrors['apiError'](_0x3eed88(0x20a)+_0x5b2169[_0x3eed88(0x211)]+')',_0x5b2169['status']>=0x190?_0x3eed88(0x265):undefined);}const _0x57764d=_0x407532[_0x3eed88(0x282)];throwIfRateLimited(_0x5b2169,_0x57764d);if(!_0x5b2169['ok']||_0x57764d[_0x3eed88(0x2a2)]===![])throw CliErrors[_0x3eed88(0x275)](_0x57764d[_0x3eed88(0x271)]||_0x57764d[_0x3eed88(0x293)]||_0x3eed88(0x25d)+_0x5b2169[_0x3eed88(0x211)],_0x57764d[_0x3eed88(0x238)]?_0x3eed88(0x290)+_0x57764d['errorCode']:undefined);return _0x57764d;}catch(_0x28cbb9){if(_0x28cbb9 instanceof Error&&_0x28cbb9[_0x3eed88(0x29d)]==='AbortError')throw CliErrors[_0x3eed88(0x275)](_0x3eed88(0x258)+_0x1d2c07);throw _0x28cbb9;}finally{clearTimeout(_0x170d93);}}async function apiBinaryRequest(_0xb02e66,_0x9604be={}){const _0x135319=a100_0x1259,{method:method=_0x135319(0x22f),headers:headers={},timeout:timeout=0x7530}=_0x9604be,_0x47023c=_activeAK,_0x11fba8=getRuntimeDomain();if(!_0x47023c)throw CliErrors[_0x135319(0x247)](_0x135319(0x23e)+PRODUCT_CONFIG[_0x135319(0x2a4)]+'.');const _0x41ed9d=''+_0x11fba8+_0xb02e66,_0x4d3b0a=new AbortController(),_0x3ba5c4=setTimeout(()=>_0x4d3b0a[_0x135319(0x21f)](),timeout);try{const _0x14bcc7=await fetch(_0x41ed9d,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x135319(0x21e)],'X-User-AK':_0x47023c,...headers},'signal':_0x4d3b0a['signal']});if(!_0x14bcc7['ok']){const _0x3758fc=await decodeResponseBody(_0x14bcc7),_0x5bd5fa=_0x3758fc['data']&&typeof _0x3758fc['data']===_0x135319(0x219)?_0x3758fc[_0x135319(0x282)]:{},_0x57253b=firstString(_0x5bd5fa[_0x135319(0x271)],_0x5bd5fa[_0x135319(0x293)],_0x5bd5fa[_0x135319(0x238)],_0x3758fc[_0x135319(0x286)]);throwIfRateLimited(_0x14bcc7,_0x3758fc[_0x135319(0x282)],_0x57253b);throw CliErrors[_0x135319(0x275)](_0x57253b||'API\x20error:\x20'+_0x14bcc7['status'],_0x135319(0x223)+_0x41ed9d);}return Buffer['from'](await _0x14bcc7[_0x135319(0x28a)]());}catch(_0x2a5e3f){if(_0x2a5e3f instanceof Error&&_0x2a5e3f[_0x135319(0x29d)]===_0x135319(0x24b))throw CliErrors[_0x135319(0x275)](_0x135319(0x258)+_0x41ed9d);throw _0x2a5e3f;}finally{clearTimeout(_0x3ba5c4);}}async function apiFormRequest(_0x1fdc8c,_0x23adfb,_0x380c75={}){const _0x202f2f=a100_0x1259,{timeout:timeout=0x7530}=_0x380c75,_0x42d946=_activeAK,_0x422da3=getRuntimeDomain();if(!_0x42d946)throw CliErrors['authRequired'](_0x202f2f(0x23e)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x1cddd1=''+_0x422da3+_0x1fdc8c,_0x52551a=new AbortController(),_0x2938e9=setTimeout(()=>_0x52551a[_0x202f2f(0x21f)](),timeout);try{const _0x17cee9=await fetch(_0x1cddd1,{'method':_0x202f2f(0x222),'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x42d946},'body':_0x23adfb,'signal':_0x52551a[_0x202f2f(0x26e)]}),_0x5f1c59=await decodeResponseBody(_0x17cee9);if(!_0x5f1c59[_0x202f2f(0x24e)]){throwIfRateLimited(_0x17cee9,undefined,_0x5f1c59[_0x202f2f(0x286)]);throw CliErrors['apiError'](_0x202f2f(0x20a)+_0x17cee9[_0x202f2f(0x211)]+')',_0x17cee9[_0x202f2f(0x211)]>=0x190?_0x202f2f(0x265):undefined);}const _0x185b32=_0x5f1c59[_0x202f2f(0x282)];throwIfRateLimited(_0x17cee9,_0x185b32);if(!_0x17cee9['ok']||_0x185b32[_0x202f2f(0x2a2)]===![])throw CliErrors[_0x202f2f(0x275)](_0x185b32['errorMsg']||_0x185b32[_0x202f2f(0x293)]||'API\x20error:\x20'+_0x17cee9[_0x202f2f(0x211)],_0x185b32['errorCode']?_0x202f2f(0x290)+_0x185b32[_0x202f2f(0x238)]:undefined);return _0x185b32;}catch(_0x376630){if(_0x376630 instanceof Error&&_0x376630[_0x202f2f(0x29d)]===_0x202f2f(0x24b))throw CliErrors[_0x202f2f(0x275)]('Request\x20timeout:\x20'+_0x1cddd1);throw _0x376630;}finally{clearTimeout(_0x2938e9);}}async function toolboxRequest(_0x4e1633,_0x507611,_0x3473df={}){const _0x4e7dc4=a100_0x1259,{method:method=_0x4e7dc4(0x22f),headers:headers={},timeout:timeout=0x7530}=_0x3473df,_0x5162a9=_activeAK;if(!_0x5162a9)throw CliErrors[_0x4e7dc4(0x247)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x4e7dc4(0x2a4)]+'.');const _0x272429=getApiDomain()[_0x4e7dc4(0x235)](/\/$/,''),_0x386773=new URL(_0x4e1633,_0x272429+_0x4e7dc4(0x263));if(_0x507611)for(const [_0x497334,_0x14cf5a]of Object[_0x4e7dc4(0x255)](_0x507611)){_0x14cf5a!==undefined&&_0x14cf5a!==null&&_0x386773[_0x4e7dc4(0x28b)][_0x4e7dc4(0x29e)](_0x497334,String(_0x14cf5a));}const _0x532c24=new AbortController(),_0x542fff=setTimeout(()=>_0x532c24[_0x4e7dc4(0x21f)](),timeout);try{const _0x5d2d5c=await fetch(_0x386773,{'method':method,'headers':{'Content-Type':_0x4e7dc4(0x205),'X-Invoke-Source':PRODUCT_CONFIG[_0x4e7dc4(0x21e)],'X-User-AK':_0x5162a9,...headers},'signal':_0x532c24[_0x4e7dc4(0x26e)]}),_0x512096=await decodeResponseBody(_0x5d2d5c);if(!_0x512096[_0x4e7dc4(0x24e)]){throwIfRateLimited(_0x5d2d5c,undefined,_0x512096[_0x4e7dc4(0x286)]);throw CliErrors[_0x4e7dc4(0x275)]('Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x5d2d5c[_0x4e7dc4(0x211)]+')',_0x5d2d5c[_0x4e7dc4(0x211)]>=0x190?_0x4e7dc4(0x265):undefined);}const _0x47462f=_0x512096[_0x4e7dc4(0x282)];throwIfRateLimited(_0x5d2d5c,_0x47462f);if(!_0x5d2d5c['ok']){const _0x5401c5=_0x47462f&&typeof _0x47462f===_0x4e7dc4(0x219)?_0x47462f:{};throw CliErrors[_0x4e7dc4(0x275)](_0x5401c5[_0x4e7dc4(0x271)]||_0x5401c5['message']||'Toolbox\x20API\x20error:\x20'+_0x5d2d5c[_0x4e7dc4(0x211)],_0x5401c5[_0x4e7dc4(0x238)]?_0x4e7dc4(0x272)+_0x5401c5[_0x4e7dc4(0x238)]:undefined);}if(_0x47462f&&typeof _0x47462f==='object'&&_0x4e7dc4(0x2a2)in _0x47462f&&typeof _0x47462f[_0x4e7dc4(0x2a2)]==='boolean'){const _0xbb0669=_0x47462f;if(!_0xbb0669[_0x4e7dc4(0x2a2)])throw CliErrors[_0x4e7dc4(0x275)](_0xbb0669[_0x4e7dc4(0x271)]||_0xbb0669[_0x4e7dc4(0x293)]||_0x4e7dc4(0x207),_0xbb0669['errorCode']?_0x4e7dc4(0x272)+_0xbb0669['errorCode']:undefined);return _0xbb0669[_0x4e7dc4(0x282)];}return _0x47462f;}catch(_0xcf056b){if(_0xcf056b instanceof Error&&_0xcf056b['name']==='AbortError')throw CliErrors['apiError']('Request\x20timeout:\x20'+_0x386773[_0x4e7dc4(0x20b)]());throw _0xcf056b;}finally{clearTimeout(_0x542fff);}}async function skillHubJsonRequest(_0x2c1480,_0x13c43a={}){const _0x5df56e=a100_0x1259,{method:method=_0x5df56e(0x22f),query:_0x17499f,body:_0x2d2476,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x13c43a,_0x525bec=_activeAK;if(!_0x525bec)throw CliErrors['authRequired']('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x5b221d=getSkillHubDomain()[_0x5df56e(0x235)](/\/$/,''),_0x205c05=new URL(_0x2c1480,_0x5b221d+'/');if(_0x17499f)for(const [_0x27c19c,_0x1d8f0e]of Object[_0x5df56e(0x255)](_0x17499f)){_0x1d8f0e!==undefined&&_0x1d8f0e!==null&&_0x205c05[_0x5df56e(0x28b)][_0x5df56e(0x29e)](_0x27c19c,String(_0x1d8f0e));}const _0x578b73=new AbortController(),_0x55fd45=setTimeout(()=>_0x578b73['abort'](),timeout);try{const _0x482a07=await fetch(_0x205c05[_0x5df56e(0x20b)](),{'method':method,'headers':{'Accept':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x5df56e(0x21e)],'X-User-AK':_0x525bec,...headers},'body':_0x2d2476,'signal':_0x578b73[_0x5df56e(0x26e)]}),_0x50dc74=await decodeResponseBody(_0x482a07);if(!_0x50dc74['isJson']){if(allowNotFound&&_0x482a07['status']===0x194)return undefined;throwIfRateLimited(_0x482a07,undefined,_0x50dc74['text']);throw CliErrors[_0x5df56e(0x275)]('SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x482a07[_0x5df56e(0x211)]+')',_0x482a07['status']>=0x190?_0x5df56e(0x265):undefined);}const _0x46d89a=_0x50dc74[_0x5df56e(0x282)];throwIfRateLimited(_0x482a07,_0x46d89a);if(allowNotFound&&isSkillHubNotFoundResponse(_0x482a07[_0x5df56e(0x211)],_0x46d89a))return undefined;const _0x2ac08f=!_0x482a07['ok']||_0x46d89a?.[_0x5df56e(0x2a2)]===![]||typeof _0x46d89a?.['code']===_0x5df56e(0x28f)&&_0x46d89a[_0x5df56e(0x27f)]>=0x190;if(_0x2ac08f)throw CliErrors[_0x5df56e(0x275)](_0x46d89a?.[_0x5df56e(0x271)]||_0x46d89a?.[_0x5df56e(0x293)]||_0x46d89a?.['msg']||_0x5df56e(0x20f)+_0x482a07[_0x5df56e(0x211)],_0x46d89a?.['errorCode']?_0x5df56e(0x212)+_0x46d89a[_0x5df56e(0x238)]:undefined);return _0x46d89a?.[_0x5df56e(0x282)]??_0x46d89a;}catch(_0x81a1e9){if(_0x81a1e9 instanceof Error&&_0x81a1e9['name']===_0x5df56e(0x24b))throw CliErrors[_0x5df56e(0x275)]('Request\x20timeout:\x20'+_0x205c05[_0x5df56e(0x20b)]());throw _0x81a1e9;}finally{clearTimeout(_0x55fd45);}}function isSkillHubNotFoundResponse(_0x5fd2d3,_0x190f7b){const _0x197ff6=a100_0x1259;if(_0x5fd2d3===0x194||_0x190f7b?.[_0x197ff6(0x27f)]===0x194)return!![];if(_0x5fd2d3!==0x190&&_0x190f7b?.[_0x197ff6(0x27f)]!==0x190)return![];const _0x592a53=[_0x190f7b?.['msg'],_0x190f7b?.[_0x197ff6(0x293)],_0x190f7b?.['errorMsg'],_0x190f7b?.[_0x197ff6(0x20d)]][_0x197ff6(0x246)](_0xecf48f=>typeof _0xecf48f===_0x197ff6(0x202))[_0x197ff6(0x285)]('\x20');return/skill not found\b/i['test'](_0x592a53);}async function skillHubBinaryRequest(_0x39ae88,_0x205ea0={}){const _0x14cf94=a100_0x1259,{query:_0x27f4f3,headers:headers={},timeout:timeout=0x7530}=_0x205ea0,_0x5cd4b4=_activeAK;if(!_0x5cd4b4)throw CliErrors['authRequired'](_0x14cf94(0x23e)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x593507=getSkillHubDomain()['replace'](/\/$/,''),_0x34a940=new URL(_0x39ae88,_0x593507+'/');if(_0x27f4f3)for(const [_0x220b94,_0x6140dd]of Object['entries'](_0x27f4f3)){_0x6140dd!==undefined&&_0x6140dd!==null&&_0x34a940[_0x14cf94(0x28b)][_0x14cf94(0x29e)](_0x220b94,String(_0x6140dd));}const _0x5857ce=new AbortController(),_0x3de5fc=setTimeout(()=>_0x5857ce[_0x14cf94(0x21f)](),timeout);try{const _0x1f5c49=await fetch(_0x34a940[_0x14cf94(0x20b)](),{'method':_0x14cf94(0x22f),'headers':{'Accept':_0x14cf94(0x250),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x5cd4b4,...headers},'signal':_0x5857ce[_0x14cf94(0x26e)]});if(!_0x1f5c49['ok']){const _0x49c75f=await decodeResponseBody(_0x1f5c49),_0x3bf055=_0x49c75f[_0x14cf94(0x282)]&&typeof _0x49c75f['data']===_0x14cf94(0x219)?_0x49c75f[_0x14cf94(0x282)]:{},_0x15c922=firstString(_0x3bf055[_0x14cf94(0x271)],_0x3bf055[_0x14cf94(0x293)],_0x3bf055['msg'],_0x3bf055['errorCode'],_0x49c75f[_0x14cf94(0x286)]);throwIfRateLimited(_0x1f5c49,_0x49c75f[_0x14cf94(0x282)],_0x15c922);throw CliErrors[_0x14cf94(0x275)](_0x15c922||_0x14cf94(0x20f)+_0x1f5c49[_0x14cf94(0x211)],'Download\x20failed:\x20'+_0x34a940[_0x14cf94(0x20b)]());}return Buffer[_0x14cf94(0x267)](await _0x1f5c49[_0x14cf94(0x28a)]());}catch(_0xfdf185){if(_0xfdf185 instanceof Error&&_0xfdf185[_0x14cf94(0x29d)]===_0x14cf94(0x24b))throw CliErrors[_0x14cf94(0x275)]('Request\x20timeout:\x20'+_0x34a940['toString']());throw _0xfdf185;}finally{clearTimeout(_0x3de5fc);}}export async function getBffEndpointContract(_0x5681be,_0x23905f){const _0x557c1b=a100_0x1259;if(_0x23905f===_0x557c1b(0x25e))throw CliErrors[_0x557c1b(0x1f1)]('Backend\x20Function\x20not\x20found\x20or\x20inaccessible:\x20appCode='+_0x5681be+_0x557c1b(0x20e)+_0x23905f);const _0x5a048c=await apiRequest('/client/bff/endpoint/'+encodeURIComponent(_0x5681be)+'/'+encodeURIComponent(_0x23905f)),_0x327cdd=_0x5a048c[_0x557c1b(0x282)];if(!_0x327cdd||typeof _0x327cdd!=='object'||Array['isArray'](_0x327cdd)||_0x327cdd[_0x557c1b(0x2a0)]!==_0x5681be||_0x327cdd[_0x557c1b(0x280)]!==_0x23905f)throw CliErrors[_0x557c1b(0x1f1)](_0x557c1b(0x281)+_0x5681be+_0x557c1b(0x20e)+_0x23905f);return{'appCode':_0x327cdd[_0x557c1b(0x2a0)],'functionName':_0x327cdd[_0x557c1b(0x280)],'description':_0x327cdd[_0x557c1b(0x274)],'version':_0x327cdd[_0x557c1b(0x253)],'gmtModified':_0x327cdd[_0x557c1b(0x225)]};}export async function getSqlQueryInfo(_0x286b8a,_0x106d6b){const _0x2503b6=a100_0x1259,_0x6feb19=await apiRequest(_0x2503b6(0x29a),{'method':_0x2503b6(0x222),'body':{'appCode':_0x286b8a,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x106d6b}}),_0x15d8aa=_0x6feb19[_0x2503b6(0x282)],_0x30bca9=_0x15d8aa&&typeof _0x15d8aa===_0x2503b6(0x219)&&_0x2503b6(0x221)in _0x15d8aa?_0x15d8aa[_0x2503b6(0x221)]?.[0x0]:_0x15d8aa&&typeof _0x15d8aa===_0x2503b6(0x219)&&'sqlCode'in _0x15d8aa?_0x15d8aa:undefined;if(!_0x30bca9)throw CliErrors[_0x2503b6(0x1f1)](_0x2503b6(0x201)+_0x106d6b);return _0x30bca9;}function isRemoteAppItem(_0x56d998){const _0x24d658=a100_0x1259;return!!_0x56d998&&typeof _0x56d998==='object'&&typeof _0x56d998[_0x24d658(0x2a0)]===_0x24d658(0x202)&&typeof _0x56d998[_0x24d658(0x233)]===_0x24d658(0x202);}function extractRemoteAppItems(_0x303b9d){const _0x5f4ab8=a100_0x1259;if(Array[_0x5f4ab8(0x25f)](_0x303b9d))return _0x303b9d[_0x5f4ab8(0x246)](isRemoteAppItem);if(!_0x303b9d||typeof _0x303b9d!==_0x5f4ab8(0x219))throw CliErrors[_0x5f4ab8(0x275)](_0x5f4ab8(0x23b));const _0x467ce6=_0x303b9d;if(Array[_0x5f4ab8(0x25f)](_0x467ce6[_0x5f4ab8(0x221)]))return _0x467ce6['tableData'][_0x5f4ab8(0x246)](isRemoteAppItem);if(_0x467ce6['data']&&typeof _0x467ce6[_0x5f4ab8(0x282)]===_0x5f4ab8(0x219)){const _0x22c501=_0x467ce6[_0x5f4ab8(0x282)];if(Array['isArray'](_0x22c501['tableData']))return _0x22c501[_0x5f4ab8(0x221)][_0x5f4ab8(0x246)](isRemoteAppItem);}throw CliErrors['apiError'](_0x5f4ab8(0x1f5));}export async function getMyApps(){const _0x1f0838=a100_0x1259,_0x54c62e=await apiRequest(_0x1f0838(0x230));return extractRemoteAppItems(_0x54c62e[_0x1f0838(0x282)]);}export async function getLoginUserInfo(){const _0x37746f=a100_0x1259,_0x46f4e8=await apiRequest(_0x37746f(0x268));if(!_0x46f4e8[_0x37746f(0x282)]||typeof _0x46f4e8[_0x37746f(0x282)]!==_0x37746f(0x219)||Array[_0x37746f(0x25f)](_0x46f4e8[_0x37746f(0x282)]))throw CliErrors[_0x37746f(0x275)]('Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.');return _0x46f4e8[_0x37746f(0x282)];}export const USER_ACCOUNT_BIND_PATH=a100_0x2f6598(0x27e);export async function bindExternalUserAccount(_0x36932f,_0x9440a7){const _0x498cf3=a100_0x2f6598,_0x4027d1=await apiRequest(USER_ACCOUNT_BIND_PATH,{'method':_0x498cf3(0x222),'body':{'provider':_0x36932f,'accountId':_0x9440a7}});return _0x4027d1['data'];}function runtimeSchedulePath(_0x1cddca,_0x5333d7=''){const _0x5f581e=a100_0x2f6598;return _0x5f581e(0x1fa)+encodeURIComponent(_0x1cddca)+'/schedules'+_0x5333d7;}export async function validateRuntimeSchedule(_0x4cfe13,_0xec61d0){const _0x39502c=a100_0x2f6598,_0x117007=await apiRequest(runtimeSchedulePath(_0x4cfe13,_0x39502c(0x262)),{'method':'POST','body':_0xec61d0});return _0x117007[_0x39502c(0x282)];}export async function createRuntimeSchedule(_0x2df531,_0x1dacc0){const _0x3f00ca=a100_0x2f6598,_0x494bf4=await apiRequest(runtimeSchedulePath(_0x2df531),{'method':_0x3f00ca(0x222),'body':_0x1dacc0});return _0x494bf4[_0x3f00ca(0x282)];}export async function listRuntimeSchedules(_0x265e5d,_0x55914b){const _0x9fd19d=a100_0x2f6598,_0x5b1e9b=new URLSearchParams();_0x5b1e9b[_0x9fd19d(0x29e)](_0x9fd19d(0x203),_0x55914b[_0x9fd19d(0x203)]);if(_0x55914b[_0x9fd19d(0x26d)]!==undefined)_0x5b1e9b[_0x9fd19d(0x29e)](_0x9fd19d(0x26d),String(_0x55914b[_0x9fd19d(0x26d)]));if(_0x55914b[_0x9fd19d(0x292)])_0x5b1e9b[_0x9fd19d(0x29e)](_0x9fd19d(0x292),_0x55914b[_0x9fd19d(0x292)]);const _0x5d6ffd=_0x5b1e9b[_0x9fd19d(0x242)]>0x0?'?'+_0x5b1e9b[_0x9fd19d(0x20b)]():'',_0xd3c3fe=await apiRequest(''+runtimeSchedulePath(_0x265e5d)+_0x5d6ffd);return _0xd3c3fe[_0x9fd19d(0x282)];}export async function getRuntimeSchedule(_0x1cfaa7,_0xcc4bdf){const _0x2046b2=a100_0x2f6598,_0x4a1a3c=await apiRequest(runtimeSchedulePath(_0x1cfaa7,'/'+encodeURIComponent(_0xcc4bdf)));return _0x4a1a3c[_0x2046b2(0x282)];}export async function deleteRuntimeSchedule(_0x1f806f,_0x1f9b26){const _0xb18dcc=a100_0x2f6598,_0x156dd3=await apiRequest(runtimeSchedulePath(_0x1f806f,'/'+encodeURIComponent(_0x1f9b26)),{'method':_0xb18dcc(0x22b)});return _0x156dd3['data'];}export async function runRuntimeSchedule(_0xdc399d,_0x2b5cda){const _0x31d5a5=a100_0x2f6598,_0x26075c=await apiRequest(runtimeSchedulePath(_0xdc399d,'/'+encodeURIComponent(_0x2b5cda)+_0x31d5a5(0x239)),{'method':_0x31d5a5(0x222)});return _0x26075c['data'];}export async function listDatasets(_0x24af44,_0xb4ec4c){const _0x33cc0c=a100_0x2f6598,_0x3cd774=await apiRequest('/client/dataset/list',{'method':_0x33cc0c(0x222),'body':{'appCode':_0x24af44,..._0xb4ec4c?.[_0x33cc0c(0x27f)]&&{'code':_0xb4ec4c[_0x33cc0c(0x27f)]},..._0xb4ec4c?.[_0x33cc0c(0x29d)]&&{'name':_0xb4ec4c[_0x33cc0c(0x29d)]}}});return extractList(_0x3cd774['data']);}export async function getDatasetDetail(_0x18682e){const _0x4d02ea=a100_0x2f6598,_0x1e84ae=await apiRequest(_0x4d02ea(0x241)+encodeURIComponent(_0x18682e));return _0x1e84ae[_0x4d02ea(0x282)];}export async function getDatasetSdkUsageDoc(_0x19bbec,_0x2e17b3){const _0xfcc0ac=a100_0x2f6598,_0x5bc9d1=await toolboxRequest(_0xfcc0ac(0x277),{'datasetCode':_0x19bbec,'appCode':_0x2e17b3});return typeof _0x5bc9d1?.[_0xfcc0ac(0x243)]===_0xfcc0ac(0x202)?_0x5bc9d1['markdown']:'';}export async function uploadRuntimeFile(_0x4229c7,_0x590c31){const _0x3acb1c=a100_0x2f6598,_0x14afbf=await readFile(_0x590c31),_0x337156=new FormData();_0x337156[_0x3acb1c(0x27a)](_0x3acb1c(0x2a0),_0x4229c7),_0x337156['append'](_0x3acb1c(0x259),new Blob([new Uint8Array(_0x14afbf)]),basename(_0x590c31));const _0x3ecd36=await apiFormRequest(_0x3acb1c(0x24d),_0x337156);return _0x3ecd36[_0x3acb1c(0x282)];}export async function queryRuntimeFileUrl(_0x4b2ad1,_0x2abe3b={}){const _0x937d61=a100_0x2f6598,_0x1c40b6=await apiRequest('/client/queryFileUrl',{'method':_0x937d61(0x222),'body':{'filePath':_0x4b2ad1,'downloadFlag':_0x2abe3b['download']??![],..._0x2abe3b[_0x937d61(0x240)]?{'longTerm':!![]}:{}}});return _0x1c40b6[_0x937d61(0x282)];}export async function recognizeRuntimeOcr(_0x17c65f,_0x157b0f){const _0x2d56b4=a100_0x2f6598,_0x123c6f=await apiRequest(_0x2d56b4(0x276),{'method':'POST','body':{'appCode':_0x17c65f,'url':_0x157b0f['url'],'type':_0x157b0f[_0x2d56b4(0x1f4)]}});return _0x123c6f[_0x2d56b4(0x282)];}export async function getRuntimeAppConfigByKey(_0x1a51c3,_0x1f291e){const _0x45edc0=a100_0x2f6598,_0x48d82a=new URLSearchParams({'appCode':_0x1a51c3,'key':_0x1f291e}),_0x26b694=await apiRequest(_0x45edc0(0x21d)+_0x48d82a[_0x45edc0(0x20b)]());if(typeof _0x26b694[_0x45edc0(0x282)]!==_0x45edc0(0x202))throw CliErrors[_0x45edc0(0x1f1)]('Invalid\x20app\x20config\x20value:\x20key='+_0x1f291e);return _0x26b694['data'];}export async function listNotificationChannelConfigs(_0x581375,_0x3720c9){const _0x44c1f2=a100_0x2f6598,_0x5ae64c=new URLSearchParams({'appCode':_0x581375,'channelType':_0x3720c9}),_0x1c6832=await apiRequest(_0x44c1f2(0x227)+_0x5ae64c[_0x44c1f2(0x20b)](),{'domain':_0x44c1f2(0x22d)});if(!Array[_0x44c1f2(0x25f)](_0x1c6832['data']))throw CliErrors[_0x44c1f2(0x275)](_0x44c1f2(0x249),_0x44c1f2(0x28c));return _0x1c6832['data'];}export async function listRuntimeArtifacts(_0xbf65cd,_0x4a219e){const _0x5b7e82=a100_0x2f6598,_0x54e110=new URLSearchParams({'appCode':_0xbf65cd});if(_0x4a219e?.[_0x5b7e82(0x204)])_0x54e110['set'](_0x5b7e82(0x204),_0x4a219e[_0x5b7e82(0x204)]);if(_0x4a219e?.['source'])_0x54e110[_0x5b7e82(0x29e)](_0x5b7e82(0x1ff),_0x4a219e['source']);if(_0x4a219e?.[_0x5b7e82(0x1fe)]!==undefined)_0x54e110['set'](_0x5b7e82(0x1fe),String(_0x4a219e['favorite']));const _0x2fc0ad=await apiRequest('/client/artifact/list?'+_0x54e110[_0x5b7e82(0x20b)]());return Array[_0x5b7e82(0x25f)](_0x2fc0ad[_0x5b7e82(0x282)])?_0x2fc0ad[_0x5b7e82(0x282)]:[];}function a100_0xf3d7(){const _0x51694d=['runtime','errorCode','/run','all','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','diagram','4409848APYyGa','Configure\x20accessKey\x20in\x20','/client/permit/dataset/permit-list','longTerm','/client/dataset/get-driven-data?code=','size','markdown','confirmWarnings','/execute?appCode=','filter','authRequired','find','Invalid\x20notification\x20config\x20list\x20response.','NAMESPACE_ONLY','AbortError','namespace','/client/uploadFile','isJson','126lqbotM','application/octet-stream','.zip','/client/permit/resource/batch-save-menu','version','visibility','entries','/api/cli/v1/skills/','Invalid\x20Skill\x20diagram\x20response:\x20missing\x20found\x20state.','Request\x20timeout:\x20','file','207355JdMGpN','/client/permit/resource/get-menu-list','warnings','API\x20error:\x20','functions','isArray','isInteger','permitList','/validate','/api/node-toolbox/','/client/permit/role/get-permit-list','Check\x20your\x20credentials\x20and\x20try\x20again.','Deploy\x20a\x20SkillHub\x20version\x20that\x20returns\x20diagramValidated/diagramBound\x20before\x20publishing\x20with\x20this\x20CLI.','from','/client/user/loginUserInfo','/diagram','diagramValidated','base64','skillCode','limit','signal','found','/skills','errorMsg','Toolbox\x20error\x20code:\x20','PRIVATE','description','apiError','/client/ocr','api-doc-generator','/client/permit/dataset/list','/client/knowledge-base/personal/list?appCode=','append','/client/knowledge-base/search','897260vfeCuX','/client/artifact/','/client/user-accounts/bind','code','functionName','Backend\x20Function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','data','displayName','items','join','text','pageSize','values','skillName','arrayBuffer','searchParams','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.','skill','Invalid\x20Skill\x20diagram\x20response:\x20absent\x20diagram\x20must\x20have\x20a\x20null\x20diagramRevision.','number','API\x20error\x20code:\x20','roleName','cursor','message','scope','/update','errors','9YaLRnR','/client/permit/user-role/get-user-list','trim','/client/sql/query','personal','diagramRevision','name','set','map','appCode','/client/permit/role/create','success','toLowerCase','newConfigFileName','diagramBound','validation','min','slug','type','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','effective','company','tags','ownerPreviewVersion','/api/harness/apps/','Knowledge-base\x20entry\x20not\x20found:\x20id=','/client/runtime-bff/personal/create','/api/v1/skills/','favorite','source','SkillHub\x20must\x20return\x20the\x20exact\x20SkillVersion\x20fingerprint\x20even\x20when\x20found=false.','SQL\x20query\x20not\x20found:\x20','string','kind','artifactType','application/json','application/zip','Toolbox\x20API\x20error','?appCode=','summary','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','toString','stringify','error',',\x20name=','SkillHub\x20API\x20error:\x20','resolvedSlug','status','SkillHub\x20error\x20code:\x20','Artifact\x20not\x20found:\x20id=','138649TtkjWr','2405544QyVtWo','/client/runtime-bff/personal/list?appCode=','41004ogbmNu','925752RBJGaB','object','/client/runtime-bff/personal/','example','/versions/','/client/app-config/getByKey?','invokeSource','abort','/client/knowledge-base/personal/','tableData','POST','Download\x20failed:\x20','/client/knowledge-base/personal/create','gmtModified','/download','/notification/channel-config/list?','max','valid','json','DELETE','/api/runtime/v1/namespaces/','api','/client/permit/role/delete','GET','/client/app/my-apps','/client/dept/queryAppUser','/client/permit/page/get-one','appName','Personal\x20Backend\x20Function\x20not\x20found:\x20id=','replace','topK'];a100_0xf3d7=function(){return _0x51694d;};return a100_0xf3d7();}function a100_0x1259(_0x10fee0,_0x13e19e){_0x10fee0=_0x10fee0-0x1f1;const _0xf3d724=a100_0xf3d7();let _0x12597a=_0xf3d724[_0x10fee0];return _0x12597a;}export async function getRuntimeArtifact(_0x445515,_0xc8d8f1){const _0x54b085=a100_0x2f6598,_0x340aea=await apiRequest(_0x54b085(0x27d)+_0x445515+'?appCode='+encodeURIComponent(_0xc8d8f1));if(!_0x340aea['data'])throw CliErrors[_0x54b085(0x1f1)](_0x54b085(0x213)+_0x445515);return _0x340aea[_0x54b085(0x282)];}export async function createRuntimeArtifact(_0x13b789,_0x276df6){const _0x404e91=a100_0x2f6598,_0x4145e7=await apiRequest('/client/artifact/create',{'method':_0x404e91(0x222),'body':{'appCode':_0x13b789,..._0x276df6}});return _0x4145e7[_0x404e91(0x282)];}export async function updateRuntimeArtifact(_0x1d59b8,_0x3859fb,_0x1f5710){const _0x3fe5a8=a100_0x2f6598,_0x27a629=await apiRequest(_0x3fe5a8(0x27d)+_0x1d59b8+_0x3fe5a8(0x295),{'method':'POST','body':{'appCode':_0x3859fb,..._0x1f5710}});return _0x27a629[_0x3fe5a8(0x282)];}export async function listPersonalBffs(_0x4fdb4a){const _0xc1ae8f=a100_0x2f6598,_0x32de62=await apiRequest(_0xc1ae8f(0x216)+encodeURIComponent(_0x4fdb4a));return Array[_0xc1ae8f(0x25f)](_0x32de62[_0xc1ae8f(0x282)])?_0x32de62[_0xc1ae8f(0x282)]:[];}export async function getPersonalBff(_0x184120,_0x38235f){const _0x1283f5=a100_0x2f6598,_0x33da78=await apiRequest(_0x1283f5(0x21a)+_0x184120+_0x1283f5(0x208)+encodeURIComponent(_0x38235f));if(!_0x33da78[_0x1283f5(0x282)])throw CliErrors[_0x1283f5(0x1f1)](_0x1283f5(0x234)+_0x184120);return _0x33da78[_0x1283f5(0x282)];}export async function createPersonalBff(_0x2f6a2d,_0x3a58d0){const _0x51faec=a100_0x2f6598,_0x146d96=await apiRequest(_0x51faec(0x1fc),{'method':_0x51faec(0x222),'body':{'appCode':_0x2f6a2d,..._0x3a58d0}});return _0x146d96[_0x51faec(0x282)];}export async function updatePersonalBff(_0x570722,_0x1e4dd2,_0x56b766){const _0x2e2c1c=a100_0x2f6598,_0x3dee81=await apiRequest(_0x2e2c1c(0x21a)+_0x570722+_0x2e2c1c(0x295),{'method':_0x2e2c1c(0x222),'body':{'appCode':_0x1e4dd2,..._0x56b766}});return _0x3dee81[_0x2e2c1c(0x282)];}export async function executePersonalBff(_0x1f56d2,_0x653d25,_0x416ef3){const _0x631e4c=a100_0x2f6598,_0xc1c349=await apiRequest(_0x631e4c(0x21a)+_0x1f56d2+_0x631e4c(0x245)+encodeURIComponent(_0x653d25),{'method':_0x631e4c(0x222),'body':_0x416ef3});return _0xc1c349[_0x631e4c(0x282)];}export async function listPersonalKnowledgeBaseItems(_0x9f4d15){const _0x1ae7dc=a100_0x2f6598,_0x4ec4af=await apiRequest(_0x1ae7dc(0x279)+encodeURIComponent(_0x9f4d15));return Array[_0x1ae7dc(0x25f)](_0x4ec4af[_0x1ae7dc(0x282)])?_0x4ec4af[_0x1ae7dc(0x282)]:[];}export async function getPersonalKnowledgeBaseItem(_0x58d1fe,_0x416f01){const _0xad4a19=a100_0x2f6598,_0x396a8a=await apiRequest(_0xad4a19(0x220)+_0x58d1fe+'?appCode='+encodeURIComponent(_0x416f01));if(!_0x396a8a[_0xad4a19(0x282)])throw CliErrors[_0xad4a19(0x1f1)](_0xad4a19(0x1fb)+_0x58d1fe);return _0x396a8a[_0xad4a19(0x282)];}export async function createPersonalKnowledgeBaseItem(_0x1d86f2,_0x16b930){const _0x74df6d=a100_0x2f6598,_0x18fe9f=await apiRequest(_0x74df6d(0x224),{'method':_0x74df6d(0x222),'body':{'appCode':_0x1d86f2,..._0x16b930}});return _0x18fe9f[_0x74df6d(0x282)];}export async function updatePersonalKnowledgeBaseItem(_0x4f2375,_0x9ab9b3,_0x4b11c8){const _0x34d21e=a100_0x2f6598,_0x3688f2=await apiRequest(_0x34d21e(0x220)+_0x4f2375+_0x34d21e(0x295),{'method':'POST','body':{'appCode':_0x9ab9b3,..._0x4b11c8}});return _0x3688f2[_0x34d21e(0x282)];}export async function searchKnowledgeBase(_0x558d79,_0x1cf70b){const _0x3dc628=a100_0x2f6598,_0x4c69fe=await apiRequest(_0x3dc628(0x27b),{'method':_0x3dc628(0x222),'body':{'appCode':_0x558d79,'query':_0x1cf70b['query'],..._0x1cf70b[_0x3dc628(0x236)]!==undefined?{'topK':_0x1cf70b['topK']}:{}}});return Array[_0x3dc628(0x25f)](_0x4c69fe['data'])?_0x4c69fe['data']:[];}export async function getRuntimeSkillByCode(_0x4dd892,_0x5da59c){const _0x326195=a100_0x2f6598,_0x593a1b=await skillHubJsonRequest(_0x326195(0x1fd)+encodeURIComponent(_0x4dd892)+'/'+encodeURIComponent(_0x5da59c),{'allowNotFound':!![]});return _0x593a1b?skillHubRuntimeDetailToRuntimeSkill(_0x593a1b):undefined;}export async function listRuntimeSkills(_0x3e2b5b){const _0x1a2276=a100_0x2f6598,_0x35fa19=await skillHubJsonRequest(_0x1a2276(0x22c)+encodeURIComponent(_0x3e2b5b[_0x1a2276(0x2a0)])+_0x1a2276(0x270),{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x3e2b5b[_0x1a2276(0x2a0)],_0x35fa19,_0x3e2b5b[_0x1a2276(0x294)]??_0x1a2276(0x23a),_0x3e2b5b[_0x1a2276(0x27f)]);}export async function listPersonalRuntimeSkills(_0x29718d){const _0xb55012=a100_0x2f6598;return(await listRuntimeSkills({'appCode':_0x29718d,'scope':_0xb55012(0x29b)}))['personal'];}export async function listCompanyRuntimeSkills(_0x54b683){const _0xcf743=a100_0x2f6598;return(await listRuntimeSkills({'appCode':_0x54b683,'scope':'company'}))[_0xcf743(0x1f7)];}export async function listVisibleRuntimeSkills(_0x1df613){const _0x182d00=a100_0x2f6598;return(await listRuntimeSkills({'appCode':_0x1df613,'scope':_0x182d00(0x23a)}))[_0x182d00(0x1f6)];}export async function createPersonalRuntimeSkill(_0x52ecde,_0x200b8c,_0x4f39aa={}){const _0x4f91d0=a100_0x2f6598;return publishRuntimeSkill(_0x52ecde,_0x200b8c,{'visibility':_0x4f91d0(0x273),'confirmWarnings':_0x4f39aa[_0x4f91d0(0x244)]});}export async function updatePersonalRuntimeSkill(_0x435c9f,_0x376096,_0x318bb9,_0x5952c7={}){const _0x34f66f=a100_0x2f6598;return publishRuntimeSkill(_0x376096,{..._0x318bb9,'skillCode':_0x318bb9[_0x34f66f(0x26c)]??_0x435c9f},{'visibility':_0x34f66f(0x273),'confirmWarnings':_0x5952c7['confirmWarnings']});}export async function publishCompanyRuntimeSkill(_0x2d25d4,_0x1fdbd7,_0x14ee4b={}){const _0x2389dd=a100_0x2f6598;return publishRuntimeSkill(_0x2d25d4,_0x1fdbd7,{'visibility':_0x2389dd(0x24a),'confirmWarnings':_0x14ee4b[_0x2389dd(0x244)]});}export async function validateRuntimeSkillPublish(_0xccaf25,_0x484285,_0x2da57d){const _0x1ed48f=a100_0x2f6598,_0x43508b=buildRuntimeSkillPublishForm(_0x484285,_0x2da57d[_0x1ed48f(0x254)]),_0x3b2a43=await skillHubJsonRequest('/api/cli/v1/skills/'+encodeURIComponent(_0xccaf25)+'/publish/validate',{'method':_0x1ed48f(0x222),'body':_0x43508b});return assertJointDiagramAcknowledged(_0x484285[_0x1ed48f(0x23c)],_0x3b2a43['diagramValidated'],_0x1ed48f(0x1f1)),{'valid':_0x3b2a43[_0x1ed48f(0x229)]===!![],'errors':Array[_0x1ed48f(0x25f)](_0x3b2a43['errors'])?_0x3b2a43[_0x1ed48f(0x296)]:[],'warnings':Array['isArray'](_0x3b2a43[_0x1ed48f(0x25c)])?_0x3b2a43[_0x1ed48f(0x25c)]:[],'resolvedSlug':_0x3b2a43[_0x1ed48f(0x210)],'resolvedVersion':_0x3b2a43['resolvedVersion'],'diagramValidated':_0x3b2a43[_0x1ed48f(0x26a)]===!![]};}export async function validateRuntimeSkillVersionDiagram(_0xc6b837,_0x32a490,_0x2b6704,_0x47c957,_0x2b6b10){const _0xccae4b=a100_0x2f6598;return skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0xc6b837,_0x32a490,_0x2b6704,_0xccae4b(0x262)),{'method':_0xccae4b(0x222),'query':{'scope':_0x47c957},'headers':{'Content-Type':'application/json'},'body':JSON[_0xccae4b(0x20c)](_0x2b6b10)});}export async function putRuntimeSkillVersionDiagram(_0xb6ec00,_0x1699c0,_0x598a3b,_0x4b5c71,_0x9bec2d){const _0x448839=a100_0x2f6598;return skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0xb6ec00,_0x1699c0,_0x598a3b),{'method':'PUT','query':{'scope':_0x4b5c71},'headers':{'Content-Type':_0x448839(0x205)},'body':JSON[_0x448839(0x20c)](_0x9bec2d)});}export async function getRuntimeSkillVersionDiagram(_0x535a36,_0x99ac72,_0x1b676d,_0x59f67d){const _0x12ff90=a100_0x2f6598,_0x40c98d=await skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0x535a36,_0x99ac72,_0x1b676d),{'query':{'scope':_0x59f67d}});if(typeof _0x40c98d[_0x12ff90(0x26f)]!=='boolean')throw CliErrors[_0x12ff90(0x275)](_0x12ff90(0x257));const _0x11f216=_0x40c98d['sourceFingerprint'];if(typeof _0x11f216!==_0x12ff90(0x202)||!/^sha256:[0-9a-f]{64}$/['test'](_0x11f216))throw CliErrors['apiError']('Invalid\x20Skill\x20diagram\x20response:\x20missing\x20canonical\x20sourceFingerprint.',_0x12ff90(0x200));const _0x454393=_0x40c98d[_0x12ff90(0x29c)];if(_0x40c98d[_0x12ff90(0x26f)]&&(!Number[_0x12ff90(0x260)](_0x454393)||Number(_0x454393)<0x1))throw CliErrors[_0x12ff90(0x275)]('Invalid\x20Skill\x20diagram\x20response:\x20found\x20diagram\x20has\x20no\x20positive\x20diagramRevision.');if(!_0x40c98d[_0x12ff90(0x26f)]&&_0x454393!==undefined&&_0x454393!==null)throw CliErrors[_0x12ff90(0x275)](_0x12ff90(0x28e));const _0x286398=_0x40c98d[_0x12ff90(0x26f)]?Number(_0x454393):null;return{..._0x40c98d,'sourceFingerprint':_0x11f216,'diagramRevision':_0x286398,'expectedDiagramRevision':_0x286398??0x0};}export async function downloadRuntimeSkillPackage(_0x35cd2b,_0x163c88,_0x5e61a1,_0x4093e8){const _0x101458=a100_0x2f6598;void _0x35cd2b;const _0x248bad=_0x4093e8?_0x101458(0x256)+encodeURIComponent(_0x5e61a1)+'/'+encodeURIComponent(_0x163c88)+_0x101458(0x21c)+encodeURIComponent(_0x4093e8)+_0x101458(0x226):_0x101458(0x256)+encodeURIComponent(_0x5e61a1)+'/'+encodeURIComponent(_0x163c88)+'/download';return skillHubBinaryRequest(_0x248bad);}async function publishRuntimeSkill(_0x5545be,_0x45b0eb,_0x1ef464){const _0x47a705=a100_0x2f6598,_0x223bb8=buildRuntimeSkillPublishForm(_0x45b0eb,_0x1ef464[_0x47a705(0x254)]),_0x16b6c8=await skillHubJsonRequest(_0x47a705(0x256)+encodeURIComponent(_0x5545be)+'/publish',{'method':_0x47a705(0x222),'query':{'confirmWarnings':_0x1ef464[_0x47a705(0x244)]===!![]?!![]:undefined},'body':_0x223bb8});return assertJointDiagramAcknowledged(_0x45b0eb[_0x47a705(0x23c)],_0x16b6c8[_0x47a705(0x2a5)],'publish'),{'appCode':_0x16b6c8[_0x47a705(0x24c)]??_0x5545be,'skillCode':_0x16b6c8['slug']??_0x45b0eb[_0x47a705(0x26c)]??'','skillName':_0x45b0eb[_0x47a705(0x289)]??_0x16b6c8[_0x47a705(0x1f3)]??_0x45b0eb[_0x47a705(0x26c)],'description':_0x45b0eb[_0x47a705(0x274)],'scope':skillHubVisibilityToScope(_0x16b6c8[_0x47a705(0x254)]??_0x1ef464[_0x47a705(0x254)])??_0x47a705(0x29b),'version':_0x16b6c8[_0x47a705(0x253)]??_0x45b0eb[_0x47a705(0x253)],'tags':_0x45b0eb[_0x47a705(0x1f8)],'content':_0x45b0eb['content'],'diagramBound':_0x16b6c8[_0x47a705(0x2a5)]===!![]};}function assertJointDiagramAcknowledged(_0x2e30e6,_0x44787b,_0x31db79){const _0x39a9f8=a100_0x2f6598;if(!_0x2e30e6||_0x44787b===!![])return;throw CliErrors[_0x39a9f8(0x275)]('SkillHub\x20does\x20not\x20support\x20atomic\x20Skill\x20diagram\x20'+_0x31db79+'.',_0x39a9f8(0x266));}function buildRuntimeSkillPublishForm(_0x399ae9,_0x385c8a){const _0xe80225=a100_0x2f6598,_0x49b77e=new FormData();return _0x49b77e['set'](_0xe80225(0x259),runtimeSkillPackageFile(_0x399ae9)),_0x399ae9['skillName']?.[_0xe80225(0x299)]()&&_0x49b77e[_0xe80225(0x29e)](_0xe80225(0x283),_0x399ae9[_0xe80225(0x289)]['trim']()),_0x49b77e[_0xe80225(0x29e)](_0xe80225(0x254),_0x385c8a),_0x399ae9[_0xe80225(0x23c)]&&_0x49b77e[_0xe80225(0x29e)](_0xe80225(0x23c),new Blob([JSON[_0xe80225(0x20c)](_0x399ae9[_0xe80225(0x23c)])],{'type':_0xe80225(0x205)})),_0x49b77e;}function runtimeSkillVersionDiagramPath(_0xb2224f,_0x439c63,_0x18f3fd,_0xfdb34c=''){const _0x3b95b4=a100_0x2f6598;return _0x3b95b4(0x256)+encodeURIComponent(_0xb2224f)+'/'+encodeURIComponent(_0x439c63)+_0x3b95b4(0x21c)+encodeURIComponent(_0x18f3fd)+_0x3b95b4(0x269)+_0xfdb34c;}function runtimeSkillPackageFile(_0x6fdb9a){const _0x2ac03c=a100_0x2f6598;if(!_0x6fdb9a['packageBase64'])throw CliErrors[_0x2ac03c(0x1f1)]('Missing\x20Skill\x20package\x20payload.');const _0xf3377c=Buffer[_0x2ac03c(0x267)](_0x6fdb9a['packageBase64'],_0x2ac03c(0x26b)),_0x2267c4=new Blob([_0xf3377c],{'type':'application/zip'}),_0x2c5302=(_0x6fdb9a[_0x2ac03c(0x26c)]||_0x2ac03c(0x28d))+_0x2ac03c(0x251);if(typeof File!=='undefined')return new File([_0x2267c4],_0x2c5302,{'type':_0x2ac03c(0x206)});return _0x2267c4;}function normalizeSkillHubRuntimeListResponse(_0x96e3e8,_0x32d12f,_0xd75503,_0x1fa5e1){const _0x3b0000=a100_0x2f6598,_0x4593ab=Array[_0x3b0000(0x25f)](_0x32d12f)?_0x32d12f:Array[_0x3b0000(0x25f)](_0x32d12f?.[_0x3b0000(0x284)])?_0x32d12f['items']:[],_0x48f11c=_0x1fa5e1?.['trim'](),_0x1ee344=_0x4593ab[_0x3b0000(0x246)](_0x340c0b=>!_0x48f11c||_0x340c0b['slug']===_0x48f11c)[_0x3b0000(0x29f)](skillHubRuntimeItemToRuntimeSkill)['filter'](_0x4306be=>Boolean(_0x4306be)),_0x37cc81=_0x1ee344['filter'](_0x178fad=>_0x178fad[_0x3b0000(0x294)]===_0x3b0000(0x29b)),_0x167e51=_0x1ee344['filter'](_0x32f7d3=>_0x32f7d3[_0x3b0000(0x294)]==='company');return{'appCode':_0x96e3e8,'personal':_0xd75503===_0x3b0000(0x1f7)?[]:_0x37cc81,'company':_0xd75503===_0x3b0000(0x29b)?[]:_0x167e51,'effective':buildEffectiveRuntimeSkills(_0x37cc81,_0x167e51,_0xd75503)};}function skillHubRuntimeItemToRuntimeSkill(_0x3fbc90){const _0x17e2a3=a100_0x2f6598,_0x5c414f=_0x3fbc90[_0x17e2a3(0x1f3)]?.[_0x17e2a3(0x299)](),_0x568c4c=skillHubVisibilityToScope(_0x3fbc90[_0x17e2a3(0x254)]);if(!_0x5c414f||!_0x568c4c)return undefined;return{'id':_0x3fbc90['id'],'appCode':_0x3fbc90[_0x17e2a3(0x24c)],'skillCode':_0x5c414f,'skillName':_0x3fbc90[_0x17e2a3(0x283)]??_0x5c414f,'description':_0x3fbc90[_0x17e2a3(0x209)],'example':_0x3fbc90[_0x17e2a3(0x21b)],'scope':_0x568c4c,'version':skillHubRuntimeItemVersion(_0x3fbc90),'status':_0x3fbc90[_0x17e2a3(0x211)]};}function skillHubRuntimeDetailToRuntimeSkill(_0xef6f02){const _0x587792=a100_0x2f6598,_0x210144=_0xef6f02[_0x587792(0x1f3)]?.['trim']();if(!_0x210144)return undefined;return{'id':_0xef6f02['id'],'appCode':_0xef6f02[_0x587792(0x24c)],'skillCode':_0x210144,'skillName':_0xef6f02[_0x587792(0x283)]??_0x210144,'description':_0xef6f02[_0x587792(0x209)],'example':_0xef6f02['example'],'scope':skillHubVisibilityToScope(_0xef6f02[_0x587792(0x254)])??_0xef6f02[_0x587792(0x254)]?.[_0x587792(0x2a3)](),'version':skillHubRuntimeItemVersion(_0xef6f02),'status':_0xef6f02[_0x587792(0x211)]};}function skillHubVisibilityToScope(_0x44fce4){const _0x79fb4c=a100_0x2f6598;if(_0x44fce4==='PRIVATE')return _0x79fb4c(0x29b);if(_0x44fce4==='NAMESPACE_ONLY')return _0x79fb4c(0x1f7);return undefined;}function skillHubRuntimeItemVersion(_0x4bba35){const _0x195cb9=a100_0x2f6598;return _0x4bba35['publishedVersion']?.['version']??_0x4bba35['headlineVersion']?.[_0x195cb9(0x253)]??_0x4bba35[_0x195cb9(0x1f9)]?.[_0x195cb9(0x253)];}function buildEffectiveRuntimeSkills(_0x6f7976,_0x4d7bdf,_0x4d8431){const _0x13c175=a100_0x2f6598;if(_0x4d8431===_0x13c175(0x29b))return _0x6f7976;if(_0x4d8431==='company')return _0x4d7bdf;const _0x339941=new Map();for(const _0x32a99f of _0x4d7bdf){_0x339941[_0x13c175(0x29e)](_0x32a99f[_0x13c175(0x26c)],_0x32a99f);}for(const _0x503e4e of _0x6f7976){_0x339941[_0x13c175(0x29e)](_0x503e4e[_0x13c175(0x26c)],_0x503e4e);}return Array[_0x13c175(0x267)](_0x339941[_0x13c175(0x288)]());}function normalizeRuntimeSkillListResponse(_0x531e3a,_0x56a4d9){const _0x467778=a100_0x2f6598;if(Array['isArray'](_0x56a4d9)){const _0x556844=_0x56a4d9['filter'](_0x303399=>_0x303399[_0x467778(0x294)]===_0x467778(0x29b)),_0x398c08=_0x56a4d9[_0x467778(0x246)](_0x305021=>_0x305021[_0x467778(0x294)]===_0x467778(0x1f7));return{'appCode':_0x531e3a,'personal':_0x556844,'company':_0x398c08,'effective':[..._0x398c08,..._0x556844]};}return{'appCode':_0x56a4d9?.[_0x467778(0x2a0)]??_0x531e3a,'personal':Array[_0x467778(0x25f)](_0x56a4d9?.[_0x467778(0x29b)])?_0x56a4d9[_0x467778(0x29b)]:[],'company':Array['isArray'](_0x56a4d9?.[_0x467778(0x1f7)])?_0x56a4d9[_0x467778(0x1f7)]:[],'effective':Array[_0x467778(0x25f)](_0x56a4d9?.['effective'])?_0x56a4d9['effective']:[]};}export async function listRuntimeAppRoles(_0x295482,_0x1abbcf={}){const _0x477ca9=a100_0x2f6598,_0x501ace=_0x1abbcf['currentPage']??0x1,_0xb3f74d=Math[_0x477ca9(0x1f2)](Math[_0x477ca9(0x228)](_0x1abbcf[_0x477ca9(0x287)]??0x64,0x1),0x64),_0x48091b=await apiRequest('/client/permit/role/get-list',{'method':_0x477ca9(0x222),'body':{'appCode':_0x295482,..._0x1abbcf[_0x477ca9(0x291)]?{'roleName':_0x1abbcf[_0x477ca9(0x291)]}:{},'currentPage':_0x501ace,'pageSize':_0xb3f74d}});return{'items':extractList(_0x48091b[_0x477ca9(0x282)]),'paging':extractPaging(_0x48091b[_0x477ca9(0x282)])};}export async function createRuntimeAppRole(_0x3e0c38){const _0x1be0fa=a100_0x2f6598,_0x20a8c8=await apiRequest(_0x1be0fa(0x2a1),{'method':_0x1be0fa(0x222),'body':{'roleType':'CUSTOM',..._0x3e0c38}});return _0x20a8c8[_0x1be0fa(0x282)];}export async function updateRuntimeAppRole(_0x459dd0){const _0x5699f3=a100_0x2f6598,_0x3a1d69=await apiRequest('/client/permit/role/update',{'method':'POST','body':_0x459dd0});return _0x3a1d69[_0x5699f3(0x282)];}export async function deleteRuntimeAppRole(_0x28e574){const _0x421eae=a100_0x2f6598,_0x1dab44=await apiRequest(_0x421eae(0x22e),{'method':_0x421eae(0x222),'body':{'id':_0x28e574}});return _0x1dab44['data'];}export async function listRuntimeRoleUsers(_0x587846){const _0x544b99=a100_0x2f6598,_0x459f66=await apiRequest(_0x544b99(0x298),{'method':_0x544b99(0x222),'body':{'appCode':_0x587846}});return extractList(_0x459f66[_0x544b99(0x282)]);}export async function updateRuntimeRoleUsers(_0x2c1219,_0x8f1e41){const _0x2ce371=await apiRequest('/client/permit/user-role/update-user-list',{'method':'POST','body':{'appCode':_0x2c1219,'roleList':_0x8f1e41}});return _0x2ce371['data'];}export async function listRuntimeAppUsers(_0x64a4a5){const _0x42d3f4=a100_0x2f6598,_0x56ac0b=await apiRequest(_0x42d3f4(0x231)+runtimePermitQuery({'appCode':_0x64a4a5}));return extractList(_0x56ac0b['data']);}function runtimePermitQuery(_0x3bc8a3){const _0x357e55=a100_0x2f6598,_0x2e7d8d=new URLSearchParams();for(const [_0x517419,_0x36a0f4]of Object[_0x357e55(0x255)](_0x3bc8a3))_0x2e7d8d[_0x357e55(0x29e)](_0x517419,String(_0x36a0f4));return'?'+_0x2e7d8d[_0x357e55(0x20b)]();}export async function listRuntimePermitRoles(_0x3eb28b,_0x505f72={}){const _0x2ad526=a100_0x2f6598,_0x1f0a18=await apiRequest(_0x2ad526(0x264),{'method':_0x2ad526(0x222),'body':{'appCode':_0x3eb28b,..._0x505f72}});return extractList(_0x1f0a18[_0x2ad526(0x282)]);}export async function getRuntimePagePermit(_0x3dba9b){const _0x1c0656=a100_0x2f6598,_0x534a2f=await apiRequest(_0x1c0656(0x232)+runtimePermitQuery({'menuId':_0x3dba9b}));return _0x534a2f[_0x1c0656(0x282)];}export async function saveRuntimePagePermit(_0x5e1b42){const _0x3bd4f8=a100_0x2f6598,_0x43b298=await apiRequest('/client/permit/page/save',{'method':_0x3bd4f8(0x222),'body':_0x5e1b42});return _0x43b298['data'];}export async function getRuntimeRoleMenuResources(_0x9c2759,_0xb7d789){const _0x5968de=a100_0x2f6598,_0x16601c=await apiRequest(_0x5968de(0x25b),{'method':_0x5968de(0x222),'body':{'appCode':_0x9c2759,'roleId':_0xb7d789}});return extractList(_0x16601c[_0x5968de(0x282)]);}export async function listRuntimeMenuRolePermits(_0x365b30){const _0xb92f2f=a100_0x2f6598,_0x72e0a8=await apiRequest('/client/menu/permit-list'+runtimePermitQuery({'appCode':_0x365b30}));return Array['isArray'](_0x72e0a8[_0xb92f2f(0x282)]?.[_0xb92f2f(0x261)])?_0x72e0a8[_0xb92f2f(0x282)]['permitList']:[];}export async function saveRuntimeMenuRolePermits(_0x3bc833,_0x505aa4){const _0x20988e=a100_0x2f6598,_0x2605a2=await apiRequest(_0x20988e(0x252),{'method':_0x20988e(0x222),'body':{'appCode':_0x3bc833,'permitList':_0x505aa4}});return _0x2605a2[_0x20988e(0x282)];}export async function listRuntimeDatasetPermits(_0xc3cb1e,_0x4cc521){const _0x272d89=a100_0x2f6598,_0x3a0c19=await apiRequest(_0x272d89(0x278)+runtimePermitQuery({'appCode':_0xc3cb1e,'roleId':_0x4cc521}));return Array[_0x272d89(0x25f)](_0x3a0c19[_0x272d89(0x282)]?.[_0x272d89(0x261)])?_0x3a0c19[_0x272d89(0x282)][_0x272d89(0x261)]:[];}export async function listRuntimeDatasetRolePermits(_0x56d434){const _0x5aed53=a100_0x2f6598,_0x3b46b0=await apiRequest(_0x5aed53(0x23f)+runtimePermitQuery({'appCode':_0x56d434}));return Array[_0x5aed53(0x25f)](_0x3b46b0[_0x5aed53(0x282)]?.[_0x5aed53(0x261)])?_0x3b46b0[_0x5aed53(0x282)]['permitList']:[];}export async function saveRuntimeDatasetRolePermits(_0x383915,_0x38bc38){const _0x2e2e20=a100_0x2f6598,_0x283737=await apiRequest('/client/permit/resource/batch-save-dataset',{'method':_0x2e2e20(0x222),'body':{'appCode':_0x383915,'permitList':_0x38bc38}});return _0x283737[_0x2e2e20(0x282)];}
|
|
1
|
+
const a103_0x5715ee=a103_0x5746;(function(_0x199f80,_0xc366a9){const _0x43d46b=a103_0x5746,_0x6f57af=_0x199f80();while(!![]){try{const _0x37d4ad=parseInt(_0x43d46b(0x110))/0x1+parseInt(_0x43d46b(0x158))/0x2+-parseInt(_0x43d46b(0x10b))/0x3*(-parseInt(_0x43d46b(0x131))/0x4)+-parseInt(_0x43d46b(0x161))/0x5*(-parseInt(_0x43d46b(0xf3))/0x6)+parseInt(_0x43d46b(0x166))/0x7*(parseInt(_0x43d46b(0x143))/0x8)+parseInt(_0x43d46b(0x135))/0x9+-parseInt(_0x43d46b(0x176))/0xa;if(_0x37d4ad===_0xc366a9)break;else _0x6f57af['push'](_0x6f57af['shift']());}catch(_0x3d4a38){_0x6f57af['push'](_0x6f57af['shift']());}}}(a103_0x4791,0x40cad));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getApiDomain,getKbDomain,getRuntimeDomain,getSkillDomain}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,extractPaging}from'../framework/response.js';import{parseLosslessJson}from'../utils/lossless-json.js';let _activeAK;export function setActiveAK(_0x17a642){_activeAK=_0x17a642||undefined;}export function clearActiveAK(){_activeAK=undefined;}function firstString(..._0x5363d3){const _0x35d42d=a103_0x5746;for(const _0x3b30bc of _0x5363d3){if(typeof _0x3b30bc===_0x35d42d(0x100)&&_0x3b30bc[_0x35d42d(0x122)]())return _0x3b30bc[_0x35d42d(0x122)]();}return undefined;}async function decodeResponseBody(_0x374525){const _0x119f08=a103_0x5746;if(typeof _0x374525[_0x119f08(0xcf)]===_0x119f08(0x153))try{const _0xea1b0=await _0x374525[_0x119f08(0xcf)]();try{return{'isJson':!![],'data':parseLosslessJson(_0xea1b0),'text':_0xea1b0};}catch{return{'isJson':![],'text':_0xea1b0['trim']()||undefined};}}catch{}try{return{'isJson':!![],'data':await _0x374525[_0x119f08(0x173)]()};}catch{return{'isJson':![]};}}function throwIfRateLimited(_0x4df379,_0xbf15a2,_0x3c0c9c){const _0x258631=a103_0x5746,_0x334d99=_0xbf15a2&&typeof _0xbf15a2===_0x258631(0xeb)?_0xbf15a2:{},_0x236691=[_0x334d99[_0x258631(0x17a)],_0x334d99[_0x258631(0x181)]]['find'](_0x1d8fed=>Number(_0x1d8fed)===0x1ad),_0x46e8c0=createRateLimitError({'status':_0x4df379[_0x258631(0x17a)]===0x1ad?_0x4df379[_0x258631(0x17a)]:_0x236691??_0x4df379[_0x258631(0x17a)],'errorCode':firstString(_0x334d99[_0x258631(0x102)],typeof _0x334d99[_0x258631(0x181)]==='string'?_0x334d99[_0x258631(0x181)]:undefined),'message':firstString(_0x334d99[_0x258631(0x15e)],_0x334d99[_0x258631(0x17d)],_0x334d99['msg'],_0x3c0c9c),'retryAfter':readRetryAfter(_0x4df379['headers'])??readRetryAfterSeconds(_0xbf15a2)});if(_0x46e8c0)throw _0x46e8c0;}async function apiRequest(_0x243777,_0x2a13e5={}){const _0x4729b2=a103_0x5746,{method:method=_0x4729b2(0x167),body:_0x402530,headers:headers={},timeout:timeout=0x7530,domain:domain=_0x4729b2(0xcb)}=_0x2a13e5,_0x449979=_activeAK,_0x13bddc=domain===_0x4729b2(0x120)?getApiDomain():domain==='kb'?getKbDomain():getRuntimeDomain();if(!_0x449979)throw CliErrors[_0x4729b2(0x13d)](_0x4729b2(0xcc)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x144f10=''+_0x13bddc+_0x243777,_0xc77b5={'X-User-AK':_0x449979},_0x4ad2b8=new AbortController(),_0x30b118=setTimeout(()=>_0x4ad2b8['abort'](),timeout);try{const _0x5b50e5=await fetch(_0x144f10,{'method':method,'headers':{'Content-Type':_0x4729b2(0x14b),'X-Invoke-Source':PRODUCT_CONFIG[_0x4729b2(0x109)],..._0xc77b5,...headers},'body':_0x402530?JSON[_0x4729b2(0x12e)](_0x402530):undefined,'signal':_0x4ad2b8[_0x4729b2(0x125)]}),_0x2ada2a=await decodeResponseBody(_0x5b50e5);if(!_0x2ada2a[_0x4729b2(0xc5)]){throwIfRateLimited(_0x5b50e5,undefined,_0x2ada2a['text']);throw CliErrors[_0x4729b2(0x171)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x5b50e5[_0x4729b2(0x17a)]+')',_0x5b50e5[_0x4729b2(0x17a)]>=0x190?_0x4729b2(0xdb):undefined);}const _0xf7c865=_0x2ada2a['data'];throwIfRateLimited(_0x5b50e5,_0xf7c865);if(!_0x5b50e5['ok']||_0xf7c865[_0x4729b2(0xf2)]===![])throw CliErrors[_0x4729b2(0x171)](_0xf7c865[_0x4729b2(0x15e)]||_0xf7c865[_0x4729b2(0x17d)]||_0x4729b2(0x16a)+_0x5b50e5['status'],_0xf7c865['errorCode']?_0x4729b2(0x172)+_0xf7c865[_0x4729b2(0x102)]:undefined);return _0xf7c865;}catch(_0x4304ea){if(_0x4304ea instanceof Error&&_0x4304ea[_0x4729b2(0x113)]==='AbortError')throw CliErrors[_0x4729b2(0x171)](_0x4729b2(0x17c)+_0x144f10);throw _0x4304ea;}finally{clearTimeout(_0x30b118);}}async function apiBinaryRequest(_0x2e0e8d,_0x36365b={}){const _0x1a7d86=a103_0x5746,{method:method=_0x1a7d86(0x167),headers:headers={},timeout:timeout=0x7530}=_0x36365b,_0x491a9e=_activeAK,_0x4a8c14=getRuntimeDomain();if(!_0x491a9e)throw CliErrors[_0x1a7d86(0x13d)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x1a7d86(0x16e)]+'.');const _0x3121a7=''+_0x4a8c14+_0x2e0e8d,_0x427417=new AbortController(),_0x302fcc=setTimeout(()=>_0x427417[_0x1a7d86(0xe0)](),timeout);try{const _0x12e760=await fetch(_0x3121a7,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x491a9e,...headers},'signal':_0x427417['signal']});if(!_0x12e760['ok']){const _0x32af98=await decodeResponseBody(_0x12e760),_0x25b090=_0x32af98[_0x1a7d86(0xe5)]&&typeof _0x32af98[_0x1a7d86(0xe5)]===_0x1a7d86(0xeb)?_0x32af98[_0x1a7d86(0xe5)]:{},_0x5b1835=firstString(_0x25b090[_0x1a7d86(0x15e)],_0x25b090[_0x1a7d86(0x17d)],_0x25b090[_0x1a7d86(0x102)],_0x32af98[_0x1a7d86(0xcf)]);throwIfRateLimited(_0x12e760,_0x32af98[_0x1a7d86(0xe5)],_0x5b1835);throw CliErrors['apiError'](_0x5b1835||'API\x20error:\x20'+_0x12e760[_0x1a7d86(0x17a)],'Download\x20failed:\x20'+_0x3121a7);}return Buffer[_0x1a7d86(0xef)](await _0x12e760[_0x1a7d86(0xc6)]());}catch(_0x278986){if(_0x278986 instanceof Error&&_0x278986[_0x1a7d86(0x113)]==='AbortError')throw CliErrors[_0x1a7d86(0x171)]('Request\x20timeout:\x20'+_0x3121a7);throw _0x278986;}finally{clearTimeout(_0x302fcc);}}async function apiFormRequest(_0x56e420,_0x5f552b,_0x35c513={}){const _0x5d6998=a103_0x5746,{timeout:timeout=0x7530}=_0x35c513,_0x316cf6=_activeAK,_0xa8fb2e=getRuntimeDomain();if(!_0x316cf6)throw CliErrors[_0x5d6998(0x13d)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x5d6998(0x16e)]+'.');const _0x1a325d=''+_0xa8fb2e+_0x56e420,_0x3dd201=new AbortController(),_0x172dfa=setTimeout(()=>_0x3dd201[_0x5d6998(0xe0)](),timeout);try{const _0x1a31a1=await fetch(_0x1a325d,{'method':'POST','headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x5d6998(0x109)],'X-User-AK':_0x316cf6},'body':_0x5f552b,'signal':_0x3dd201[_0x5d6998(0x125)]}),_0x27693c=await decodeResponseBody(_0x1a31a1);if(!_0x27693c[_0x5d6998(0xc5)]){throwIfRateLimited(_0x1a31a1,undefined,_0x27693c[_0x5d6998(0xcf)]);throw CliErrors[_0x5d6998(0x171)](_0x5d6998(0xf1)+_0x1a31a1['status']+')',_0x1a31a1[_0x5d6998(0x17a)]>=0x190?_0x5d6998(0xdb):undefined);}const _0x2f1df1=_0x27693c[_0x5d6998(0xe5)];throwIfRateLimited(_0x1a31a1,_0x2f1df1);if(!_0x1a31a1['ok']||_0x2f1df1[_0x5d6998(0xf2)]===![])throw CliErrors['apiError'](_0x2f1df1[_0x5d6998(0x15e)]||_0x2f1df1[_0x5d6998(0x17d)]||_0x5d6998(0x16a)+_0x1a31a1[_0x5d6998(0x17a)],_0x2f1df1['errorCode']?_0x5d6998(0x172)+_0x2f1df1[_0x5d6998(0x102)]:undefined);return _0x2f1df1;}catch(_0x69a146){if(_0x69a146 instanceof Error&&_0x69a146['name']===_0x5d6998(0x145))throw CliErrors[_0x5d6998(0x171)]('Request\x20timeout:\x20'+_0x1a325d);throw _0x69a146;}finally{clearTimeout(_0x172dfa);}}async function toolboxRequest(_0x22a2cb,_0x380e5a,_0x3eaed2={}){const _0x20aa2b=a103_0x5746,{method:method=_0x20aa2b(0x167),headers:headers={},timeout:timeout=0x7530}=_0x3eaed2,_0x4dbf74=_activeAK;if(!_0x4dbf74)throw CliErrors[_0x20aa2b(0x13d)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x20aa2b(0x16e)]+'.');const _0x2f343f=getApiDomain()['replace'](/\/$/,''),_0x62bd20=new URL(_0x22a2cb,_0x2f343f+_0x20aa2b(0x160));if(_0x380e5a)for(const [_0x144fc2,_0x57f5c2]of Object[_0x20aa2b(0xfd)](_0x380e5a)){_0x57f5c2!==undefined&&_0x57f5c2!==null&&_0x62bd20[_0x20aa2b(0x180)][_0x20aa2b(0x129)](_0x144fc2,String(_0x57f5c2));}const _0x190b55=new AbortController(),_0x13c396=setTimeout(()=>_0x190b55[_0x20aa2b(0xe0)](),timeout);try{const _0x563904=await fetch(_0x62bd20,{'method':method,'headers':{'Content-Type':_0x20aa2b(0x14b),'X-Invoke-Source':PRODUCT_CONFIG[_0x20aa2b(0x109)],'X-User-AK':_0x4dbf74,...headers},'signal':_0x190b55[_0x20aa2b(0x125)]}),_0x174a3f=await decodeResponseBody(_0x563904);if(!_0x174a3f[_0x20aa2b(0xc5)]){throwIfRateLimited(_0x563904,undefined,_0x174a3f['text']);throw CliErrors['apiError'](_0x20aa2b(0xce)+_0x563904['status']+')',_0x563904[_0x20aa2b(0x17a)]>=0x190?_0x20aa2b(0xdb):undefined);}const _0x5fd62b=_0x174a3f[_0x20aa2b(0xe5)];throwIfRateLimited(_0x563904,_0x5fd62b);if(!_0x563904['ok']){const _0x44dd4f=_0x5fd62b&&typeof _0x5fd62b===_0x20aa2b(0xeb)?_0x5fd62b:{};throw CliErrors[_0x20aa2b(0x171)](_0x44dd4f[_0x20aa2b(0x15e)]||_0x44dd4f[_0x20aa2b(0x17d)]||_0x20aa2b(0x132)+_0x563904['status'],_0x44dd4f[_0x20aa2b(0x102)]?_0x20aa2b(0x15c)+_0x44dd4f[_0x20aa2b(0x102)]:undefined);}if(_0x5fd62b&&typeof _0x5fd62b===_0x20aa2b(0xeb)&&_0x20aa2b(0xf2)in _0x5fd62b&&typeof _0x5fd62b['success']===_0x20aa2b(0x179)){const _0x104f1c=_0x5fd62b;if(!_0x104f1c[_0x20aa2b(0xf2)])throw CliErrors[_0x20aa2b(0x171)](_0x104f1c[_0x20aa2b(0x15e)]||_0x104f1c[_0x20aa2b(0x17d)]||_0x20aa2b(0x152),_0x104f1c['errorCode']?_0x20aa2b(0x15c)+_0x104f1c[_0x20aa2b(0x102)]:undefined);return _0x104f1c[_0x20aa2b(0xe5)];}return _0x5fd62b;}catch(_0x99edf){if(_0x99edf instanceof Error&&_0x99edf['name']==='AbortError')throw CliErrors[_0x20aa2b(0x171)](_0x20aa2b(0x17c)+_0x62bd20[_0x20aa2b(0x14e)]());throw _0x99edf;}finally{clearTimeout(_0x13c396);}}async function skillHubJsonRequest(_0x50fcdd,_0x1c1a63={}){const _0xb48479=a103_0x5746,{method:method=_0xb48479(0x167),query:_0x199def,body:_0x2ee573,headers:headers={},timeout:timeout=0x7530,allowNotFound:allowNotFound=![]}=_0x1c1a63,_0x3e8599=_activeAK;if(!_0x3e8599)throw CliErrors[_0xb48479(0x13d)](_0xb48479(0xcc)+PRODUCT_CONFIG[_0xb48479(0x16e)]+'.');const _0x17085d=getSkillDomain()['replace'](/\/$/,''),_0x4073d0=new URL(_0x50fcdd,_0x17085d+'/');if(_0x199def)for(const [_0x772145,_0x3b83d4]of Object['entries'](_0x199def)){_0x3b83d4!==undefined&&_0x3b83d4!==null&&_0x4073d0[_0xb48479(0x180)][_0xb48479(0x129)](_0x772145,String(_0x3b83d4));}const _0x3664ab=new AbortController(),_0x47413e=setTimeout(()=>_0x3664ab[_0xb48479(0xe0)](),timeout);try{const _0x1a88a6=await fetch(_0x4073d0['toString'](),{'method':method,'headers':{'Accept':_0xb48479(0x14b),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x3e8599,...headers},'body':_0x2ee573,'signal':_0x3664ab['signal']}),_0x27ee7b=await decodeResponseBody(_0x1a88a6);if(!_0x27ee7b['isJson']){if(allowNotFound&&_0x1a88a6[_0xb48479(0x17a)]===0x194)return undefined;throwIfRateLimited(_0x1a88a6,undefined,_0x27ee7b['text']);throw CliErrors[_0xb48479(0x171)](_0xb48479(0x144)+_0x1a88a6[_0xb48479(0x17a)]+')',_0x1a88a6[_0xb48479(0x17a)]>=0x190?_0xb48479(0xdb):undefined);}const _0x177aed=_0x27ee7b['data'];throwIfRateLimited(_0x1a88a6,_0x177aed);if(allowNotFound&&isSkillHubNotFoundResponse(_0x1a88a6['status'],_0x177aed))return undefined;const _0x2ba1ae=!_0x1a88a6['ok']||_0x177aed?.[_0xb48479(0xf2)]===![]||typeof _0x177aed?.[_0xb48479(0x181)]==='number'&&_0x177aed[_0xb48479(0x181)]>=0x190;if(_0x2ba1ae)throw CliErrors[_0xb48479(0x171)](_0x177aed?.[_0xb48479(0x15e)]||_0x177aed?.[_0xb48479(0x17d)]||_0x177aed?.[_0xb48479(0x115)]||_0xb48479(0xf0)+_0x1a88a6[_0xb48479(0x17a)],_0x177aed?.['errorCode']?_0xb48479(0x136)+_0x177aed[_0xb48479(0x102)]:undefined);return _0x177aed?.[_0xb48479(0xe5)]??_0x177aed;}catch(_0x53756e){if(_0x53756e instanceof Error&&_0x53756e['name']==='AbortError')throw CliErrors[_0xb48479(0x171)](_0xb48479(0x17c)+_0x4073d0[_0xb48479(0x14e)]());throw _0x53756e;}finally{clearTimeout(_0x47413e);}}function isSkillHubNotFoundResponse(_0x4715cf,_0x5aeced){const _0x3266d5=a103_0x5746;if(_0x4715cf===0x194||_0x5aeced?.[_0x3266d5(0x181)]===0x194)return!![];if(_0x4715cf!==0x190&&_0x5aeced?.['code']!==0x190)return![];const _0x4a49b3=[_0x5aeced?.['msg'],_0x5aeced?.[_0x3266d5(0x17d)],_0x5aeced?.[_0x3266d5(0x15e)],_0x5aeced?.['error']][_0x3266d5(0xd6)](_0x2bcc37=>typeof _0x2bcc37===_0x3266d5(0x100))[_0x3266d5(0x119)]('\x20');return/skill not found\b/i[_0x3266d5(0x182)](_0x4a49b3);}async function skillHubBinaryRequest(_0x54f11a,_0x1db700={}){const _0x517791=a103_0x5746,{query:_0x5313d9,headers:headers={},timeout:timeout=0x7530}=_0x1db700,_0x4289b0=_activeAK;if(!_0x4289b0)throw CliErrors[_0x517791(0x13d)](_0x517791(0xcc)+PRODUCT_CONFIG[_0x517791(0x16e)]+'.');const _0x2bc175=getSkillDomain()[_0x517791(0x10a)](/\/$/,''),_0x870b95=new URL(_0x54f11a,_0x2bc175+'/');if(_0x5313d9)for(const [_0x12f4d6,_0x10bcdc]of Object[_0x517791(0xfd)](_0x5313d9)){_0x10bcdc!==undefined&&_0x10bcdc!==null&&_0x870b95[_0x517791(0x180)][_0x517791(0x129)](_0x12f4d6,String(_0x10bcdc));}const _0x442c88=new AbortController(),_0x596f7a=setTimeout(()=>_0x442c88[_0x517791(0xe0)](),timeout);try{const _0x6c6d9f=await fetch(_0x870b95[_0x517791(0x14e)](),{'method':_0x517791(0x167),'headers':{'Accept':_0x517791(0xd1),'X-Invoke-Source':PRODUCT_CONFIG[_0x517791(0x109)],'X-User-AK':_0x4289b0,...headers},'signal':_0x442c88['signal']});if(!_0x6c6d9f['ok']){const _0x3d9b74=await decodeResponseBody(_0x6c6d9f),_0x5895f2=_0x3d9b74[_0x517791(0xe5)]&&typeof _0x3d9b74[_0x517791(0xe5)]==='object'?_0x3d9b74[_0x517791(0xe5)]:{},_0x298b58=firstString(_0x5895f2[_0x517791(0x15e)],_0x5895f2[_0x517791(0x17d)],_0x5895f2[_0x517791(0x115)],_0x5895f2[_0x517791(0x102)],_0x3d9b74[_0x517791(0xcf)]);throwIfRateLimited(_0x6c6d9f,_0x3d9b74[_0x517791(0xe5)],_0x298b58);throw CliErrors['apiError'](_0x298b58||_0x517791(0xf0)+_0x6c6d9f[_0x517791(0x17a)],_0x517791(0x12b)+_0x870b95[_0x517791(0x14e)]());}return Buffer[_0x517791(0xef)](await _0x6c6d9f[_0x517791(0xc6)]());}catch(_0x33fd23){if(_0x33fd23 instanceof Error&&_0x33fd23[_0x517791(0x113)]==='AbortError')throw CliErrors['apiError'](_0x517791(0x17c)+_0x870b95['toString']());throw _0x33fd23;}finally{clearTimeout(_0x596f7a);}}export async function getBffEndpointContract(_0x5b70da,_0x3bbda0){const _0x5ee7ba=a103_0x5746;if(_0x3bbda0===_0x5ee7ba(0xe3))throw CliErrors[_0x5ee7ba(0x121)](_0x5ee7ba(0xf7)+_0x5b70da+_0x5ee7ba(0x16d)+_0x3bbda0);const _0x4117d8=await apiRequest(_0x5ee7ba(0xd5)+encodeURIComponent(_0x5b70da)+'/'+encodeURIComponent(_0x3bbda0)),_0x601f7a=_0x4117d8['data'];if(!_0x601f7a||typeof _0x601f7a!==_0x5ee7ba(0xeb)||Array['isArray'](_0x601f7a)||_0x601f7a['appCode']!==_0x5b70da||_0x601f7a[_0x5ee7ba(0x10e)]!==_0x3bbda0)throw CliErrors[_0x5ee7ba(0x121)](_0x5ee7ba(0xf7)+_0x5b70da+_0x5ee7ba(0x16d)+_0x3bbda0);return{'appCode':_0x601f7a[_0x5ee7ba(0xd0)],'functionName':_0x601f7a[_0x5ee7ba(0x10e)],'description':_0x601f7a[_0x5ee7ba(0x137)],'version':_0x601f7a[_0x5ee7ba(0x154)],'gmtModified':_0x601f7a['gmtModified']};}export async function getSqlQueryInfo(_0x11c78c,_0x4d8aee){const _0x461a13=a103_0x5746,_0x1628d6=await apiRequest('/client/sql/query',{'method':_0x461a13(0x14d),'body':{'appCode':_0x11c78c,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x4d8aee}}),_0x5aa563=_0x1628d6[_0x461a13(0xe5)],_0x1ff49b=_0x5aa563&&typeof _0x5aa563===_0x461a13(0xeb)&&_0x461a13(0xc8)in _0x5aa563?_0x5aa563[_0x461a13(0xc8)]?.[0x0]:_0x5aa563&&typeof _0x5aa563==='object'&&_0x461a13(0xc4)in _0x5aa563?_0x5aa563:undefined;if(!_0x1ff49b)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x4d8aee);return _0x1ff49b;}function isRemoteAppItem(_0x58ad34){const _0x4ce3eb=a103_0x5746;return!!_0x58ad34&&typeof _0x58ad34===_0x4ce3eb(0xeb)&&typeof _0x58ad34['appCode']===_0x4ce3eb(0x100)&&typeof _0x58ad34[_0x4ce3eb(0xc9)]===_0x4ce3eb(0x100);}function a103_0x5746(_0x37400a,_0x4ee241){_0x37400a=_0x37400a-0xc4;const _0x4791f4=a103_0x4791();let _0x57461d=_0x4791f4[_0x37400a];return _0x57461d;}function extractRemoteAppItems(_0x2eabec){const _0x541373=a103_0x5746;if(Array[_0x541373(0xf4)](_0x2eabec))return _0x2eabec['filter'](isRemoteAppItem);if(!_0x2eabec||typeof _0x2eabec!==_0x541373(0xeb))throw CliErrors[_0x541373(0x171)](_0x541373(0xc7));const _0x50b59b=_0x2eabec;if(Array[_0x541373(0xf4)](_0x50b59b[_0x541373(0xc8)]))return _0x50b59b[_0x541373(0xc8)][_0x541373(0xd6)](isRemoteAppItem);if(_0x50b59b['data']&&typeof _0x50b59b[_0x541373(0xe5)]==='object'){const _0x5f37a1=_0x50b59b['data'];if(Array[_0x541373(0xf4)](_0x5f37a1['tableData']))return _0x5f37a1['tableData'][_0x541373(0xd6)](isRemoteAppItem);}throw CliErrors[_0x541373(0x171)](_0x541373(0x104));}export async function getMyApps(){const _0x5e856d=a103_0x5746,_0x756283=await apiRequest(_0x5e856d(0x149));return extractRemoteAppItems(_0x756283[_0x5e856d(0xe5)]);}export async function getLoginUserInfo(){const _0x462bc2=a103_0x5746,_0x541067=await apiRequest(_0x462bc2(0x107));if(!_0x541067[_0x462bc2(0xe5)]||typeof _0x541067[_0x462bc2(0xe5)]!==_0x462bc2(0xeb)||Array[_0x462bc2(0xf4)](_0x541067[_0x462bc2(0xe5)]))throw CliErrors['apiError'](_0x462bc2(0xe2));return _0x541067['data'];}export const USER_ACCOUNT_BIND_PATH=a103_0x5715ee(0x175);export async function bindExternalUserAccount(_0x2971a3,_0x41ec77){const _0x248fa3=a103_0x5715ee,_0x1f640d=await apiRequest(USER_ACCOUNT_BIND_PATH,{'method':_0x248fa3(0x14d),'body':{'provider':_0x2971a3,'accountId':_0x41ec77}});return _0x1f640d[_0x248fa3(0xe5)];}function runtimeSchedulePath(_0x1cd8ce,_0x494ed3=''){const _0x3aa976=a103_0x5715ee;return _0x3aa976(0x12f)+encodeURIComponent(_0x1cd8ce)+_0x3aa976(0x11b)+_0x494ed3;}export async function validateRuntimeSchedule(_0x50e3f6,_0x4a11f9){const _0x2dcbf1=a103_0x5715ee,_0x151946=await apiRequest(runtimeSchedulePath(_0x50e3f6,_0x2dcbf1(0x178)),{'method':'POST','body':_0x4a11f9});return _0x151946['data'];}export async function createRuntimeSchedule(_0x16778c,_0x210abe){const _0x44ba91=a103_0x5715ee,_0x5b171d=await apiRequest(runtimeSchedulePath(_0x16778c),{'method':_0x44ba91(0x14d),'body':_0x210abe});return _0x5b171d[_0x44ba91(0xe5)];}export async function listRuntimeSchedules(_0x1c4892,_0x578795){const _0x48bce5=a103_0x5715ee,_0x3ca0a0=new URLSearchParams();_0x3ca0a0[_0x48bce5(0x129)](_0x48bce5(0x174),_0x578795['kind']);if(_0x578795[_0x48bce5(0x142)]!==undefined)_0x3ca0a0[_0x48bce5(0x129)](_0x48bce5(0x142),String(_0x578795['limit']));if(_0x578795[_0x48bce5(0x123)])_0x3ca0a0[_0x48bce5(0x129)]('cursor',_0x578795[_0x48bce5(0x123)]);const _0x160894=_0x3ca0a0[_0x48bce5(0xe4)]>0x0?'?'+_0x3ca0a0[_0x48bce5(0x14e)]():'',_0x1b756e=await apiRequest(''+runtimeSchedulePath(_0x1c4892)+_0x160894);return _0x1b756e[_0x48bce5(0xe5)];}export async function getRuntimeSchedule(_0x3b9fb9,_0x4234f0){const _0xc5091f=a103_0x5715ee,_0x36dcbe=await apiRequest(runtimeSchedulePath(_0x3b9fb9,'/'+encodeURIComponent(_0x4234f0)));return _0x36dcbe[_0xc5091f(0xe5)];}export async function deleteRuntimeSchedule(_0x50dab4,_0x134098){const _0x2215cf=a103_0x5715ee,_0x52d57f=await apiRequest(runtimeSchedulePath(_0x50dab4,'/'+encodeURIComponent(_0x134098)),{'method':_0x2215cf(0xf6)});return _0x52d57f[_0x2215cf(0xe5)];}export async function runRuntimeSchedule(_0xa28be7,_0x6ee119){const _0x2ef3cf=a103_0x5715ee,_0x35b759=await apiRequest(runtimeSchedulePath(_0xa28be7,'/'+encodeURIComponent(_0x6ee119)+_0x2ef3cf(0x164)),{'method':_0x2ef3cf(0x14d)});return _0x35b759[_0x2ef3cf(0xe5)];}export async function listDatasets(_0x3021f8,_0x4d4b93){const _0x11e857=a103_0x5715ee,_0x91485e=await apiRequest(_0x11e857(0x183),{'method':_0x11e857(0x14d),'body':{'appCode':_0x3021f8,..._0x4d4b93?.[_0x11e857(0x181)]&&{'code':_0x4d4b93['code']},..._0x4d4b93?.[_0x11e857(0x113)]&&{'name':_0x4d4b93['name']}}});return extractList(_0x91485e[_0x11e857(0xe5)]);}export async function getDatasetDetail(_0x5617a4){const _0x30d8bf=await apiRequest('/client/dataset/get-driven-data?code='+encodeURIComponent(_0x5617a4));return _0x30d8bf['data'];}export async function getDatasetSdkUsageDoc(_0x533ad8,_0x462ca8){const _0x39a8e0=a103_0x5715ee,_0x349411=await toolboxRequest(_0x39a8e0(0x156),{'datasetCode':_0x533ad8,'appCode':_0x462ca8});return typeof _0x349411?.[_0x39a8e0(0x13a)]===_0x39a8e0(0x100)?_0x349411[_0x39a8e0(0x13a)]:'';}export async function uploadRuntimeFile(_0x198545,_0x4e655a){const _0x3d44cd=a103_0x5715ee,_0xed663=await readFile(_0x4e655a),_0x4935d2=new FormData();_0x4935d2[_0x3d44cd(0x114)]('appCode',_0x198545),_0x4935d2[_0x3d44cd(0x114)](_0x3d44cd(0x116),new Blob([new Uint8Array(_0xed663)]),basename(_0x4e655a));const _0x4f26c6=await apiFormRequest(_0x3d44cd(0xd2),_0x4935d2);return _0x4f26c6['data'];}export async function queryRuntimeFileUrl(_0x475209,_0x3eb9a0={}){const _0x25d661=a103_0x5715ee,_0x2e2570=await apiRequest(_0x25d661(0xdd),{'method':_0x25d661(0x14d),'body':{'filePath':_0x475209,'downloadFlag':_0x3eb9a0['download']??![],..._0x3eb9a0[_0x25d661(0x15d)]?{'longTerm':!![]}:{}}});return _0x2e2570[_0x25d661(0xe5)];}export async function recognizeRuntimeOcr(_0x9c3193,_0x544fbe){const _0x35c5a4=a103_0x5715ee,_0x3a5775=await apiRequest(_0x35c5a4(0xfa),{'method':_0x35c5a4(0x14d),'body':{'appCode':_0x9c3193,'url':_0x544fbe['url'],'type':_0x544fbe[_0x35c5a4(0x17f)]}});return _0x3a5775['data'];}export async function getRuntimeAppConfigByKey(_0x38c653,_0x10fb28){const _0x56892a=a103_0x5715ee,_0xa1991d=new URLSearchParams({'appCode':_0x38c653,'key':_0x10fb28}),_0x16b267=await apiRequest(_0x56892a(0xe9)+_0xa1991d['toString']());if(typeof _0x16b267[_0x56892a(0xe5)]!==_0x56892a(0x100))throw CliErrors['validation'](_0x56892a(0xe6)+_0x10fb28);return _0x16b267[_0x56892a(0xe5)];}export async function listNotificationChannelConfigs(_0x19c06c,_0x44c39e){const _0x87f996=a103_0x5715ee,_0x8b793b=new URLSearchParams({'appCode':_0x19c06c,'channelType':_0x44c39e}),_0x2ce966=await apiRequest(_0x87f996(0x13e)+_0x8b793b[_0x87f996(0x14e)](),{'domain':'api'});if(!Array['isArray'](_0x2ce966['data']))throw CliErrors['apiError']('Invalid\x20notification\x20config\x20list\x20response.','Expected\x20the\x20server\x20data\x20field\x20to\x20be\x20an\x20array.');return _0x2ce966['data'];}export async function listRuntimeArtifacts(_0x380cf1,_0x388341){const _0x3663b6=a103_0x5715ee,_0x566e4e=new URLSearchParams({'appCode':_0x380cf1});if(_0x388341?.[_0x3663b6(0x13c)])_0x566e4e[_0x3663b6(0x129)](_0x3663b6(0x13c),_0x388341[_0x3663b6(0x13c)]);if(_0x388341?.['source'])_0x566e4e[_0x3663b6(0x129)](_0x3663b6(0x130),_0x388341[_0x3663b6(0x130)]);if(_0x388341?.['favorite']!==undefined)_0x566e4e[_0x3663b6(0x129)](_0x3663b6(0x111),String(_0x388341['favorite']));const _0x258937=await apiRequest('/client/artifact/list?'+_0x566e4e[_0x3663b6(0x14e)]());return Array[_0x3663b6(0xf4)](_0x258937[_0x3663b6(0xe5)])?_0x258937[_0x3663b6(0xe5)]:[];}export async function getRuntimeArtifact(_0x31a27f,_0x35a32b){const _0x2c7f26=a103_0x5715ee,_0x212688=await apiRequest('/client/artifact/'+_0x31a27f+_0x2c7f26(0x13f)+encodeURIComponent(_0x35a32b));if(!_0x212688[_0x2c7f26(0xe5)])throw CliErrors['validation'](_0x2c7f26(0x10f)+_0x31a27f);return _0x212688[_0x2c7f26(0xe5)];}export async function createRuntimeArtifact(_0x1ca990,_0xf4161f){const _0x34bf4c=a103_0x5715ee,_0x7fd036=await apiRequest('/client/artifact/create',{'method':_0x34bf4c(0x14d),'body':{'appCode':_0x1ca990,..._0xf4161f}});return _0x7fd036[_0x34bf4c(0xe5)];}export async function updateRuntimeArtifact(_0x1998c8,_0x2b7ccf,_0x188263){const _0x3560c1=a103_0x5715ee,_0x26ec7c=await apiRequest(_0x3560c1(0x140)+_0x1998c8+_0x3560c1(0x10d),{'method':'POST','body':{'appCode':_0x2b7ccf,..._0x188263}});return _0x26ec7c[_0x3560c1(0xe5)];}export async function listPersonalBffs(_0x488aba){const _0x358dd5=a103_0x5715ee,_0x1fb85a=await apiRequest('/client/runtime-bff/personal/list?appCode='+encodeURIComponent(_0x488aba));return Array['isArray'](_0x1fb85a[_0x358dd5(0xe5)])?_0x1fb85a['data']:[];}export async function getPersonalBff(_0x59a726,_0x305687){const _0x31d5bf=a103_0x5715ee,_0x3e9754=await apiRequest(_0x31d5bf(0x15f)+_0x59a726+'?appCode='+encodeURIComponent(_0x305687));if(!_0x3e9754['data'])throw CliErrors[_0x31d5bf(0x121)]('Personal\x20Backend\x20Function\x20not\x20found:\x20id='+_0x59a726);return _0x3e9754[_0x31d5bf(0xe5)];}export async function createPersonalBff(_0x23e0e0,_0x2dcd28){const _0x4470a9=a103_0x5715ee,_0x15298d=await apiRequest('/client/runtime-bff/personal/create',{'method':'POST','body':{'appCode':_0x23e0e0,..._0x2dcd28}});return _0x15298d[_0x4470a9(0xe5)];}export async function updatePersonalBff(_0x417098,_0x4345f2,_0x4941e7){const _0x3c8313=a103_0x5715ee,_0x2bd3bf=await apiRequest('/client/runtime-bff/personal/'+_0x417098+_0x3c8313(0x10d),{'method':'POST','body':{'appCode':_0x4345f2,..._0x4941e7}});return _0x2bd3bf[_0x3c8313(0xe5)];}export async function executePersonalBff(_0x5e798d,_0x1f65da,_0x462491){const _0x1a074a=a103_0x5715ee,_0x1051f0=await apiRequest('/client/runtime-bff/personal/'+_0x5e798d+'/execute?appCode='+encodeURIComponent(_0x1f65da),{'method':_0x1a074a(0x14d),'body':_0x462491});return _0x1051f0[_0x1a074a(0xe5)];}export async function listPersonalKnowledgeBaseItems(_0x275965){const _0x1761d2=a103_0x5715ee,_0x1234e2=await apiRequest('/client/knowledge-base/personal/list?appCode='+encodeURIComponent(_0x275965),{'domain':'kb'});return Array[_0x1761d2(0xf4)](_0x1234e2[_0x1761d2(0xe5)])?_0x1234e2[_0x1761d2(0xe5)]:[];}export async function getPersonalKnowledgeBaseItem(_0x44874f,_0x50536e){const _0x2e59e4=a103_0x5715ee,_0x39faf4=await apiRequest(_0x2e59e4(0x168)+_0x44874f+'?appCode='+encodeURIComponent(_0x50536e),{'domain':'kb'});if(!_0x39faf4[_0x2e59e4(0xe5)])throw CliErrors['validation'](_0x2e59e4(0x147)+_0x44874f);return _0x39faf4[_0x2e59e4(0xe5)];}export async function createPersonalKnowledgeBaseItem(_0x361b5f,_0x4ac060){const _0x451356=a103_0x5715ee,_0x21df04=await apiRequest(_0x451356(0x118),{'method':'POST','body':{'appCode':_0x361b5f,..._0x4ac060},'domain':'kb'});return _0x21df04['data'];}export async function updatePersonalKnowledgeBaseItem(_0x3781da,_0x56133c,_0x592962){const _0x5f5ced=a103_0x5715ee,_0xf7b074=await apiRequest(_0x5f5ced(0x168)+_0x3781da+_0x5f5ced(0x10d),{'method':_0x5f5ced(0x14d),'body':{'appCode':_0x56133c,..._0x592962},'domain':'kb'});return _0xf7b074[_0x5f5ced(0xe5)];}export async function searchKnowledgeBase(_0xf31c08,_0x41abf6){const _0x5267dc=a103_0x5715ee,_0xef53d5=await apiRequest(_0x5267dc(0x157),{'method':_0x5267dc(0x14d),'body':{'appCode':_0xf31c08,'query':_0x41abf6[_0x5267dc(0x17e)],..._0x41abf6[_0x5267dc(0x11a)]!==undefined?{'topK':_0x41abf6[_0x5267dc(0x11a)]}:{}},'domain':'kb'});return Array['isArray'](_0xef53d5[_0x5267dc(0xe5)])?_0xef53d5[_0x5267dc(0xe5)]:[];}export async function getRuntimeSkillByCode(_0x1b4ea4,_0x454210){const _0xa36101=a103_0x5715ee,_0x3b6838=await skillHubJsonRequest(_0xa36101(0xd4)+encodeURIComponent(_0x1b4ea4)+'/'+encodeURIComponent(_0x454210),{'allowNotFound':!![]});return _0x3b6838?skillHubRuntimeDetailToRuntimeSkill(_0x3b6838):undefined;}export async function listRuntimeSkills(_0x10523a){const _0x1f68d7=a103_0x5715ee,_0x4e4fbe=await skillHubJsonRequest(_0x1f68d7(0x184)+encodeURIComponent(_0x10523a['appCode'])+'/skills',{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x10523a[_0x1f68d7(0xd0)],_0x4e4fbe,_0x10523a[_0x1f68d7(0xec)]??_0x1f68d7(0xde),_0x10523a[_0x1f68d7(0x181)]);}export async function listPersonalRuntimeSkills(_0x10306c){const _0xb22302=a103_0x5715ee;return(await listRuntimeSkills({'appCode':_0x10306c,'scope':'personal'}))[_0xb22302(0x124)];}export async function listCompanyRuntimeSkills(_0x492bf9){const _0x37e338=a103_0x5715ee;return(await listRuntimeSkills({'appCode':_0x492bf9,'scope':_0x37e338(0x105)}))[_0x37e338(0x105)];}export async function listVisibleRuntimeSkills(_0x17ee11){const _0x389a5b=a103_0x5715ee;return(await listRuntimeSkills({'appCode':_0x17ee11,'scope':_0x389a5b(0xde)}))['effective'];}export async function createPersonalRuntimeSkill(_0x5539bf,_0x3d8403,_0x2eb0d6={}){const _0x523341=a103_0x5715ee;return publishRuntimeSkill(_0x5539bf,_0x3d8403,{'visibility':_0x523341(0x162),'confirmWarnings':_0x2eb0d6[_0x523341(0x108)]});}export async function updatePersonalRuntimeSkill(_0x19da5c,_0x111f7a,_0xfd4d25,_0x38ec5e={}){const _0x357834=a103_0x5715ee;return publishRuntimeSkill(_0x111f7a,{..._0xfd4d25,'skillCode':_0xfd4d25[_0x357834(0x146)]??_0x19da5c},{'visibility':_0x357834(0x162),'confirmWarnings':_0x38ec5e[_0x357834(0x108)]});}export async function publishCompanyRuntimeSkill(_0x52df5b,_0x7b84f8,_0x16ae58={}){const _0x12334d=a103_0x5715ee;return publishRuntimeSkill(_0x52df5b,_0x7b84f8,{'visibility':'NAMESPACE_ONLY','confirmWarnings':_0x16ae58[_0x12334d(0x108)]});}export async function validateRuntimeSkillPublish(_0x1f1d81,_0x18a05c,_0x47d788){const _0x4c2072=a103_0x5715ee,_0x56772b=buildRuntimeSkillPublishForm(_0x18a05c,_0x47d788['visibility']),_0x333ed6=await skillHubJsonRequest(_0x4c2072(0x139)+encodeURIComponent(_0x1f1d81)+_0x4c2072(0xd7),{'method':'POST','body':_0x56772b});return assertJointDiagramAcknowledged(_0x18a05c[_0x4c2072(0xf9)],_0x333ed6[_0x4c2072(0x185)],_0x4c2072(0x121)),{'valid':_0x333ed6[_0x4c2072(0xff)]===!![],'errors':Array[_0x4c2072(0xf4)](_0x333ed6['errors'])?_0x333ed6[_0x4c2072(0x163)]:[],'warnings':Array['isArray'](_0x333ed6[_0x4c2072(0x112)])?_0x333ed6['warnings']:[],'resolvedSlug':_0x333ed6[_0x4c2072(0x14f)],'resolvedVersion':_0x333ed6[_0x4c2072(0x16b)],'diagramValidated':_0x333ed6[_0x4c2072(0x185)]===!![]};}export async function validateRuntimeSkillVersionDiagram(_0x913efd,_0x1d4862,_0x219ffd,_0xb8c691,_0x22d414){const _0x3034d6=a103_0x5715ee;return skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0x913efd,_0x1d4862,_0x219ffd,_0x3034d6(0x178)),{'method':_0x3034d6(0x14d),'query':{'scope':_0xb8c691},'headers':{'Content-Type':'application/json'},'body':JSON[_0x3034d6(0x12e)](_0x22d414)});}export async function putRuntimeSkillVersionDiagram(_0x329844,_0x5a6e87,_0x5d8170,_0x30717d,_0x2a5b91){const _0x57491f=a103_0x5715ee;return skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0x329844,_0x5a6e87,_0x5d8170),{'method':_0x57491f(0xf8),'query':{'scope':_0x30717d},'headers':{'Content-Type':_0x57491f(0x14b)},'body':JSON[_0x57491f(0x12e)](_0x2a5b91)});}export async function getRuntimeSkillVersionDiagram(_0x504bc2,_0x326613,_0x354b20,_0x55f9d0){const _0x682a2b=a103_0x5715ee,_0x4a6e35=await skillHubJsonRequest(runtimeSkillVersionDiagramPath(_0x504bc2,_0x326613,_0x354b20),{'query':{'scope':_0x55f9d0}});if(typeof _0x4a6e35[_0x682a2b(0x11f)]!==_0x682a2b(0x179))throw CliErrors[_0x682a2b(0x171)]('Invalid\x20Skill\x20diagram\x20response:\x20missing\x20found\x20state.');const _0x200e3f=_0x4a6e35[_0x682a2b(0xe7)];if(typeof _0x200e3f!==_0x682a2b(0x100)||!/^sha256:[0-9a-f]{64}$/[_0x682a2b(0x182)](_0x200e3f))throw CliErrors[_0x682a2b(0x171)](_0x682a2b(0x16c),'SkillHub\x20must\x20return\x20the\x20exact\x20SkillVersion\x20fingerprint\x20even\x20when\x20found=false.');const _0x3981f5=_0x4a6e35[_0x682a2b(0xca)];if(_0x4a6e35[_0x682a2b(0x11f)]&&(!Number[_0x682a2b(0x165)](_0x3981f5)||Number(_0x3981f5)<0x1))throw CliErrors[_0x682a2b(0x171)]('Invalid\x20Skill\x20diagram\x20response:\x20found\x20diagram\x20has\x20no\x20positive\x20diagramRevision.');if(!_0x4a6e35[_0x682a2b(0x11f)]&&_0x3981f5!==undefined&&_0x3981f5!==null)throw CliErrors[_0x682a2b(0x171)](_0x682a2b(0x169));const _0x3c7367=_0x4a6e35[_0x682a2b(0x11f)]?Number(_0x3981f5):null;return{..._0x4a6e35,'sourceFingerprint':_0x200e3f,'diagramRevision':_0x3c7367,'expectedDiagramRevision':_0x3c7367??0x0};}export async function downloadRuntimeSkillPackage(_0x2e23bb,_0x49e322,_0xe26b32,_0x61bfb5){const _0x5b151e=a103_0x5715ee;void _0x2e23bb;const _0x32977c=_0x61bfb5?_0x5b151e(0x139)+encodeURIComponent(_0xe26b32)+'/'+encodeURIComponent(_0x49e322)+_0x5b151e(0xdc)+encodeURIComponent(_0x61bfb5)+'/download':_0x5b151e(0x139)+encodeURIComponent(_0xe26b32)+'/'+encodeURIComponent(_0x49e322)+_0x5b151e(0x12d);return skillHubBinaryRequest(_0x32977c);}async function publishRuntimeSkill(_0x5731fe,_0x435667,_0x128f13){const _0x379ad1=a103_0x5715ee,_0x1ec2dc=buildRuntimeSkillPublishForm(_0x435667,_0x128f13[_0x379ad1(0x11e)]),_0x4e316d=await skillHubJsonRequest(_0x379ad1(0x139)+encodeURIComponent(_0x5731fe)+_0x379ad1(0xe1),{'method':_0x379ad1(0x14d),'query':{'confirmWarnings':_0x128f13[_0x379ad1(0x108)]===!![]?!![]:undefined},'body':_0x1ec2dc});return assertJointDiagramAcknowledged(_0x435667[_0x379ad1(0xf9)],_0x4e316d[_0x379ad1(0x17b)],_0x379ad1(0x15a)),{'appCode':_0x4e316d[_0x379ad1(0x14a)]??_0x5731fe,'skillCode':_0x4e316d[_0x379ad1(0x159)]??_0x435667[_0x379ad1(0x146)]??'','skillName':_0x435667['skillName']??_0x4e316d[_0x379ad1(0x159)]??_0x435667[_0x379ad1(0x146)],'description':_0x435667['description'],'scope':skillHubVisibilityToScope(_0x4e316d[_0x379ad1(0x11e)]??_0x128f13[_0x379ad1(0x11e)])??_0x379ad1(0x124),'version':_0x4e316d[_0x379ad1(0x154)]??_0x435667['version'],'tags':_0x435667[_0x379ad1(0xfc)],'content':_0x435667['content'],'diagramBound':_0x4e316d[_0x379ad1(0x17b)]===!![]};}function assertJointDiagramAcknowledged(_0x39c179,_0x4c9344,_0x2d1a10){const _0x2f78de=a103_0x5715ee;if(!_0x39c179||_0x4c9344===!![])return;throw CliErrors[_0x2f78de(0x171)](_0x2f78de(0x103)+_0x2d1a10+'.',_0x2f78de(0x141));}function buildRuntimeSkillPublishForm(_0x39ee11,_0x4406e7){const _0x247e62=a103_0x5715ee,_0x2d30da=new FormData();return _0x2d30da['set'](_0x247e62(0x116),runtimeSkillPackageFile(_0x39ee11)),_0x39ee11[_0x247e62(0x128)]?.[_0x247e62(0x122)]()&&_0x2d30da['set'](_0x247e62(0x126),_0x39ee11[_0x247e62(0x128)][_0x247e62(0x122)]()),_0x2d30da['set'](_0x247e62(0x11e),_0x4406e7),_0x39ee11[_0x247e62(0xf9)]&&_0x2d30da[_0x247e62(0x129)](_0x247e62(0xf9),new Blob([JSON['stringify'](_0x39ee11[_0x247e62(0xf9)])],{'type':_0x247e62(0x14b)})),_0x2d30da;}function a103_0x4791(){const _0x24da32=['API\x20error:\x20','resolvedVersion','Invalid\x20Skill\x20diagram\x20response:\x20missing\x20canonical\x20sourceFingerprint.',',\x20name=','newConfigFileName','.zip','summary','apiError','API\x20error\x20code:\x20','json','kind','/client/user-accounts/bind','14561940NtzarW','application/zip','/validate','boolean','status','diagramBound','Request\x20timeout:\x20','message','query','type','searchParams','code','test','/client/dataset/list','/api/runtime/v1/namespaces/','diagramValidated','sqlCode','isJson','arrayBuffer','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','tableData','appName','diagramRevision','runtime','Configure\x20accessKey\x20in\x20','/client/permit/dataset/permit-list','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','text','appCode','application/octet-stream','/client/uploadFile','/client/permit/role/get-list','/api/v1/skills/','/client/bff/endpoint/','filter','/publish/validate','values','headlineVersion','roleName','Check\x20your\x20credentials\x20and\x20try\x20again.','/versions/','/client/queryFileUrl','all','/diagram','abort','/publish','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','functions','size','data','Invalid\x20app\x20config\x20value:\x20key=','sourceFingerprint','NAMESPACE_ONLY','/client/app-config/getByKey?','publishedVersion','object','scope','base64','example','from','SkillHub\x20API\x20error:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','success','1206366odYTTO','isArray','permitList','DELETE','Backend\x20Function\x20not\x20found\x20or\x20inaccessible:\x20appCode=','PUT','diagram','/client/ocr','/client/permit/page/get-one','tags','entries','packageBase64','valid','string','items','errorCode','SkillHub\x20does\x20not\x20support\x20atomic\x20Skill\x20diagram\x20','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','company','min','/client/user/loginUserInfo','confirmWarnings','invokeSource','replace','18kKwlNs','/client/permit/role/update','/update','functionName','Artifact\x20not\x20found:\x20id=','44155diptqi','favorite','warnings','name','append','msg','file','currentPage','/client/knowledge-base/personal/create','join','topK','/schedules','skill','max','visibility','found','api','validation','trim','cursor','personal','signal','displayName','/client/permit/page/save','skillName','set','CUSTOM','Download\x20failed:\x20','map','/download','stringify','/api/harness/apps/','source','350236GBWvHb','Toolbox\x20API\x20error:\x20','ownerPreviewVersion','toLowerCase','2105145oUNEcr','SkillHub\x20error\x20code:\x20','description','/client/permit/user-role/get-user-list','/api/cli/v1/skills/','markdown','undefined','artifactType','authRequired','/notification/channel-config/list?','?appCode=','/client/artifact/','Deploy\x20a\x20SkillHub\x20version\x20that\x20returns\x20diagramValidated/diagramBound\x20before\x20publishing\x20with\x20this\x20CLI.','limit','16LsDHNX','SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20','AbortError','skillCode','Knowledge-base\x20entry\x20not\x20found:\x20id=','/client/menu/permit-list','/client/app/my-apps','namespace','application/json','/client/permit/user-role/update-user-list','POST','toString','resolvedSlug','/client/permit/role/delete','/client/permit/resource/batch-save-menu','Toolbox\x20API\x20error','function','version','/client/permit/role/create','api-doc-generator','/client/knowledge-base/search','964832aBMBWu','slug','publish','effective','Toolbox\x20error\x20code:\x20','longTerm','errorMsg','/client/runtime-bff/personal/','/api/node-toolbox/','5uiLSuc','PRIVATE','errors','/run','isInteger','821422GaKOgU','GET','/client/knowledge-base/personal/','Invalid\x20Skill\x20diagram\x20response:\x20absent\x20diagram\x20must\x20have\x20a\x20null\x20diagramRevision.'];a103_0x4791=function(){return _0x24da32;};return a103_0x4791();}function runtimeSkillVersionDiagramPath(_0x1885db,_0x1191a6,_0x12572a,_0x3697a4=''){const _0xdee631=a103_0x5715ee;return _0xdee631(0x139)+encodeURIComponent(_0x1885db)+'/'+encodeURIComponent(_0x1191a6)+_0xdee631(0xdc)+encodeURIComponent(_0x12572a)+_0xdee631(0xdf)+_0x3697a4;}function runtimeSkillPackageFile(_0x50c996){const _0x39507b=a103_0x5715ee;if(!_0x50c996[_0x39507b(0xfe)])throw CliErrors['validation']('Missing\x20Skill\x20package\x20payload.');const _0xbc5080=Buffer[_0x39507b(0xef)](_0x50c996[_0x39507b(0xfe)],_0x39507b(0xed)),_0x37b6f7=new Blob([_0xbc5080],{'type':_0x39507b(0x177)}),_0x426646=(_0x50c996[_0x39507b(0x146)]||_0x39507b(0x11c))+_0x39507b(0x16f);if(typeof File!==_0x39507b(0x13b))return new File([_0x37b6f7],_0x426646,{'type':_0x39507b(0x177)});return _0x37b6f7;}function normalizeSkillHubRuntimeListResponse(_0x4564f8,_0x395020,_0xe7a29f,_0x3f85c3){const _0xe2c0a5=a103_0x5715ee,_0x31fb47=Array['isArray'](_0x395020)?_0x395020:Array[_0xe2c0a5(0xf4)](_0x395020?.[_0xe2c0a5(0x101)])?_0x395020[_0xe2c0a5(0x101)]:[],_0x2d15cc=_0x3f85c3?.[_0xe2c0a5(0x122)](),_0x256261=_0x31fb47['filter'](_0x4592a0=>!_0x2d15cc||_0x4592a0[_0xe2c0a5(0x159)]===_0x2d15cc)[_0xe2c0a5(0x12c)](skillHubRuntimeItemToRuntimeSkill)[_0xe2c0a5(0xd6)](_0x5b152e=>Boolean(_0x5b152e)),_0x3dc736=_0x256261[_0xe2c0a5(0xd6)](_0x46035d=>_0x46035d[_0xe2c0a5(0xec)]===_0xe2c0a5(0x124)),_0x2471c0=_0x256261[_0xe2c0a5(0xd6)](_0xd646f3=>_0xd646f3[_0xe2c0a5(0xec)]==='company');return{'appCode':_0x4564f8,'personal':_0xe7a29f==='company'?[]:_0x3dc736,'company':_0xe7a29f===_0xe2c0a5(0x124)?[]:_0x2471c0,'effective':buildEffectiveRuntimeSkills(_0x3dc736,_0x2471c0,_0xe7a29f)};}function skillHubRuntimeItemToRuntimeSkill(_0x35ef23){const _0xafa41d=a103_0x5715ee,_0x4bb87c=_0x35ef23[_0xafa41d(0x159)]?.['trim'](),_0xf996a2=skillHubVisibilityToScope(_0x35ef23['visibility']);if(!_0x4bb87c||!_0xf996a2)return undefined;return{'id':_0x35ef23['id'],'appCode':_0x35ef23[_0xafa41d(0x14a)],'skillCode':_0x4bb87c,'skillName':_0x35ef23[_0xafa41d(0x126)]??_0x4bb87c,'description':_0x35ef23[_0xafa41d(0x170)],'example':_0x35ef23[_0xafa41d(0xee)],'scope':_0xf996a2,'version':skillHubRuntimeItemVersion(_0x35ef23),'status':_0x35ef23[_0xafa41d(0x17a)]};}function skillHubRuntimeDetailToRuntimeSkill(_0x2c5b0b){const _0x1ad970=a103_0x5715ee,_0x4edfa7=_0x2c5b0b[_0x1ad970(0x159)]?.[_0x1ad970(0x122)]();if(!_0x4edfa7)return undefined;return{'id':_0x2c5b0b['id'],'appCode':_0x2c5b0b[_0x1ad970(0x14a)],'skillCode':_0x4edfa7,'skillName':_0x2c5b0b['displayName']??_0x4edfa7,'description':_0x2c5b0b[_0x1ad970(0x170)],'example':_0x2c5b0b[_0x1ad970(0xee)],'scope':skillHubVisibilityToScope(_0x2c5b0b[_0x1ad970(0x11e)])??_0x2c5b0b[_0x1ad970(0x11e)]?.[_0x1ad970(0x134)](),'version':skillHubRuntimeItemVersion(_0x2c5b0b),'status':_0x2c5b0b['status']};}function skillHubVisibilityToScope(_0x5ea4db){const _0x3d4d2c=a103_0x5715ee;if(_0x5ea4db==='PRIVATE')return _0x3d4d2c(0x124);if(_0x5ea4db===_0x3d4d2c(0xe8))return _0x3d4d2c(0x105);return undefined;}function skillHubRuntimeItemVersion(_0x15518f){const _0x3e29f1=a103_0x5715ee;return _0x15518f[_0x3e29f1(0xea)]?.[_0x3e29f1(0x154)]??_0x15518f[_0x3e29f1(0xd9)]?.[_0x3e29f1(0x154)]??_0x15518f[_0x3e29f1(0x133)]?.[_0x3e29f1(0x154)];}function buildEffectiveRuntimeSkills(_0x151cbc,_0x27ce29,_0x3171c7){const _0x34e64c=a103_0x5715ee;if(_0x3171c7==='personal')return _0x151cbc;if(_0x3171c7==='company')return _0x27ce29;const _0x4b2269=new Map();for(const _0x34422e of _0x27ce29){_0x4b2269[_0x34e64c(0x129)](_0x34422e[_0x34e64c(0x146)],_0x34422e);}for(const _0x4a9be7 of _0x151cbc){_0x4b2269[_0x34e64c(0x129)](_0x4a9be7[_0x34e64c(0x146)],_0x4a9be7);}return Array[_0x34e64c(0xef)](_0x4b2269[_0x34e64c(0xd8)]());}function normalizeRuntimeSkillListResponse(_0xa5bb66,_0x45414b){const _0x7a00b0=a103_0x5715ee;if(Array[_0x7a00b0(0xf4)](_0x45414b)){const _0x1349fc=_0x45414b[_0x7a00b0(0xd6)](_0x5294dc=>_0x5294dc['scope']===_0x7a00b0(0x124)),_0x5a8858=_0x45414b[_0x7a00b0(0xd6)](_0x14fb61=>_0x14fb61[_0x7a00b0(0xec)]===_0x7a00b0(0x105));return{'appCode':_0xa5bb66,'personal':_0x1349fc,'company':_0x5a8858,'effective':[..._0x5a8858,..._0x1349fc]};}return{'appCode':_0x45414b?.[_0x7a00b0(0xd0)]??_0xa5bb66,'personal':Array[_0x7a00b0(0xf4)](_0x45414b?.[_0x7a00b0(0x124)])?_0x45414b['personal']:[],'company':Array[_0x7a00b0(0xf4)](_0x45414b?.[_0x7a00b0(0x105)])?_0x45414b[_0x7a00b0(0x105)]:[],'effective':Array[_0x7a00b0(0xf4)](_0x45414b?.[_0x7a00b0(0x15b)])?_0x45414b[_0x7a00b0(0x15b)]:[]};}export async function listRuntimeAppRoles(_0x1b2469,_0x27eb27={}){const _0x10f39e=a103_0x5715ee,_0x8b46c8=_0x27eb27[_0x10f39e(0x117)]??0x1,_0xf5ac3f=Math[_0x10f39e(0x106)](Math[_0x10f39e(0x11d)](_0x27eb27['pageSize']??0x64,0x1),0x64),_0x3b61b8=await apiRequest(_0x10f39e(0xd3),{'method':_0x10f39e(0x14d),'body':{'appCode':_0x1b2469,..._0x27eb27[_0x10f39e(0xda)]?{'roleName':_0x27eb27[_0x10f39e(0xda)]}:{},'currentPage':_0x8b46c8,'pageSize':_0xf5ac3f}});return{'items':extractList(_0x3b61b8[_0x10f39e(0xe5)]),'paging':extractPaging(_0x3b61b8[_0x10f39e(0xe5)])};}export async function createRuntimeAppRole(_0x385409){const _0x28a2ce=a103_0x5715ee,_0x38f2d3=await apiRequest(_0x28a2ce(0x155),{'method':_0x28a2ce(0x14d),'body':{'roleType':_0x28a2ce(0x12a),..._0x385409}});return _0x38f2d3['data'];}export async function updateRuntimeAppRole(_0x50c916){const _0x3fb97f=a103_0x5715ee,_0x34f442=await apiRequest(_0x3fb97f(0x10c),{'method':_0x3fb97f(0x14d),'body':_0x50c916});return _0x34f442[_0x3fb97f(0xe5)];}export async function deleteRuntimeAppRole(_0x2f5556){const _0xd03f9=a103_0x5715ee,_0x44b7f5=await apiRequest(_0xd03f9(0x150),{'method':_0xd03f9(0x14d),'body':{'id':_0x2f5556}});return _0x44b7f5['data'];}export async function listRuntimeRoleUsers(_0x10f25d){const _0x20f4fd=a103_0x5715ee,_0x2872de=await apiRequest(_0x20f4fd(0x138),{'method':'POST','body':{'appCode':_0x10f25d}});return extractList(_0x2872de[_0x20f4fd(0xe5)]);}export async function updateRuntimeRoleUsers(_0x5a7927,_0x19a133){const _0x54d6fd=a103_0x5715ee,_0x45d315=await apiRequest(_0x54d6fd(0x14c),{'method':_0x54d6fd(0x14d),'body':{'appCode':_0x5a7927,'roleList':_0x19a133}});return _0x45d315[_0x54d6fd(0xe5)];}export async function listRuntimeAppUsers(_0x19da4a){const _0x1f09b9=a103_0x5715ee,_0x329416=await apiRequest('/client/dept/queryAppUser'+runtimePermitQuery({'appCode':_0x19da4a}));return extractList(_0x329416[_0x1f09b9(0xe5)]);}function runtimePermitQuery(_0x27856b){const _0x203bf9=a103_0x5715ee,_0x512ac3=new URLSearchParams();for(const [_0x3bcc2a,_0x188a5f]of Object[_0x203bf9(0xfd)](_0x27856b))_0x512ac3[_0x203bf9(0x129)](_0x3bcc2a,String(_0x188a5f));return'?'+_0x512ac3['toString']();}export async function listRuntimePermitRoles(_0x43b20f,_0xb11d24={}){const _0x357ea4=a103_0x5715ee,_0x56a6f0=await apiRequest('/client/permit/role/get-permit-list',{'method':_0x357ea4(0x14d),'body':{'appCode':_0x43b20f,..._0xb11d24}});return extractList(_0x56a6f0[_0x357ea4(0xe5)]);}export async function getRuntimePagePermit(_0x52e789){const _0x44b043=a103_0x5715ee,_0x4ce8ed=await apiRequest(_0x44b043(0xfb)+runtimePermitQuery({'menuId':_0x52e789}));return _0x4ce8ed['data'];}export async function saveRuntimePagePermit(_0xb48145){const _0x517c3b=a103_0x5715ee,_0x27eb64=await apiRequest(_0x517c3b(0x127),{'method':_0x517c3b(0x14d),'body':_0xb48145});return _0x27eb64[_0x517c3b(0xe5)];}export async function getRuntimeRoleMenuResources(_0x58b4d0,_0x3c8831){const _0x65230e=a103_0x5715ee,_0x40671f=await apiRequest('/client/permit/resource/get-menu-list',{'method':_0x65230e(0x14d),'body':{'appCode':_0x58b4d0,'roleId':_0x3c8831}});return extractList(_0x40671f[_0x65230e(0xe5)]);}export async function listRuntimeMenuRolePermits(_0x57df19){const _0x47bc5d=a103_0x5715ee,_0xa57ff7=await apiRequest(_0x47bc5d(0x148)+runtimePermitQuery({'appCode':_0x57df19}));return Array[_0x47bc5d(0xf4)](_0xa57ff7['data']?.[_0x47bc5d(0xf5)])?_0xa57ff7[_0x47bc5d(0xe5)][_0x47bc5d(0xf5)]:[];}export async function saveRuntimeMenuRolePermits(_0x4ce5ae,_0x4d3de3){const _0x4772b2=a103_0x5715ee,_0x5f2bd9=await apiRequest(_0x4772b2(0x151),{'method':_0x4772b2(0x14d),'body':{'appCode':_0x4ce5ae,'permitList':_0x4d3de3}});return _0x5f2bd9[_0x4772b2(0xe5)];}export async function listRuntimeDatasetPermits(_0x15bfe3,_0x5051ea){const _0x48894e=a103_0x5715ee,_0x36bd71=await apiRequest('/client/permit/dataset/list'+runtimePermitQuery({'appCode':_0x15bfe3,'roleId':_0x5051ea}));return Array[_0x48894e(0xf4)](_0x36bd71['data']?.[_0x48894e(0xf5)])?_0x36bd71[_0x48894e(0xe5)][_0x48894e(0xf5)]:[];}export async function listRuntimeDatasetRolePermits(_0xec7820){const _0x358b5=a103_0x5715ee,_0x4b75d0=await apiRequest(_0x358b5(0xcd)+runtimePermitQuery({'appCode':_0xec7820}));return Array[_0x358b5(0xf4)](_0x4b75d0[_0x358b5(0xe5)]?.[_0x358b5(0xf5)])?_0x4b75d0[_0x358b5(0xe5)][_0x358b5(0xf5)]:[];}export async function saveRuntimeDatasetRolePermits(_0x4bb563,_0x1f1786){const _0x4a79a8=await apiRequest('/client/permit/resource/batch-save-dataset',{'method':'POST','body':{'appCode':_0x4bb563,'permitList':_0x1f1786}});return _0x4a79a8['data'];}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28992e,_0x316432){const _0x4cb91c=a104_0x4fe3,_0x5ecc55=_0x28992e();while(!![]){try{const _0x4d15d1=parseInt(_0x4cb91c(0x1f1))/0x1*(-parseInt(_0x4cb91c(0x1e9))/0x2)+parseInt(_0x4cb91c(0x1ea))/0x3*(parseInt(_0x4cb91c(0x1eb))/0x4)+-parseInt(_0x4cb91c(0x1e1))/0x5*(-parseInt(_0x4cb91c(0x1ed))/0x6)+-parseInt(_0x4cb91c(0x1f0))/0x7*(-parseInt(_0x4cb91c(0x1e2))/0x8)+-parseInt(_0x4cb91c(0x1ec))/0x9*(-parseInt(_0x4cb91c(0x1df))/0xa)+parseInt(_0x4cb91c(0x1f3))/0xb+parseInt(_0x4cb91c(0x1e0))/0xc*(-parseInt(_0x4cb91c(0x1e4))/0xd);if(_0x4d15d1===_0x316432)break;else _0x5ecc55['push'](_0x5ecc55['shift']());}catch(_0x280d10){_0x5ecc55['push'](_0x5ecc55['shift']());}}}(a104_0x5e01,0xae105));import{listDatasets}from'../core/api-client.js';function a104_0x5e01(){const _0x1af09e=['dbId','805460CGkPEY','347664tGHfML','16010WxVEXM','16KVPjUp','entries','988HOaqAM','find','dbName','db-','map','1249996lJiXYH','156939XXhspU','88dLpyUT','18gkZvSC','42SHqkce','has','dbtableConfig','3991141ghOvic','1UlPwdY','set','11716287aVMolf'];a104_0x5e01=function(){return _0x1af09e;};return a104_0x5e01();}const cache=new Map();function a104_0x4fe3(_0x51932d,_0x137884){_0x51932d=_0x51932d-0x1de;const _0x5e018c=a104_0x5e01();let _0x4fe3a8=_0x5e018c[_0x51932d];return _0x4fe3a8;}export async function listDatabases(_0x3047ca){const _0x323beb=a104_0x4fe3;if(cache[_0x323beb(0x1ee)](_0x3047ca))return cache['get'](_0x3047ca);const _0x153e6c=await listDatasets(_0x3047ca),_0x40838b=new Map();for(const _0x3a0769 of _0x153e6c){const _0x47a743=_0x3a0769[_0x323beb(0x1ef)];_0x47a743?.[_0x323beb(0x1de)]!=null&&_0x40838b[_0x323beb(0x1f2)](_0x47a743[_0x323beb(0x1de)],_0x47a743[_0x323beb(0x1e6)]??_0x323beb(0x1e7)+_0x47a743['dbId']);}const _0x524c4b=[..._0x40838b[_0x323beb(0x1e3)]()][_0x323beb(0x1e8)](([_0x47b0d9,_0x2642bb])=>({'dbId':_0x47b0d9,'dbName':_0x2642bb}));return cache[_0x323beb(0x1f2)](_0x3047ca,_0x524c4b),_0x524c4b;}export async function getDbName(_0x4cd950,_0x15cbbc){const _0x10a934=a104_0x4fe3;try{const _0x57a6e6=await listDatabases(_0x4cd950);return _0x57a6e6[_0x10a934(0x1e5)](_0x5deefe=>_0x5deefe['dbId']===_0x15cbbc)?.[_0x10a934(0x1e6)];}catch{return undefined;}}
|