@lovrabet/lovrabet-cli 2.1.18-beta.2 → 2.1.18-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.d.ts +7 -14
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JSON
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* numbers. Native JSON.parse rounds those values before callers can inspect
|
|
6
|
-
* them, so converting the resulting number with String() is already too late.
|
|
7
|
-
* This module quotes only unsafe integer tokens before the first parse. Safe
|
|
8
|
-
* integers, decimal values, booleans, nulls, and string contents keep their
|
|
9
|
-
* normal JSON semantics.
|
|
2
|
+
* 本文件提供无损 JSON 解析,并在 SDK 调用期间临时替换 Response.json。
|
|
3
|
+
* 它会在首次解析前把超出 JavaScript 安全整数范围的整数字面量转成字符串,
|
|
4
|
+
* 同时保留安全整数、小数、布尔值、null 与字符串的原有语义。
|
|
10
5
|
*/
|
|
6
|
+
/** 解析 JSON,同时把非安全整数保留为十进制字符串。 */
|
|
11
7
|
export declare function parseLosslessJson<T = unknown>(text: string): T;
|
|
12
8
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* parser hook, so this must run before the first runtime response is decoded.
|
|
16
|
-
*
|
|
17
|
-
* Returns a restore function so the CLI can limit the global Response patch to
|
|
18
|
-
* the SDK command lifecycle.
|
|
9
|
+
* 在 @lovrabet/sdk 使用的 Response 边界安装无损解析器。
|
|
10
|
+
* SDK 暂未暴露 parser hook,因此调用方需要在首个响应解析前安装,并在命令结束后恢复。
|
|
19
11
|
*/
|
|
20
12
|
export declare function installLosslessJsonResponseParser(): () => void;
|
|
13
|
+
/** 若无损 Response.json 解析器已安装,则立即恢复原实现。 */
|
|
21
14
|
export declare function restoreLosslessJsonResponseParser(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a120_0x1816(_0x545892,_0x4fad41){_0x545892=_0x545892-0x187;const _0x2e3e96=a120_0x2e3e();let _0x1816c4=_0x2e3e96[_0x545892];return _0x1816c4;}const a120_0x1788f0=a120_0x1816;(function(_0x4f1f15,_0x183f2f){const _0x2343dd=a120_0x1816,_0x39d21a=_0x4f1f15();while(!![]){try{const _0xc4a407=parseInt(_0x2343dd(0x18f))/0x1+parseInt(_0x2343dd(0x18b))/0x2*(parseInt(_0x2343dd(0x192))/0x3)+parseInt(_0x2343dd(0x196))/0x4*(-parseInt(_0x2343dd(0x189))/0x5)+-parseInt(_0x2343dd(0x197))/0x6+parseInt(_0x2343dd(0x198))/0x7+parseInt(_0x2343dd(0x193))/0x8*(-parseInt(_0x2343dd(0x188))/0x9)+parseInt(_0x2343dd(0x194))/0xa;if(_0xc4a407===_0x183f2f)break;else _0x39d21a['push'](_0x39d21a['shift']());}catch(_0x50b131){_0x39d21a['push'](_0x39d21a['shift']());}}}(a120_0x2e3e,0x2c271));const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number[a120_0x1788f0(0x191)]),MIN_SAFE_INTEGER=BigInt(Number[a120_0x1788f0(0x187)]);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function isUnsafeIntegerLiteral(_0x1b5fab){const _0x53bed2=a120_0x1788f0;if(_0x1b5fab[_0x53bed2(0x18e)]('.')||_0x1b5fab[_0x53bed2(0x18e)]('e')||_0x1b5fab[_0x53bed2(0x18e)]('E'))return![];const _0x2516e6=BigInt(_0x1b5fab);return _0x2516e6>MAX_SAFE_INTEGER||_0x2516e6<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x3c1ecf){const _0x16315d=a120_0x1788f0;let _0x15c86a='',_0x3132a5=![],_0x4d19dc=![];for(let _0x8ad22d=0x0;_0x8ad22d<_0x3c1ecf[_0x16315d(0x18d)];){const _0x18dc1f=_0x3c1ecf[_0x8ad22d];if(_0x3132a5){_0x15c86a+=_0x18dc1f,_0x8ad22d+=0x1;if(_0x4d19dc)_0x4d19dc=![];else{if(_0x18dc1f==='\x5c')_0x4d19dc=!![];else _0x18dc1f==='\x22'&&(_0x3132a5=![]);}continue;}if(_0x18dc1f==='\x22'){_0x3132a5=!![],_0x15c86a+=_0x18dc1f,_0x8ad22d+=0x1;continue;}if(_0x18dc1f==='-'||_0x18dc1f>='0'&&_0x18dc1f<='9'){const _0x4a0a06=JSON_NUMBER_PATTERN[_0x16315d(0x18a)](_0x3c1ecf[_0x16315d(0x199)](_0x8ad22d))?.[0x0];if(_0x4a0a06){_0x15c86a+=isUnsafeIntegerLiteral(_0x4a0a06)?'\x22'+_0x4a0a06+'\x22':_0x4a0a06,_0x8ad22d+=_0x4a0a06[_0x16315d(0x18d)];continue;}}_0x15c86a+=_0x18dc1f,_0x8ad22d+=0x1;}return _0x15c86a;}export function parseLosslessJson(_0x1e878d){return JSON['parse'](quoteUnsafeIntegerLiterals(_0x1e878d));}function a120_0x2e3e(){const _0xcb981e=['includes','283264rZKbkV','json','MAX_SAFE_INTEGER','78333TgOdHk','8zOUOeM','2456810ChujiH','undefined','108AsNHEE','2121444qjwvJr','1567566ZrzSLf','slice','text','MIN_SAFE_INTEGER','1774917pBnpTQ','8770vLPyvC','exec','2LWKUIz','defineProperty','length'];a120_0x2e3e=function(){return _0xcb981e;};return a120_0x2e3e();}export function installLosslessJsonResponseParser(){const _0x5785ae=a120_0x1788f0;if(typeof Response===_0x5785ae(0x195))return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response['prototype'],originalResponseJsonDescriptor=Object['getOwnPropertyDescriptor'](responseJsonPrototype,_0x5785ae(0x190)),Object[_0x5785ae(0x18c)](responseJsonPrototype,_0x5785ae(0x190),{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x5636ae(){const _0x132aa7=_0x5785ae;return parseLosslessJson(await this[_0x132aa7(0x19a)]());}}),restoreResponseJsonParser=()=>{const _0x2fd577=_0x5785ae;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object[_0x2fd577(0x18c)](responseJsonPrototype,_0x2fd577(0x190),originalResponseJsonDescriptor):delete responseJsonPrototype['json'],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32912e,_0x58180a){const _0x1b6da2=a121_0x3d1a,_0x225b4c=_0x32912e();while(!![]){try{const _0x1f9268=-parseInt(_0x1b6da2(0xcf))/0x1+-parseInt(_0x1b6da2(0xcc))/0x2+parseInt(_0x1b6da2(0xce))/0x3*(parseInt(_0x1b6da2(0xb8))/0x4)+-parseInt(_0x1b6da2(0xbc))/0x5+parseInt(_0x1b6da2(0xcb))/0x6+-parseInt(_0x1b6da2(0xc0))/0x7*(-parseInt(_0x1b6da2(0xc8))/0x8)+parseInt(_0x1b6da2(0xb9))/0x9*(-parseInt(_0x1b6da2(0xbf))/0xa);if(_0x1f9268===_0x58180a)break;else _0x225b4c['push'](_0x225b4c['shift']());}catch(_0x16d652){_0x225b4c['push'](_0x225b4c['shift']());}}}(a121_0x1d3a,0xdfc9e));function a121_0x1d3a(){const _0x1c42b7=['795ahNuIF','430749ZGLPSn','\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.','items','data\x20update\x20--params.','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','Invalid\x20JSON\x20for\x20--params:\x20','test','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','26612tmUdRz','3123VqBEuq','validation','data\x20update\x20can\x20update\x20at\x20most\x20','387795dMfDAJ','id[','data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','37540eOHARV','8218hbLrUk','isArray','string','map','length','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','object','isSafeInteger','11104EsrqiR','\x20records\x20per\x20call;\x20received\x20','join','3737202UpdkNv','2575680lZMDbN','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27'];a121_0x1d3a=function(){return _0x1c42b7;};return a121_0x1d3a();}function a121_0x3d1a(_0x2bef16,_0x5bb57e){_0x2bef16=_0x2bef16-0xb1;const _0x1d3a4f=a121_0x1d3a();let _0x3d1ae9=_0x1d3a4f[_0x2bef16];return _0x3d1ae9;}import{CliErrors}from'../errors.js';import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0x5e8e7d){const _0x2859a8=a121_0x3d1a;if(!_0x5e8e7d)return undefined;try{return parseLosslessJson(_0x5e8e7d);}catch{throw CliErrors[_0x2859a8(0xba)](_0x2859a8(0xb4)+_0x5e8e7d);}}export function parseJsonParamsValue(_0x3a0721){const _0x1ea0a5=a121_0x3d1a;if(!_0x3a0721)return undefined;try{return parseLosslessJson(_0x3a0721);}catch{throw CliErrors[_0x1ea0a5(0xba)](_0x1ea0a5(0xb4)+_0x3a0721);}}export function parseBatchCreateItemsFromParams(_0x3b0902){const _0x4d4b23=a121_0x3d1a;if(Array['isArray'](_0x3b0902))return _0x3b0902;if(_0x3b0902!==null&&_0x3b0902!==undefined&&typeof _0x3b0902==='object'&&Array[_0x4d4b23(0xc1)](_0x3b0902[_0x4d4b23(0xb1)]))return _0x3b0902[_0x4d4b23(0xb1)];throw CliErrors['validation'](_0x4d4b23(0xb7),_0x4d4b23(0xb3));}function parseDataUpdateId(_0x34e2cb,_0x4efb22){const _0x4d22e3=a121_0x3d1a;if(typeof _0x34e2cb==='number'&&Number[_0x4d22e3(0xc7)](_0x34e2cb)&&_0x34e2cb>0x0)return _0x34e2cb;if(typeof _0x34e2cb===_0x4d22e3(0xc2)){if(/^[1-9]\d*$/[_0x4d22e3(0xb5)](_0x34e2cb))return _0x34e2cb;}throw CliErrors['validation'](_0x4d22e3(0xb2)+_0x4efb22+_0x4d22e3(0xd0));}export function parseUpdateIdsFromParams(_0x3867c7){const _0x2b19ee=a121_0x3d1a;if(_0x3867c7===null||_0x3867c7===undefined||typeof _0x3867c7!==_0x2b19ee(0xc6)||Array[_0x2b19ee(0xc1)](_0x3867c7))throw CliErrors[_0x2b19ee(0xba)](_0x2b19ee(0xc5),_0x2b19ee(0xcd));const _0x1c8db4=_0x3867c7['id'];if(_0x1c8db4===undefined||_0x1c8db4===null)throw CliErrors[_0x2b19ee(0xba)](_0x2b19ee(0xbe),_0x2b19ee(0xcd));const _0x4e21c5=Array[_0x2b19ee(0xc1)](_0x1c8db4)?_0x1c8db4:[_0x1c8db4];if(_0x4e21c5[_0x2b19ee(0xc4)]===0x0)throw CliErrors[_0x2b19ee(0xba)](_0x2b19ee(0xb6));if(_0x4e21c5['length']>MAX_DATA_UPDATE_IDS)throw CliErrors[_0x2b19ee(0xba)](_0x2b19ee(0xbb)+MAX_DATA_UPDATE_IDS+_0x2b19ee(0xc9)+_0x4e21c5['length']+'.');return _0x4e21c5[_0x2b19ee(0xc3)]((_0x2cb062,_0xa1e025)=>parseDataUpdateId(_0x2cb062,Array['isArray'](_0x1c8db4)?_0x2b19ee(0xbd)+_0xa1e025+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x4e2eff,_0x19ea66){const _0x32afa2=a121_0x3d1a;if(Array[_0x32afa2(0xc1)](_0x4e2eff['id'])&&_0x19ea66['length']>0x1)return{..._0x4e2eff,'id':_0x19ea66[_0x32afa2(0xca)](',')};return _0x4e2eff;}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a122_0x4708(){const _0x25485b=['34145089JRiwXe','1085jytKke','11296629upcHbX','12TOFUoY','10ldsAJc','platform','1672490GRqhav','6905874idikvA','49440ieeKux','1217150plVmRx','10fdWShX','.cmd','2657964JlRERh','win32','3YQGQYP'];a122_0x4708=function(){return _0x25485b;};return a122_0x4708();}const a122_0x28a9d8=a122_0x5adc;(function(_0x37f23d,_0x280e78){const _0x65efe2=a122_0x5adc,_0x43c55f=_0x37f23d();while(!![]){try{const _0x13257c=parseInt(_0x65efe2(0x8d))/0x1+-parseInt(_0x65efe2(0x99))/0x2*(parseInt(_0x65efe2(0x92))/0x3)+parseInt(_0x65efe2(0x90))/0x4*(-parseInt(_0x65efe2(0x8e))/0x5)+-parseInt(_0x65efe2(0x9a))/0x6+-parseInt(_0x65efe2(0x94))/0x7*(-parseInt(_0x65efe2(0x9b))/0x8)+-parseInt(_0x65efe2(0x95))/0x9*(parseInt(_0x65efe2(0x97))/0xa)+-parseInt(_0x65efe2(0x93))/0xb*(-parseInt(_0x65efe2(0x96))/0xc);if(_0x13257c===_0x280e78)break;else _0x43c55f['push'](_0x43c55f['shift']());}catch(_0x8e9da2){_0x43c55f['push'](_0x43c55f['shift']());}}}(a122_0x4708,0xaccb2));function a122_0x5adc(_0x51208c,_0x61ea5d){_0x51208c=_0x51208c-0x8d;const _0x470801=a122_0x4708();let _0x5adced=_0x470801[_0x51208c];return _0x5adced;}export const isWindows=process[a122_0x28a9d8(0x98)]===a122_0x28a9d8(0x91);export function resolveNpmBin(_0x508e3f){const _0x5ba0b8=a122_0x28a9d8;return isWindows?_0x508e3f+_0x5ba0b8(0x8f):_0x508e3f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f040e,_0x1916f8){const _0x241900=a123_0x5cb3,_0x1287b4=_0x3f040e();while(!![]){try{const _0x445aa3=-parseInt(_0x241900(0xa6))/0x1*(parseInt(_0x241900(0xae))/0x2)+-parseInt(_0x241900(0xa2))/0x3*(-parseInt(_0x241900(0xc9))/0x4)+parseInt(_0x241900(0xa9))/0x5+parseInt(_0x241900(0xbd))/0x6*(-parseInt(_0x241900(0xc1))/0x7)+-parseInt(_0x241900(0xa4))/0x8+-parseInt(_0x241900(0xbe))/0x9+parseInt(_0x241900(0xa3))/0xa*(parseInt(_0x241900(0xa8))/0xb);if(_0x445aa3===_0x1916f8)break;else _0x1287b4['push'](_0x1287b4['shift']());}catch(_0x49ebe9){_0x1287b4['push'](_0x1287b4['shift']());}}}(a123_0x4cfa,0x8ad06));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function parseSemver(_0x4f8080){const _0xc89ac=a123_0x5cb3,_0x18c835=_0x4f8080[_0xc89ac(0xa5)]()[_0xc89ac(0xca)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x18c835)return null;return{'major':Number(_0x18c835[0x1]),'minor':Number(_0x18c835[0x2]),'patch':Number(_0x18c835[0x3]),'prerelease':_0x18c835[0x4]};}function compareSemver(_0x2407da,_0xd98e62){const _0x217228=a123_0x5cb3,_0x7fa52f=parseSemver(_0x2407da),_0x8f8432=parseSemver(_0xd98e62);if(!_0x7fa52f||!_0x8f8432)throw new Error(_0x217228(0xa0));for(const _0x3ec239 of[_0x217228(0xc4),'minor',_0x217228(0xb5)]){if(_0x7fa52f[_0x3ec239]<_0x8f8432[_0x3ec239])return-0x1;if(_0x7fa52f[_0x3ec239]>_0x8f8432[_0x3ec239])return 0x1;}if(!_0x7fa52f[_0x217228(0xc5)]&&!_0x8f8432[_0x217228(0xc5)])return 0x0;if(!_0x7fa52f[_0x217228(0xc5)])return 0x1;if(!_0x8f8432['prerelease'])return-0x1;if(_0x7fa52f[_0x217228(0xc5)]===_0x8f8432[_0x217228(0xc5)])return 0x0;return _0x7fa52f[_0x217228(0xc5)]<_0x8f8432[_0x217228(0xc5)]?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x3875e8=a123_0x5cb3,_0x345690=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x3875e8(0xa5)]()[_0x3875e8(0xc6)]();return _0x345690==='1'||_0x345690===_0x3875e8(0xa1)||_0x345690===_0x3875e8(0xb0);}function a123_0x4cfa(){const _0x24614f=['4VQOHQd','match','Invalid\x20semver','true','3138654eXiqbj','17969450bxOoAP','4356120gibvLU','trim','324679qORxUy','json','11fvFVNq','3005675LhoIcT','/dist-tags','/-/package/','lastNotifiedAt','fromEntries','6FbjDEo','\x20update','yes','object',',\x20run:\x20','timeout','latest','patch','utf8','lovrabet-cli','update-check.json','number','filter','\x20available,\x20current\x20','parse','6uDAuLO','3238335mwtePY','lastNotifiedVersion','checkedAt','6981443NwHAFe','https://www.npmjs.com/package/','stringify','major','prerelease','toLowerCase','now','map'];a123_0x4cfa=function(){return _0x24614f;};return a123_0x4cfa();}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x1dbfd7=a123_0x5cb3;return join(cacheRoot(),_0x1dbfd7(0xb7),_0x1dbfd7(0xb8));}function a123_0x5cb3(_0x3d7997,_0x31ef35){_0x3d7997=_0x3d7997-0xa0;const _0x4cfa50=a123_0x4cfa();let _0x5cb3a7=_0x4cfa50[_0x3d7997];return _0x5cb3a7;}async function readUpdateNoticeCache(){const _0x1727de=a123_0x5cb3;try{const _0x3e421f=await readFile(getUpdateNoticeCachePath(),_0x1727de(0xb6)),_0x3c881a=JSON[_0x1727de(0xbc)](_0x3e421f);if(!_0x3c881a||typeof _0x3c881a!==_0x1727de(0xb1))return{};return _0x3c881a;}catch{return{};}}async function writeUpdateNoticeCache(_0x118c07){const _0x255a3f=a123_0x5cb3;try{const _0x4783dd=getUpdateNoticeCachePath();await mkdir(dirname(_0x4783dd),{'recursive':!![]}),await writeFile(_0x4783dd,JSON[_0x255a3f(0xc3)](_0x118c07,null,0x2)+'\x0a',_0x255a3f(0xb6));}catch{}}function isFreshCheck(_0x482b6f,_0x26621b){const _0x140f6e=a123_0x5cb3;return typeof _0x482b6f[_0x140f6e(0xc0)]==='number'&&_0x26621b-_0x482b6f[_0x140f6e(0xc0)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x34748e,_0x3ad2b0,_0x1fe62e){const _0x5d3f00=a123_0x5cb3;return _0x34748e[_0x5d3f00(0xbf)]===_0x3ad2b0&&typeof _0x34748e[_0x5d3f00(0xac)]===_0x5d3f00(0xb9)&&_0x1fe62e-_0x34748e[_0x5d3f00(0xac)]<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x2c7a99=0x5dc){const _0x30da35=a123_0x5cb3;try{const _0x1aa183=NPM_REGISTRY_BASE_URL+_0x30da35(0xab)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x30da35(0xaa),_0x329561=await fetch(_0x1aa183,{'signal':AbortSignal[_0x30da35(0xb3)](_0x2c7a99)});if(!_0x329561['ok'])return null;const _0x2fc4ee=await _0x329561[_0x30da35(0xa7)]();if(!_0x2fc4ee||typeof _0x2fc4ee!==_0x30da35(0xb1))return null;return Object[_0x30da35(0xad)](Object['entries'](_0x2fc4ee)[_0x30da35(0xba)](([,_0x3658b2])=>typeof _0x3658b2==='string'&&_0x3658b2['trim']())[_0x30da35(0xc8)](([_0x21be19,_0x2d925a])=>[_0x21be19,String(_0x2d925a)['trim']()]));}catch{return null;}}export function buildNpmVersionUrl(_0xac5027){const _0xf1a35b=a123_0x5cb3;return _0xf1a35b(0xc2)+LOVRABET_NPM_PACKAGE_NAME+'/v/'+_0xac5027;}export async function resolveLatestUpdateNotice(){const _0x28b30d=a123_0x5cb3;if(isUpdateNoticeDisabled())return null;try{const _0x511f2c=Date[_0x28b30d(0xc7)](),_0x35d9f6=getCliVersion(),_0x12c80=await readUpdateNoticeCache();let _0x401ca0=isFreshCheck(_0x12c80,_0x511f2c)?_0x12c80[_0x28b30d(0xb4)]?.[_0x28b30d(0xa5)]():undefined;if(!_0x401ca0&&!isFreshCheck(_0x12c80,_0x511f2c)){const _0x3941c0=await fetchNpmDistTags();_0x401ca0=_0x3941c0?.[_0x28b30d(0xb4)]?.['trim'](),await writeUpdateNoticeCache({..._0x12c80,'checkedAt':_0x511f2c,'latest':_0x401ca0,'failed':!_0x401ca0});}if(!_0x401ca0||compareSemver(_0x35d9f6,_0x401ca0)>=0x0)return null;if(isRecentlyNotified(_0x12c80,_0x401ca0,_0x511f2c))return null;const _0x15050a=CLI_BIN_NAME+_0x28b30d(0xaf);return await writeUpdateNoticeCache({..._0x12c80,'checkedAt':isFreshCheck(_0x12c80,_0x511f2c)?_0x12c80[_0x28b30d(0xc0)]:_0x511f2c,'latest':_0x401ca0,'failed':![],'lastNotifiedVersion':_0x401ca0,'lastNotifiedAt':_0x511f2c}),{'command':_0x15050a,'current':_0x35d9f6,'latest':_0x401ca0,'url':buildNpmVersionUrl(_0x401ca0),'message':CLI_BIN_NAME+'\x20'+_0x401ca0+_0x28b30d(0xbb)+_0x35d9f6+_0x28b30d(0xb2)+_0x15050a};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10a181,_0x55e3c7){const _0x2fd954=a124_0x3ef5,_0x4915f9=_0x10a181();while(!![]){try{const _0x3f4d3b=-parseInt(_0x2fd954(0x1c3))/0x1+parseInt(_0x2fd954(0x1c9))/0x2*(-parseInt(_0x2fd954(0x1c5))/0x3)+parseInt(_0x2fd954(0x1c6))/0x4+-parseInt(_0x2fd954(0x1c8))/0x5*(parseInt(_0x2fd954(0x1cb))/0x6)+-parseInt(_0x2fd954(0x1c2))/0x7*(-parseInt(_0x2fd954(0x1c7))/0x8)+parseInt(_0x2fd954(0x1ca))/0x9*(parseInt(_0x2fd954(0x1cc))/0xa)+parseInt(_0x2fd954(0x1cd))/0xb;if(_0x3f4d3b===_0x55e3c7)break;else _0x4915f9['push'](_0x4915f9['shift']());}catch(_0x760839){_0x4915f9['push'](_0x4915f9['shift']());}}}(a124_0x34b3,0xe2ecc));function a124_0x3ef5(_0xcda115,_0x57931d){_0xcda115=_0xcda115-0x1c2;const _0x34b30c=a124_0x34b3();let _0x3ef589=_0x34b30c[_0xcda115];return _0x3ef589;}function a124_0x34b3(){const _0x219a4f=['21lfuzQT','433649EJIzEK','slice','2992575WKgeHl','81408uuUmAg','3367472IcsLYd','5USbnOc','2YLkdwh','5002497idfavT','8082276mRylBv','10vLEniJ','20555887CssCcM'];a124_0x34b3=function(){return _0x219a4f;};return a124_0x34b3();}import{BUILD_TIME,GIT_COMMIT,VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}export function getCliGitCommit(){const _0x5b1d81=String(GIT_COMMIT);return _0x5b1d81&&_0x5b1d81!=='unknown'?_0x5b1d81:'';}export function getCliVersionDisplay(){const _0x3e4b50=a124_0x3ef5,_0xe1c972=getCliGitCommit(),_0x14e5fa=BUILD_TIME[_0x3e4b50(0x1c4)](0x0,0xa);if(!_0xe1c972||!_0x14e5fa)return VERSION;return VERSION+'\x20('+_0xe1c972+',\x20'+_0x14e5fa+')';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31cb38,_0x1e2fba){var _0x4e54b5=a125_0x1eda,_0x2acf00=_0x31cb38();while(!![]){try{var _0x4cd149=-parseInt(_0x4e54b5(0x91))/0x1*(-parseInt(_0x4e54b5(0x8e))/0x2)+parseInt(_0x4e54b5(0x94))/0x3+-parseInt(_0x4e54b5(0x96))/0x4+parseInt(_0x4e54b5(0x95))/0x5+parseInt(_0x4e54b5(0x93))/0x6*(parseInt(_0x4e54b5(0x90))/0x7)+-parseInt(_0x4e54b5(0x97))/0x8+-parseInt(_0x4e54b5(0x92))/0x9;if(_0x4cd149===_0x1e2fba)break;else _0x2acf00['push'](_0x2acf00['shift']());}catch(_0x34793f){_0x2acf00['push'](_0x2acf00['shift']());}}}(a125_0x1f8b,0xc5846));function a125_0x1f8b(){var _0x57fb7e=['65830LRbAtK','6476571ryZwXt','6011778SMljUU','4835334AXecjh','2607905FIbmjb','2196920TsGvVU','8986184rxenda','stderr','2XMKWOE','write','7CCuWDI'];a125_0x1f8b=function(){return _0x57fb7e;};return a125_0x1f8b();}function a125_0x1eda(_0x9e0ce7,_0x1610e5){_0x9e0ce7=_0x9e0ce7-0x8e;var _0x1f8ba2=a125_0x1f8b();var _0x1eda16=_0x1f8ba2[_0x9e0ce7];return _0x1eda16;}export function writeCliSideChannelLine(_0x10c1d8){var _0x10895c=a125_0x1eda;process[_0x10895c(0x98)][_0x10895c(0x8f)](_0x10c1d8+'\x0a');}
|
package/package.json
CHANGED