@lovrabet/rabetbase-cli 2.0.11 → 2.0.13
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/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.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/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -0
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.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/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a97_0x2d561d=a97_0x3501;(function(_0x112a18,_0x1c4303){const _0x1d3391=a97_0x3501,_0x5703da=_0x112a18();while(!![]){try{const _0x2849bb=-parseInt(_0x1d3391(0x7a))/0x1*(parseInt(_0x1d3391(0x80))/0x2)+-parseInt(_0x1d3391(0x78))/0x3*(-parseInt(_0x1d3391(0x8a))/0x4)+parseInt(_0x1d3391(0x81))/0x5*(-parseInt(_0x1d3391(0x82))/0x6)+parseInt(_0x1d3391(0x83))/0x7*(parseInt(_0x1d3391(0x74))/0x8)+-parseInt(_0x1d3391(0x7c))/0x9+parseInt(_0x1d3391(0x7e))/0xa+-parseInt(_0x1d3391(0x8d))/0xb;if(_0x2849bb===_0x1c4303)break;else _0x5703da['push'](_0x5703da['shift']());}catch(_0x2d23d2){_0x5703da['push'](_0x5703da['shift']());}}}(a97_0x5bca,0x483ce));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a97_0x2d561d(0x6d),a97_0x2d561d(0x70),a97_0x2d561d(0x72)];export function normalizeBffType(_0x1d71f1){const _0x1cf014=a97_0x2d561d;if(!_0x1d71f1)return undefined;const _0x83de26=_0x1d71f1['trim']()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x1cf014(0x85)](_0x83de26)?_0x83de26:undefined;}async function scanJsFilesRecursively(_0x21c6f9,_0x4ea4b9){const _0x13d220=a97_0x2d561d,_0x54b5f5=[];try{const _0x367f39=await readdir(_0x21c6f9,{'withFileTypes':!![]});for(const _0x38c7cb of _0x367f39){const _0x53a557=join(_0x21c6f9,_0x38c7cb[_0x13d220(0x79)]);if(_0x38c7cb[_0x13d220(0x7d)]())_0x54b5f5['push'](...await scanJsFilesRecursively(_0x53a557,_0x4ea4b9+'/'+_0x38c7cb[_0x13d220(0x79)]));else _0x38c7cb[_0x13d220(0x73)]()&&_0x38c7cb['name'][_0x13d220(0x76)](_0x13d220(0x8e))&&_0x54b5f5[_0x13d220(0x7b)]({'lockKey':_0x4ea4b9+'/'+_0x38c7cb[_0x13d220(0x79)][_0x13d220(0x75)](/\.js$/,''),'filePath':_0x53a557});}}catch(_0x16578d){if(_0x16578d[_0x13d220(0x6b)]!==_0x13d220(0x89))throw _0x16578d;}return _0x54b5f5;}async function scanFlatFunctions(_0x4a6216,_0x552b9c){const _0x392f6e=a97_0x2d561d,_0x5f305b=join(_0x4a6216[_0x392f6e(0x6c)],_0x552b9c),_0x1003f7=await scanJsFilesRecursively(_0x5f305b,_0x552b9c);return _0x1003f7['map'](({lockKey:_0x172535,filePath:_0xd7a544})=>({'type':_0x552b9c,'name':_0x172535['split']('/')['at'](-0x1)??'','filePath':_0xd7a544,'lockKey':_0x172535}));}async function scanHookFunctions(_0x47fe30){const _0x149302=a97_0x2d561d,_0x168a4b=join(_0x47fe30['scriptsRootDir'],_0x149302(0x72)),_0x53aed0=[];try{const _0x3679a4=await readdir(_0x168a4b,{'withFileTypes':!![]});for(const _0x1940ab of _0x3679a4){if(!_0x1940ab['isDirectory']())continue;const _0x282978=_0x1940ab[_0x149302(0x79)],_0xb42dfa=join(_0x168a4b,_0x282978),_0x34f0ed=await readdir(_0xb42dfa,{'withFileTypes':!![]});for(const _0x485c54 of _0x34f0ed){if(!_0x485c54[_0x149302(0x7d)]())continue;const _0x162110=_0x485c54[_0x149302(0x79)],_0x17f364=join(_0xb42dfa,_0x162110),_0x170c16=await readdir(_0x17f364,{'withFileTypes':!![]});for(const _0x4b3da5 of _0x170c16){if(!_0x4b3da5[_0x149302(0x7d)]())continue;const _0x527650=_0x4b3da5[_0x149302(0x79)],_0xed6d09=join(_0x17f364,_0x527650),_0x3829bf=await readdir(_0xed6d09,{'withFileTypes':!![]});for(const _0x42fc88 of _0x3829bf){if(!_0x42fc88[_0x149302(0x73)]()||!_0x42fc88[_0x149302(0x79)][_0x149302(0x76)](_0x149302(0x8e)))continue;const _0x103745=_0x42fc88[_0x149302(0x79)][_0x149302(0x75)](/\.js$/,'');_0x53aed0[_0x149302(0x7b)]({'type':_0x149302(0x72),'name':_0x103745,'filePath':join(_0xed6d09,_0x42fc88[_0x149302(0x79)]),'lockKey':'HOOK/'+_0x282978+'/'+_0x162110+'/'+_0x527650+'/'+_0x103745,'alias':_0x282978,'operationType':_0x162110,'functionNode':_0x527650});}}}}}catch(_0x2a203c){if(_0x2a203c[_0x149302(0x6b)]!==_0x149302(0x89))throw _0x2a203c;}return _0x53aed0;}export async function scanLocalBffFunctions(_0x1db2db,_0x404fe5){const _0x51e695=a97_0x2d561d;if(_0x404fe5===_0x51e695(0x6d)||_0x404fe5===_0x51e695(0x70))return scanFlatFunctions(_0x1db2db,_0x404fe5);if(_0x404fe5===_0x51e695(0x72))return scanHookFunctions(_0x1db2db);const [_0x1b0165,_0xb96d2,_0x2d0344]=await Promise[_0x51e695(0x86)]([scanFlatFunctions(_0x1db2db,_0x51e695(0x6d)),scanFlatFunctions(_0x1db2db,_0x51e695(0x70)),scanHookFunctions(_0x1db2db)]);return[..._0x1b0165,..._0xb96d2,..._0x2d0344];}export function resolveLocalFilePathFromLockKey(_0x17ddb4,_0xef88c5){const _0x263b98=a97_0x2d561d;return join(_0x17ddb4[_0x263b98(0x6c)],..._0xef88c5[_0x263b98(0x6f)]('/'))+_0x263b98(0x8e);}export function createHookLocationMap(_0xfe97b2){const _0x3f7405=a97_0x2d561d,_0x52890a=new Map();for(const _0x257905 of _0xfe97b2){_0x257905[_0x3f7405(0x87)]&&_0x52890a['set'](_0x257905['beforeScriptId'],{'datasetCode':_0x257905[_0x3f7405(0x8f)],'operationType':snakeToCamel(_0x257905[_0x3f7405(0x6e)]),'functionNode':_0x3f7405(0x71)}),_0x257905['afterScriptId']&&_0x52890a['set'](_0x257905['afterScriptId'],{'datasetCode':_0x257905[_0x3f7405(0x8f)],'operationType':snakeToCamel(_0x257905[_0x3f7405(0x6e)]),'functionNode':_0x3f7405(0x8c)});}return _0x52890a;}export function resolveRemoteScriptTarget(_0x6ab622,_0xec979f,_0x56f9ed,_0x1b11ce,_0x2a8669){const _0x523377=a97_0x2d561d,_0x1208f7=normalizeBffType(_0xec979f[_0x523377(0x77)]);if(!_0x1208f7||!_0xec979f['functionName'])return null;if(_0x1208f7==='HOOK'){const _0x1bed01=(_0xec979f['id']?_0x56f9ed[_0x523377(0x88)](_0xec979f['id']):undefined)??findHookLocationByRemoteId(_0x1b11ce,_0xec979f['id']);if(!_0x1bed01)return null;const _0x27d8f3=_0x1bed01[_0x523377(0x84)]||_0x2a8669[_0x523377(0x88)](_0x1bed01['datasetCode']),_0x193dce=_0x27d8f3??_0x1bed01[_0x523377(0x8f)],_0x2a6ce8={..._0x1bed01,'alias':_0x27d8f3},_0x513be2='HOOK/'+_0x193dce+'/'+_0x2a6ce8['operationType']+'/'+_0x2a6ce8['functionNode']+'/'+_0xec979f['functionName'];return{'lockKey':_0x513be2,'filePath':resolveLocalFilePathFromLockKey(_0x6ab622,_0x513be2),'type':_0x523377(0x72),'hookLocation':_0x2a6ce8};}const _0x275325=_0x1208f7+'/'+_0xec979f[_0x523377(0x8b)];return{'lockKey':_0x275325,'filePath':resolveLocalFilePathFromLockKey(_0x6ab622,_0x275325),'type':_0x1208f7};}export async function ensureParentDirectory(_0x5685d3){await mkdir(dirname(_0x5685d3),{'recursive':!![]});}function a97_0x3501(_0x4ac0d6,_0x155be7){_0x4ac0d6=_0x4ac0d6-0x6b;const _0x5bca63=a97_0x5bca();let _0x350190=_0x5bca63[_0x4ac0d6];return _0x350190;}function a97_0x5bca(){const _0x4444a2=['after','5856444GfxpYy','.js','datasetCode','code','scriptsRootDir','COMMON','operationType','split','ENDPOINT','before','HOOK','isFile','216488vdbEaX','replace','endsWith','scriptType','144uLYiff','name','25628yjeoQw','push','515583GOrSFV','isDirectory','3841160eJzPVu','F_OK','26DLaWzo','115ALuFoF','4296UXNFgB','119vwIcGw','alias','includes','all','beforeScriptId','get','ENOENT','32588wcRbHL','functionName'];a97_0x5bca=function(){return _0x4444a2;};return a97_0x5bca();}export async function fileExists(_0x24ca69){const _0x31bbe3=a97_0x2d561d;try{return await access(_0x24ca69,constants[_0x31bbe3(0x7f)]),!![];}catch{return![];}}export async function directoryExists(_0x4a0062){const _0x5d2c45=a97_0x2d561d;try{const _0x4e2f63=await stat(_0x4a0062);return _0x4e2f63[_0x5d2c45(0x7d)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a98_0x2917(){const _0x4c5df7=['1772414VjMtCz','1264968KueTKa','1240524fSpBeg','408888rawhGi','2807916drfxYX','update','537933nMQDlD','createHash','digest','6SknmeZ','7825625pXlaPe','md5','hex'];a98_0x2917=function(){return _0x4c5df7;};return a98_0x2917();}(function(_0x4f4780,_0x3d829a){const _0x4f4d76=a98_0x53c9,_0x200d06=_0x4f4780();while(!![]){try{const _0x568e43=parseInt(_0x4f4d76(0x1e8))/0x1*(parseInt(_0x4f4d76(0x1eb))/0x2)+parseInt(_0x4f4d76(0x1e6))/0x3+-parseInt(_0x4f4d76(0x1e4))/0x4+-parseInt(_0x4f4d76(0x1df))/0x5+parseInt(_0x4f4d76(0x1e5))/0x6+parseInt(_0x4f4d76(0x1e2))/0x7+-parseInt(_0x4f4d76(0x1e3))/0x8;if(_0x568e43===_0x3d829a)break;else _0x200d06['push'](_0x200d06['shift']());}catch(_0x1c35a1){_0x200d06['push'](_0x200d06['shift']());}}}(a98_0x2917,0xcc870));function a98_0x53c9(_0x5ef667,_0x21cb8a){_0x5ef667=_0x5ef667-0x1df;const _0x2917c6=a98_0x2917();let _0x53c99d=_0x2917c6[_0x5ef667];return _0x53c99d;}import{readFile}from'node:fs/promises';import a98_0x26c8f9 from'node:crypto';export function computeContentHash(_0x871d29){const _0x98e7f5=a98_0x53c9;return a98_0x26c8f9[_0x98e7f5(0x1e9)](_0x98e7f5(0x1e0))[_0x98e7f5(0x1e7)](_0x871d29)[_0x98e7f5(0x1ea)](_0x98e7f5(0x1e1));}export async function computeFileHash(_0x5d1bd3){const _0x53cdca=await readFile(_0x5d1bd3,'utf8');return computeContentHash(_0x53cdca);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31d084,_0x56a52d){const _0x785671=a99_0x4538,_0x58030b=_0x31d084();while(!![]){try{const _0x110a71=parseInt(_0x785671(0x8d))/0x1+parseInt(_0x785671(0x88))/0x2+-parseInt(_0x785671(0x81))/0x3+-parseInt(_0x785671(0x87))/0x4*(parseInt(_0x785671(0x7d))/0x5)+parseInt(_0x785671(0x91))/0x6+parseInt(_0x785671(0x7f))/0x7+-parseInt(_0x785671(0x8f))/0x8*(parseInt(_0x785671(0x8e))/0x9);if(_0x110a71===_0x56a52d)break;else _0x58030b['push'](_0x58030b['shift']());}catch(_0x4b8cba){_0x58030b['push'](_0x58030b['shift']());}}}(a99_0x5d10,0x7a576));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x213c85,_0x45367a,_0x13004d,_0x1ad2c2){const _0x75a428=a99_0x4538,_0x517c2a={'apps':_0x213c85['apps']&&typeof _0x213c85[_0x75a428(0x8b)]==='object'?_0x213c85[_0x75a428(0x8b)]:{}};let _0x72be06=_0x517c2a[_0x75a428(0x8b)][_0x45367a];if(!_0x72be06)return _0x72be06={'scriptsRoot':_0x13004d,'lastSync':'','functions':{}},_0x517c2a['apps'][_0x45367a]=_0x72be06,{'lockData':_0x517c2a,'appLock':_0x72be06};if(!_0x72be06[_0x75a428(0x84)])_0x72be06[_0x75a428(0x84)]=_0x13004d;else{if(_0x72be06['scriptsRoot']!==_0x13004d)throw new Error(_0x1ad2c2+':\x20scriptsRoot\x20mismatch\x20—\x20'+('current\x20\x22'+_0x13004d+_0x75a428(0x90)+_0x72be06[_0x75a428(0x84)]+_0x75a428(0x85))+_0x75a428(0x80));}return!_0x72be06[_0x75a428(0x8a)]&&(_0x72be06[_0x75a428(0x8a)]={}),!_0x72be06[_0x75a428(0x86)]&&(_0x72be06[_0x75a428(0x86)]=''),{'lockData':_0x517c2a,'appLock':_0x72be06};}function a99_0x5d10(){const _0x4d37a2=['1269204iIWbvR','stringify','code','scriptsRoot','\x22.\x20','lastSync','3559508kWFaoj','1057810cRYFBR','ENOENT','functions','apps','utf8','830103Vzwlat','18YRTySq','3099176EhexSN','\x22\x20vs\x20lock\x20\x22','3820242ltngar','5UvWZaA','object','4151938DCGYTu','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.'];a99_0x5d10=function(){return _0x4d37a2;};return a99_0x5d10();}export async function readBffLockFile(_0x379caf){const _0x46b368=a99_0x4538;try{const _0x2ef75a=await readFile(_0x379caf,'utf8'),_0x5172d9=JSON['parse'](_0x2ef75a);return{'apps':_0x5172d9['apps']&&typeof _0x5172d9['apps']===_0x46b368(0x7e)?_0x5172d9[_0x46b368(0x8b)]:{}};}catch(_0x190496){if(_0x190496[_0x46b368(0x83)]===_0x46b368(0x89))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x190496));}}function a99_0x4538(_0x39f539,_0xd49acf){_0x39f539=_0x39f539-0x7d;const _0x5d104f=a99_0x5d10();let _0x45387f=_0x5d104f[_0x39f539];return _0x45387f;}export async function writeBffLockFile(_0x2de414,_0x478b01){const _0x488b38=a99_0x4538;await mkdir(dirname(_0x2de414),{'recursive':!![]}),await writeFile(_0x2de414,JSON[_0x488b38(0x82)](_0x478b01,null,0x2),_0x488b38(0x8c));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a101_0x575b(_0x22bc22,_0x5ab31e){_0x22bc22=_0x22bc22-0x1f0;const _0x9e53bd=a101_0x9e53();let _0x575bd7=_0x9e53bd[_0x22bc22];return _0x575bd7;}(function(_0x52bddd,_0x2391a9){const _0xcc50dc=a101_0x575b,_0x3e5c1b=_0x52bddd();while(!![]){try{const _0x17ecc3=-parseInt(_0xcc50dc(0x203))/0x1*(-parseInt(_0xcc50dc(0x1f6))/0x2)+-parseInt(_0xcc50dc(0x202))/0x3*(-parseInt(_0xcc50dc(0x1f5))/0x4)+parseInt(_0xcc50dc(0x1f8))/0x5+-parseInt(_0xcc50dc(0x1f4))/0x6*(-parseInt(_0xcc50dc(0x201))/0x7)+parseInt(_0xcc50dc(0x1fe))/0x8+-parseInt(_0xcc50dc(0x1fc))/0x9+parseInt(_0xcc50dc(0x1fa))/0xa*(-parseInt(_0xcc50dc(0x1f3))/0xb);if(_0x17ecc3===_0x2391a9)break;else _0x3e5c1b['push'](_0x3e5c1b['shift']());}catch(_0x189ad2){_0x3e5c1b['push'](_0x3e5c1b['shift']());}}}(a101_0x9e53,0x3b58c));export function snakeToCamel(_0x4f2fea){const _0x3eb723=a101_0x575b;return _0x4f2fea['toLowerCase']()[_0x3eb723(0x1f9)](/_([a-z])/g,(_0x1dd082,_0x19338b)=>_0x19338b['toUpperCase']());}export function findHookLocationByRemoteId(_0x5062fc,_0x324a63){const _0x6b7ed7=a101_0x575b;if(!_0x324a63)return undefined;for(const _0x1f7225 of Object['values'](_0x5062fc)){if(_0x1f7225[_0x6b7ed7(0x1f2)]===_0x324a63&&_0x1f7225[_0x6b7ed7(0x200)]&&_0x1f7225[_0x6b7ed7(0x1fd)]&&_0x1f7225['functionNode'])return{'datasetCode':_0x1f7225[_0x6b7ed7(0x200)],'operationType':_0x1f7225['operationType'],'functionNode':_0x1f7225['functionNode']};}return undefined;}export function extractScriptDescription(_0x456b32){const _0x3f5d4a=a101_0x575b,_0x473ef2=_0x456b32[_0x3f5d4a(0x1f0)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x473ef2?.[0x1]?.[_0x3f5d4a(0x1f1)]()||undefined;}function a101_0x9e53(){const _0x8521c8=['650288wPSvJI','before','datasetCode','161meBJyK','201nXyPDI','211TnUBJt','match','trim','remoteId','11xwvSsV','77298UUaNeZ','12748PHwAWP','268BUGzUs','test','1669700GTbXSr','replace','3663130BBQeFS','toLowerCase','3095469DjaeBU','operationType'];a101_0x9e53=function(){return _0x8521c8;};return a101_0x9e53();}export function isValidBffFunctionName(_0x4666d8){const _0x5a679d=a101_0x575b;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x5a679d(0x1f7)](_0x4666d8);}export function normalizeHookFunctionNode(_0x281589){const _0x53404d=a101_0x575b;if(!_0x281589)return undefined;const _0x2b45e0=_0x281589[_0x53404d(0x1f1)]()[_0x53404d(0x1fb)]();if(_0x2b45e0===_0x53404d(0x1ff)||_0x2b45e0==='after')return _0x2b45e0;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47b4cb,_0x3a0146){const _0x137b04=a102_0xabc4,_0x56bee3=_0x47b4cb();while(!![]){try{const _0xc47188=-parseInt(_0x137b04(0x177))/0x1+parseInt(_0x137b04(0x17e))/0x2+-parseInt(_0x137b04(0x17c))/0x3+parseInt(_0x137b04(0x178))/0x4*(-parseInt(_0x137b04(0x176))/0x5)+parseInt(_0x137b04(0x179))/0x6+-parseInt(_0x137b04(0x184))/0x7+parseInt(_0x137b04(0x183))/0x8;if(_0xc47188===_0x3a0146)break;else _0x56bee3['push'](_0x56bee3['shift']());}catch(_0x4150d){_0x56bee3['push'](_0x56bee3['shift']());}}}(a102_0x4d4a,0x5adc6));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x3b6ea2){const _0x2115da=a102_0xabc4;if(cache[_0x2115da(0x17f)](_0x3b6ea2))return cache[_0x2115da(0x171)](_0x3b6ea2);const _0x3dad65=await listDatasets(_0x3b6ea2),_0xe913f3=new Map();for(const _0x366e86 of _0x3dad65){const _0x52ad0e=_0x366e86['dbtableConfig'];_0x52ad0e?.[_0x2115da(0x173)]!=null&&_0xe913f3[_0x2115da(0x180)](_0x52ad0e[_0x2115da(0x173)],_0x52ad0e[_0x2115da(0x185)]??_0x2115da(0x182)+_0x52ad0e[_0x2115da(0x173)]);}const _0x95b8ae=[..._0xe913f3['entries']()][_0x2115da(0x181)](([_0x142a23,_0x574556])=>({'dbId':_0x142a23,'dbName':_0x574556}));return cache[_0x2115da(0x180)](_0x3b6ea2,_0x95b8ae),_0x95b8ae;}export async function resolveDb(_0x1cc65c,_0x8293a1){const _0x399a1d=a102_0xabc4,_0x5a1f1c=await listDatabases(_0x1cc65c);if(_0x5a1f1c[_0x399a1d(0x170)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x8293a1)return{'resolved':_0x5a1f1c};const _0x529e8b=Number(_0x8293a1);if(!Number[_0x399a1d(0x17d)](_0x529e8b)){const _0x4bd19a=_0x5a1f1c['find'](_0x4fa5ea=>_0x4fa5ea['dbId']===_0x529e8b);if(_0x4bd19a)return{'resolved':[_0x4bd19a]};}const _0x3b94c3=_0x8293a1[_0x399a1d(0x17b)](),_0x3ddf62=_0x5a1f1c[_0x399a1d(0x172)](_0x59f43b=>_0x59f43b[_0x399a1d(0x185)]['toLowerCase']()[_0x399a1d(0x175)](_0x3b94c3));if(_0x3ddf62['length']>0x0)return{'resolved':_0x3ddf62};const _0xc8946a=_0x5a1f1c[_0x399a1d(0x181)](_0x50d5fd=>_0x50d5fd['dbName']+'\x20('+_0x50d5fd[_0x399a1d(0x173)]+')')[_0x399a1d(0x174)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x8293a1+'\x22.\x20Available:\x20'+_0xc8946a};}export async function resolveOneDb(_0x251971,_0x4bc9ed){const _0x173984=a102_0xabc4,{resolved:_0x46389b,error:_0x43a156}=await resolveDb(_0x251971,_0x4bc9ed);if(_0x43a156)return{'db':null,'error':_0x43a156};if(_0x46389b[_0x173984(0x170)]===0x1)return{'db':_0x46389b[0x0]};if(!_0x4bc9ed){const _0x5cace2=_0x46389b[_0x173984(0x181)](_0x36f36f=>_0x36f36f[_0x173984(0x185)]+'\x20('+_0x36f36f[_0x173984(0x173)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x5cace2};}const _0x24c9ae=_0x46389b[_0x173984(0x181)](_0xca4b97=>_0xca4b97[_0x173984(0x185)]+'\x20('+_0xca4b97[_0x173984(0x173)]+')')[_0x173984(0x174)](',\x20');return{'db':null,'error':'\x22'+_0x4bc9ed+_0x173984(0x17a)+_0x24c9ae+_0x173984(0x16f)};}export async function getDbName(_0x364f53,_0x2792f3){const _0x5a3829=a102_0xabc4,_0x28e30d=await listDatabases(_0x364f53);return _0x28e30d['find'](_0x51070a=>_0x51070a[_0x5a3829(0x173)]===_0x2792f3)?.['dbName'];}function a102_0xabc4(_0x211a10,_0x2f2d22){_0x211a10=_0x211a10-0x16f;const _0x4d4a72=a102_0x4d4a();let _0xabc443=_0x4d4a72[_0x211a10];return _0xabc443;}function a102_0x4d4a(){const _0x42bb94=['filter','dbId','join','includes','1215fxgEpf','56968XnRKzp','1468VzrfuN','3341802yanUHc','\x22\x20matches\x20multiple\x20databases:\x20','toLowerCase','1228803LKWgWh','isNaN','497904TgWFYc','has','set','map','db-','3875184IaiOWp','2536807xLqNYN','dbName','.\x20Be\x20more\x20specific.','length','get'];a102_0x4d4a=function(){return _0x42bb94;};return a102_0x4d4a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24fcc1,_0x5660c7){const _0x1d71f9=a103_0x3f00,_0x3b9476=_0x24fcc1();while(!![]){try{const _0x221080=-parseInt(_0x1d71f9(0x1c3))/0x1+parseInt(_0x1d71f9(0x1c5))/0x2*(-parseInt(_0x1d71f9(0x1b1))/0x3)+parseInt(_0x1d71f9(0x1b9))/0x4+parseInt(_0x1d71f9(0x1c4))/0x5+parseInt(_0x1d71f9(0x1ac))/0x6+parseInt(_0x1d71f9(0x1b7))/0x7*(-parseInt(_0x1d71f9(0x1bc))/0x8)+-parseInt(_0x1d71f9(0x1b4))/0x9*(-parseInt(_0x1d71f9(0x1b3))/0xa);if(_0x221080===_0x5660c7)break;else _0x3b9476['push'](_0x3b9476['shift']());}catch(_0x251ff4){_0x3b9476['push'](_0x3b9476['shift']());}}}(a103_0x4639,0x595e3));function a103_0x3f00(_0x538112,_0x1e8e97){_0x538112=_0x538112-0x1a3;const _0x46395b=a103_0x4639();let _0x3f00b7=_0x46395b[_0x538112];return _0x3f00b7;}export function detectSqlType(_0x49872e){const _0x262f42=a103_0x3f00;if(!_0x49872e?.[_0x262f42(0x1c8)]())return{'type':_0x262f42(0x1b2),'isSelectOnly':![],'isDangerous':![],'reason':_0x262f42(0x1b0)};const _0x246942=_0x49872e[_0x262f42(0x1bf)](/#\{[^}]*\}/g,'?')[_0x262f42(0x1bf)](/\$\{[^}]*\}/g,'?')[_0x262f42(0x1bf)](/@[^(\s]+(\([^)]*\))?/g,'')['replace'](/\/\*[\s\S]*?\*\//g,'')[_0x262f42(0x1c8)](),_0x48d49e=_0x246942['split']('\x0a');let _0x55a8db='';for(const _0x334bc2 of _0x48d49e){const _0x66166e=_0x334bc2[_0x262f42(0x1c8)]();if(!_0x66166e||_0x66166e[_0x262f42(0x1af)]('--')||_0x66166e[_0x262f42(0x1af)]('/*'))continue;_0x55a8db=_0x66166e;break;}const _0x3e42f6=_0x55a8db[_0x262f42(0x1a4)]();if(_0x3e42f6['startsWith'](_0x262f42(0x1bb))||_0x3e42f6[_0x262f42(0x1af)](_0x262f42(0x1a7))){const _0x2674f3=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x262f42(0x1a9)](_0x246942);return{'type':'SELECT','isSelectOnly':!_0x2674f3,'isDangerous':_0x2674f3,'reason':_0x2674f3?_0x262f42(0x1aa):undefined};}if(_0x3e42f6[_0x262f42(0x1af)](_0x262f42(0x1c7)))return{'type':_0x262f42(0x1c7),'isSelectOnly':![],'isDangerous':![]};if(_0x3e42f6[_0x262f42(0x1af)](_0x262f42(0x1ad)))return{'type':_0x262f42(0x1ad),'isSelectOnly':![],'isDangerous':![]};if(_0x3e42f6[_0x262f42(0x1af)](_0x262f42(0x1a5)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':'DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save'};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x262f42(0x1a9)](_0x3e42f6))return{'type':_0x262f42(0x1b5),'isSelectOnly':![],'isDangerous':!![],'reason':'DDL\x20statements\x20are\x20blocked\x20from\x20auto-save'};return{'type':_0x262f42(0x1b2),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x2d13ff){const _0x153629=a103_0x3f00,_0x6ced4a=_0x2d13ff[_0x153629(0x1bf)](/#\{[^}]*\}/g,'?')[_0x153629(0x1bf)](/\$\{[^}]*\}/g,'?')[_0x153629(0x1bf)](/'[^']*'/g,'\x27\x27')[_0x153629(0x1bf)](/--.*$/gm,'')['replace'](/\/\*[\s\S]*?\*\//g,''),_0x58593b=[],_0x305735=_0x6ced4a[_0x153629(0x1be)](/FROM\s+([^\s,)(]+)/i);if(_0x305735?.[0x1])_0x58593b[_0x153629(0x1c1)](_0x305735[0x1][_0x153629(0x1bf)](/[`"]/g,''));for(const _0x4e71a1 of _0x6ced4a[_0x153629(0x1c0)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x43b2bf=_0x4e71a1[0x1]?.['replace'](/[`"]/g,'');if(_0x43b2bf&&!_0x58593b[_0x153629(0x1ae)](_0x43b2bf))_0x58593b[_0x153629(0x1c1)](_0x43b2bf);}const _0x544b93=_0x6ced4a['match'](/INTO\s+([^\s(]+)/i);if(_0x544b93?.[0x1]){const _0x21c738=_0x544b93[0x1]['replace'](/[`"]/g,'');if(!_0x58593b['includes'](_0x21c738))_0x58593b['push'](_0x21c738);}const _0x47c44e=_0x6ced4a[_0x153629(0x1be)](/UPDATE\s+([^\s,)(]+)/i);if(_0x47c44e?.[0x1]){const _0x507a22=_0x47c44e[0x1][_0x153629(0x1bf)](/[`"]/g,'');if(!_0x58593b[_0x153629(0x1ae)](_0x507a22))_0x58593b[_0x153629(0x1c1)](_0x507a22);}return _0x58593b;}function a103_0x4639(){const _0x48e5ea=['\x20query\x20targeting\x20','SELECT','156472rmiOTp','add','match','replace','matchAll','push','isDangerous','115002ehLpXq','1088590qUckdq','1282LcHnMx','join','INSERT','trim','reason','unknown\x20table(s)','toUpperCase','DELETE','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','WITH','\x20with\x20parameters:\x20','test','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','type','587202aPoIJd','UPDATE','includes','startsWith','SQL\x20content\x20is\x20empty','1761qztsLL','UNKNOWN','2162470pnrnio','9fzPIGd','DDL','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','21KUHfUJ','length','1536660YqcCgI'];a103_0x4639=function(){return _0x48e5ea;};return a103_0x4639();}function extractParameters(_0x405c63){const _0xe430c8=a103_0x3f00,_0xe2d3f0=new Set();for(const _0x45f09b of _0x405c63[_0xe430c8(0x1c0)](/#\{(\w+)\}/g))if(_0x45f09b[0x1])_0xe2d3f0[_0xe430c8(0x1bd)](_0x45f09b[0x1]);for(const _0x33aad6 of _0x405c63[_0xe430c8(0x1c0)](/\$\{(\w+)\}/g))if(_0x33aad6[0x1])_0xe2d3f0[_0xe430c8(0x1bd)](_0x33aad6[0x1]);return Array['from'](_0xe2d3f0);}export function validateSql(_0x962b35){const _0x102820=a103_0x3f00,_0x2512b8=detectSqlType(_0x962b35),_0x4e3167=extractTables(_0x962b35),_0x5456ad=extractParameters(_0x962b35);if(_0x2512b8[_0x102820(0x1c2)])return{'valid':![],'sqlType':_0x2512b8,'tables':_0x4e3167,'parameters':_0x5456ad,'message':_0x2512b8[_0x102820(0x1c9)]||_0x2512b8[_0x102820(0x1ab)]+_0x102820(0x1a6)};if(_0x2512b8['type']==='UNKNOWN')return{'valid':![],'sqlType':_0x2512b8,'tables':_0x4e3167,'parameters':_0x5456ad,'message':_0x102820(0x1b6)};return{'valid':!![],'sqlType':_0x2512b8,'tables':_0x4e3167,'parameters':_0x5456ad,'message':_0x2512b8[_0x102820(0x1ab)]+_0x102820(0x1ba)+(_0x4e3167[_0x102820(0x1b8)]?_0x4e3167[_0x102820(0x1c6)](',\x20'):_0x102820(0x1a3))+(_0x5456ad['length']?_0x102820(0x1a8)+_0x5456ad['join'](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a104_0x3b66(_0x55975e,_0x451b25){_0x55975e=_0x55975e-0x9d;const _0x3ba6f8=a104_0x3ba6();let _0x3b6663=_0x3ba6f8[_0x55975e];return _0x3b6663;}const a104_0x4c4c3c=a104_0x3b66;(function(_0x2ce16f,_0x542475){const _0x55086b=a104_0x3b66,_0xb2f482=_0x2ce16f();while(!![]){try{const _0x299fd4=-parseInt(_0x55086b(0xbd))/0x1*(-parseInt(_0x55086b(0xac))/0x2)+-parseInt(_0x55086b(0xab))/0x3+-parseInt(_0x55086b(0xb2))/0x4*(-parseInt(_0x55086b(0x9d))/0x5)+parseInt(_0x55086b(0xa7))/0x6+parseInt(_0x55086b(0xa9))/0x7*(-parseInt(_0x55086b(0xba))/0x8)+parseInt(_0x55086b(0xa8))/0x9+parseInt(_0x55086b(0xa5))/0xa*(-parseInt(_0x55086b(0xa3))/0xb);if(_0x299fd4===_0x542475)break;else _0xb2f482['push'](_0xb2f482['shift']());}catch(_0x127109){_0xb2f482['push'](_0xb2f482['shift']());}}}(a104_0x3ba6,0xe552d));import{CLI_BIN_NAME}from'./constant/cli.js';function a104_0x3ba6(){const _0x2f73cb=['hint','Not\x20in\x20a\x20','329332CFNsog','Configuration\x20file\x20not\x20found','code','Tip:\x20`','Unknown\x20command:\x20','Run\x20`','Authentication\x20required','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','657848XfgpTT','config_missing','name','5560qRyIxb','exitCode','Network\x20error:\x20','5ssnoGQ','not_in_project','auth_required','Operation\x20cancelled.','\x20project\x20directory','Missing\x20required\x20flag:\x20--','11RlleVa','CliError','32710YqHcfI','flag_missing','9715350CCRPbd','438291IYUaGh','119OYPKpO','\x20auth`\x20to\x20login\x20first.','547770TbzARx','278YPhlDS','network_error','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.'];a104_0x3ba6=function(){return _0x2f73cb;};return a104_0x3ba6();}export class CliError extends Error{[a104_0x4c4c3c(0xb4)];[a104_0x4c4c3c(0xbe)];['hint'];constructor(_0x527e23,_0x3f2160,_0x110f4a,_0xa6ec3a){const _0x160d0f=a104_0x4c4c3c;super(_0x110f4a),this[_0x160d0f(0xbc)]=_0x160d0f(0xa4),this[_0x160d0f(0xb4)]=_0x527e23,this[_0x160d0f(0xbe)]=_0x3f2160,this[_0x160d0f(0xb0)]=_0xa6ec3a;}}export const CliErrors={'authRequired':_0x1d226a=>new CliError(a104_0x4c4c3c(0x9f),0x1,a104_0x4c4c3c(0xb8),_0x1d226a??a104_0x4c4c3c(0xb7)+CLI_BIN_NAME+a104_0x4c4c3c(0xaa)),'configMissing':_0x4d2abe=>new CliError(a104_0x4c4c3c(0xbb),0x1,a104_0x4c4c3c(0xb3),_0x4d2abe??['Set\x20appcode\x20via\x20`'+CLI_BIN_NAME+a104_0x4c4c3c(0xb9),a104_0x4c4c3c(0xb5)+CLI_BIN_NAME+a104_0x4c4c3c(0xaf)]['join']('\x0a\x20\x20\x20\x20\x20\x20\x20')),'notInProject':()=>new CliError(a104_0x4c4c3c(0x9e),0x1,a104_0x4c4c3c(0xb1)+CLI_BIN_NAME+a104_0x4c4c3c(0xa1),a104_0x4c4c3c(0xae)),'apiError':(_0x93e3ba,_0x177b84)=>new CliError('api_error',0x2,_0x93e3ba,_0x177b84),'networkError':_0xced8d0=>new CliError(a104_0x4c4c3c(0xad),0x2,a104_0x4c4c3c(0xbf)+_0xced8d0,'Check\x20your\x20internet\x20connection\x20and\x20try\x20again.'),'unknownCommand':_0x10f2f9=>new CliError('unknown_command',0x1,a104_0x4c4c3c(0xb6)+_0x10f2f9,'Run\x20`'+CLI_BIN_NAME+'\x20--help`\x20to\x20see\x20available\x20commands.'),'flagMissing':(_0x2565e2,_0x43f447)=>new CliError(a104_0x4c4c3c(0xa6),0x1,a104_0x4c4c3c(0xa2)+_0x2565e2,_0x43f447),'validation':(_0x1c78aa,_0x367994)=>new CliError('validation_error',0x1,_0x1c78aa,_0x367994),'cancelled':_0x40c6cd=>new CliError('cancelled',0x0,_0x40c6cd??a104_0x4c4c3c(0xa0),undefined)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a105_0x57f4(){const _0x321342=['3748kojCIF','1315480oZAjXm','push','dryRun','478488kDlvZG','8JhfArt','flags','8XTERiU','risk','286650jSClOE','format','boolean','1063636knLIZC','440832GelJLa','Output\x20format','dry-run','json','high-risk-write','hasFormat','8226567hhPXWg','compress','Preview\x20the\x20operation\x20without\x20executing','Skip\x20confirmation\x20prompt','pretty'];a105_0x57f4=function(){return _0x321342;};return a105_0x57f4();}(function(_0x14e6ad,_0x2ad1e9){const _0x44cc30=a105_0x5c0f,_0x4b9a31=_0x14e6ad();while(!![]){try{const _0x54e860=parseInt(_0x44cc30(0x10a))/0x1*(parseInt(_0x44cc30(0x105))/0x2)+-parseInt(_0x44cc30(0x10e))/0x3+-parseInt(_0x44cc30(0x109))/0x4+-parseInt(_0x44cc30(0x106))/0x5+-parseInt(_0x44cc30(0x112))/0x6+parseInt(_0x44cc30(0x111))/0x7*(-parseInt(_0x44cc30(0x10c))/0x8)+parseInt(_0x44cc30(0x100))/0x9;if(_0x54e860===_0x2ad1e9)break;else _0x4b9a31['push'](_0x4b9a31['shift']());}catch(_0x55716e){_0x4b9a31['push'](_0x4b9a31['shift']());}}}(a105_0x57f4,0x37057));function a105_0x5c0f(_0x5a483f,_0xc670d3){_0x5a483f=_0x5a483f-0xfb;const _0x57f402=a105_0x57f4();let _0x5c0f68=_0x57f402[_0x5a483f];return _0x5c0f68;}export function buildAllFlags(_0x2f4bb1){const _0x2df4a1=a105_0x5c0f,_0xfc09b=[..._0x2f4bb1[_0x2df4a1(0x10b)]];return _0x2f4bb1[_0x2df4a1(0x108)]&&_0xfc09b[_0x2df4a1(0x107)]({'name':_0x2df4a1(0xfc),'type':_0x2df4a1(0x110),'description':_0x2df4a1(0x102)}),_0x2f4bb1[_0x2df4a1(0xff)]!==![]&&_0xfc09b['push']({'name':_0x2df4a1(0x10f),'type':'string','default':_0x2f4bb1['defaultOutputFormat']??_0x2df4a1(0x104),'enum':[_0x2df4a1(0xfd),'pretty',_0x2df4a1(0x101)],'description':_0x2df4a1(0xfb)}),_0x2f4bb1[_0x2df4a1(0x10d)]===_0x2df4a1(0xfe)&&_0xfc09b[_0x2df4a1(0x107)]({'name':'yes','type':_0x2df4a1(0x110),'description':_0x2df4a1(0x103)}),_0xfc09b;}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a0116,_0x52d221){const _0x28dabc=a106_0x4a39,_0x38eb33=_0x3a0116();while(!![]){try{const _0x3dd023=-parseInt(_0x28dabc(0x12e))/0x1*(parseInt(_0x28dabc(0x118))/0x2)+-parseInt(_0x28dabc(0x115))/0x3*(parseInt(_0x28dabc(0x127))/0x4)+parseInt(_0x28dabc(0x130))/0x5+parseInt(_0x28dabc(0x132))/0x6*(parseInt(_0x28dabc(0x134))/0x7)+-parseInt(_0x28dabc(0x133))/0x8*(parseInt(_0x28dabc(0x119))/0x9)+parseInt(_0x28dabc(0x128))/0xa+parseInt(_0x28dabc(0x11a))/0xb;if(_0x3dd023===_0x52d221)break;else _0x38eb33['push'](_0x38eb33['shift']());}catch(_0x10e8ea){_0x38eb33['push'](_0x38eb33['shift']());}}}(a106_0x19ad,0x9e92f));function a106_0x4a39(_0x4fe8fd,_0x2775d2){_0x4fe8fd=_0x4fe8fd-0x113;const _0x19ada6=a106_0x19ad();let _0x4a3967=_0x19ada6[_0x4fe8fd];return _0x4a3967;}function a106_0x19ad(){const _0x2ed4bf=['Invalid\x20--','145618hAQOyj','27vxcNKM','9463124ayaReu','\x20is\x20required\x20for\x20`','enum','dry-run','type','dryRun','test','\x22\x20for\x20--','default','join','replace','Invalid\x20value\x20\x22','length','184RwsiFb','4172070wRBiyr','description','number','.\x20Allowed:\x20','true','pattern','4UXcVWw','boolean','4235185lEDdOL','validation','6DtyFmQ','1141688gCDrMs','2287502zdIdIL','\x20expects\x20a\x20number,\x20got\x20\x22','name','includes','yes',',\x20got\x20\x22','70593AJzNyj',':\x20expected\x20'];a106_0x19ad=function(){return _0x2ed4bf;};return a106_0x19ad();}import{CliErrors}from'../errors.js';export function parseFlags(_0x489ebb,_0xa374bd){const _0x451432=a106_0x4a39,_0x293396={};for(const _0xcbe724 of _0x489ebb){const _0x48ccd7=_0xa374bd[_0xcbe724[_0x451432(0x136)]]??_0xa374bd[toCamelCase(_0xcbe724[_0x451432(0x136)])];if(_0x48ccd7===undefined||_0x48ccd7===null){_0xcbe724[_0x451432(0x122)]!==undefined&&(_0x293396[_0xcbe724[_0x451432(0x136)]]=_0xcbe724[_0x451432(0x122)]);continue;}_0x293396[_0xcbe724[_0x451432(0x136)]]=coerce(_0xcbe724,_0x48ccd7);}for(const _0x1af304 of[_0x451432(0x11d),_0x451432(0x11f),_0x451432(0x113),'format','jq']){const _0x2f79e0=_0xa374bd[_0x1af304];if(_0x2f79e0!==undefined){const _0x528f7b=_0x1af304===_0x451432(0x11f)?_0x451432(0x11d):_0x1af304;_0x293396[_0x528f7b]=_0x2f79e0;}}return _0x293396;}export function validateFlags(_0x3c4b18,_0x216d5c,_0x3e6ac2){const _0x5a1940=a106_0x4a39;for(const _0x16f5d2 of _0x3c4b18){const _0x26b114=_0x216d5c[_0x16f5d2['name']];if(_0x16f5d2['required']&&(_0x26b114===undefined||_0x26b114===''))throw CliErrors['flagMissing'](_0x16f5d2[_0x5a1940(0x136)],'--'+_0x16f5d2[_0x5a1940(0x136)]+_0x5a1940(0x11b)+_0x3e6ac2+'`.');if(_0x16f5d2[_0x5a1940(0x11c)]&&_0x16f5d2[_0x5a1940(0x11c)][_0x5a1940(0x126)]>0x0&&_0x26b114!==undefined&&_0x26b114!==''){if(!_0x16f5d2[_0x5a1940(0x11c)][_0x5a1940(0x137)](String(_0x26b114)))throw CliErrors['validation'](_0x5a1940(0x125)+_0x26b114+_0x5a1940(0x121)+_0x16f5d2[_0x5a1940(0x136)]+_0x5a1940(0x12b)+_0x16f5d2[_0x5a1940(0x11c)][_0x5a1940(0x123)](',\x20'));}if(_0x16f5d2[_0x5a1940(0x12d)]&&_0x26b114!==undefined&&_0x26b114!==''){if(!_0x16f5d2[_0x5a1940(0x12d)]['regex'][_0x5a1940(0x120)](String(_0x26b114)))throw CliErrors[_0x5a1940(0x131)](_0x5a1940(0x117)+_0x16f5d2[_0x5a1940(0x136)]+_0x5a1940(0x116)+_0x16f5d2['pattern'][_0x5a1940(0x129)]+_0x5a1940(0x114)+_0x26b114+'\x22.');}}}function coerce(_0xf89db5,_0x136ca1){const _0x2b27e1=a106_0x4a39;switch(_0xf89db5[_0x2b27e1(0x11e)]){case _0x2b27e1(0x12f):return _0x136ca1===!![]||_0x136ca1===_0x2b27e1(0x12c);case _0x2b27e1(0x12a):{const _0x1c408b=Number(_0x136ca1);if(isNaN(_0x1c408b))throw CliErrors[_0x2b27e1(0x131)]('--'+_0xf89db5['name']+_0x2b27e1(0x135)+_0x136ca1+'\x22');return _0x1c408b;}default:return String(_0x136ca1);}}function toCamelCase(_0x3df49b){const _0x2d4d88=a106_0x4a39;return _0x3df49b[_0x2d4d88(0x124)](/-([a-z])/g,(_0x1c58f7,_0x19a522)=>_0x19a522['toUpperCase']());}
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a105_0x106d5d=a105_0x54df;function a105_0x2fb8(){const _0x41194f=['2040EmYNJK','\x20[global-options]\x20<service>\x20<command>\x20[flags]','\x20\x20PREREQUISITES','high-risk-write','service','get','split','hint','2MtbvRs','4896388ETGQDk','boolean','7146mZMjAb','\x20\x20Unknown\x20service:\x20','367890DXGuvz','length','\x20auth`\x20first).','Requires\x20authentication\x20(run\x20`','\x20\x20COMMANDS','\x20(required)','\x20\x20[write]','510FbPFZC','\x20\x20[high-risk-write]','\x20<service>\x20<command>\x20--help`\x20for\x20command\x20flags.','\x20\x20FLAGS','\x20\x20RISK:\x20','hasFormat','Requires\x20appcode\x20(set\x20via\x20`','trim','number','default','commands','tag','1062039CechhB','473566WfQiCd','dryRun','47100TZSZhA','requiresAppCode','\x20\x20\x20\x20Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.','padEnd','isSingleCommand','7104713BEsiAm','\x20<n>','find','args','helpExtra','605JTxuEe','\x20[default:\x20','type','\x20project\x20init`\x20or\x20--appcode).','\x20\x20USAGE','risk','enum','\x20\x20\x20\x20\x20\x20','max','requiresAuth','required','\x20<service>\x20--help`\x20for\x20service\x20commands.','function','map','command','\x20[flags]','wildcardDef','label','push','\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20$\x20','name','\x20<value>','\x20\x20\x20\x20','description','join','\x20\x20ARGS','(required)','\x20\x20Run\x20`','includes'];a105_0x2fb8=function(){return _0x41194f;};return a105_0x2fb8();}(function(_0x17005e,_0x4bf996){const _0x5a5188=a105_0x54df,_0xb83b0f=_0x17005e();while(!![]){try{const _0x1f5761=-parseInt(_0x5a5188(0xb8))/0x1+parseInt(_0x5a5188(0xea))/0x2*(-parseInt(_0x5a5188(0xb7))/0x3)+parseInt(_0x5a5188(0xeb))/0x4+-parseInt(_0x5a5188(0xf6))/0x5*(parseInt(_0x5a5188(0xba))/0x6)+-parseInt(_0x5a5188(0xbf))/0x7+-parseInt(_0x5a5188(0xe2))/0x8*(-parseInt(_0x5a5188(0xed))/0x9)+-parseInt(_0x5a5188(0xef))/0xa*(-parseInt(_0x5a5188(0xc4))/0xb);if(_0x1f5761===_0x4bf996)break;else _0xb83b0f['push'](_0xb83b0f['shift']());}catch(_0x145f3b){_0xb83b0f['push'](_0xb83b0f['shift']());}}}(a105_0x2fb8,0xc4f44));function a105_0x54df(_0x56518b,_0x52659e){_0x56518b=_0x56518b-0xad;const _0x2fb83b=a105_0x2fb8();let _0x54dfd4=_0x2fb83b[_0x56518b];return _0x54dfd4;}import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';const RISK_LABELS={'read':'','write':a105_0x106d5d(0xf5),'high-risk-write':a105_0x106d5d(0xf7)};export function generateCommandHelp(_0x539e38){const _0x2c3bb1=a105_0x106d5d,_0x1f43e1=[],_0x2faf1f=_0x539e38['service']===_0x539e38[_0x2c3bb1(0xd2)]?CLI_BIN_NAME+'\x20'+_0x539e38[_0x2c3bb1(0xe6)]:CLI_BIN_NAME+'\x20'+_0x539e38['service']+'\x20'+_0x539e38['command'],_0x584f91=_0x539e38['args']?_0x539e38[_0x2c3bb1(0xc2)]['map'](_0x1705f0=>_0x1705f0['required']!==![]?'<'+_0x1705f0[_0x2c3bb1(0xd9)]+'>':'['+_0x1705f0[_0x2c3bb1(0xd9)]+']')[_0x2c3bb1(0xdd)]('\x20'):'',_0x173269=_0x584f91?_0x2faf1f+'\x20'+_0x584f91+'\x20[flags]':_0x2faf1f+_0x2c3bb1(0xd3);_0x1f43e1[_0x2c3bb1(0xd6)](''),_0x1f43e1['push']('\x20\x20'+_0x539e38[_0x2c3bb1(0xdc)]),_0x1f43e1[_0x2c3bb1(0xd6)](''),_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xc8)),_0x1f43e1['push']('\x20\x20\x20\x20'+_0x173269),_0x1f43e1[_0x2c3bb1(0xd6)](''),_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xaf)+_0x539e38[_0x2c3bb1(0xc9)]);_0x539e38[_0x2c3bb1(0xc9)]===_0x2c3bb1(0xe5)&&_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xbc));_0x1f43e1[_0x2c3bb1(0xd6)]('');if(_0x539e38[_0x2c3bb1(0xc2)]&&_0x539e38[_0x2c3bb1(0xc2)][_0x2c3bb1(0xf0)]>0x0){_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xde));const _0x5e8e1d=Math[_0x2c3bb1(0xcc)](..._0x539e38[_0x2c3bb1(0xc2)]['map'](_0xafdcf3=>_0xafdcf3['name'][_0x2c3bb1(0xf0)]+0x2));for(const _0xe356f3 of _0x539e38[_0x2c3bb1(0xc2)]){const _0x16a8d1=('<'+_0xe356f3['name']+'>')[_0x2c3bb1(0xbd)](_0x5e8e1d+0x2),_0x5aeed6=_0xe356f3[_0x2c3bb1(0xce)]!==![]?_0x2c3bb1(0xf4):'';_0x1f43e1[_0x2c3bb1(0xd6)]('\x20\x20\x20\x20'+_0x16a8d1+_0xe356f3['description']+_0x5aeed6);}_0x1f43e1['push']('');}if(_0x539e38['flags'][_0x2c3bb1(0xf0)]>0x0||_0x539e38[_0x2c3bb1(0xb9)]||_0x539e38[_0x2c3bb1(0xb0)]!==![]){_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xae));const _0x2bb6c2=buildAllFlags(_0x539e38),_0x51ec6a=Math[_0x2c3bb1(0xcc)](..._0x2bb6c2[_0x2c3bb1(0xd1)](_0x1ddc7f=>formatFlagName(_0x1ddc7f)[_0x2c3bb1(0xf0)]));for(const _0x3663f1 of _0x2bb6c2){_0x1f43e1[_0x2c3bb1(0xd6)]('\x20\x20\x20\x20'+formatFlagName(_0x3663f1)[_0x2c3bb1(0xbd)](_0x51ec6a+0x2)+renderFlagDesc(_0x3663f1));}_0x1f43e1[_0x2c3bb1(0xd6)]('');}const _0x3b8210=[];_0x539e38[_0x2c3bb1(0xcd)]!==![]&&_0x3b8210[_0x2c3bb1(0xd6)](_0x2c3bb1(0xf2)+CLI_BIN_NAME+_0x2c3bb1(0xf1));_0x539e38[_0x2c3bb1(0xbb)]!==![]&&_0x3b8210[_0x2c3bb1(0xd6)](_0x2c3bb1(0xb1)+CLI_BIN_NAME+_0x2c3bb1(0xc7));if(_0x3b8210[_0x2c3bb1(0xf0)]>0x0){_0x1f43e1[_0x2c3bb1(0xd6)](_0x2c3bb1(0xe4));for(const _0x3fa2f3 of _0x3b8210){_0x1f43e1[_0x2c3bb1(0xd6)]('\x20\x20\x20\x20•\x20'+_0x3fa2f3);}_0x1f43e1[_0x2c3bb1(0xd6)]('');}if(_0x539e38[_0x2c3bb1(0xc3)]){const _0x4b8438=typeof _0x539e38[_0x2c3bb1(0xc3)]===_0x2c3bb1(0xd0)?_0x539e38['helpExtra']():_0x539e38[_0x2c3bb1(0xc3)];_0x1f43e1['push'](_0x4b8438),_0x1f43e1[_0x2c3bb1(0xd6)]('');}return _0x1f43e1[_0x2c3bb1(0xdd)]('\x0a');}export function generateServiceHelp(_0x4e5d87){const _0x23852f=a105_0x106d5d,_0x4d1ea5=getServiceEntry(_0x4e5d87);if(!_0x4d1ea5)return _0x23852f(0xee)+_0x4e5d87+'\x0a';const _0x408908=[],_0x1ae093=serviceGroups[_0x23852f(0xe7)](_0x4e5d87);_0x408908[_0x23852f(0xd6)](''),_0x408908['push']('\x20\x20'+_0x4d1ea5[_0x23852f(0xd5)]),_0x408908['push'](''),_0x408908[_0x23852f(0xd6)](_0x23852f(0xc8)),_0x408908[_0x23852f(0xd6)](_0x23852f(0xdb)+CLI_BIN_NAME+'\x20'+_0x4e5d87+'\x20<command>\x20[args]\x20[flags]'),_0x408908['push'](''),_0x408908[_0x23852f(0xd6)]('\x20\x20COMMANDS');for(const _0x559c6 of _0x4d1ea5[_0x23852f(0xb5)]){_0x408908['push']('');const _0x297e23=_0x559c6['tag']?'\x20\x20'+_0x559c6[_0x23852f(0xb6)][_0x23852f(0xb2)]():'';_0x408908['push'](_0x23852f(0xdb)+_0x559c6[_0x23852f(0xd2)]+_0x297e23),_0x408908[_0x23852f(0xd6)](_0x23852f(0xcb)+_0x559c6[_0x23852f(0xdc)]);const _0xf92812=_0x1ae093?.[_0x23852f(0xc1)](_0x1f27ee=>_0x1f27ee['command']===_0x559c6['command']);if(_0xf92812?.[_0x23852f(0xc2)]&&_0xf92812['args'][_0x23852f(0xf0)]>0x0){_0x408908[_0x23852f(0xd6)]('\x20\x20\x20\x20\x20\x20ARGS');const _0x3f87bf=Math[_0x23852f(0xcc)](..._0xf92812[_0x23852f(0xc2)][_0x23852f(0xd1)](_0x393e62=>_0x393e62['name']['length']+0x2));for(const _0x111c53 of _0xf92812['args']){const _0x2200d9=('<'+_0x111c53['name']+'>')[_0x23852f(0xbd)](_0x3f87bf+0x2),_0x110027=_0x111c53[_0x23852f(0xce)]!==![]?_0x23852f(0xf4):'';_0x408908[_0x23852f(0xd6)](_0x23852f(0xd7)+_0x2200d9+_0x111c53[_0x23852f(0xdc)]+_0x110027);}}const _0x298127=getCommandFlags(_0x4e5d87,_0x559c6[_0x23852f(0xd2)],_0x1ae093);if(_0x298127['length']>0x0){const _0x2e97fd=Math[_0x23852f(0xcc)](..._0x298127['map'](_0x3d009f=>formatFlagName(_0x3d009f)[_0x23852f(0xf0)]));for(const _0x33e66a of _0x298127){_0x408908[_0x23852f(0xd6)]('\x20\x20\x20\x20\x20\x20'+formatFlagName(_0x33e66a)[_0x23852f(0xbd)](_0x2e97fd+0x2)+renderFlagDesc(_0x33e66a));}}}return _0x408908[_0x23852f(0xd6)](''),_0x408908[_0x23852f(0xdd)]('\x0a');}export function generateFullHelp(){const _0x174150=a105_0x106d5d,_0x166f2c=[];_0x166f2c['push'](''),_0x166f2c[_0x174150(0xd6)]('\x20\x20'+CLI_DISPLAY_NAME),_0x166f2c[_0x174150(0xd6)](''),_0x166f2c['push'](_0x174150(0xc8)),_0x166f2c['push'](_0x174150(0xd8)+CLI_BIN_NAME+_0x174150(0xe3)),_0x166f2c[_0x174150(0xd6)](''),_0x166f2c[_0x174150(0xd6)]('\x20\x20GLOBAL\x20OPTIONS');const _0x1b2063=GLOBAL_FLAGS['filter'](_0x58fced=>!_0x58fced['hidden']),_0x2f8d73=Math['max'](..._0x1b2063[_0x174150(0xd1)](_0x3e095a=>{const _0x1cd66b=_0x174150,_0x5cfd59=_0x3e095a[_0x1cd66b(0xe9)]?'\x20'+_0x3e095a[_0x1cd66b(0xe9)]:'';return('--'+_0x3e095a[_0x1cd66b(0xd9)]+_0x5cfd59)[_0x1cd66b(0xf0)];}));for(const _0x8cce8d of _0x1b2063){const _0x4128be=_0x8cce8d[_0x174150(0xe9)]?'\x20'+_0x8cce8d[_0x174150(0xe9)]:'',_0x300d14=('--'+_0x8cce8d['name']+_0x4128be)[_0x174150(0xbd)](_0x2f8d73+0x2);_0x166f2c[_0x174150(0xd6)](_0x174150(0xdb)+_0x300d14+_0x8cce8d[_0x174150(0xdc)]);}_0x166f2c['push'](''),_0x166f2c['push'](_0x174150(0xf3)),_0x166f2c[_0x174150(0xd6)]('');for(const _0x37ada2 of serviceRegistry){_0x166f2c['push']('\x20\x20'+_0x37ada2[_0x174150(0xd5)]);if(_0x37ada2[_0x174150(0xbe)]){const _0x38df53=_0x37ada2['commands'][0x0],_0x22ceac=_0x38df53[_0x174150(0xb6)]??'';_0x166f2c[_0x174150(0xd6)](_0x174150(0xdb)+_0x37ada2[_0x174150(0xe6)]['padEnd'](0x12)+_0x38df53['description']+_0x22ceac);}else{const _0x27c05f=_0x37ada2[_0x174150(0xb5)][_0x174150(0xd1)](_0x88321e=>_0x37ada2['service']+'\x20'+_0x88321e['command']),_0xf22575=Math['max'](..._0x27c05f['map'](_0x49b920=>_0x49b920[_0x174150(0xf0)]));for(let _0x2f2817=0x0;_0x2f2817<_0x37ada2[_0x174150(0xb5)]['length'];_0x2f2817++){const _0x407253=_0x37ada2['commands'][_0x2f2817],_0x342d57=_0x407253[_0x174150(0xb6)]??'';_0x166f2c['push'](_0x174150(0xdb)+_0x27c05f[_0x2f2817][_0x174150(0xbd)](_0xf22575+0x2)+_0x407253[_0x174150(0xdc)]+_0x342d57);}}if(_0x37ada2[_0x174150(0xd4)]?.[_0x174150(0xc3)]){const _0x94331b=typeof _0x37ada2[_0x174150(0xd4)]['helpExtra']===_0x174150(0xd0)?_0x37ada2['wildcardDef']['helpExtra']():_0x37ada2[_0x174150(0xd4)][_0x174150(0xc3)];for(const _0x574630 of _0x94331b[_0x174150(0xe8)]('\x0a')){_0x166f2c[_0x174150(0xd6)]('\x20\x20'+_0x574630);}}_0x166f2c['push']('');}return _0x166f2c['push'](_0x174150(0xe0)+CLI_BIN_NAME+_0x174150(0xcf)),_0x166f2c[_0x174150(0xd6)](_0x174150(0xe0)+CLI_BIN_NAME+_0x174150(0xad)),_0x166f2c[_0x174150(0xd6)](''),_0x166f2c['join']('\x0a');}function getCommandFlags(_0x4bd657,_0x2e33f8,_0x3218dc){const _0x58dd38=a105_0x106d5d;if(_0x3218dc){const _0x11c8fc=_0x3218dc['find'](_0x19346a=>_0x19346a[_0x58dd38(0xd2)]===_0x2e33f8);if(_0x11c8fc)return buildAllFlags(_0x11c8fc);}return[];}function renderFlagDesc(_0x3e2e22){const _0x35d6d1=a105_0x106d5d;let _0xdbe5b6=_0x3e2e22[_0x35d6d1(0xdc)];return _0x3e2e22[_0x35d6d1(0xca)]&&_0x3e2e22[_0x35d6d1(0xca)][_0x35d6d1(0xf0)]>0x0&&(_0xdbe5b6+='\x20('+_0x3e2e22[_0x35d6d1(0xca)][_0x35d6d1(0xdd)]('\x20|\x20')+')'),_0x3e2e22[_0x35d6d1(0xb4)]!==undefined&&_0x3e2e22[_0x35d6d1(0xb4)]!==''&&_0x3e2e22[_0x35d6d1(0xb4)]!==![]&&(_0xdbe5b6+=_0x35d6d1(0xc5)+_0x3e2e22[_0x35d6d1(0xb4)]+']'),_0x3e2e22[_0x35d6d1(0xce)]&&!_0xdbe5b6[_0x35d6d1(0xe1)](_0x35d6d1(0xdf))&&(_0xdbe5b6+='\x20(required)'),_0xdbe5b6;}function formatFlagName(_0x2bdb84){const _0x137876=a105_0x106d5d,_0x53770a=_0x2bdb84[_0x137876(0xc6)]===_0x137876(0xec)?'':_0x2bdb84[_0x137876(0xc6)]===_0x137876(0xb3)?_0x137876(0xc0):_0x137876(0xda);return'--'+_0x2bdb84[_0x137876(0xd9)]+_0x53770a;}
|
|
1
|
+
const a107_0x3b6eef=a107_0x5420;(function(_0x2932db,_0xc6618c){const _0x41c8a2=a107_0x5420,_0x4a0843=_0x2932db();while(!![]){try{const _0x76a7d0=-parseInt(_0x41c8a2(0xce))/0x1+parseInt(_0x41c8a2(0xbf))/0x2*(-parseInt(_0x41c8a2(0xbc))/0x3)+-parseInt(_0x41c8a2(0xe5))/0x4+-parseInt(_0x41c8a2(0xc9))/0x5+-parseInt(_0x41c8a2(0xe4))/0x6+parseInt(_0x41c8a2(0xc1))/0x7+parseInt(_0x41c8a2(0xde))/0x8*(parseInt(_0x41c8a2(0xda))/0x9);if(_0x76a7d0===_0xc6618c)break;else _0x4a0843['push'](_0x4a0843['shift']());}catch(_0x834cf6){_0x4a0843['push'](_0x4a0843['shift']());}}}(a107_0x1c6b,0xd3cfb));function a107_0x1c6b(){const _0x84e0ed=['description','boolean','requiresAuth','args','get','tag','\x20\x20ARGS','padEnd','1844145XdtTnh','\x20\x20\x20\x20•\x20','\x20\x20RISK:\x20','function','176lmPzYh','max','includes','Requires\x20authentication\x20(run\x20`','find','helpExtra','9037866zyDIwl','3129076cHNkTb','type','isSingleCommand','default','command','service','filter','\x20\x20\x20\x20\x20\x20','wildcardDef','\x20\x20\x20\x20\x20\x20ARGS','\x20\x20COMMANDS','dryRun','map','\x20\x20\x20\x20$\x20','\x20\x20[write]','label','\x20|\x20','number','\x20[flags]','push','\x20\x20\x20\x20','\x20<n>','\x20[global-options]\x20<service>\x20<command>\x20[flags]','join','enum','\x20\x20Run\x20`','\x20\x20FLAGS','(required)','high-risk-write','\x20(required)','1798494nNWUSf','required','commands','4lDzmbt','\x20<command>\x20[args]\x20[flags]','11932235gipuqd','Requires\x20appcode\x20(set\x20via\x20`','length','hint','\x20\x20GLOBAL\x20OPTIONS','\x20\x20USAGE','\x20[default:\x20','trim','1435315VflMvP','\x20<service>\x20--help`\x20for\x20service\x20commands.','hasFormat','\x20\x20Unknown\x20service:\x20','name','1570297urkSqh','requiresAppCode','\x20<service>\x20<command>\x20--help`\x20for\x20command\x20flags.','hidden'];a107_0x1c6b=function(){return _0x84e0ed;};return a107_0x1c6b();}import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';const RISK_LABELS={'read':'','write':a107_0x3b6eef(0xac),'high-risk-write':'\x20\x20[high-risk-write]'};export function generateCommandHelp(_0x2893f7){const _0x3790ad=a107_0x3b6eef,_0x2dc1b2=[],_0x3b0fd5=_0x2893f7[_0x3790ad(0xa3)]===_0x2893f7['command']?CLI_BIN_NAME+'\x20'+_0x2893f7[_0x3790ad(0xa3)]:CLI_BIN_NAME+'\x20'+_0x2893f7[_0x3790ad(0xa3)]+'\x20'+_0x2893f7[_0x3790ad(0xa2)],_0x1d8dd7=_0x2893f7[_0x3790ad(0xd5)]?_0x2893f7[_0x3790ad(0xd5)][_0x3790ad(0xaa)](_0x4ea27b=>_0x4ea27b['required']!==![]?'<'+_0x4ea27b[_0x3790ad(0xcd)]+'>':'['+_0x4ea27b[_0x3790ad(0xcd)]+']')[_0x3790ad(0xb5)]('\x20'):'',_0x58d8a6=_0x1d8dd7?_0x3b0fd5+'\x20'+_0x1d8dd7+_0x3790ad(0xb0):_0x3b0fd5+_0x3790ad(0xb0);_0x2dc1b2[_0x3790ad(0xb1)](''),_0x2dc1b2[_0x3790ad(0xb1)]('\x20\x20'+_0x2893f7['description']),_0x2dc1b2[_0x3790ad(0xb1)](''),_0x2dc1b2[_0x3790ad(0xb1)]('\x20\x20USAGE'),_0x2dc1b2[_0x3790ad(0xb1)](_0x3790ad(0xb2)+_0x58d8a6),_0x2dc1b2[_0x3790ad(0xb1)](''),_0x2dc1b2['push'](_0x3790ad(0xdc)+_0x2893f7['risk']);_0x2893f7['risk']===_0x3790ad(0xba)&&_0x2dc1b2[_0x3790ad(0xb1)]('\x20\x20\x20\x20Requires\x20--yes\x20to\x20confirm,\x20or\x20interactive\x20prompt.');_0x2dc1b2[_0x3790ad(0xb1)]('');if(_0x2893f7[_0x3790ad(0xd5)]&&_0x2893f7[_0x3790ad(0xd5)][_0x3790ad(0xc3)]>0x0){_0x2dc1b2[_0x3790ad(0xb1)](_0x3790ad(0xd8));const _0x42f316=Math[_0x3790ad(0xdf)](..._0x2893f7[_0x3790ad(0xd5)][_0x3790ad(0xaa)](_0x2369ab=>_0x2369ab[_0x3790ad(0xcd)]['length']+0x2));for(const _0x2df9e2 of _0x2893f7[_0x3790ad(0xd5)]){const _0x4e66b3=('<'+_0x2df9e2[_0x3790ad(0xcd)]+'>')['padEnd'](_0x42f316+0x2),_0x22fefa=_0x2df9e2[_0x3790ad(0xbd)]!==![]?'\x20(required)':'';_0x2dc1b2['push']('\x20\x20\x20\x20'+_0x4e66b3+_0x2df9e2[_0x3790ad(0xd2)]+_0x22fefa);}_0x2dc1b2['push']('');}if(_0x2893f7['flags'][_0x3790ad(0xc3)]>0x0||_0x2893f7[_0x3790ad(0xa9)]||_0x2893f7[_0x3790ad(0xcb)]!==![]){_0x2dc1b2['push'](_0x3790ad(0xb8));const _0x55ffb0=buildAllFlags(_0x2893f7),_0x2f7556=Math[_0x3790ad(0xdf)](..._0x55ffb0['map'](_0x4992b0=>formatFlagName(_0x4992b0)['length']));for(const _0x1d4c70 of _0x55ffb0){_0x2dc1b2['push']('\x20\x20\x20\x20'+formatFlagName(_0x1d4c70)[_0x3790ad(0xd9)](_0x2f7556+0x2)+renderFlagDesc(_0x1d4c70));}_0x2dc1b2[_0x3790ad(0xb1)]('');}const _0x3976df=[];_0x2893f7[_0x3790ad(0xd4)]!==![]&&_0x3976df['push'](_0x3790ad(0xe1)+CLI_BIN_NAME+'\x20auth`\x20first).');_0x2893f7[_0x3790ad(0xcf)]!==![]&&_0x3976df[_0x3790ad(0xb1)](_0x3790ad(0xc2)+CLI_BIN_NAME+'\x20project\x20init`\x20or\x20--appcode).');if(_0x3976df[_0x3790ad(0xc3)]>0x0){_0x2dc1b2[_0x3790ad(0xb1)]('\x20\x20PREREQUISITES');for(const _0x295274 of _0x3976df){_0x2dc1b2[_0x3790ad(0xb1)](_0x3790ad(0xdb)+_0x295274);}_0x2dc1b2[_0x3790ad(0xb1)]('');}if(_0x2893f7[_0x3790ad(0xe3)]){const _0x54ec6b=typeof _0x2893f7[_0x3790ad(0xe3)]===_0x3790ad(0xdd)?_0x2893f7['helpExtra']():_0x2893f7[_0x3790ad(0xe3)];_0x2dc1b2[_0x3790ad(0xb1)](_0x54ec6b),_0x2dc1b2[_0x3790ad(0xb1)]('');}return _0x2dc1b2['join']('\x0a');}export function generateServiceHelp(_0x4612ed){const _0x163d35=a107_0x3b6eef,_0x10b085=getServiceEntry(_0x4612ed);if(!_0x10b085)return _0x163d35(0xcc)+_0x4612ed+'\x0a';const _0x2685af=[],_0x506703=serviceGroups[_0x163d35(0xd6)](_0x4612ed);_0x2685af['push'](''),_0x2685af[_0x163d35(0xb1)]('\x20\x20'+_0x10b085[_0x163d35(0xad)]),_0x2685af[_0x163d35(0xb1)](''),_0x2685af['push'](_0x163d35(0xc6)),_0x2685af[_0x163d35(0xb1)](_0x163d35(0xb2)+CLI_BIN_NAME+'\x20'+_0x4612ed+_0x163d35(0xc0)),_0x2685af[_0x163d35(0xb1)](''),_0x2685af[_0x163d35(0xb1)](_0x163d35(0xa8));for(const _0x5144ac of _0x10b085[_0x163d35(0xbe)]){_0x2685af['push']('');const _0x176b4c=_0x5144ac[_0x163d35(0xd7)]?'\x20\x20'+_0x5144ac[_0x163d35(0xd7)][_0x163d35(0xc8)]():'';_0x2685af[_0x163d35(0xb1)](_0x163d35(0xb2)+_0x5144ac[_0x163d35(0xa2)]+_0x176b4c),_0x2685af[_0x163d35(0xb1)](_0x163d35(0xa5)+_0x5144ac['description']);const _0x59a3d4=_0x506703?.[_0x163d35(0xe2)](_0x5917de=>_0x5917de['command']===_0x5144ac[_0x163d35(0xa2)]);if(_0x59a3d4?.['args']&&_0x59a3d4[_0x163d35(0xd5)][_0x163d35(0xc3)]>0x0){_0x2685af['push'](_0x163d35(0xa7));const _0x44f775=Math[_0x163d35(0xdf)](..._0x59a3d4[_0x163d35(0xd5)][_0x163d35(0xaa)](_0x224b3a=>_0x224b3a['name'][_0x163d35(0xc3)]+0x2));for(const _0x4beb38 of _0x59a3d4[_0x163d35(0xd5)]){const _0x3ee300=('<'+_0x4beb38[_0x163d35(0xcd)]+'>')['padEnd'](_0x44f775+0x2),_0x3d32b5=_0x4beb38[_0x163d35(0xbd)]!==![]?_0x163d35(0xbb):'';_0x2685af[_0x163d35(0xb1)]('\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3ee300+_0x4beb38[_0x163d35(0xd2)]+_0x3d32b5);}}const _0x4a4be8=getCommandFlags(_0x4612ed,_0x5144ac[_0x163d35(0xa2)],_0x506703);if(_0x4a4be8[_0x163d35(0xc3)]>0x0){const _0x2a58e5=Math['max'](..._0x4a4be8['map'](_0x12e505=>formatFlagName(_0x12e505)[_0x163d35(0xc3)]));for(const _0x5d1927 of _0x4a4be8){_0x2685af[_0x163d35(0xb1)](_0x163d35(0xa5)+formatFlagName(_0x5d1927)['padEnd'](_0x2a58e5+0x2)+renderFlagDesc(_0x5d1927));}}}return _0x2685af[_0x163d35(0xb1)](''),_0x2685af[_0x163d35(0xb5)]('\x0a');}export function generateFullHelp(){const _0x425949=a107_0x3b6eef,_0x481920=[];_0x481920['push'](''),_0x481920[_0x425949(0xb1)]('\x20\x20'+CLI_DISPLAY_NAME),_0x481920[_0x425949(0xb1)](''),_0x481920['push']('\x20\x20USAGE'),_0x481920['push'](_0x425949(0xab)+CLI_BIN_NAME+_0x425949(0xb4)),_0x481920[_0x425949(0xb1)](''),_0x481920[_0x425949(0xb1)](_0x425949(0xc5));const _0x1daa9f=GLOBAL_FLAGS[_0x425949(0xa4)](_0x5aca75=>!_0x5aca75[_0x425949(0xd1)]),_0x1ab4bb=Math[_0x425949(0xdf)](..._0x1daa9f[_0x425949(0xaa)](_0x5a5c0e=>{const _0x1dd4b7=_0x425949,_0x4c414c=_0x5a5c0e['hint']?'\x20'+_0x5a5c0e[_0x1dd4b7(0xc4)]:'';return('--'+_0x5a5c0e['name']+_0x4c414c)['length'];}));for(const _0x5e0222 of _0x1daa9f){const _0x23de38=_0x5e0222[_0x425949(0xc4)]?'\x20'+_0x5e0222[_0x425949(0xc4)]:'',_0x24f295=('--'+_0x5e0222[_0x425949(0xcd)]+_0x23de38)[_0x425949(0xd9)](_0x1ab4bb+0x2);_0x481920[_0x425949(0xb1)](_0x425949(0xb2)+_0x24f295+_0x5e0222['description']);}_0x481920['push'](''),_0x481920[_0x425949(0xb1)](_0x425949(0xa8)),_0x481920[_0x425949(0xb1)]('');for(const _0x44c993 of serviceRegistry){_0x481920[_0x425949(0xb1)]('\x20\x20'+_0x44c993[_0x425949(0xad)]);if(_0x44c993[_0x425949(0xe7)]){const _0x4e1fcd=_0x44c993['commands'][0x0],_0x5877fd=_0x4e1fcd['tag']??'';_0x481920[_0x425949(0xb1)](_0x425949(0xb2)+_0x44c993[_0x425949(0xa3)]['padEnd'](0x12)+_0x4e1fcd[_0x425949(0xd2)]+_0x5877fd);}else{const _0x203b71=_0x44c993[_0x425949(0xbe)][_0x425949(0xaa)](_0x482119=>_0x44c993[_0x425949(0xa3)]+'\x20'+_0x482119[_0x425949(0xa2)]),_0x36a48a=Math['max'](..._0x203b71[_0x425949(0xaa)](_0x133711=>_0x133711[_0x425949(0xc3)]));for(let _0x4d5a17=0x0;_0x4d5a17<_0x44c993['commands'][_0x425949(0xc3)];_0x4d5a17++){const _0x6a82cb=_0x44c993[_0x425949(0xbe)][_0x4d5a17],_0x2c9be7=_0x6a82cb[_0x425949(0xd7)]??'';_0x481920[_0x425949(0xb1)](_0x425949(0xb2)+_0x203b71[_0x4d5a17][_0x425949(0xd9)](_0x36a48a+0x2)+_0x6a82cb[_0x425949(0xd2)]+_0x2c9be7);}}if(_0x44c993[_0x425949(0xa6)]?.[_0x425949(0xe3)]){const _0x41449d=typeof _0x44c993[_0x425949(0xa6)]['helpExtra']===_0x425949(0xdd)?_0x44c993[_0x425949(0xa6)][_0x425949(0xe3)]():_0x44c993[_0x425949(0xa6)][_0x425949(0xe3)];for(const _0x377ea7 of _0x41449d['split']('\x0a')){_0x481920[_0x425949(0xb1)]('\x20\x20'+_0x377ea7);}}_0x481920[_0x425949(0xb1)]('');}return _0x481920['push']('\x20\x20Run\x20`'+CLI_BIN_NAME+_0x425949(0xca)),_0x481920[_0x425949(0xb1)](_0x425949(0xb7)+CLI_BIN_NAME+_0x425949(0xd0)),_0x481920[_0x425949(0xb1)](''),_0x481920[_0x425949(0xb5)]('\x0a');}function getCommandFlags(_0x499676,_0x41035a,_0x188e0a){const _0x45dc2c=a107_0x3b6eef;if(_0x188e0a){const _0x2abd00=_0x188e0a[_0x45dc2c(0xe2)](_0x5a2f99=>_0x5a2f99[_0x45dc2c(0xa2)]===_0x41035a);if(_0x2abd00)return buildAllFlags(_0x2abd00);}return[];}function a107_0x5420(_0x546124,_0x3bdee0){_0x546124=_0x546124-0xa2;const _0x1c6b6c=a107_0x1c6b();let _0x542059=_0x1c6b6c[_0x546124];return _0x542059;}function renderFlagDesc(_0x5cd265){const _0x47e0ba=a107_0x3b6eef;let _0xfac806=_0x5cd265[_0x47e0ba(0xd2)];return _0x5cd265[_0x47e0ba(0xb6)]&&_0x5cd265[_0x47e0ba(0xb6)][_0x47e0ba(0xc3)]>0x0&&(_0xfac806+='\x20('+_0x5cd265[_0x47e0ba(0xb6)][_0x47e0ba(0xb5)](_0x47e0ba(0xae))+')'),_0x5cd265['default']!==undefined&&_0x5cd265['default']!==''&&_0x5cd265['default']!==![]&&(_0xfac806+=_0x47e0ba(0xc7)+_0x5cd265[_0x47e0ba(0xe8)]+']'),_0x5cd265[_0x47e0ba(0xbd)]&&!_0xfac806[_0x47e0ba(0xe0)](_0x47e0ba(0xb9))&&(_0xfac806+=_0x47e0ba(0xbb)),_0xfac806;}function formatFlagName(_0x27991f){const _0x16f326=a107_0x3b6eef,_0x34fa39=_0x27991f[_0x16f326(0xe6)]===_0x16f326(0xd3)?'':_0x27991f[_0x16f326(0xe6)]===_0x16f326(0xaf)?_0x16f326(0xb3):'\x20<value>';return'--'+_0x27991f[_0x16f326(0xcd)]+_0x34fa39;}
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3ce4da,_0x24c26c){var _0x302de3=a108_0x1c2b,_0x31800b=_0x3ce4da();while(!![]){try{var _0x330847=parseInt(_0x302de3(0x1ce))/0x1+-parseInt(_0x302de3(0x1c9))/0x2+parseInt(_0x302de3(0x1cc))/0x3+-parseInt(_0x302de3(0x1cb))/0x4*(parseInt(_0x302de3(0x1cd))/0x5)+-parseInt(_0x302de3(0x1cf))/0x6*(parseInt(_0x302de3(0x1ca))/0x7)+parseInt(_0x302de3(0x1d1))/0x8+parseInt(_0x302de3(0x1d0))/0x9;if(_0x330847===_0x24c26c)break;else _0x31800b['push'](_0x31800b['shift']());}catch(_0x23124a){_0x31800b['push'](_0x31800b['shift']());}}}(a108_0x13f4,0x8532c));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';function a108_0x13f4(){var _0x54104d=['2105304uBFcka','604692qruwUV','77JhisyY','1712hzxQeK','1467228bdlAne','1095JDKcEC','655393qmppWz','464256srooNA','3466458ZOIYZY'];a108_0x13f4=function(){return _0x54104d;};return a108_0x13f4();}export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';function a108_0x1c2b(_0x43d3e4,_0x55dc7c){_0x43d3e4=_0x43d3e4-0x1c9;var _0x13f441=a108_0x13f4();var _0x1c2ba4=_0x13f441[_0x43d3e4];return _0x1c2ba4;}export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a109_0x405a(_0x2430f8,_0x1b95d7){_0x2430f8=_0x2430f8-0xf0;const _0x48bbc5=a109_0x48bb();let _0x405a1c=_0x48bbc5[_0x2430f8];return _0x405a1c;}(function(_0x2acb11,_0xc3d1d2){const _0x3735ef=a109_0x405a,_0x8feb33=_0x2acb11();while(!![]){try{const _0x469f28=-parseInt(_0x3735ef(0xfd))/0x1*(parseInt(_0x3735ef(0x104))/0x2)+-parseInt(_0x3735ef(0x116))/0x3*(-parseInt(_0x3735ef(0x123))/0x4)+parseInt(_0x3735ef(0x11c))/0x5*(parseInt(_0x3735ef(0x118))/0x6)+parseInt(_0x3735ef(0x108))/0x7*(-parseInt(_0x3735ef(0x100))/0x8)+-parseInt(_0x3735ef(0xf8))/0x9+-parseInt(_0x3735ef(0x115))/0xa*(-parseInt(_0x3735ef(0xf5))/0xb)+parseInt(_0x3735ef(0xf6))/0xc*(parseInt(_0x3735ef(0x122))/0xd);if(_0x469f28===_0xc3d1d2)break;else _0x8feb33['push'](_0x8feb33['shift']());}catch(_0x1c3ff8){_0x8feb33['push'](_0x8feb33['shift']());}}}(a109_0x48bb,0x99247));import{applyJqFilter}from'../utils/apply-jq-filter.js';export function formatOutput(_0x1a7a5d,_0x28dcaa){const _0x242ff9=a109_0x405a,{format:_0x830de5}=_0x28dcaa;switch(_0x830de5){case _0x242ff9(0x121):printJson(_0x1a7a5d,_0x28dcaa);break;case _0x242ff9(0xfc):printCompress(_0x1a7a5d,_0x28dcaa);break;case _0x242ff9(0x101):default:printPretty(_0x1a7a5d,_0x28dcaa);break;}}function buildEnvelope(_0x505830,_0x2ec6d4){const _0x5f2747=a109_0x405a,_0x4f5cb6={'ok':_0x505830['ok'],'command':_0x2ec6d4[_0x5f2747(0x10f)],'risk':_0x2ec6d4[_0x5f2747(0x106)]};if(_0x2ec6d4[_0x5f2747(0x113)])_0x4f5cb6[_0x5f2747(0x113)]=!![];if(_0x505830[_0x5f2747(0x10a)]!==undefined)_0x4f5cb6[_0x5f2747(0x10a)]=_0x505830['data'];return!_0x505830['ok']&&_0x505830['message']&&(_0x4f5cb6[_0x5f2747(0x120)]={'code':_0x5f2747(0xfa),'message':_0x505830[_0x5f2747(0xf9)]}),_0x4f5cb6;}function printJson(_0x3f7597,_0x7fa4b4){const _0x2c3233=a109_0x405a,_0x3fa603=buildEnvelope(_0x3f7597,_0x7fa4b4),_0x4be373=JSON[_0x2c3233(0xf7)](_0x3fa603,null,0x2)+'\x0a';writeJsonWithOptionalJq(_0x4be373,_0x7fa4b4);}function printCompress(_0xef51b9,_0x306348){const _0x1ecc7b=a109_0x405a,_0x84243a=buildEnvelope(_0xef51b9,_0x306348),_0xacf16c=JSON[_0x1ecc7b(0xf7)](_0x84243a)+'\x0a';writeJsonWithOptionalJq(_0xacf16c,_0x306348);}function writeJsonWithOptionalJq(_0x138fde,_0x1bbbb6){const _0x2e9433=a109_0x405a,_0x3cd684=_0x1bbbb6[_0x2e9433(0x10d)]?.['trim']();if(!_0x3cd684){process[_0x2e9433(0x11d)][_0x2e9433(0x109)](_0x138fde);return;}const _0x25969f=applyJqFilter(_0x138fde,_0x3cd684);process[_0x2e9433(0x11d)][_0x2e9433(0x109)](_0x25969f[_0x2e9433(0x103)]('\x0a')?_0x25969f:_0x25969f+'\x0a');}function a109_0x48bb(){const _0x1a7525=['globalPath','dryRun','(empty)','7270aGHxuY','3opMwvK','isArray','18JUFZBe','defaultAppSource','Error:\x20','\x20\x20Default\x20app:\x20\x20\x20\x20\x20','26995OndgYj','stdout','Found\x20','max','error','json','1456iwsYqy','4353864BUACZt','keys','map','(none)','Unknown\x20error','items','log','3443TXxMLJ','188580LWIoTc','stringify','4369113uZvcNz','message','command_error','projectPath','compress','871657MtGzQm','\x20\x20Global\x20config:\x20\x20\x20','global','8863272acMBlR','pretty','filter','endsWith','2ZHPdvE','object','risk','entries','7aRjTDw','write','data','length','\x20\x20Project\x20config:\x20\x20','jqFilter','meta','command','\x20items:\x0a','defaultApp'];a109_0x48bb=function(){return _0x1a7525;};return a109_0x48bb();}function isListWithMetaData(_0x588ebd){const _0x570fe1=a109_0x405a;return typeof _0x588ebd===_0x570fe1(0x105)&&_0x588ebd!==null&&_0x570fe1(0xf3)in _0x588ebd&&Array['isArray'](_0x588ebd['items'])&&'meta'in _0x588ebd&&typeof _0x588ebd[_0x570fe1(0x10e)]==='object'&&_0x588ebd['meta']!==null;}function printAppListMeta(_0x5d9e65){const _0x251a62=a109_0x405a,_0x4aa15f=_0x5d9e65[_0x251a62(0x112)]!=null?String(_0x5d9e65[_0x251a62(0x112)]):_0x251a62(0xf1),_0x567e52=_0x5d9e65[_0x251a62(0xfb)]!=null?String(_0x5d9e65[_0x251a62(0xfb)]):_0x251a62(0xf1),_0x19548d=_0x5d9e65[_0x251a62(0x111)]!=null?String(_0x5d9e65[_0x251a62(0x111)]):_0x251a62(0xf1),_0x319fc2=_0x5d9e65[_0x251a62(0x119)],_0x1e1449=_0x319fc2==='project'?'\x20(default\x20from\x20project\x20file)':_0x319fc2===_0x251a62(0xff)?'\x20(default\x20from\x20global\x20file)':'';console[_0x251a62(0xf4)](_0x251a62(0xfe)+_0x4aa15f),console[_0x251a62(0xf4)](_0x251a62(0x10c)+_0x567e52),console[_0x251a62(0xf4)](_0x251a62(0x11b)+_0x19548d+_0x1e1449),console[_0x251a62(0xf4)]();}function printPretty(_0x5b9c39,_0x32c462){const _0x5853eb=a109_0x405a;if(_0x32c462[_0x5853eb(0x113)]){console[_0x5853eb(0xf4)]('[dry-run]\x20Would\x20execute:'),console[_0x5853eb(0xf4)](JSON[_0x5853eb(0xf7)](_0x5b9c39[_0x5853eb(0x10a)],null,0x2));return;}if(!_0x5b9c39['ok']){console[_0x5853eb(0x120)](_0x5853eb(0x11a)+(_0x5b9c39[_0x5853eb(0xf9)]??_0x5853eb(0xf2)));return;}const _0x27067e=_0x5b9c39[_0x5853eb(0x10a)];if(_0x27067e===undefined||_0x27067e===null){if(_0x5b9c39['message'])console[_0x5853eb(0xf4)](_0x5b9c39[_0x5853eb(0xf9)]);return;}if(isListWithMetaData(_0x27067e)){printAppListMeta(_0x27067e[_0x5853eb(0x10e)]),printArrayPretty(_0x27067e[_0x5853eb(0xf3)]);return;}if(Array[_0x5853eb(0x117)](_0x27067e)){printArrayPretty(_0x27067e);return;}if(typeof _0x27067e===_0x5853eb(0x105)){printObjectPretty(_0x27067e);return;}console[_0x5853eb(0xf4)](String(_0x27067e));}function printObjectPretty(_0x3ff48a){const _0x108c09=a109_0x405a,_0xff4709=Math['max'](...Object[_0x108c09(0x124)](_0x3ff48a)['map'](_0x5b24a1=>_0x5b24a1[_0x108c09(0x10b)]),0x0);for(const [_0x48d296,_0x3ae0df]of Object[_0x108c09(0x107)](_0x3ff48a)){if(_0x3ae0df===undefined||_0x3ae0df===null)continue;const _0x33938b=_0x48d296['padEnd'](_0xff4709);typeof _0x3ae0df===_0x108c09(0x105)?console[_0x108c09(0xf4)](_0x33938b+'\x20\x20'+JSON['stringify'](_0x3ae0df)):console[_0x108c09(0xf4)](_0x33938b+'\x20\x20'+_0x3ae0df);}}function printArrayPretty(_0x2665aa){const _0x15fc90=a109_0x405a;if(_0x2665aa[_0x15fc90(0x10b)]===0x0){console[_0x15fc90(0xf4)](_0x15fc90(0x114));return;}console['log'](_0x15fc90(0x11e)+_0x2665aa[_0x15fc90(0x10b)]+_0x15fc90(0x110));for(const _0x130fd5 of _0x2665aa){if(typeof _0x130fd5==='object'&&_0x130fd5!==null){const _0x1489ea=Object[_0x15fc90(0x107)](_0x130fd5)[_0x15fc90(0x102)](([,_0x4fd54c])=>_0x4fd54c!=null&&_0x4fd54c!=='');if(_0x1489ea[_0x15fc90(0x10b)]===0x0)continue;const _0x22951f=Math[_0x15fc90(0x11f)](..._0x1489ea[_0x15fc90(0xf0)](([_0x35fd6a])=>_0x35fd6a[_0x15fc90(0x10b)]));for(const [_0x3d47ca,_0x3a0e5f]of _0x1489ea){const _0xef3881=typeof _0x3a0e5f===_0x15fc90(0x105)?JSON['stringify'](_0x3a0e5f):String(_0x3a0e5f);console[_0x15fc90(0xf4)]('\x20\x20'+_0x3d47ca['padEnd'](_0x22951f)+'\x20\x20'+_0xef3881);}console['log']('');}else console[_0x15fc90(0xf4)]('\x20\x20'+_0x130fd5);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a110_0x549c(){var _0x2b1046=['4hhUkXj','2258954AqAAEx','tableData','300727LXqryb','object','6676104csCQwL','2325006ylezhv','6205653rASJtd','47901DIcILV','isArray','30Zrndok','2873840lfSWCU','18ZmpOqF'];a110_0x549c=function(){return _0x2b1046;};return a110_0x549c();}(function(_0x57702a,_0x102ef9){var _0x6e3830=a110_0x5be0,_0xa4c6e8=_0x57702a();while(!![]){try{var _0x91ed5e=parseInt(_0x6e3830(0xc4))/0x1+-parseInt(_0x6e3830(0xc2))/0x2+parseInt(_0x6e3830(0xc7))/0x3*(-parseInt(_0x6e3830(0xc1))/0x4)+-parseInt(_0x6e3830(0xbf))/0x5+parseInt(_0x6e3830(0xc0))/0x6*(parseInt(_0x6e3830(0xbc))/0x7)+parseInt(_0x6e3830(0xc6))/0x8+-parseInt(_0x6e3830(0xc8))/0x9*(-parseInt(_0x6e3830(0xbe))/0xa);if(_0x91ed5e===_0x102ef9)break;else _0xa4c6e8['push'](_0xa4c6e8['shift']());}catch(_0x202032){_0xa4c6e8['push'](_0xa4c6e8['shift']());}}}(a110_0x549c,0xb5e71));export function extractList(_0x51257b){var _0x4d3ba6=a110_0x5be0;if(Array[_0x4d3ba6(0xbd)](_0x51257b))return _0x51257b;if(_0x51257b&&typeof _0x51257b===_0x4d3ba6(0xc5))return _0x51257b[_0x4d3ba6(0xc3)]??[];return[];}function a110_0x5be0(_0x13d65f,_0x32d122){_0x13d65f=_0x13d65f-0xbc;var _0x549c1a=a110_0x549c();var _0x5be0d4=_0x549c1a[_0x13d65f];return _0x5be0d4;}export function extractPaging(_0x5b2454){var _0x4e9ba1=a110_0x5be0;if(_0x5b2454&&typeof _0x5b2454===_0x4e9ba1(0xc5)&&!Array[_0x4e9ba1(0xbd)](_0x5b2454))return _0x5b2454['paging'];return undefined;}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a111_0x38f6(_0x4072b3,_0x54ec2c){_0x4072b3=_0x4072b3-0xcb;const _0x5b7a40=a111_0x5b7a();let _0x38f62f=_0x5b7a40[_0x4072b3];return _0x38f62f;}(function(_0x8a923b,_0x4c22e3){const _0x5b5fc3=a111_0x38f6,_0x433a60=_0x8a923b();while(!![]){try{const _0x5b6d96=-parseInt(_0x5b5fc3(0x115))/0x1*(parseInt(_0x5b5fc3(0x103))/0x2)+-parseInt(_0x5b5fc3(0x109))/0x3+parseInt(_0x5b5fc3(0x106))/0x4*(parseInt(_0x5b5fc3(0xd0))/0x5)+-parseInt(_0x5b5fc3(0xe8))/0x6+parseInt(_0x5b5fc3(0xee))/0x7+-parseInt(_0x5b5fc3(0xe5))/0x8+parseInt(_0x5b5fc3(0xf5))/0x9;if(_0x5b6d96===_0x4c22e3)break;else _0x433a60['push'](_0x433a60['shift']());}catch(_0x253f87){_0x433a60['push'](_0x433a60['shift']());}}}(a111_0x5b7a,0xad5e7));import{riskLevelOrder,normalizeLegacyOutputFormat}from'../framework/types.js';import{parseFlags,validateFlags}from'../framework/flags.js';import{formatOutput}from'../framework/output.js';function a111_0x5b7a(){const _0xb76f7=['\x0a\x20\x20\x20Continue?\x20[y/N]\x20','toLowerCase','`\x20requires\x20either\x20--code\x20or\x20--alias.','202sKVAuL','stdin','requiresAuth','1432MIvvjr','compress','dry-run','1469883AuPyta','defaultVerbose','trim','authRequired','args','cancelled','\x22.\x20visit\x20https://qizhiyuntu.feishu.cn/docx/JTiOdxQlXo2dQLxXVu6ctutcnme\x20for\x20more\x20information.','verbose','Set\x20appcode\x20via\x20`','map','number','flags','12363zbqYeb','high-risk-write','`\x20has\x20risk\x20level\x20\x22','\x22.\x0a','code','node:readline','apiDomain','question','configMissing','17365Mvmujh','High-risk\x20operation\x20`','service','No\x20api.ts\x20found\x20in\x20','Operation\x20cancelled\x20by\x20user.','command','Command\x20`','jqFilter','format','risk','apiDir','some','close','pretty','yes','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.','defaultPageSize','Unknown\x20alias\x20\x22','\x20api\x20pull`\x20first.','\x22.\x20','resolveCookie','3970616vdwWvt','../core/api-client.js','resolveApiDomain','1804314mUXstu','hasFormat','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','cookie','--jq\x20only\x20applies\x20with\x20--format\x20json\x20or\x20--format\x20compress\x20(current:\x20','name','8722413gJZLNF','validate','length','type','resolveAppCode','alias','execute','6807564OybxRp','\x22,\x20which\x20exceeds\x20the\x20configured\x20riskLevel\x20\x22','isNonInteractive','--dry-run\x20is\x20not\x20supported\x20for\x20`','selectedAppName','rawFlags','dryRun','riskLevel','string','json','validation'];a111_0x5b7a=function(){return _0xb76f7;};return a111_0x5b7a();}import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_API_DIR}from'../constant/paths.js';export async function runCommand(_0xd8a141,_0x1e31a9){const _0x1f6da2=a111_0x38f6,_0x3d2b78=CLI_BIN_NAME+'\x20'+_0xd8a141[_0x1f6da2(0xd2)]+'\x20'+_0xd8a141[_0x1f6da2(0xd5)],_0x517e38=parseFlags(_0xd8a141['flags'],_0x1e31a9[_0x1f6da2(0xfa)]);validateFlags(_0xd8a141[_0x1f6da2(0x114)],_0x517e38,_0x3d2b78);if(!_0x517e38[_0x1f6da2(0x108)]&&_0x1e31a9[_0x1f6da2(0xfc)]&&riskLevelOrder(_0xd8a141[_0x1f6da2(0xd9)])>riskLevelOrder(_0x1e31a9[_0x1f6da2(0xfc)])){if(_0x1e31a9['isNonInteractive'])throw CliErrors[_0x1f6da2(0xff)](_0x1f6da2(0xd6)+_0x3d2b78+_0x1f6da2(0x117)+_0xd8a141[_0x1f6da2(0xd9)]+_0x1f6da2(0xf6)+_0x1e31a9[_0x1f6da2(0xfc)]+'\x22.');throw CliErrors[_0x1f6da2(0xff)](_0x1f6da2(0xd6)+_0x3d2b78+'`\x20has\x20risk\x20level\x20\x22'+_0xd8a141[_0x1f6da2(0xd9)]+_0x1f6da2(0xf6)+_0x1e31a9[_0x1f6da2(0xfc)]+_0x1f6da2(0x118)+('\x20\x20Edit\x20the\x20config\x20file\x20manually\x20and\x20set\x20riskLevel\x20to\x20\x22'+_0xd8a141[_0x1f6da2(0xd9)]+_0x1f6da2(0x10f)));}const _0x1b93f2=_0x1e31a9[_0x1f6da2(0xda)]||DEFAULT_API_DIR;resolveAliasToCode(_0xd8a141,_0x517e38,_0x1b93f2,_0x3d2b78);let _0x4aebc9='';if(_0xd8a141[_0x1f6da2(0x105)]!==![]){_0x4aebc9=_0x1e31a9[_0x1f6da2(0xe4)]();if(!_0x4aebc9)throw CliErrors[_0x1f6da2(0x10c)]();const {setActiveCookie:_0x143200}=await import(_0x1f6da2(0xe6));_0x143200(_0x4aebc9);}let _0xb769bb='';if(_0xd8a141['requiresAppCode']!==![]){_0xb769bb=_0x1e31a9[_0x1f6da2(0xf2)]()??'';if(!_0xb769bb)throw CliErrors[_0x1f6da2(0xcf)](_0x1f6da2(0x111)+CLI_BIN_NAME+_0x1f6da2(0xea));}let _0x2791b8=resolveFormat(_0x517e38,_0xd8a141,_0x1e31a9['defaultFormat']);const _0x5a3be4=resolveJqFilter(_0x517e38);_0x5a3be4&&_0x2791b8==='pretty'&&(_0x2791b8=_0x1f6da2(0xfe));if(_0x5a3be4&&_0x2791b8!=='json'&&_0x2791b8!==_0x1f6da2(0x107))throw CliErrors[_0x1f6da2(0xff)](_0x1f6da2(0xec)+_0x2791b8+').');const _0xc7335b=buildRuntimeContext({'appCode':_0xb769bb,'cookie':_0x4aebc9,'apiDomain':_0x1e31a9[_0x1f6da2(0xe7)](),'format':_0x2791b8,'jqFilter':_0x5a3be4,'flags':_0x517e38,'def':_0xd8a141,'nonInteractive':_0x1e31a9['isNonInteractive'],'defaultPageSize':_0x1e31a9[_0x1f6da2(0xe0)],'defaultVerbose':_0x1e31a9[_0x1f6da2(0x10a)],'apiDir':_0x1b93f2,'selectedAppName':_0x1e31a9[_0x1f6da2(0xf9)],'args':_0x1e31a9[_0x1f6da2(0x10d)]??[]});_0xd8a141[_0x1f6da2(0xef)]&&await _0xd8a141[_0x1f6da2(0xef)](_0xc7335b);if(_0x517e38[_0x1f6da2(0x108)]){if(!_0xd8a141[_0x1f6da2(0xfb)])throw CliErrors[_0x1f6da2(0xff)](_0x1f6da2(0xf8)+_0x3d2b78+'`.');const _0x30cf57=await _0xd8a141[_0x1f6da2(0xfb)](_0xc7335b);formatOutput({'ok':!![],'data':_0x30cf57},{'command':_0x3d2b78,'risk':_0xd8a141[_0x1f6da2(0xd9)],'format':_0x2791b8,'dryRun':!![],'jqFilter':_0x5a3be4});return;}if(_0xd8a141[_0x1f6da2(0xd9)]===_0x1f6da2(0x116)&&!_0x517e38['yes']){if(_0x1e31a9[_0x1f6da2(0xf7)])throw CliErrors[_0x1f6da2(0xff)](_0x1f6da2(0xd1)+_0x3d2b78+_0x1f6da2(0xdf));await requireConfirmation(_0x3d2b78);}const _0x1a5f35=await _0xd8a141[_0x1f6da2(0xf4)](_0xc7335b);formatOutput(_0x1a5f35,{'command':_0x3d2b78,'risk':_0xd8a141[_0x1f6da2(0xd9)],'format':_0x2791b8,'jqFilter':_0x5a3be4});}function buildRuntimeContext(_0x341b39){const _0x3d16f9=a111_0x38f6,{flags:_0xa818fe,def:_0x3628aa}=_0x341b39,_0x5c1efc=CLI_BIN_NAME+'\x20'+_0x3628aa['service']+'\x20'+_0x3628aa['command'];return{'appCode':_0x341b39['appCode'],'cookie':_0x341b39[_0x3d16f9(0xeb)],'apiDomain':_0x341b39[_0x3d16f9(0xcd)],'format':_0x341b39[_0x3d16f9(0xd8)],'nonInteractive':_0x341b39['nonInteractive'],'apiDir':_0x341b39[_0x3d16f9(0xda)],'selectedAppName':_0x341b39['selectedAppName'],'args':_0x341b39[_0x3d16f9(0x10d)],'str'(_0x46fb9a){return String(_0xa818fe[_0x46fb9a]??'');},'bool'(_0x430884){const _0x3a987e=_0x3d16f9;if(_0xa818fe[_0x430884]===!![])return!![];if(_0x430884===_0x3a987e(0x110)&&_0x341b39[_0x3a987e(0x10a)])return!![];return![];},'num'(_0x3f2469,_0x4028d7){const _0x2f48b1=_0x3d16f9,_0x3bdc00=_0xa818fe[_0x3f2469];if(typeof _0x3bdc00===_0x2f48b1(0x113))return _0x3bdc00;if(_0x3f2469==='pagesize'&&_0x341b39[_0x2f48b1(0xe0)]!=null)return _0x341b39[_0x2f48b1(0xe0)];return _0x4028d7??0x0;},'flag'(_0x427012){return _0xa818fe[_0x427012];},'output'(_0x464fa3){const _0x28f394=_0x3d16f9;formatOutput(_0x464fa3,{'command':_0x5c1efc,'risk':_0x3628aa['risk'],'format':_0x341b39[_0x28f394(0xd8)],'jqFilter':_0x341b39[_0x28f394(0xd7)]});}};}function resolveJqFilter(_0x5f2405){const _0x174d58=a111_0x38f6,_0x59d862=_0x5f2405['jq'];if(_0x59d862===undefined||_0x59d862===null)return undefined;const _0x1b5777=String(_0x59d862)[_0x174d58(0x10b)]();return _0x1b5777===''?undefined:_0x1b5777;}function resolveFormat(_0x10bdea,_0x413553,_0x5dfb31){const _0x3ed11f=a111_0x38f6;if(_0x413553[_0x3ed11f(0xe9)]===![])return _0x3ed11f(0xdd);const _0x31f296=normalizeLegacyOutputFormat(_0x10bdea[_0x3ed11f(0xd8)]);if(_0x31f296)return _0x31f296;const _0x42d510=normalizeLegacyOutputFormat(_0x5dfb31);if(_0x42d510)return _0x42d510;const _0xb38540=normalizeLegacyOutputFormat(_0x413553['defaultOutputFormat']);if(_0xb38540)return _0xb38540;return _0x3ed11f(0xdd);}async function requireConfirmation(_0x2222d4){const _0x3c2c4c=a111_0x38f6,_0x420c9d=await import(_0x3c2c4c(0xcc)),_0x224e53=_0x420c9d['createInterface']({'input':process[_0x3c2c4c(0x104)],'output':process['stderr']});return new Promise((_0x55a8d0,_0x3e3192)=>{const _0x5b6d5f=_0x3c2c4c;_0x224e53[_0x5b6d5f(0xce)]('⚠\x20\x20High-risk\x20operation:\x20'+_0x2222d4+_0x5b6d5f(0x100),_0xb555df=>{const _0x9d9bf8=_0x5b6d5f;_0x224e53[_0x9d9bf8(0xdc)](),_0xb555df[_0x9d9bf8(0x101)]()==='y'||_0xb555df[_0x9d9bf8(0x101)]()===_0x9d9bf8(0xde)?_0x55a8d0():_0x3e3192(CliErrors[_0x9d9bf8(0x10e)](_0x9d9bf8(0xd4)));});});}function resolveAliasToCode(_0x5f577d,_0x38e97d,_0x45c656,_0x386c4c){const _0x42ef23=a111_0x38f6,_0x1a0bab=_0x5f577d[_0x42ef23(0x114)][_0x42ef23(0xdb)](_0xa2c514=>_0xa2c514[_0x42ef23(0xed)]===_0x42ef23(0xcb)&&_0xa2c514[_0x42ef23(0xf1)]===_0x42ef23(0xfd)),_0x1b6af6=_0x5f577d[_0x42ef23(0x114)][_0x42ef23(0xdb)](_0x3ea081=>_0x3ea081['name']==='alias'&&_0x3ea081['type']===_0x42ef23(0xfd));if(!_0x1a0bab||!_0x1b6af6)return;const _0xc609b=_0x38e97d[_0x42ef23(0xcb)]?String(_0x38e97d[_0x42ef23(0xcb)]):'',_0x13562=_0x38e97d[_0x42ef23(0xf3)]?String(_0x38e97d[_0x42ef23(0xf3)]):'';if(!_0xc609b&&!_0x13562)throw CliErrors[_0x42ef23(0xff)]('`'+_0x386c4c+_0x42ef23(0x102));if(_0x13562&&!_0xc609b){const _0x2182fa=resolveAlias(_0x45c656,_0x13562);if(!_0x2182fa){const _0x24fb81=listAliases(_0x45c656)[_0x42ef23(0x112)](_0x570cd1=>_0x570cd1['alias']),_0x3c59b7=_0x24fb81[_0x42ef23(0xf0)]?'Available\x20aliases:\x20'+_0x24fb81['join'](',\x20'):_0x42ef23(0xd3)+_0x45c656+'.\x20Run\x20`'+CLI_BIN_NAME+_0x42ef23(0xe2);throw CliErrors[_0x42ef23(0xff)](_0x42ef23(0xe1)+_0x13562+_0x42ef23(0xe3)+_0x3c59b7);}_0x38e97d[_0x42ef23(0xcb)]=_0x2182fa;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x48aded,_0x18f982){const _0x2fffc8=a112_0x37f2,_0x2352f4=_0x48aded();while(!![]){try{const _0x169b44=-parseInt(_0x2fffc8(0xb5))/0x1+parseInt(_0x2fffc8(0x91))/0x2+-parseInt(_0x2fffc8(0x9b))/0x3+-parseInt(_0x2fffc8(0xa3))/0x4+-parseInt(_0x2fffc8(0x8d))/0x5+-parseInt(_0x2fffc8(0xb0))/0x6+-parseInt(_0x2fffc8(0x9d))/0x7*(-parseInt(_0x2fffc8(0x9c))/0x8);if(_0x169b44===_0x18f982)break;else _0x2352f4['push'](_0x2352f4['shift']());}catch(_0x57dafd){_0x2352f4['push'](_0x2352f4['shift']());}}}(a112_0x11ba,0x9e803));import{buildAllFlags}from'../framework/build-all-flags.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{VERSION,GIT_COMMIT}from'../generated/build-info.js';function a112_0x37f2(_0x3e10df,_0x2526b8){_0x3e10df=_0x3e10df-0x8d;const _0x11ba04=a112_0x11ba();let _0x37f2ef=_0x11ba04[_0x3e10df];return _0x37f2ef;}function serializeFlag(_0x3bf7ea){const _0x439cd7=a112_0x37f2,_0x485408={'name':_0x3bf7ea['name'],'type':_0x3bf7ea['type'],'description':_0x3bf7ea[_0x439cd7(0xa1)]};if(_0x3bf7ea['required']!==undefined)_0x485408['required']=_0x3bf7ea[_0x439cd7(0xa7)];if(_0x3bf7ea[_0x439cd7(0x93)]!==undefined)_0x485408[_0x439cd7(0x93)]=_0x3bf7ea[_0x439cd7(0x93)];if(_0x3bf7ea[_0x439cd7(0x90)]&&_0x3bf7ea[_0x439cd7(0x90)][_0x439cd7(0x96)]>0x0)_0x485408['enum']=_0x3bf7ea[_0x439cd7(0x90)];if(_0x3bf7ea[_0x439cd7(0xb4)])_0x485408[_0x439cd7(0xb4)]=_0x3bf7ea[_0x439cd7(0xb4)];if(_0x3bf7ea[_0x439cd7(0x98)])_0x485408[_0x439cd7(0x98)]=_0x3bf7ea[_0x439cd7(0x98)];return _0x3bf7ea[_0x439cd7(0xa9)]&&(_0x485408[_0x439cd7(0xa9)]={'source':_0x3bf7ea[_0x439cd7(0xa9)][_0x439cd7(0x99)][_0x439cd7(0xa2)],'flags':_0x3bf7ea[_0x439cd7(0xa9)][_0x439cd7(0x99)][_0x439cd7(0xa6)],'description':_0x3bf7ea[_0x439cd7(0xa9)][_0x439cd7(0xa1)]}),_0x485408;}function a112_0x11ba(){const _0x5a745c=['source','5154728PUhgLS','requiresAppCode','args','flags','required','hint','pattern','map','<script>','hasFormat','tag','function','label','2274426ZAngqf','../commands/registry.js','requiresAuth','dryRun','alias','288403FWCYhE','2829295WNFKcW','commands','helpExtra','enum','707782SVbQKB','service','default','push','name','length','trim','hidden','regex','command','961479KQzbWc','482744JNcAYN','364JhVNwI','wildcardDef','defaultCommand','type','description'];a112_0x11ba=function(){return _0x5a745c;};return a112_0x11ba();}function serializeHelpExtra(_0x37c9aa){const _0x513107=a112_0x37f2;if(_0x37c9aa[_0x513107(0x8f)]===undefined)return undefined;if(typeof _0x37c9aa[_0x513107(0x8f)]===_0x513107(0xae))return{'dynamic':!![]};return _0x37c9aa[_0x513107(0x8f)];}function serializeCommand(_0xe172cf,_0x2e575e){const _0x3bdce9=a112_0x37f2,_0x2b1c8f=_0xe172cf[_0x3bdce9(0xb2)]!==![],_0x7f8864=_0xe172cf[_0x3bdce9(0xa4)]!==![],_0x3571c9=_0xe172cf[_0x3bdce9(0xac)]!==![],_0x4ad020=serializeHelpExtra(_0xe172cf);return{'command':_0x2e575e['command'],'description':_0x2e575e['description'],..._0x2e575e[_0x3bdce9(0xad)]?{'tag':_0x2e575e['tag'][_0x3bdce9(0x97)]()}:{},'risk':_0xe172cf['risk'],'requiresAuth':_0x2b1c8f,'requiresAppCode':_0x7f8864,'hasFormat':_0x3571c9,'supportsDryRun':Boolean(_0xe172cf[_0x3bdce9(0xb3)]),..._0xe172cf['args']&&_0xe172cf[_0x3bdce9(0xa5)][_0x3bdce9(0x96)]>0x0?{'args':_0xe172cf[_0x3bdce9(0xa5)]}:{},'flags':buildAllFlags(_0xe172cf)[_0x3bdce9(0xaa)](serializeFlag),..._0x4ad020!==undefined?{'helpExtra':_0x4ad020}:{}};}export async function buildSchemaPayload(){const _0x1ac21d=a112_0x37f2,{serviceRegistry:_0x11300f,findDefinition:_0x1d0c65}=await import(_0x1ac21d(0xb1)),_0x467599=[];for(const _0x550b0c of _0x11300f){const _0x3bce71=[];for(const _0x196784 of _0x550b0c[_0x1ac21d(0x8e)]){const _0x14c707=_0x196784[_0x1ac21d(0x9a)]===_0x1ac21d(0xab)&&_0x550b0c[_0x1ac21d(0x9e)]?_0x550b0c[_0x1ac21d(0x9e)]:_0x1d0c65(_0x550b0c[_0x1ac21d(0x92)],_0x196784[_0x1ac21d(0x9a)]);if(!_0x14c707)continue;_0x3bce71[_0x1ac21d(0x94)](serializeCommand(_0x14c707,_0x196784));}_0x467599['push']({'service':_0x550b0c[_0x1ac21d(0x92)],'label':_0x550b0c[_0x1ac21d(0xaf)],..._0x550b0c['isSingleCommand']?{'isSingleCommand':!![]}:{},..._0x550b0c['defaultCommand']?{'defaultCommand':_0x550b0c[_0x1ac21d(0x9f)]}:{},'hasWildcard':Boolean(_0x550b0c[_0x1ac21d(0x9e)]),'commands':_0x3bce71});}return{'schemaVersion':0x1,'cli':{'bin':CLI_BIN_NAME,'displayName':CLI_DISPLAY_NAME,'version':VERSION,'gitCommit':GIT_COMMIT},'globalFlags':GLOBAL_FLAGS[_0x1ac21d(0xaa)](_0x3f6fa0=>({'name':_0x3f6fa0[_0x1ac21d(0x95)],'type':_0x3f6fa0[_0x1ac21d(0xa0)],'description':_0x3f6fa0['description'],..._0x3f6fa0[_0x1ac21d(0xa8)]?{'hint':_0x3f6fa0[_0x1ac21d(0xa8)]}:{},..._0x3f6fa0[_0x1ac21d(0x98)]?{'hidden':!![]}:{}})),'services':_0x467599};}
|