@lovrabet/lovrabet-cli 2.1.7-beta.1 → 2.1.7-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x526ecf,_0x449a86){const _0x5baea6=a15_0x4363,_0x1e0d54=_0x526ecf();while(!![]){try{const _0x325776=-parseInt(_0x5baea6(0x170))/0x1*(-parseInt(_0x5baea6(0x175))/0x2)+-parseInt(_0x5baea6(0x16f))/0x3*(-parseInt(_0x5baea6(0x17b))/0x4)+-parseInt(_0x5baea6(0x182))/0x5*(-parseInt(_0x5baea6(0x180))/0x6)+-parseInt(_0x5baea6(0x17a))/0x7+parseInt(_0x5baea6(0x177))/0x8*(-parseInt(_0x5baea6(0x17e))/0x9)+parseInt(_0x5baea6(0x171))/0xa+-parseInt(_0x5baea6(0x17c))/0xb;if(_0x325776===_0x449a86)break;else _0x1e0d54['push'](_0x1e0d54['shift']());}catch(_0x58ea94){_0x1e0d54['push'](_0x1e0d54['shift']());}}}(a15_0xb34f,0xcf158));function a15_0x4363(_0x10fa58,_0x3b4299){_0x10fa58=_0x10fa58-0x16d;const _0xb34f8a=a15_0xb34f();let _0x436360=_0xb34f8a[_0x10fa58];return _0x436360;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';function a15_0xb34f(){const _0x35fe3d=['329422VHAfUA','13128610owTakc','project-or-global-explicit','project-default','Add\x20--global\x20to\x20write\x20to\x20~/','10vrBYwK','inProject','2728KiQqGB','\x20init`\x20first.','global','129255Aknxrk','44DflqLi','34211881LbdCQg','project','16452HJdDSk','newConfigFileName','36GLoMgQ','validation','728445ThkVId','global-default','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',',\x20or\x20run\x20`','208935vaMBzQ'];a15_0xb34f=function(){return _0x35fe3d;};return a15_0xb34f();}export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x343c76){const _0x53cc09=a15_0x4363,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x2e6da1}=_0x343c76;if(explicitGlobal&&explicitProject)throw CliErrors[_0x53cc09(0x181)](_0x53cc09(0x16d),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x53cc09(0x179);if(explicitProject)return'project';switch(_0x2e6da1){case _0x53cc09(0x183):return _0x53cc09(0x179);case _0x53cc09(0x173):return _0x343c76[_0x53cc09(0x176)]??isInProject()?_0x53cc09(0x17d):_0x53cc09(0x179);case _0x53cc09(0x172):if(!(_0x343c76[_0x53cc09(0x176)]??isInProject()))throw CliErrors[_0x53cc09(0x181)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG[_0x53cc09(0x17f)]+'\x20found).',_0x53cc09(0x174)+PRODUCT_CONFIG['newConfigFileName']+_0x53cc09(0x16e)+CLI_BIN_NAME+_0x53cc09(0x178));return'project';}}export function toScopeFlags(_0x353ca8){const _0x559b1d=a15_0x4363;return{'global':_0x353ca8===_0x559b1d(0x179)};}export function formatScopeLabel(_0x1aa3bb){const _0x145796=a15_0x4363;return _0x1aa3bb===_0x145796(0x179)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a16_0x3c31(){const _0x4dc92f=['join','735536wmewGE','393034IGPRnk','validation','50aYjMhG','5770170JQtOrO','At\x20least\x20one\x20of\x20','18687UaJaRR','flag','148CFStyr',':\x20expected\x20','Provide\x20one\x20of:\x20','filter','Flags\x20','\x20are\x20mutually\x20exclusive\x20for\x20`','length','\x20is\x20required\x20for\x20`','Only\x20one\x20of\x20','56342vmFCkB','172260wmBHnT','\x20is\x20allowed,\x20found:\x20',',\x20got\x20\x22','453628veldUu'];a16_0x3c31=function(){return _0x4dc92f;};return a16_0x3c31();}(function(_0x3516cb,_0x96b994){const _0x491295=a16_0x5825,_0x2786b9=_0x3516cb();while(!![]){try{const _0x2afde7=-parseInt(_0x491295(0x7f))/0x1+parseInt(_0x491295(0x86))/0x2+-parseInt(_0x491295(0x74))/0x3*(-parseInt(_0x491295(0x76))/0x4)+-parseInt(_0x491295(0x71))/0x5*(-parseInt(_0x491295(0x80))/0x6)+parseInt(_0x491295(0x83))/0x7+parseInt(_0x491295(0x85))/0x8+-parseInt(_0x491295(0x72))/0x9;if(_0x2afde7===_0x96b994)break;else _0x2786b9['push'](_0x2786b9['shift']());}catch(_0x5932e2){_0x2786b9['push'](_0x2786b9['shift']());}}}(a16_0x3c31,0x2a534));import{CliErrors}from'../../errors.js';function isSet(_0x2abff7,_0x297785){const _0x32f5bf=a16_0x5825,_0x1d9022=_0x2abff7[_0x32f5bf(0x75)](_0x297785);return _0x1d9022!==undefined&&_0x1d9022!==''&&_0x1d9022!==![]&&_0x1d9022!==0x0;}function a16_0x5825(_0x5d00eb,_0x26b5eb){_0x5d00eb=_0x5d00eb-0x71;const _0x3c31e0=a16_0x3c31();let _0x5825f9=_0x3c31e0[_0x5d00eb];return _0x5825f9;}function fmtNames(_0x4d39c4){const _0x2e7bf3=a16_0x5825;return _0x4d39c4['map'](_0xc56651=>'--'+_0xc56651)[_0x2e7bf3(0x84)](',\x20');}export function requireOneOf(_0x3ddf2a,_0x1f3b2b,_0x2ab8ef){const _0x4090f8=a16_0x5825,_0x53df99=_0x1f3b2b['filter'](_0x47b0bf=>isSet(_0x3ddf2a,_0x47b0bf));if(_0x53df99['length']!==0x1)throw CliErrors['validation'](_0x53df99[_0x4090f8(0x7c)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x1f3b2b)+_0x4090f8(0x7d)+_0x2ab8ef+'`.':_0x4090f8(0x7e)+fmtNames(_0x1f3b2b)+_0x4090f8(0x81)+fmtNames(_0x53df99)+'.',_0x53df99[_0x4090f8(0x7c)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x1f3b2b):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x5131f8,_0x4a4d1e,_0x2ab364){const _0x26581f=a16_0x5825;if(!_0x4a4d1e['some'](_0x3b390d=>isSet(_0x5131f8,_0x3b390d)))throw CliErrors['validation'](_0x26581f(0x73)+fmtNames(_0x4a4d1e)+_0x26581f(0x7d)+_0x2ab364+'`.',_0x26581f(0x78)+fmtNames(_0x4a4d1e));}export function mutuallyExclusive(_0x1986c4,_0x3df3fb,_0x21d84c){const _0x17cf38=a16_0x5825,_0x337a78=_0x3df3fb[_0x17cf38(0x79)](_0x5332d1=>isSet(_0x1986c4,_0x5332d1));if(_0x337a78[_0x17cf38(0x7c)]>0x1)throw CliErrors[_0x17cf38(0x87)](_0x17cf38(0x7a)+fmtNames(_0x337a78)+_0x17cf38(0x7b)+_0x21d84c+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x3df3fb));}export function validatePattern(_0xa86681,_0xab02ec,_0xf7171,_0x5888f5){const _0x213d3b=a16_0x5825,_0x3efd3d=_0xa86681['str'](_0xab02ec);if(_0x3efd3d&&!_0xf7171['test'](_0x3efd3d))throw CliErrors[_0x213d3b(0x87)]('Invalid\x20--'+_0xab02ec+_0x213d3b(0x77)+_0x5888f5+_0x213d3b(0x82)+_0x3efd3d+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a17_0x4d5c(_0x1e2d15,_0x2cd984){_0x1e2d15=_0x1e2d15-0x11d;const _0xd48cc1=a17_0xd48c();let _0x4d5c15=_0xd48cc1[_0x1e2d15];return _0x4d5c15;}const a17_0x285e13=a17_0x4d5c;(function(_0x1f076e,_0x2ea7b5){const _0xda4f6d=a17_0x4d5c,_0x25c134=_0x1f076e();while(!![]){try{const _0x341e65=parseInt(_0xda4f6d(0x126))/0x1*(parseInt(_0xda4f6d(0x125))/0x2)+parseInt(_0xda4f6d(0x132))/0x3*(-parseInt(_0xda4f6d(0x133))/0x4)+parseInt(_0xda4f6d(0x131))/0x5*(-parseInt(_0xda4f6d(0x12b))/0x6)+parseInt(_0xda4f6d(0x12d))/0x7*(parseInt(_0xda4f6d(0x12a))/0x8)+-parseInt(_0xda4f6d(0x11f))/0x9+parseInt(_0xda4f6d(0x12c))/0xa+parseInt(_0xda4f6d(0x120))/0xb*(parseInt(_0xda4f6d(0x134))/0xc);if(_0x341e65===_0x2ea7b5)break;else _0x25c134['push'](_0x25c134['shift']());}catch(_0x3cf08e){_0x25c134['push'](_0x25c134['shift']());}}}(a17_0xd48c,0xa51af));export const CODE_FLAG={'name':a17_0x285e13(0x123),'type':a17_0x285e13(0x122),'required':!![],'description':a17_0x285e13(0x11e),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x285e13(0x135)}};export const SQLCODE_FLAG={'name':a17_0x285e13(0x12f),'type':'string','required':!![],'description':a17_0x285e13(0x127),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x285e13(0x11d)}};export const VERBOSE_FLAG={'name':a17_0x285e13(0x130),'type':'boolean','description':a17_0x285e13(0x128)};export const PARAMS_FLAG={'name':a17_0x285e13(0x124),'type':a17_0x285e13(0x122),'description':a17_0x285e13(0x12e)};function a17_0xd48c(){const _0x59c045=['1255696hxPdbH','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Return\x20full\x20raw\x20response\x20object','name','72JdSfBU','426vQOrZZ','19640ZyhuJP','606907JjyHRl','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','sqlcode','verbose','72595WJwGxW','240CeZnyi','6328xqrlpc','12IovBxY','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','5092164PpPrAG','3976577bIjORm','Resource\x20ID','string','code','params','2vqWPWD'];a17_0xd48c=function(){return _0x59c045;};return a17_0xd48c();}export const NAME_FLAG={'name':a17_0x285e13(0x129),'type':'string','description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':'number','required':!![],'description':a17_0x285e13(0x121)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x411358=a18_0x50fe;(function(_0x3846db,_0x2e8006){const _0x4453d9=a18_0x50fe,_0x3b420c=_0x3846db();while(!![]){try{const _0x52e960=-parseInt(_0x4453d9(0x122))/0x1*(-parseInt(_0x4453d9(0x12f))/0x2)+-parseInt(_0x4453d9(0x116))/0x3+-parseInt(_0x4453d9(0x120))/0x4+-parseInt(_0x4453d9(0x145))/0x5*(parseInt(_0x4453d9(0x130))/0x6)+-parseInt(_0x4453d9(0x131))/0x7+-parseInt(_0x4453d9(0x147))/0x8+-parseInt(_0x4453d9(0x123))/0x9*(-parseInt(_0x4453d9(0x113))/0xa);if(_0x52e960===_0x2e8006)break;else _0x3b420c['push'](_0x3b420c['shift']());}catch(_0x1344d9){_0x3b420c['push'](_0x3b420c['shift']());}}}(a18_0x2a39,0xd8366));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x411358(0x117),'type':a18_0x411358(0x10c),'description':a18_0x411358(0x110),'default':![]};function parseAliasAppcodeSetKey(_0x2056f9){const _0x289d46=a18_0x411358,_0x3a6260=_0x2056f9[_0x289d46(0x114)]('.');if(_0x3a6260['length']!==0x3||_0x3a6260[0x0]!==_0x289d46(0x13d)||_0x3a6260[0x2]!==_0x289d46(0x148))return undefined;const _0x5376ad=_0x3a6260[0x1]?.[_0x289d46(0x11e)]();return _0x5376ad?_0x5376ad:undefined;}function parseAliasDeleteKey(_0x2fa4bc){const _0x578f4c=a18_0x411358,_0x413bfe=_0x2fa4bc[_0x578f4c(0x114)]('.');if(_0x413bfe[_0x578f4c(0x111)]===0x2&&_0x413bfe[0x0]==='apps'){const _0x2ccb34=_0x413bfe[0x1]?.[_0x578f4c(0x11e)]();return _0x2ccb34?{'alias':_0x2ccb34}:undefined;}if(_0x413bfe[_0x578f4c(0x111)]===0x3&&_0x413bfe[0x0]==='apps'&&_0x413bfe[0x2]===_0x578f4c(0x148)){const _0x352369=_0x413bfe[0x1]?.[_0x578f4c(0x11e)]();return _0x352369?{'alias':_0x352369,'field':'appcode'}:undefined;}return undefined;}function a18_0x2a39(){const _0x733689=['project-or-global-explicit','289884fsCuNG','Set\x20`','251oovtbN','162midXXW','join','stringify','validation','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','object','Missing\x20key\x20argument.','pageSize','raw','Set\x20a\x20config\x20value','field','write','7222cWRJyO','966glUGlc','11987647jjYYjC','\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','alias','`\x20=\x20\x22','Deleted\x20`','format','log','\x20\x20project:\x20','includes','Key\x20not\x20found:\x20','Value\x20to\x20assign','apps','(none)','isArray','Delete\x20a\x20config\x20value','Missing\x20key\x20or\x20value.','read','Top-level\x20key\x20\x22','delete','43405isuphS','Invalid\x20value\x20for\x20\x22','5852232IgtaHX','appcode','config','Config\x20files:\x0a','\x22.\x20Allowed:\x20','boolean','\x20\x20global:\x20\x20','key','get','Write\x20to\x20global\x20config','length','pretty','2914090cJqHol','split','List\x20current\x20config','4055865MwrTnd','global','Key\x20\x22','\x20(global)','bool','set','Usage:\x20','args','trim'];a18_0x2a39=function(){return _0x733689;};return a18_0x2a39();}function setLocalAppAlias(_0x400e17,_0x326777,_0x424e83){const _0x41be55=a18_0x411358,_0x12a885=_0x400e17[_0x41be55(0x13d)]&&typeof _0x400e17[_0x41be55(0x13d)]===_0x41be55(0x128)&&!Array[_0x41be55(0x13f)](_0x400e17['apps'])?_0x400e17[_0x41be55(0x13d)]:{},_0x571878=_0x12a885[_0x326777]&&typeof _0x12a885[_0x326777]===_0x41be55(0x128)&&!Array['isArray'](_0x12a885[_0x326777])?_0x12a885[_0x326777]:{};_0x571878[_0x41be55(0x148)]=_0x424e83,_0x12a885[_0x326777]=_0x571878,_0x400e17['apps']=_0x12a885;}function deleteLocalAppAlias(_0x469f5f,_0x4b0713){const _0x1c5cc5=a18_0x411358;if(!_0x469f5f[_0x1c5cc5(0x13d)]||typeof _0x469f5f[_0x1c5cc5(0x13d)]!==_0x1c5cc5(0x128)||Array[_0x1c5cc5(0x13f)](_0x469f5f[_0x1c5cc5(0x13d)]))return![];const _0x26209a=_0x469f5f['apps'],_0x33cbd1=_0x26209a[_0x4b0713['alias']];if(!_0x33cbd1||typeof _0x33cbd1!==_0x1c5cc5(0x128)||Array[_0x1c5cc5(0x13f)](_0x33cbd1))return![];if(!_0x4b0713[_0x1c5cc5(0x12d)])return delete _0x26209a[_0x4b0713[_0x1c5cc5(0x134)]],!![];if(!(_0x4b0713[_0x1c5cc5(0x12d)]in _0x33cbd1))return![];return delete _0x33cbd1[_0x4b0713[_0x1c5cc5(0x12d)]],Object['keys'](_0x33cbd1)['length']===0x0&&delete _0x26209a[_0x4b0713['alias']],!![];}const listDef={'service':a18_0x411358(0x149),'command':'list','description':a18_0x411358(0x115),'risk':a18_0x411358(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x48ed9e){const _0xcdfc7c=a18_0x411358,{buildConfigFromFlags:_0x39b9c9}=await import('../../context.js'),_0x27a0d9=_0x39b9c9({}),_0x28a0fc=getProjectConfigPath(),_0x4b421c=resolveWriteConfigPath('global');if(_0x48ed9e[_0xcdfc7c(0x137)]===_0xcdfc7c(0x112))return{'ok':!![],'message':_0xcdfc7c(0x127)+(JSON[_0xcdfc7c(0x125)](_0x27a0d9['raw'],null,0x2)+'\x0a\x0a')+_0xcdfc7c(0x14a)+(_0xcdfc7c(0x139)+(_0x28a0fc??_0xcdfc7c(0x13e))+'\x0a')+(_0xcdfc7c(0x10d)+_0x4b421c)};return{'ok':!![],'data':{'effective':_0x27a0d9[_0xcdfc7c(0x12b)],'configFiles':{'project':_0x28a0fc??null,'global':_0x4b421c}}};}},getDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x10f),'description':'Get\x20a\x20config\x20value','risk':a18_0x411358(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x44c167){const _0x3321e4=a18_0x411358,_0x2c5af7=_0x44c167[_0x3321e4(0x11d)][0x0];if(!_0x2c5af7)throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x129),_0x3321e4(0x11c)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x34947c}=await import('../../context.js'),{raw:_0x1ad410}=_0x34947c({});if(_0x2c5af7[_0x3321e4(0x13a)]('.')){const _0x5b7f3e=_0x2c5af7[_0x3321e4(0x114)]('.');let _0x1636fe=_0x1ad410;for(const _0x34ef87 of _0x5b7f3e){if(_0x1636fe==null||typeof _0x1636fe!==_0x3321e4(0x128))throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x13b)+_0x2c5af7);_0x1636fe=_0x1636fe[_0x34ef87];}if(_0x1636fe===undefined)throw CliErrors[_0x3321e4(0x126)]('Key\x20not\x20found:\x20'+_0x2c5af7);return console[_0x3321e4(0x138)](typeof _0x1636fe===_0x3321e4(0x128)?JSON[_0x3321e4(0x125)](_0x1636fe,null,0x2):String(_0x1636fe)),{'ok':!![]};}const _0x4bd98b=_0x1ad410[_0x2c5af7];if(_0x4bd98b===undefined)throw CliErrors[_0x3321e4(0x126)](_0x3321e4(0x13b)+_0x2c5af7);return console['log'](typeof _0x4bd98b===_0x3321e4(0x128)?JSON[_0x3321e4(0x125)](_0x4bd98b,null,0x2):String(_0x4bd98b)),{'ok':!![]};}},setDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x11b),'description':a18_0x411358(0x12c),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':a18_0x411358(0x13c),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x2cccb6){const _0x6e45a4=a18_0x411358,_0x3ae2c7=_0x2cccb6['args'][0x0],_0x292f30=_0x2cccb6[_0x6e45a4(0x11d)][0x1];if(!_0x3ae2c7||_0x292f30===undefined)throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x141),_0x6e45a4(0x11c)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x3ae2c7]&&!ENUM_KEYS[_0x3ae2c7][_0x6e45a4(0x13a)](_0x292f30))throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x146)+_0x3ae2c7+_0x6e45a4(0x14b)+ENUM_KEYS[_0x3ae2c7][_0x6e45a4(0x124)](',\x20'));if(_0x3ae2c7==='riskLevel')throw CliErrors[_0x6e45a4(0x126)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x3ae2c7===_0x6e45a4(0x12a)){const _0xfc523c=Number(_0x292f30);if(isNaN(_0xfc523c)||_0xfc523c<=0x0)throw CliErrors[_0x6e45a4(0x126)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x4a4160=resolveWriteScope({'explicitGlobal':_0x2cccb6[_0x6e45a4(0x11a)]('global'),'policy':'project-or-global-explicit'}),_0x32a618=toScopeFlags(_0x4a4160),_0x5994f9=readScopedConfig(_0x32a618),_0x208fd6=parseAliasAppcodeSetKey(_0x3ae2c7);if(!_0x208fd6&&!isTopLevelConfigKey(_0x3ae2c7))throw CliErrors[_0x6e45a4(0x126)](_0x6e45a4(0x143)+_0x3ae2c7+_0x6e45a4(0x132),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x208fd6?setLocalAppAlias(_0x5994f9,_0x208fd6,_0x292f30):_0x5994f9[_0x3ae2c7]=_0x3ae2c7===_0x6e45a4(0x12a)?Number(_0x292f30):_0x292f30,console[_0x6e45a4(0x138)](_0x6e45a4(0x121)+_0x3ae2c7+_0x6e45a4(0x135)+_0x292f30+'\x22'+(_0x4a4160==='global'?_0x6e45a4(0x119):'')),writeScopedConfig(_0x5994f9,_0x32a618),{'ok':!![]};}},deleteDef={'service':a18_0x411358(0x149),'command':a18_0x411358(0x144),'description':a18_0x411358(0x140),'risk':a18_0x411358(0x12e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x411358(0x10e),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5c763a){const _0x17c38e=a18_0x411358,_0x2abfa7=_0x5c763a[_0x17c38e(0x11d)][0x0];if(!_0x2abfa7)throw CliErrors['validation'](_0x17c38e(0x129),'Usage:\x20'+CLI_BIN_NAME+_0x17c38e(0x133));const _0x74ff5c=resolveWriteScope({'explicitGlobal':_0x5c763a[_0x17c38e(0x11a)](_0x17c38e(0x117)),'policy':_0x17c38e(0x11f)}),_0x5e63e1=toScopeFlags(_0x74ff5c),_0x5c7e5e=readScopedConfig(_0x5e63e1),_0x44d2a5=parseAliasDeleteKey(_0x2abfa7);if(_0x44d2a5){if(!deleteLocalAppAlias(_0x5c7e5e,_0x44d2a5))throw CliErrors[_0x17c38e(0x126)](_0x17c38e(0x13b)+_0x2abfa7);return console[_0x17c38e(0x138)](_0x17c38e(0x136)+_0x2abfa7+'`'+(_0x74ff5c===_0x17c38e(0x117)?'\x20(global)':'')),writeScopedConfig(_0x5c7e5e,_0x5e63e1),{'ok':!![]};}if(_0x5c7e5e[_0x2abfa7]===undefined)throw CliErrors[_0x17c38e(0x126)](_0x17c38e(0x118)+_0x2abfa7+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x5c7e5e[_0x2abfa7],console[_0x17c38e(0x138)](_0x17c38e(0x136)+_0x2abfa7+'`'+(_0x74ff5c==='global'?_0x17c38e(0x119):'')),writeScopedConfig(_0x5c7e5e,_0x5e63e1),{'ok':!![]};}};function a18_0x50fe(_0x4534ad,_0x1be6ca){_0x4534ad=_0x4534ad-0x10c;const _0x2a39a4=a18_0x2a39();let _0x50fe97=_0x2a39a4[_0x4534ad];return _0x50fe97;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x12d69e=a18_0x29ed;(function(_0x1bb339,_0x593002){const _0x4ad898=a18_0x29ed,_0x3e6387=_0x1bb339();while(!![]){try{const _0x177200=-parseInt(_0x4ad898(0xd9))/0x1+parseInt(_0x4ad898(0xd8))/0x2*(-parseInt(_0x4ad898(0xc5))/0x3)+-parseInt(_0x4ad898(0xc6))/0x4+-parseInt(_0x4ad898(0xc8))/0x5+parseInt(_0x4ad898(0xad))/0x6+-parseInt(_0x4ad898(0xe8))/0x7+-parseInt(_0x4ad898(0xe3))/0x8*(-parseInt(_0x4ad898(0xbe))/0x9);if(_0x177200===_0x593002)break;else _0x3e6387['push'](_0x3e6387['shift']());}catch(_0xd315f7){_0x3e6387['push'](_0x3e6387['shift']());}}}(a18_0xaa4c,0x577c3));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x12d69e(0xd0),'type':a18_0x12d69e(0xc1),'description':a18_0x12d69e(0xa7),'default':![]};function parseAliasAppcodeSetKey(_0x15ddef){const _0x7140b5=a18_0x12d69e,_0x3406cd=_0x15ddef[_0x7140b5(0xc9)]('.');if(_0x3406cd[_0x7140b5(0xc2)]!==0x3||_0x3406cd[0x0]!=='apps'||_0x3406cd[0x2]!==_0x7140b5(0xe0))return undefined;const _0x9af9be=_0x3406cd[0x1]?.[_0x7140b5(0xe1)]();return _0x9af9be?_0x9af9be:undefined;}function parseAliasDeleteKey(_0x48633c){const _0x26162c=a18_0x12d69e,_0x5181f3=_0x48633c[_0x26162c(0xc9)]('.');if(_0x5181f3[_0x26162c(0xc2)]===0x2&&_0x5181f3[0x0]===_0x26162c(0xde)){const _0x2f9bbc=_0x5181f3[0x1]?.['trim']();return _0x2f9bbc?{'alias':_0x2f9bbc}:undefined;}if(_0x5181f3['length']===0x3&&_0x5181f3[0x0]==='apps'&&_0x5181f3[0x2]===_0x26162c(0xe0)){const _0x2ddd3c=_0x5181f3[0x1]?.[_0x26162c(0xe1)]();return _0x2ddd3c?{'alias':_0x2ddd3c,'field':_0x26162c(0xe0)}:undefined;}return undefined;}function a18_0x29ed(_0x4f90f5,_0x2879c7){_0x4f90f5=_0x4f90f5-0xa3;const _0xaa4cf1=a18_0xaa4c();let _0x29ede8=_0xaa4cf1[_0x4f90f5];return _0x29ede8;}function setLocalAppAlias(_0x49b738,_0x34a288,_0x173fb2){const _0x3ca080=a18_0x12d69e,_0xa5da91=_0x49b738[_0x3ca080(0xde)]&&typeof _0x49b738[_0x3ca080(0xde)]===_0x3ca080(0xb7)&&!Array[_0x3ca080(0xd6)](_0x49b738['apps'])?_0x49b738['apps']:{},_0x14da4a=_0xa5da91[_0x34a288]&&typeof _0xa5da91[_0x34a288]==='object'&&!Array['isArray'](_0xa5da91[_0x34a288])?_0xa5da91[_0x34a288]:{};_0x14da4a[_0x3ca080(0xe0)]=_0x173fb2,_0xa5da91[_0x34a288]=_0x14da4a,_0x49b738[_0x3ca080(0xde)]=_0xa5da91;}function deleteLocalAppAlias(_0x171ecb,_0x366f5e){const _0x4eb865=a18_0x12d69e;if(!_0x171ecb['apps']||typeof _0x171ecb['apps']!=='object'||Array[_0x4eb865(0xd6)](_0x171ecb[_0x4eb865(0xde)]))return![];const _0x1aff25=_0x171ecb[_0x4eb865(0xde)],_0x81629b=_0x1aff25[_0x366f5e['alias']];if(!_0x81629b||typeof _0x81629b!==_0x4eb865(0xb7)||Array[_0x4eb865(0xd6)](_0x81629b))return![];if(!_0x366f5e[_0x4eb865(0xcf)])return delete _0x1aff25[_0x366f5e[_0x4eb865(0xa6)]],!![];if(!(_0x366f5e[_0x4eb865(0xcf)]in _0x81629b))return![];return delete _0x81629b[_0x366f5e[_0x4eb865(0xcf)]],Object['keys'](_0x81629b)[_0x4eb865(0xc2)]===0x0&&delete _0x1aff25[_0x366f5e[_0x4eb865(0xa6)]],!![];}const listDef={'service':a18_0x12d69e(0xd3),'command':a18_0x12d69e(0xc3),'description':a18_0x12d69e(0xac),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x48f746){const _0xb5da0a=a18_0x12d69e,{buildConfigFromFlags:_0x58484e}=await import(_0xb5da0a(0xb0)),_0x5f2625=_0x58484e({}),_0xacca94=getProjectConfigPath(),_0x1d24b8=resolveWriteConfigPath(_0xb5da0a(0xd0));if(_0x48f746[_0xb5da0a(0xaf)]===_0xb5da0a(0xb1))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON['stringify'](_0x5f2625['raw'],null,0x2)+'\x0a\x0a')+_0xb5da0a(0xda)+(_0xb5da0a(0xe5)+(_0xacca94??_0xb5da0a(0xb5))+'\x0a')+(_0xb5da0a(0xc0)+_0x1d24b8)};return{'ok':!![],'data':{'effective':_0x5f2625[_0xb5da0a(0xa8)],'configFiles':{'project':_0xacca94??null,'global':_0x1d24b8}}};}},getDef={'service':a18_0x12d69e(0xd3),'command':a18_0x12d69e(0xb9),'description':a18_0x12d69e(0xbd),'risk':a18_0x12d69e(0xd2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a18_0x12d69e(0xe7),'required':!![]}],'flags':[],async 'execute'(_0x496088){const _0xf4bd6f=a18_0x12d69e,_0x3a85ba=_0x496088['args'][0x0];if(!_0x3a85ba)throw CliErrors[_0xf4bd6f(0xe4)](_0xf4bd6f(0xbc),_0xf4bd6f(0xc7)+CLI_BIN_NAME+_0xf4bd6f(0xb8));const {buildConfigFromFlags:_0x21de06}=await import(_0xf4bd6f(0xb0)),{raw:_0x412c97}=_0x21de06({});if(_0x3a85ba[_0xf4bd6f(0xb6)]('.')){const _0x3a1a98=_0x3a85ba[_0xf4bd6f(0xc9)]('.');let _0x4ccf73=_0x412c97;for(const _0x82a98d of _0x3a1a98){if(_0x4ccf73==null||typeof _0x4ccf73!==_0xf4bd6f(0xb7))throw CliErrors[_0xf4bd6f(0xe4)](_0xf4bd6f(0xcd)+_0x3a85ba);_0x4ccf73=_0x4ccf73[_0x82a98d];}if(_0x4ccf73===undefined)throw CliErrors[_0xf4bd6f(0xe4)](_0xf4bd6f(0xcd)+_0x3a85ba);return console[_0xf4bd6f(0xd4)](typeof _0x4ccf73===_0xf4bd6f(0xb7)?JSON[_0xf4bd6f(0xa3)](_0x4ccf73,null,0x2):String(_0x4ccf73)),{'ok':!![]};}const _0x159b9f=_0x412c97[_0x3a85ba];if(_0x159b9f===undefined)throw CliErrors[_0xf4bd6f(0xe4)](_0xf4bd6f(0xcd)+_0x3a85ba);return console['log'](typeof _0x159b9f===_0xf4bd6f(0xb7)?JSON['stringify'](_0x159b9f,null,0x2):String(_0x159b9f)),{'ok':!![]};}},setDef={'service':a18_0x12d69e(0xd3),'command':a18_0x12d69e(0xd1),'description':'Set\x20a\x20config\x20value','risk':a18_0x12d69e(0xcc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x12d69e(0xb4),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x12d69e(0xdb),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x58046d){const _0x2e3932=a18_0x12d69e,_0x4f1a69=_0x58046d[_0x2e3932(0xaa)][0x0],_0x50cc36=_0x58046d[_0x2e3932(0xaa)][0x1];if(!_0x4f1a69||_0x50cc36===undefined)throw CliErrors[_0x2e3932(0xe4)](_0x2e3932(0xbb),_0x2e3932(0xc7)+CLI_BIN_NAME+_0x2e3932(0xb3));if(ENUM_KEYS[_0x4f1a69]&&!ENUM_KEYS[_0x4f1a69][_0x2e3932(0xb6)](_0x50cc36))throw CliErrors[_0x2e3932(0xe4)](_0x2e3932(0xb2)+_0x4f1a69+_0x2e3932(0xce)+ENUM_KEYS[_0x4f1a69][_0x2e3932(0xc4)](',\x20'));if(_0x4f1a69===_0x2e3932(0xa4))throw CliErrors[_0x2e3932(0xe4)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x4f1a69===_0x2e3932(0xa5)){const _0x423791=Number(_0x50cc36);if(isNaN(_0x423791)||_0x423791<=0x0)throw CliErrors[_0x2e3932(0xe4)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x12f6b8=resolveWriteScope({'explicitGlobal':_0x58046d[_0x2e3932(0xbf)]('global'),'policy':_0x2e3932(0xdd)}),_0x54c5fb=toScopeFlags(_0x12f6b8),_0x20922e=readScopedConfig(_0x54c5fb),_0x15a7d8=parseAliasAppcodeSetKey(_0x4f1a69);if(!_0x15a7d8&&!isTopLevelConfigKey(_0x4f1a69))throw CliErrors[_0x2e3932(0xe4)](_0x2e3932(0xe2)+_0x4f1a69+_0x2e3932(0xd5),_0x2e3932(0xae)+getTopLevelConfigKeySummary()+_0x2e3932(0xa9));return _0x15a7d8?setLocalAppAlias(_0x20922e,_0x15a7d8,_0x50cc36):_0x20922e[_0x4f1a69]=_0x4f1a69===_0x2e3932(0xa5)?Number(_0x50cc36):_0x50cc36,console[_0x2e3932(0xd4)](_0x2e3932(0xab)+_0x4f1a69+_0x2e3932(0xe6)+_0x50cc36+'\x22'+(_0x12f6b8===_0x2e3932(0xd0)?'\x20(global)':'')),writeScopedConfig(_0x20922e,_0x54c5fb),{'ok':!![]};}},deleteDef={'service':a18_0x12d69e(0xd3),'command':a18_0x12d69e(0xcb),'description':a18_0x12d69e(0xdf),'risk':a18_0x12d69e(0xcc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x549491){const _0x45e90b=a18_0x12d69e,_0x32a473=_0x549491[_0x45e90b(0xaa)][0x0];if(!_0x32a473)throw CliErrors['validation'](_0x45e90b(0xbc),_0x45e90b(0xc7)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x11f350=resolveWriteScope({'explicitGlobal':_0x549491[_0x45e90b(0xbf)]('global'),'policy':_0x45e90b(0xdd)}),_0xf6864c=toScopeFlags(_0x11f350),_0x2da6d7=readScopedConfig(_0xf6864c),_0x1449d9=parseAliasDeleteKey(_0x32a473);if(_0x1449d9){if(!deleteLocalAppAlias(_0x2da6d7,_0x1449d9))throw CliErrors[_0x45e90b(0xe4)](_0x45e90b(0xcd)+_0x32a473);return console['log']('Deleted\x20`'+_0x32a473+'`'+(_0x11f350===_0x45e90b(0xd0)?_0x45e90b(0xba):'')),writeScopedConfig(_0x2da6d7,_0xf6864c),{'ok':!![]};}if(_0x2da6d7[_0x32a473]===undefined)throw CliErrors[_0x45e90b(0xe4)](_0x45e90b(0xd7)+_0x32a473+_0x45e90b(0xdc));return delete _0x2da6d7[_0x32a473],console['log'](_0x45e90b(0xca)+_0x32a473+'`'+(_0x11f350===_0x45e90b(0xd0)?_0x45e90b(0xba):'')),writeScopedConfig(_0x2da6d7,_0xf6864c),{'ok':!![]};}};function a18_0xaa4c(){const _0x1baf5f=['global','set','read','config','log','\x22\x20is\x20not\x20settable.','isArray','Key\x20\x22','4yIWMsj','657861wCHdYI','Config\x20files:\x0a','value','\x22\x20not\x20found\x20at\x20top\x20level.','project-or-global-explicit','apps','Delete\x20a\x20config\x20value','appcode','trim','Top-level\x20key\x20\x22','89368CNIKRv','validation','\x20\x20project:\x20','`\x20=\x20\x22','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','1467438eIhMMe','stringify','riskLevel','pageSize','alias','Write\x20to\x20global\x20config','raw',';\x20apps.<alias>.appcode','args','Set\x20`','List\x20current\x20config','2812176NjiCHV','Settable\x20keys:\x20','format','../../context.js','pretty','Invalid\x20value\x20for\x20\x22','\x20config\x20set\x20<key>\x20<value>\x20[--global]','key','(none)','includes','object','\x20config\x20get\x20<key>','get','\x20(global)','Missing\x20key\x20or\x20value.','Missing\x20key\x20argument.','Get\x20a\x20config\x20value','1206GeCzTd','bool','\x20\x20global:\x20\x20','boolean','length','list','join','752943wFBAhP','102404ucVDAg','Usage:\x20','1061065POPyAH','split','Deleted\x20`','delete','write','Key\x20not\x20found:\x20','\x22.\x20Allowed:\x20','field'];a18_0xaa4c=function(){return _0x1baf5f;};return a18_0xaa4c();}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c409a,_0x4fede5){var _0x37f700=a19_0x28b8,_0x313419=_0x4c409a();while(!![]){try{var _0x554fd0=-parseInt(_0x37f700(0x1ed))/0x1+parseInt(_0x37f700(0x1eb))/0x2*(parseInt(_0x37f700(0x1f1))/0x3)+parseInt(_0x37f700(0x1f3))/0x4*(parseInt(_0x37f700(0x1ee))/0x5)+parseInt(_0x37f700(0x1ec))/0x6*(-parseInt(_0x37f700(0x1f4))/0x7)+parseInt(_0x37f700(0x1f2))/0x8*(-parseInt(_0x37f700(0x1f0))/0x9)+parseInt(_0x37f700(0x1ea))/0xa+parseInt(_0x37f700(0x1ef))/0xb;if(_0x554fd0===_0x4fede5)break;else _0x313419['push'](_0x313419['shift']());}catch(_0x33f312){_0x313419['push'](_0x313419['shift']());}}}(a19_0x3acb,0x83418));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a19_0x3acb(){var _0x58c7fd=['2kcxHpJ','258fujsAG','449050jsFGmU','2038265aOvfHS','6828283CNnDJn','657Ijnusw','211683wsIFur','56480SBXkhb','8VWaXua','52955kSggUH','3207290IkruCd'];a19_0x3acb=function(){return _0x58c7fd;};return a19_0x3acb();}export{readScopedConfig,writeScopedConfig}from'../../context.js';function a19_0x28b8(_0x4cdb23,_0x58a805){_0x4cdb23=_0x4cdb23-0x1ea;var _0x3acb25=a19_0x3acb();var _0x28b8ac=_0x3acb25[_0x4cdb23];return _0x28b8ac;}export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a20_0xf43b(){const _0xd151a7=['join','/api/{appCode}/','operation','502372MiMVjp','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','batchCreate','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','map','data\x20','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','str','5CahmJI','1293422GyTxIJ','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','data','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','read','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','aggregate','build','write','Preview:\x20data\x20','8635635HYKSna','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','162oSnmyy','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','create','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','update','7260953ZDSnZy','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','delete','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','paramsRequired','helpExtra','risk','filter','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20EXAMPLES','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20WHERE\x20OPERATORS','getOne','\x20completed\x20in\x20','\x20\x20PARAMS\x20STRUCTURE','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','POST','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20LOGICAL\x20COMBINATORS','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','8NtUXSl','command','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','2456660iVRTjV','now','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','5724654KYqLzu','code','dryRun','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','55096MiyTYx','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','params','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Update\x20an\x20existing\x20record','\x20\x20AGGREGATE\x20TYPES'];a20_0xf43b=function(){return _0xd151a7;};return a20_0xf43b();}const a20_0x5e8073=a20_0x580e;(function(_0x22703c,_0x214d19){const _0x5359de=a20_0x580e,_0x32a420=_0x22703c();while(!![]){try{const _0x109806=parseInt(_0x5359de(0x1a1))/0x1+-parseInt(_0x5359de(0x198))/0x2+parseInt(_0x5359de(0x15d))/0x3*(parseInt(_0x5359de(0x18b))/0x4)+parseInt(_0x5359de(0x1a0))/0x5*(-parseInt(_0x5359de(0x184))/0x6)+parseInt(_0x5359de(0x165))/0x7*(parseInt(_0x5359de(0x17c))/0x8)+-parseInt(_0x5359de(0x15b))/0x9+-parseInt(_0x5359de(0x181))/0xa;if(_0x109806===_0x214d19)break;else _0x32a420['push'](_0x32a420['shift']());}catch(_0xb10e37){_0x32a420['push'](_0x32a420['shift']());}}}(a20_0xf43b,0xa21d5));import{executeData}from'../../core/sdk-client.js';function a20_0x580e(_0x6a047,_0x532b16){_0x6a047=_0x6a047-0x150;const _0xf43b0f=a20_0xf43b();let _0x580e5c=_0xf43b0f[_0x6a047];return _0x580e5c;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a20_0x5e8073(0x16c),'operation':a20_0x5e8073(0x16c),'risk':a20_0x5e8073(0x154),'paramsRequired':![],'description':a20_0x5e8073(0x150),'paramsHint':a20_0x5e8073(0x155)+a20_0x5e8073(0x19e),'helpExtra':[a20_0x5e8073(0x171),a20_0x5e8073(0x191),a20_0x5e8073(0x187),a20_0x5e8073(0x177),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a20_0x5e8073(0x1a4),a20_0x5e8073(0x178),a20_0x5e8073(0x15e),a20_0x5e8073(0x1a3),a20_0x5e8073(0x188),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a20_0x5e8073(0x179),'\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a20_0x5e8073(0x17e),a20_0x5e8073(0x17b),a20_0x5e8073(0x15c),a20_0x5e8073(0x1a2),a20_0x5e8073(0x180),'','\x20\x20PAGINATION',a20_0x5e8073(0x162),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x5e8073(0x17f)][a20_0x5e8073(0x195)]('\x0a')},{'command':a20_0x5e8073(0x172),'operation':a20_0x5e8073(0x172),'risk':a20_0x5e8073(0x154),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x5e8073(0x189)},{'command':a20_0x5e8073(0x160),'operation':a20_0x5e8073(0x160),'risk':a20_0x5e8073(0x159),'paramsRequired':!![],'description':a20_0x5e8073(0x153),'paramsHint':a20_0x5e8073(0x199)},{'command':'batchCreate','operation':a20_0x5e8073(0x19a),'risk':'write','paramsRequired':!![],'description':a20_0x5e8073(0x156),'paramsHint':a20_0x5e8073(0x168)},{'command':a20_0x5e8073(0x164),'operation':a20_0x5e8073(0x164),'risk':'write','paramsRequired':!![],'description':a20_0x5e8073(0x193),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a20_0x5e8073(0x167),'operation':a20_0x5e8073(0x167),'risk':'high-risk-write','paramsRequired':!![],'description':a20_0x5e8073(0x17a),'paramsHint':a20_0x5e8073(0x189)},{'command':a20_0x5e8073(0x157),'operation':'aggregate','risk':'read','paramsRequired':![],'description':a20_0x5e8073(0x18c),'paramsHint':a20_0x5e8073(0x15f)+a20_0x5e8073(0x175),'helpExtra':[a20_0x5e8073(0x194),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}',a20_0x5e8073(0x161),a20_0x5e8073(0x18e),a20_0x5e8073(0x16f),a20_0x5e8073(0x18d),'\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a20_0x5e8073(0x174),a20_0x5e8073(0x170),a20_0x5e8073(0x183),a20_0x5e8073(0x151),a20_0x5e8073(0x166),a20_0x5e8073(0x18f),a20_0x5e8073(0x18a),'',a20_0x5e8073(0x16e),a20_0x5e8073(0x163),a20_0x5e8073(0x16d),'',a20_0x5e8073(0x192),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x5e8073(0x19b)][a20_0x5e8073(0x195)]('\x0a')}];function makeDataCommand(_0x1de73e){const _0x50f95d=a20_0x5e8073,_0x15a17e=_0x50f95d(0x19d)+_0x1de73e[_0x50f95d(0x17d)],_0x35962d={'service':_0x50f95d(0x152),'command':_0x1de73e[_0x50f95d(0x17d)],'description':_0x1de73e['description'],'risk':_0x1de73e['risk'],'helpExtra':_0x1de73e[_0x50f95d(0x16a)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x1de73e['paramsHint']}],'validate':async _0x294c6c=>{const _0x3ed456=_0x50f95d;_0x1de73e[_0x3ed456(0x169)]&&requireAnyOf(_0x294c6c,[_0x3ed456(0x190)],_0x15a17e),_0x1de73e['operation']===_0x3ed456(0x19a)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x294c6c[_0x3ed456(0x19f)](_0x3ed456(0x190))));},async 'execute'(_0xdf80df){const _0xdb6470=_0x50f95d,_0x36ce25=_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x185)),_0x4a1cfb=_0x1de73e[_0xdb6470(0x197)]===_0xdb6470(0x19a)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x190)))):parseJsonParams(_0xdf80df[_0xdb6470(0x19f)](_0xdb6470(0x190)))??{},_0x309aa7=Date['now'](),_0x5c595e=await executeData(_0x36ce25,_0x1de73e[_0xdb6470(0x197)],_0x4a1cfb),_0x2d7795=Date[_0xdb6470(0x182)]()-_0x309aa7;return{'ok':!![],'data':{'result':_0x5c595e,'elapsed':_0x2d7795},'message':_0xdb6470(0x19d)+_0x1de73e[_0xdb6470(0x17d)]+_0xdb6470(0x173)+_0x2d7795+'ms'};}};return _0x1de73e[_0x50f95d(0x16b)]!==_0x50f95d(0x154)&&(_0x35962d[_0x50f95d(0x186)]=async _0x2d3271=>{const _0x4eccf1=_0x50f95d,_0x2da736=_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x185)),_0x2834f4=_0x1de73e['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x190)))):parseJsonParams(_0x2d3271[_0x4eccf1(0x19f)](_0x4eccf1(0x190)))??{};return dryRun(_0x4eccf1(0x176),_0x4eccf1(0x196)+_0x2da736+'/'+_0x1de73e[_0x4eccf1(0x197)])['body'](_0x2834f4)['description'](_0x4eccf1(0x15a)+_0x1de73e['command']+'\x20on\x20dataset\x20'+_0x2da736)[_0x4eccf1(0x158)]();}),_0x35962d;}export const dataDefinitions=specs[a20_0x5e8073(0x19c)](makeDataCommand);
|
|
1
|
+
const a20_0x4dd2b9=a20_0x208c;(function(_0x49ef40,_0x35f97b){const _0x2c8996=a20_0x208c,_0xa8974d=_0x49ef40();while(!![]){try{const _0x54a835=-parseInt(_0x2c8996(0x85))/0x1+parseInt(_0x2c8996(0x8d))/0x2+parseInt(_0x2c8996(0xc0))/0x3+-parseInt(_0x2c8996(0xb7))/0x4+-parseInt(_0x2c8996(0xcc))/0x5+-parseInt(_0x2c8996(0x8e))/0x6*(-parseInt(_0x2c8996(0xb0))/0x7)+parseInt(_0x2c8996(0xbd))/0x8*(parseInt(_0x2c8996(0xba))/0x9);if(_0x54a835===_0x35f97b)break;else _0xa8974d['push'](_0xa8974d['shift']());}catch(_0x4b1d45){_0xa8974d['push'](_0xa8974d['shift']());}}}(a20_0x23df,0x7921f));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a20_0x23df(){const _0xa6ee11=['write','Preview:\x20data\x20','\x20completed\x20in\x20','Update\x20an\x20existing\x20record','helpExtra','build','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','body','delete','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','operation','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','code','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','now','description','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','filter','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20AGGREGATE\x20TYPES','28bcUwiL','getOne','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20PARAMS\x20STRUCTURE','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','3677796PzQhQU','update','\x20on\x20dataset\x20','1989693QZMuRE','params','high-risk-write','56uXPkJu','join','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','1280775AkwLML','paramsRequired','dryRun','create','risk','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','str','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','data','\x20\x20PAGINATION','3588785KHYBTn','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','/api/{appCode}/','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','read','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','POST','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','927100sbhbbd','aggregate','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','batchCreate','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','201178ohYGKA','1478118rwjzJK','command','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','map','data\x20','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}'];a20_0x23df=function(){return _0xa6ee11;};return a20_0x23df();}const specs=[{'command':a20_0x4dd2b9(0xad),'operation':a20_0x4dd2b9(0xad),'risk':a20_0x4dd2b9(0x81),'paramsRequired':![],'description':a20_0x4dd2b9(0x9a),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a20_0x4dd2b9(0x87),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a20_0x4dd2b9(0xb6),a20_0x4dd2b9(0xbf),'\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}',a20_0x4dd2b9(0xc8),a20_0x4dd2b9(0x93),a20_0x4dd2b9(0xa8),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}',a20_0x4dd2b9(0x82),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}',a20_0x4dd2b9(0xcf),'',a20_0x4dd2b9(0xae),a20_0x4dd2b9(0x80),a20_0x4dd2b9(0x7e),'',a20_0x4dd2b9(0x9b),a20_0x4dd2b9(0xac),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a20_0x4dd2b9(0xa1),'',a20_0x4dd2b9(0xcb),a20_0x4dd2b9(0xc5),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x4dd2b9(0x8c)]['join']('\x0a')},{'command':a20_0x4dd2b9(0xb1),'operation':'getOne','risk':a20_0x4dd2b9(0x81),'paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a20_0x4dd2b9(0xb4)},{'command':a20_0x4dd2b9(0xc3),'operation':a20_0x4dd2b9(0xc3),'risk':a20_0x4dd2b9(0x94),'paramsRequired':!![],'description':a20_0x4dd2b9(0xc6),'paramsHint':a20_0x4dd2b9(0x9e)},{'command':a20_0x4dd2b9(0x8b),'operation':a20_0x4dd2b9(0x8b),'risk':a20_0x4dd2b9(0x94),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a20_0x4dd2b9(0xb2)},{'command':a20_0x4dd2b9(0xb8),'operation':'update','risk':a20_0x4dd2b9(0x94),'paramsRequired':!![],'description':a20_0x4dd2b9(0x97),'paramsHint':a20_0x4dd2b9(0x84)},{'command':a20_0x4dd2b9(0xa3),'operation':'delete','risk':a20_0x4dd2b9(0xbc),'paramsRequired':!![],'description':a20_0x4dd2b9(0x88),'paramsHint':a20_0x4dd2b9(0xb4)},{'command':a20_0x4dd2b9(0x86),'operation':'aggregate','risk':a20_0x4dd2b9(0x81),'paramsRequired':![],'description':a20_0x4dd2b9(0xb5),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a20_0x4dd2b9(0x90),'helpExtra':[a20_0x4dd2b9(0xaf),a20_0x4dd2b9(0xa6),a20_0x4dd2b9(0x9d),a20_0x4dd2b9(0xab),a20_0x4dd2b9(0xc9),a20_0x4dd2b9(0x8a),'\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a20_0x4dd2b9(0xb3),a20_0x4dd2b9(0x7f),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a20_0x4dd2b9(0xa0),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','','\x20\x20EXAMPLES',a20_0x4dd2b9(0xcd),a20_0x4dd2b9(0xa4),'',a20_0x4dd2b9(0x9c),a20_0x4dd2b9(0x9f),'','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a20_0x4dd2b9(0xbe)]('\x0a')}];function a20_0x208c(_0x489398,_0x96807a){_0x489398=_0x489398-0x7e;const _0x23df18=a20_0x23df();let _0x208c1b=_0x23df18[_0x489398];return _0x208c1b;}function makeDataCommand(_0x3a36c7){const _0x1dc6bc=a20_0x4dd2b9,_0x3be681=_0x1dc6bc(0x92)+_0x3a36c7['command'],_0xd3b919={'service':_0x1dc6bc(0xca),'command':_0x3a36c7[_0x1dc6bc(0x8f)],'description':_0x3a36c7[_0x1dc6bc(0xaa)],'risk':_0x3a36c7[_0x1dc6bc(0xc4)],'helpExtra':_0x3a36c7[_0x1dc6bc(0x98)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x3a36c7[_0x1dc6bc(0x89)]}],'validate':async _0x2a6fc1=>{const _0xcedfc4=_0x1dc6bc;_0x3a36c7[_0xcedfc4(0xc1)]&&requireAnyOf(_0x2a6fc1,[_0xcedfc4(0xbb)],_0x3be681),_0x3a36c7['operation']===_0xcedfc4(0x8b)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2a6fc1[_0xcedfc4(0xc7)](_0xcedfc4(0xbb))));},async 'execute'(_0x5be779){const _0x515050=_0x1dc6bc,_0x29eda1=_0x5be779['str'](_0x515050(0xa7)),_0x1ccd73=_0x3a36c7[_0x515050(0xa5)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5be779[_0x515050(0xc7)](_0x515050(0xbb)))):parseJsonParams(_0x5be779[_0x515050(0xc7)](_0x515050(0xbb)))??{},_0x3b7e3e=Date[_0x515050(0xa9)](),_0x41873e=await executeData(_0x29eda1,_0x3a36c7[_0x515050(0xa5)],_0x1ccd73),_0x57b62a=Date[_0x515050(0xa9)]()-_0x3b7e3e;return{'ok':!![],'data':{'result':_0x41873e,'elapsed':_0x57b62a},'message':_0x515050(0x92)+_0x3a36c7[_0x515050(0x8f)]+_0x515050(0x96)+_0x57b62a+'ms'};}};return _0x3a36c7['risk']!==_0x1dc6bc(0x81)&&(_0xd3b919[_0x1dc6bc(0xc2)]=async _0x3af025=>{const _0x3b85bc=_0x1dc6bc,_0x1c58b9=_0x3af025[_0x3b85bc(0xc7)](_0x3b85bc(0xa7)),_0x48626a=_0x3a36c7[_0x3b85bc(0xa5)]===_0x3b85bc(0x8b)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3af025[_0x3b85bc(0xc7)]('params'))):parseJsonParams(_0x3af025['str'](_0x3b85bc(0xbb)))??{};return dryRun(_0x3b85bc(0x83),_0x3b85bc(0xce)+_0x1c58b9+'/'+_0x3a36c7[_0x3b85bc(0xa5)])[_0x3b85bc(0xa2)](_0x48626a)[_0x3b85bc(0xaa)](_0x3b85bc(0x95)+_0x3a36c7['command']+_0x3b85bc(0xb9)+_0x1c58b9)[_0x3b85bc(0x99)]();}),_0xd3b919;}export const dataDefinitions=specs[a20_0x4dd2b9(0x91)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x867ef8=a21_0x4eda;(function(_0x1f9aed,_0x5065fa){const _0x37eae3=a21_0x4eda,_0xb403c6=_0x1f9aed();while(!![]){try{const _0x22b708=parseInt(_0x37eae3(0x1c4))/0x1+parseInt(_0x37eae3(0x1c9))/0x2+-parseInt(_0x37eae3(0x1d7))/0x3*(-parseInt(_0x37eae3(0x1da))/0x4)+parseInt(_0x37eae3(0x1ee))/0x5*(parseInt(_0x37eae3(0x1b2))/0x6)+parseInt(_0x37eae3(0x1be))/0x7*(parseInt(_0x37eae3(0x1d5))/0x8)+parseInt(_0x37eae3(0x1b1))/0x9*(-parseInt(_0x37eae3(0x1ec))/0xa)+-parseInt(_0x37eae3(0x1c5))/0xb;if(_0x22b708===_0x5065fa)break;else _0xb403c6['push'](_0xb403c6['shift']());}catch(_0x1f6359){_0xb403c6['push'](_0xb403c6['shift']());}}}(a21_0x1839,0x8d6a1));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x307e59){const _0x53e0f9=a21_0x4eda;if(_0x307e59[_0x53e0f9(0x1dd)])return null;const _0x2b8e35=Boolean(_0x307e59[_0x53e0f9(0x1de)]!==undefined||_0x307e59[_0x53e0f9(0x1b0)]!==undefined);let _0x31db0e={};if(!_0x2b8e35&&typeof _0x307e59['extend']===_0x53e0f9(0x1cd))try{_0x31db0e=JSON[_0x53e0f9(0x1e7)](_0x307e59[_0x53e0f9(0x1aa)]);}catch{}const _0x3cad90=_0x2b8e35?_0x307e59[_0x53e0f9(0x1d0)]:_0x307e59[_0x53e0f9(0x1d6)],_0x23bf1d=_0x2b8e35?_0x307e59[_0x53e0f9(0x1de)]:_0x307e59[_0x53e0f9(0x1d0)],_0x56d093=_0x2b8e35?_0x307e59[_0x53e0f9(0x1b0)]:_0x307e59[_0x53e0f9(0x1db)]||_0x307e59['dataType'],_0x5ad394=_0x2b8e35?_0x307e59[_0x53e0f9(0x1b5)]===!![]:_0x31db0e['pkField']===!![],_0x2b5be5=_0x2b8e35?_0x307e59[_0x53e0f9(0x1c8)]===!![]:_0x31db0e['required']===!![],_0xcb4120=_0x2b8e35?_0x307e59['options']??null:_0x31db0e[_0x53e0f9(0x1d4)]??null,_0x20a13e={'name':_0x3cad90,'displayName':_0x23bf1d||_0x3cad90,'type':_0x56d093,'dbType':_0x307e59[_0x53e0f9(0x1bb)],'pk':_0x5ad394,'required':_0x2b5be5,'description':_0x307e59[_0x53e0f9(0x1b3)]||undefined};return Array[_0x53e0f9(0x1a7)](_0xcb4120)&&_0xcb4120['length']>0x0&&(_0x20a13e['options']=_0xcb4120),_0x20a13e;}function parseJsonMaybe(_0x415238){const _0x4f7406=a21_0x4eda;if(typeof _0x415238!==_0x4f7406(0x1cd))return _0x415238;try{return JSON[_0x4f7406(0x1e7)](_0x415238);}catch{return _0x415238;}}function normalizeOperationEntry(_0x44a053,_0x4d4097){const _0x8f599b=a21_0x4eda;if(!_0x4d4097||typeof _0x4d4097!==_0x8f599b(0x1ea))return null;if(!_0x4d4097[_0x8f599b(0x1ca)]||!_0x4d4097[_0x8f599b(0x1c0)])return null;const _0x217ab9={'name':_0x44a053,'method':_0x4d4097[_0x8f599b(0x1ca)],'path':_0x4d4097[_0x8f599b(0x1c0)]};if(_0x4d4097[_0x8f599b(0x1a9)])_0x217ab9[_0x8f599b(0x1a9)]=_0x4d4097[_0x8f599b(0x1a9)];if(_0x4d4097[_0x8f599b(0x1cb)]!=null)_0x217ab9[_0x8f599b(0x1cb)]=parseJsonMaybe(_0x4d4097[_0x8f599b(0x1cb)]);if(_0x4d4097[_0x8f599b(0x1b8)]!=null)_0x217ab9['responseBody']=parseJsonMaybe(_0x4d4097[_0x8f599b(0x1b8)]);if(_0x4d4097[_0x8f599b(0x1e4)]!=null)_0x217ab9['beforeScriptId']=_0x4d4097['beforeScriptId'];if(_0x4d4097['afterScriptId']!=null)_0x217ab9['afterScriptId']=_0x4d4097[_0x8f599b(0x1e0)];if(Array['isArray'](_0x4d4097[_0x8f599b(0x1ac)]))_0x217ab9['requestFields']=_0x4d4097[_0x8f599b(0x1ac)];if(Array[_0x8f599b(0x1a7)](_0x4d4097[_0x8f599b(0x1ab)]))_0x217ab9[_0x8f599b(0x1ab)]=_0x4d4097[_0x8f599b(0x1ab)];return _0x217ab9;}function summarizeDbtable(_0x71d0bd){const _0x47266b=a21_0x4eda,_0x3a67c1={},_0xef16b=['dbId',_0x47266b(0x1e3),_0x47266b(0x1e1),_0x47266b(0x1dc),'pkField',_0x47266b(0x1c3),_0x47266b(0x1cf),_0x47266b(0x1c1),_0x47266b(0x1bd),_0x47266b(0x1b6),_0x47266b(0x1bf),_0x47266b(0x1eb),_0x47266b(0x1ed),'labelField',_0x47266b(0x1e8)];for(const _0x2dfd8d of _0xef16b){if(_0x71d0bd[_0x2dfd8d]!==undefined)_0x3a67c1[_0x2dfd8d]=_0x71d0bd[_0x2dfd8d];}return typeof _0x3a67c1[_0x47266b(0x1c3)]===_0x47266b(0x1cd)&&_0x3a67c1[_0x47266b(0x1c3)][_0x47266b(0x1df)]>0x0&&(_0x3a67c1[_0x47266b(0x1ba)]=_0x3a67c1['allFields'][_0x47266b(0x1e5)](',')['map'](_0x8b74f2=>_0x8b74f2[_0x47266b(0x1c6)]())[_0x47266b(0x1ad)](Boolean)),_0x3a67c1;}function a21_0x4eda(_0x522478,_0x3cc2bc){_0x522478=_0x522478-0x1a7;const _0x18396e=a21_0x1839();let _0x4edaeb=_0x18396e[_0x522478];return _0x4edaeb;}function a21_0x1839(){const _0x399e6e=['fields','title','doType','9NWTzAj','1566byiuuV','description','map','pkField','creatorIdField','dbtableConfig','responseBody','Get\x20dataset\x20detail\x20including\x20fields,\x20relations,\x20and\x20operations','allFieldNames','dbType','source','updateTimeField','133MwtSxa','creatorNameField','path','createTimeField','dbId','allFields','451847IzTwol','823790WksJdS','trim','operations','required','1725626tZdubc','method','requestBody','push','string','validateRules','logicField','name','appCode','relatedPageInfoList','properties','options','40520OOzAOP','code','3531sGohNT','doVersion','columnCodeListWithDeleted','580dEaiXp','type','datasetKey','deleted','displayName','length','afterScriptId','tableName','entries','dbName','beforeScriptId','split','str','parse','dblinkInfoDTO','sourceType','object','modifierIdField','11156180GEEcGO','modifierNameField','3605iWvcKv','isArray','read','host','extend','responseFields','requestFields','filter'];a21_0x1839=function(){return _0x399e6e;};return a21_0x1839();}function normalizeRelatedPages(_0x507a37){const _0x26c78c=a21_0x4eda;if(!Array['isArray'](_0x507a37))return[];return _0x507a37[_0x26c78c(0x1ad)](_0xec9770=>_0xec9770&&typeof _0xec9770===_0x26c78c(0x1ea))['map'](_0x337efd=>({'id':_0x337efd['id'],'type':_0x337efd[_0x26c78c(0x1db)],'code':_0x337efd['code'],'title':_0x337efd[_0x26c78c(0x1af)],'deleted':_0x337efd[_0x26c78c(0x1dd)]===!![]}));}function normalizeFallbackFieldName(_0x5834c6,_0x2fb868){const _0x4d944e=_0x5834c6['trim']();if(!_0x4d944e)return null;return{'name':_0x4d944e,'displayName':_0x4d944e,'type':undefined,'dbType':undefined,'pk':_0x4d944e===_0x2fb868,'required':![],'description':undefined};}async function loadListFieldFallback(_0x44f4a9,_0x4965c7){const _0x357c30=a21_0x4eda;if(!_0x44f4a9||!_0x4965c7)return[];try{const _0x4f38e3=await listDatasets(_0x44f4a9,{'code':_0x4965c7}),_0x566a02=_0x4f38e3['find'](_0x5ce855=>_0x5ce855[_0x357c30(0x1d6)]===_0x4965c7)??_0x4f38e3[0x0],_0x46590c=_0x566a02?.[_0x357c30(0x1b7)]??{},_0x5874f4=typeof _0x46590c[_0x357c30(0x1c3)]===_0x357c30(0x1cd)?_0x46590c[_0x357c30(0x1c3)][_0x357c30(0x1e5)](','):[];return _0x5874f4[_0x357c30(0x1b4)](_0xd2bec=>normalizeFallbackFieldName(_0xd2bec,_0x46590c[_0x357c30(0x1b5)]))['filter'](_0x840fcf=>_0x840fcf!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':'detail','description':a21_0x867ef8(0x1b9),'risk':a21_0x867ef8(0x1a8),'flags':[CODE_FLAG],async 'execute'(_0x39bdf5){const _0x19f3c5=a21_0x867ef8,_0x217272=await getDatasetDetail(_0x39bdf5[_0x19f3c5(0x1e6)]('code')),_0x54a29a=Array[_0x19f3c5(0x1a7)](_0x217272[_0x19f3c5(0x1ae)])?_0x217272[_0x19f3c5(0x1ae)]:Array[_0x19f3c5(0x1a7)](_0x217272[_0x19f3c5(0x1d3)])?_0x217272[_0x19f3c5(0x1d3)]:[];let _0x4724e8=_0x54a29a[_0x19f3c5(0x1b4)](_0x3a56e1=>normalizeField(_0x3a56e1))[_0x19f3c5(0x1ad)](_0x2cadba=>_0x2cadba!==null);_0x4724e8['length']===0x0&&(_0x4724e8=await loadListFieldFallback(_0x39bdf5[_0x19f3c5(0x1d1)],_0x39bdf5[_0x19f3c5(0x1e6)](_0x19f3c5(0x1d6))));const _0x136174=_0x217272[_0x19f3c5(0x1c7)]??{},_0x347758=[];for(const [_0x3988a0,_0x4dd1dd]of Object[_0x19f3c5(0x1e2)](_0x136174)){const _0x3bf7b8=normalizeOperationEntry(_0x3988a0,_0x4dd1dd);if(_0x3bf7b8)_0x347758[_0x19f3c5(0x1cc)](_0x3bf7b8);}const _0x25bd12=_0x217272[_0x19f3c5(0x1b7)]??{},_0x214a59=_0x217272['dataset']??{},_0x3c02f1=_0x25bd12[_0x19f3c5(0x1c2)]!=null?{'id':_0x25bd12['dbId'],'name':_0x25bd12[_0x19f3c5(0x1e3)]??null}:undefined;let _0x24babd;return typeof _0x217272['extend']===_0x19f3c5(0x1cd)&&(_0x24babd=parseJsonMaybe(_0x217272[_0x19f3c5(0x1aa)])),{'ok':!![],'data':{'id':_0x217272['modelId']??_0x217272['id'],'name':_0x217272[_0x19f3c5(0x1d0)],'code':_0x217272['modelCode']||_0x217272['code'],'doVersion':_0x217272[_0x19f3c5(0x1d8)],'description':_0x217272['description']||_0x214a59['tableComment']||undefined,'source':_0x217272[_0x19f3c5(0x1bc)]||_0x214a59[_0x19f3c5(0x1e9)],'table':_0x25bd12[_0x19f3c5(0x1e1)]||_0x214a59[_0x19f3c5(0x1e1)],'datasetKey':_0x25bd12[_0x19f3c5(0x1dc)],'pk':_0x25bd12[_0x19f3c5(0x1b5)],'db':_0x3c02f1,'dbtable':summarizeDbtable(_0x25bd12),'fields':_0x4724e8,'operations':_0x347758,'indexes':Array['isArray'](_0x214a59['indexes'])?_0x214a59['indexes']:[],'relations':_0x217272['relations']??null,'relatedPages':normalizeRelatedPages(_0x217272[_0x19f3c5(0x1d2)]),...Array[_0x19f3c5(0x1a7)](_0x217272[_0x19f3c5(0x1d9)])?{'columnCodeListWithDeleted':_0x217272[_0x19f3c5(0x1d9)]}:{},'formatRules':Array[_0x19f3c5(0x1a7)](_0x217272['formatRules'])?_0x217272['formatRules']:[],'validateRules':Array[_0x19f3c5(0x1a7)](_0x217272[_0x19f3c5(0x1ce)])?_0x217272[_0x19f3c5(0x1ce)]:[],..._0x24babd!==undefined?{'extend':_0x24babd}:{},'stats':{'fieldCount':_0x4724e8[_0x19f3c5(0x1df)],'operationCount':_0x347758[_0x19f3c5(0x1df)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x4b33(_0x2dd56d,_0x114634){_0x2dd56d=_0x2dd56d-0x15e;const _0x254583=a22_0x2545();let _0x4b337b=_0x254583[_0x2dd56d];return _0x4b337b;}(function(_0x23f971,_0x3dcd93){const _0x4defa8=a22_0x4b33,_0x32c7e1=_0x23f971();while(!![]){try{const _0x152eb4=-parseInt(_0x4defa8(0x160))/0x1*(-parseInt(_0x4defa8(0x163))/0x2)+parseInt(_0x4defa8(0x15f))/0x3*(-parseInt(_0x4defa8(0x15e))/0x4)+parseInt(_0x4defa8(0x165))/0x5*(-parseInt(_0x4defa8(0x168))/0x6)+-parseInt(_0x4defa8(0x167))/0x7*(-parseInt(_0x4defa8(0x166))/0x8)+-parseInt(_0x4defa8(0x164))/0x9+parseInt(_0x4defa8(0x169))/0xa*(-parseInt(_0x4defa8(0x161))/0xb)+parseInt(_0x4defa8(0x162))/0xc;if(_0x152eb4===_0x3dcd93)break;else _0x32c7e1['push'](_0x32c7e1['shift']());}catch(_0xd59e7d){_0x32c7e1['push'](_0x32c7e1['shift']());}}}(a22_0x2545,0xf1c08));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];function a22_0x2545(){const _0x48d509=['3309948gEpGtD','5361945nnxBdJ','128yeUSJU','17080tGjdJY','6WstYqp','471360wYLImE','127156ZEAgSY','177dwvXwj','1EjwMIQ','198SfRqNO','42597612cDheNe','3131070MaGBYf'];a22_0x2545=function(){return _0x48d509;};return a22_0x2545();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x55791c=a23_0x5220;(function(_0x263222,_0x28486d){const _0x27eee9=a23_0x5220,_0x3f4c5a=_0x263222();while(!![]){try{const _0x55a198=parseInt(_0x27eee9(0xbd))/0x1*(-parseInt(_0x27eee9(0xbe))/0x2)+parseInt(_0x27eee9(0xc3))/0x3+-parseInt(_0x27eee9(0xc4))/0x4+-parseInt(_0x27eee9(0xcf))/0x5+-parseInt(_0x27eee9(0xd5))/0x6*(-parseInt(_0x27eee9(0xd2))/0x7)+parseInt(_0x27eee9(0xc0))/0x8+parseInt(_0x27eee9(0xbc))/0x9;if(_0x55a198===_0x28486d)break;else _0x3f4c5a['push'](_0x3f4c5a['shift']());}catch(_0x414e9f){_0x3f4c5a['push'](_0x3f4c5a['shift']());}}}(a23_0x317e,0x6374e));function a23_0x5220(_0x2ea8e5,_0x38c2b2){_0x2ea8e5=_0x2ea8e5-0xbc;const _0x317ee=a23_0x317e();let _0x5220f3=_0x317ee[_0x2ea8e5];return _0x5220f3;}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x55791c(0xc9),'command':a23_0x55791c(0xc7),'description':a23_0x55791c(0xc2),'risk':a23_0x55791c(0xc6),'flags':[{'name':a23_0x55791c(0xc5),'type':a23_0x55791c(0xc8),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a23_0x55791c(0xc1)}],async 'execute'(_0x5de165){const _0x55039d=a23_0x55791c,_0x104b3c=_0x5de165['str']('name'),_0x5c8866=_0x5de165[_0x55039d(0xd3)](_0x55039d(0xcd)),_0x47651e=await listDatasets(_0x5de165[_0x55039d(0xd1)],{..._0x104b3c&&{'name':_0x104b3c},..._0x5c8866&&{'code':_0x5c8866}});return{'ok':!![],'data':{'total':_0x47651e[_0x55039d(0xcc)],'datasets':_0x47651e['map'](_0xeca9c7=>{const _0x4bef3c=_0x55039d,_0x5dd08f=_0xeca9c7[_0x4bef3c(0xca)]??{};return{'id':_0xeca9c7['id'],'code':_0xeca9c7['code'],'name':_0xeca9c7[_0x4bef3c(0xc5)],'source':_0xeca9c7[_0x4bef3c(0xd0)],'description':_0xeca9c7['description'],'table':_0x5dd08f['tableName'],'datasetKey':_0x5dd08f[_0x4bef3c(0xd4)],'pk':_0x5dd08f['pkField'],'fields':_0x5dd08f[_0x4bef3c(0xbf)]?_0x5dd08f['allFields'][_0x4bef3c(0xce)](',')['map'](_0x16084d=>_0x16084d[_0x4bef3c(0xcb)]()):[]};})}};}};function a23_0x317e(){const _0x341733=['List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','1284684bkEWss','2147212eKGiZO','name','read','list','string','dataset','dbtableConfig','trim','length','code','split','1766605cZxwXI','source','appCode','5089DISyWx','str','datasetKey','3972qxLvDX','1587825cjPeDL','30113CyIXAY','8tJQbWf','allFields','2656184ngrIhz','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)'];a23_0x317e=function(){return _0x341733;};return a23_0x317e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a24_0x1498(_0x47aece,_0x19face){_0x47aece=_0x47aece-0xab;const _0x246204=a24_0x2462();let _0x149870=_0x246204[_0x47aece];return _0x149870;}const a24_0x3fb6a4=a24_0x1498;(function(_0x56b422,_0x130820){const _0xbfb1ba=a24_0x1498,_0x3bea7a=_0x56b422();while(!![]){try{const _0x96547c=parseInt(_0xbfb1ba(0xb3))/0x1+-parseInt(_0xbfb1ba(0xb8))/0x2*(-parseInt(_0xbfb1ba(0xab))/0x3)+-parseInt(_0xbfb1ba(0xad))/0x4*(parseInt(_0xbfb1ba(0xb9))/0x5)+-parseInt(_0xbfb1ba(0xb0))/0x6*(-parseInt(_0xbfb1ba(0xbc))/0x7)+-parseInt(_0xbfb1ba(0xae))/0x8+-parseInt(_0xbfb1ba(0xbb))/0x9+parseInt(_0xbfb1ba(0xac))/0xa;if(_0x96547c===_0x130820)break;else _0x3bea7a['push'](_0x3bea7a['shift']());}catch(_0x241bde){_0x3bea7a['push'](_0x3bea7a['shift']());}}}(a24_0x2462,0x6a591));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x3fb6a4(0xaf);export function formatDatasetSdkMarkdown(_0x4b7c6e){const _0x369f70=a24_0x3fb6a4,_0x2ee737=typeof _0x4b7c6e===_0x369f70(0xb5)?_0x4b7c6e[_0x369f70(0xb2)]():'';return _0x2ee737||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a24_0x3fb6a4(0xb1),'command':a24_0x3fb6a4(0xb4),'description':a24_0x3fb6a4(0xb6),'risk':'read','flags':[{...CODE_FLAG,'description':a24_0x3fb6a4(0xba)}],async 'execute'(_0x489a12){const _0x2cc055=a24_0x3fb6a4,_0xf7d2cb=_0x489a12['str'](_0x2cc055(0xb7)),_0x36e96d=await getDatasetSdkUsageDoc(_0xf7d2cb,_0x489a12['appCode']);return{'ok':!![],'data':{'code':_0xf7d2cb,'appCode':_0x489a12['appCode'],'markdown':formatDatasetSdkMarkdown(_0x36e96d)}};}};function a24_0x2462(){const _0x227000=['49XrzDyG','342477UunBUb','5489110SUncLq','81132WvcjGJ','2606936zXMbYJ','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','534738yCPWgO','dataset','trim','377321jAdxrt','sdk-doc','string','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','code','2vXnIoJ','165oenMWd','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','2101005yytztG'];a24_0x2462=function(){return _0x227000;};return a24_0x2462();}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x3f35(_0x463371,_0x189c41){_0x463371=_0x463371-0x14d;const _0x1afb87=a25_0x1afb();let _0x3f35ab=_0x1afb87[_0x463371];return _0x3f35ab;}const a25_0x47929f=a25_0x3f35;(function(_0x5f2096,_0x55160a){const _0x242cd2=a25_0x3f35,_0x3f0140=_0x5f2096();while(!![]){try{const _0x245d13=-parseInt(_0x242cd2(0x182))/0x1*(-parseInt(_0x242cd2(0x150))/0x2)+parseInt(_0x242cd2(0x15d))/0x3*(parseInt(_0x242cd2(0x176))/0x4)+parseInt(_0x242cd2(0x193))/0x5+-parseInt(_0x242cd2(0x199))/0x6*(-parseInt(_0x242cd2(0x17f))/0x7)+parseInt(_0x242cd2(0x19d))/0x8*(-parseInt(_0x242cd2(0x19c))/0x9)+-parseInt(_0x242cd2(0x14f))/0xa+parseInt(_0x242cd2(0x16a))/0xb*(-parseInt(_0x242cd2(0x180))/0xc);if(_0x245d13===_0x55160a)break;else _0x3f0140['push'](_0x3f0140['shift']());}catch(_0x1a0c9b){_0x3f0140['push'](_0x3f0140['shift']());}}}(a25_0x1afb,0x265b1));import a25_0x3b3d69 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';function a25_0x1afb(){const _0x6f0ea9=['2880460BezWGD','407882hOysQd','services','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','ClientAk','format','pageSize','log','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','✗\x20Invalid\x20JSON','\x20\x20Config\x20Files','\x20\x20Service\x20Tree','81HXAwGC','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','gray','check','locale','\x20\x20API\x20Endpoints','\x20\x20Merged\x20Config','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Config\x20JSON','\x20doctor','doctor','9493RsqggP','commandCount','currentApp','\x20\x20Auth','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','Global','\x20commands)','padEnd','serviceCode','43348EygLHP','Project','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','riskLevel','\x20\x20─','(default:\x20','appCode','\x20\x20auth\x20(effective):\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','42wSkGLv','1236tqZLoU','length','1uvQkfN','bold','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','Diagnose\x20CLI\x20configuration\x20and\x20environment','✓\x20Loaded','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','red','repeat','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','(unnamed)','platform','⚠\x20Empty','(missing)','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','1007515uiSQcJ','registryPath','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','source','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','64668XuzjMC','green','yellow','2058039eNkpDl','8ZGmPph','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','empty','message','\x20Imported\x20from:\x20','arch','defaultApp','name','✓\x20Valid\x20JSON','status'];a25_0x1afb=function(){return _0x6f0ea9;};return a25_0x1afb();}import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x20fcfb){const _0x910845=a25_0x3f35,_0x296f66=getCliVersion(),_0x402b9a=buildConfigFromFlags({});await initGlobalEnvironment(_0x402b9a),console[_0x910845(0x158)](),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x183)](CLI_BIN_NAME+_0x910845(0x168))),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x15f)]('─'[_0x910845(0x18a)](0x32))),console[_0x910845(0x158)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x296f66),console[_0x910845(0x158)](_0x910845(0x17e)+process['version']),console[_0x910845(0x158)](_0x910845(0x15e)+process[_0x910845(0x18e)]+'\x20'+process[_0x910845(0x1a3)]),console[_0x910845(0x158)](),console['log'](a25_0x3b3d69[_0x910845(0x183)](_0x910845(0x15b))),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x17a)[_0x910845(0x18a)](0x1e)));const _0x7d01dc=getGlobalConfigPath(),_0x3a484c=getProjectConfigPath();console['log'](_0x910845(0x164)+(_0x7d01dc||a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x154)))),console[_0x910845(0x158)](_0x910845(0x191)+(_0x3a484c||a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x154)))),console[_0x910845(0x158)](),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x183)](_0x910845(0x167))),console[_0x910845(0x158)](a25_0x3b3d69['gray'](_0x910845(0x17a)['repeat'](0x1e)));const _0x255d0c=(_0x4322ca,_0x5893c1)=>{const _0x23f27d=_0x910845;if(!_0x5893c1){console[_0x23f27d(0x158)]('\x20\x20'+_0x4322ca[_0x23f27d(0x174)](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x15f)]('(no\x20file)'));return;}const _0x39eed2=inspectCliConfigJsonFile(_0x5893c1);if(_0x39eed2[_0x23f27d(0x14e)]==='ok')console[_0x23f27d(0x158)]('\x20\x20'+_0x4322ca['padEnd'](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x19a)](_0x23f27d(0x14d)));else{if(_0x39eed2[_0x23f27d(0x14e)]==='empty')console[_0x23f27d(0x158)]('\x20\x20'+_0x4322ca[_0x23f27d(0x174)](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x19b)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x39eed2[_0x23f27d(0x14e)]==='missing'?console['log']('\x20\x20'+_0x4322ca[_0x23f27d(0x174)](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x15f)](_0x23f27d(0x190))):(console['log']('\x20\x20'+_0x4322ca[_0x23f27d(0x174)](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x189)](_0x23f27d(0x15a))),console[_0x23f27d(0x158)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a25_0x3b3d69[_0x23f27d(0x189)](_0x39eed2['message'])));}};_0x255d0c(_0x910845(0x172),_0x7d01dc),_0x255d0c(_0x910845(0x177),_0x3a484c),console[_0x910845(0x158)](),console[_0x910845(0x158)](a25_0x3b3d69['bold'](_0x910845(0x163))),console['log'](a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x17a)[_0x910845(0x18a)](0x1e))),console[_0x910845(0x158)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x402b9a[_0x910845(0x17c)]||a25_0x3b3d69['red'](_0x910845(0x18c)))),console['log'](_0x910845(0x19f)+_0x402b9a['env']);const _0x23a262=isLegacyCompatConfigKey(_0x910845(0x161))?a25_0x3b3d69[_0x910845(0x15f)](_0x402b9a[_0x910845(0x161)]+'\x20(legacy/compat\x20only)'):_0x402b9a[_0x910845(0x161)];console[_0x910845(0x158)](_0x910845(0x198)+_0x23a262),console[_0x910845(0x158)](_0x910845(0x178)+(_0x402b9a[_0x910845(0x1a4)]||a25_0x3b3d69[_0x910845(0x15f)]('(none)'))),console[_0x910845(0x158)](_0x910845(0x159)+(_0x402b9a[_0x910845(0x16c)]||a25_0x3b3d69['gray'](_0x910845(0x192)))),console[_0x910845(0x158)](_0x910845(0x153)+(_0x402b9a['format']||a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x17b)+DEFAULT_CONFIG_VALUES[_0x910845(0x156)]+')'))),console[_0x910845(0x158)](_0x910845(0x184)+(_0x402b9a[_0x910845(0x157)]??a25_0x3b3d69['gray']('(default)'))),console['log'](_0x910845(0x18b)+_0x402b9a[_0x910845(0x179)]),console[_0x910845(0x158)](_0x910845(0x170)+_0x402b9a['verbose']),console[_0x910845(0x158)](_0x910845(0x17d)+AUTH_MODE[_0x910845(0x155)]),console[_0x910845(0x158)](_0x910845(0x171)+(_0x402b9a['accessKey']?a25_0x3b3d69[_0x910845(0x19a)]('(set,\x20length='+_0x402b9a['accessKey'][_0x910845(0x181)]+')'):a25_0x3b3d69['gray'](_0x910845(0x192)))),console[_0x910845(0x158)](),console['log'](a25_0x3b3d69[_0x910845(0x183)](_0x910845(0x162))),console[_0x910845(0x158)](a25_0x3b3d69['gray']('\x20\x20─'[_0x910845(0x18a)](0x1e))),console[_0x910845(0x158)](_0x910845(0x16f)+getApiDomain()),console['log'](_0x910845(0x188)+getUserDomain()),console[_0x910845(0x158)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x183)](_0x910845(0x15c))),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x15f)]('\x20\x20─'[_0x910845(0x18a)](0x1e)));const _0x43fd9d=inspectServiceRegistry();console[_0x910845(0x158)](_0x910845(0x19e)+_0x43fd9d[_0x910845(0x194)]),console[_0x910845(0x158)](_0x910845(0x195)+formatServiceRegistryStatus(_0x43fd9d)),console['log']('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x43fd9d['serviceCount']),console[_0x910845(0x158)]('\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x43fd9d[_0x910845(0x16b)]);for(const _0x4ec1f5 of _0x43fd9d[_0x910845(0x151)]){console[_0x910845(0x158)]('\x20\x20'+(_0x4ec1f5[_0x910845(0x175)]+':')['padEnd'](0x11)+'\x20'+(_0x4ec1f5[_0x910845(0x1a5)]||a25_0x3b3d69['gray'](_0x910845(0x18d)))+'\x20('+_0x4ec1f5[_0x910845(0x16b)]+_0x910845(0x173)),console[_0x910845(0x158)]('\x20\x20'+''[_0x910845(0x174)](0x11)+_0x910845(0x1a2)+_0x4ec1f5[_0x910845(0x197)]['path']);}return console[_0x910845(0x158)](),console[_0x910845(0x158)](a25_0x3b3d69['bold'](_0x910845(0x16d))),console[_0x910845(0x158)](a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x17a)[_0x910845(0x18a)](0x1e))),console['log'](_0x910845(0x16e)+a25_0x3b3d69[_0x910845(0x19a)](AUTH_MODE[_0x910845(0x155)]+_0x910845(0x185))),console[_0x910845(0x158)](_0x910845(0x166)+a25_0x3b3d69[_0x910845(0x15f)](_0x910845(0x152))),console[_0x910845(0x158)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x1786f5){const _0x1705c0=a25_0x3f35;if(_0x1786f5[_0x1705c0(0x14e)]==='ok')return a25_0x3b3d69[_0x1705c0(0x19a)](_0x1705c0(0x187));if(_0x1786f5[_0x1705c0(0x14e)]===_0x1705c0(0x196))return a25_0x3b3d69[_0x1705c0(0x15f)](_0x1705c0(0x154));if(_0x1786f5['status']===_0x1705c0(0x1a0))return a25_0x3b3d69[_0x1705c0(0x19b)](_0x1705c0(0x18f));return a25_0x3b3d69[_0x1705c0(0x189)](_0x1705c0(0x165)+(_0x1786f5[_0x1705c0(0x1a1)]?':\x20'+_0x1786f5['message']:''));}export const doctorDefinition={'service':a25_0x47929f(0x169),'command':a25_0x47929f(0x160),'description':a25_0x47929f(0x186),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0xe50726=a26_0x3963;(function(_0x3045f5,_0x2467ba){const _0x1389e6=a26_0x3963,_0x53896d=_0x3045f5();while(!![]){try{const _0x2c8e4e=parseInt(_0x1389e6(0x18e))/0x1+-parseInt(_0x1389e6(0x185))/0x2*(-parseInt(_0x1389e6(0x180))/0x3)+-parseInt(_0x1389e6(0x17d))/0x4+-parseInt(_0x1389e6(0x1a3))/0x5*(-parseInt(_0x1389e6(0x198))/0x6)+parseInt(_0x1389e6(0x18f))/0x7*(parseInt(_0x1389e6(0x18c))/0x8)+parseInt(_0x1389e6(0x18d))/0x9*(-parseInt(_0x1389e6(0x19e))/0xa)+parseInt(_0x1389e6(0x17b))/0xb*(-parseInt(_0x1389e6(0x1ad))/0xc);if(_0x2c8e4e===_0x2467ba)break;else _0x53896d['push'](_0x53896d['shift']());}catch(_0x4a1e00){_0x53896d['push'](_0x53896d['shift']());}}}(a26_0x2d59,0x240ef));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a26_0x3963(_0x497da9,_0x3b285a){_0x497da9=_0x497da9-0x168;const _0x2d5999=a26_0x2d59();let _0x39630e=_0x2d5999[_0x497da9];return _0x39630e;}import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0xe50726(0x173),'type':a26_0xe50726(0x176),'description':a26_0xe50726(0x16e)},{'name':a26_0xe50726(0x17e),'type':a26_0xe50726(0x176),'description':a26_0xe50726(0x191)+DEFAULT_CONFIG_VALUES[a26_0xe50726(0x17e)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0xe50726(0x175),'type':a26_0xe50726(0x178),'description':a26_0xe50726(0x169)+PRODUCT_CONFIG[a26_0xe50726(0x1ac)]+a26_0xe50726(0x197),'default':![]},{'name':'yes','type':a26_0xe50726(0x178),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a26_0xe50726(0x176),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':'appcode','type':a26_0xe50726(0x176),'description':a26_0xe50726(0x1a7)},{'name':a26_0xe50726(0x17e),'type':a26_0xe50726(0x176),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0xe50726(0x178),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a26_0xe50726(0x1ac)]+a26_0xe50726(0x197),'default':![]},{'name':'yes','type':a26_0xe50726(0x178),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x8bcd46){const _0x665fab=a26_0xe50726,_0x4dcf68=isNonInteractiveMode(_0x8bcd46),_0x549231=_0x8bcd46[_0x665fab(0x175)]?'global':_0x665fab(0x16f),_0x384704=resolveWriteConfigPath(_0x549231);try{_0x4dcf68?await runNonInteractive(_0x8bcd46,_0x384704):await runInteractive(_0x8bcd46,_0x384704);}catch(_0x625dbc){if(_0x625dbc instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x625dbc;}}export async function runInitImport(_0x4ed3b3){const _0x3fcc69=a26_0xe50726,_0x556c91=_0x4ed3b3[_0x3fcc69(0x175)]?_0x3fcc69(0x175):_0x3fcc69(0x16f),_0x5edc3c=resolveWriteConfigPath(_0x556c91);await runFromImport(_0x4ed3b3,_0x5edc3c);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0xe50726(0x192)]);async function runFromImport(_0x3cecdc,_0x2470c0){const _0x2e3b4b=a26_0xe50726,_0x5c0ffb=resolveFilePath(_0x3cecdc[_0x2e3b4b(0x1a2)]);if(!existsSync(_0x5c0ffb))throw CliErrors[_0x2e3b4b(0x177)](_0x2e3b4b(0x1a4)+_0x5c0ffb);const _0x1ced61=readSourceFile(_0x5c0ffb),_0x1720e4=convertToRuntimeConfig(_0x1ced61);_0x3cecdc[_0x2e3b4b(0x173)]&&(_0x1720e4[_0x2e3b4b(0x173)]=String(_0x3cecdc[_0x2e3b4b(0x173)]));_0x3cecdc[_0x2e3b4b(0x17e)]&&(_0x1720e4[_0x2e3b4b(0x17e)]=resolveInitEnv(_0x3cecdc));if(!_0x1720e4[_0x2e3b4b(0x173)])throw CliErrors[_0x2e3b4b(0x177)](_0x2e3b4b(0x1a9),_0x2e3b4b(0x196));await writeInitConfig(_0x2470c0,_0x1720e4,_0x3cecdc),console[_0x2e3b4b(0x181)](_0x2e3b4b(0x1a6)+_0x5c0ffb),console[_0x2e3b4b(0x181)](_0x2e3b4b(0x1b0)+_0x2470c0),console[_0x2e3b4b(0x181)]('\x20\x20appcode:\x20'+_0x1720e4['appcode']);if(_0x1720e4['defaultApp'])console['log']('\x20\x20default:\x20'+_0x1720e4[_0x2e3b4b(0x16a)]);}function convertToRuntimeConfig(_0x4482e3){const _0x204743=a26_0xe50726;if(_0x4482e3[_0x204743(0x193)]&&typeof _0x4482e3['apps']===_0x204743(0x19d))throw CliErrors[_0x204743(0x177)](_0x204743(0x19a),_0x204743(0x1a8));const _0x26eb64={};for(const _0x22c4e0 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4482e3[_0x22c4e0]!==undefined&&(_0x26eb64[_0x22c4e0]=_0x4482e3[_0x22c4e0]);}return!_0x26eb64[_0x204743(0x170)]&&(_0x26eb64[_0x204743(0x170)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x26eb64;}async function runNonInteractive(_0x3de611,_0x43d8b3){const _0x348535=a26_0xe50726,_0x10b867=_0x3de611[_0x348535(0x173)];if(!_0x10b867)throw CliErrors[_0x348535(0x195)](_0x348535(0x173),_0x348535(0x1ab)+CLI_BIN_NAME+_0x348535(0x16d));const _0x46a14e=resolveInitEnv(_0x3de611);await writeInitConfig(_0x43d8b3,{'appcode':_0x10b867,'env':_0x46a14e},_0x3de611),console[_0x348535(0x181)](_0x348535(0x18a)+_0x43d8b3),console[_0x348535(0x181)]('\x20\x20appcode:\x20'+_0x10b867),console[_0x348535(0x181)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x46a14e);}async function runInteractive(_0x1b11fc,_0x1f5002){const _0x32f507=a26_0xe50726,_0xf31f97=loadExisting(_0x1f5002),_0x46b379=typeof _0xf31f97?.[_0x32f507(0x173)]==='string'?_0xf31f97[_0x32f507(0x173)]:'',_0x2ba15f=resolveInitEnv(_0x1b11fc);console[_0x32f507(0x181)](CLI_BIN_NAME+_0x32f507(0x17c)+PRODUCT_CONFIG[_0x32f507(0x1ac)]+'\x0a');if(existsSync(_0x1f5002)&&!_0x1b11fc['yes']){const _0x84ff23=await promptYesNo(_0x32f507(0x1ae)+_0x1f5002+_0x32f507(0x183),![]);if(!_0x84ff23){console[_0x32f507(0x181)](_0x32f507(0x172));return;}}const _0x4aff19=typeof _0x1b11fc[_0x32f507(0x173)]===_0x32f507(0x176)?_0x1b11fc[_0x32f507(0x173)][_0x32f507(0x19b)]():'';let _0x270c29=_0x4aff19;!_0x270c29&&(_0x270c29=await promptInput(_0x32f507(0x1a1),_0x46b379));if(!_0x270c29[_0x32f507(0x19b)]())throw CliErrors['validation'](_0x32f507(0x18b));await writeInitConfig(_0x1f5002,{'appcode':_0x270c29[_0x32f507(0x19b)](),'env':_0x2ba15f},_0x1b11fc),console[_0x32f507(0x181)](_0x32f507(0x16b)+_0x1f5002),console[_0x32f507(0x181)](_0x32f507(0x194)+_0x270c29[_0x32f507(0x19b)]()),console[_0x32f507(0x181)](_0x32f507(0x19f)+_0x2ba15f);}async function writeInitConfig(_0x217ed2,_0xcb4ea9,_0x21a416){const _0x2ac539=a26_0xe50726;let _0x211853={};existsSync(_0x217ed2)&&!_0x21a416[_0x2ac539(0x186)]&&(_0x211853=readConfigFile(_0x217ed2));for(const [_0x4fb4d6,_0x28ebf3]of Object['entries'](_0xcb4ea9)){_0x28ebf3!==undefined&&(_0x211853[_0x4fb4d6]=_0x28ebf3);}if(_0x211853[_0x2ac539(0x1a5)])delete _0x211853[_0x2ac539(0x1a5)];writeConfigFile(_0x217ed2,_0x211853);}class AbortPrompt extends Error{constructor(){const _0x452501=a26_0xe50726;super(_0x452501(0x168)),this['name']=_0x452501(0x17a);}}function createSafeRl(){const _0x1885a9=a26_0xe50726,_0x388a0f=createInterface({'input':process['stdin'],'output':process[_0x1885a9(0x189)]});let _0x5b6275;const _0x341dc3=new Promise((_0x343c9f,_0x49ce7f)=>{const _0x1d985f=_0x1885a9;_0x5b6275=()=>{const _0x5d48a2=a26_0x3963;_0x5b6275&&(_0x388a0f[_0x5d48a2(0x184)](_0x5d48a2(0x188),_0x5b6275),_0x5b6275=undefined);try{_0x388a0f[_0x5d48a2(0x190)]();}catch{}_0x49ce7f(new AbortPrompt());},_0x388a0f['once'](_0x1d985f(0x188),_0x5b6275);}),_0x4e7d3b=()=>{const _0x4dee2d=_0x1885a9;_0x5b6275&&(_0x388a0f[_0x4dee2d(0x184)]('SIGINT',_0x5b6275),_0x5b6275=undefined);try{_0x388a0f['close']();}catch{}};return{'rl':_0x388a0f,'abortPromise':_0x341dc3,'disposeSuccess':_0x4e7d3b};}async function promptInput(_0x138605,_0x607d1c){const _0x40d821=a26_0xe50726,{rl:_0x26bddd,abortPromise:_0x544af4,disposeSuccess:_0x54c257}=createSafeRl(),_0x35d05a=new Promise(_0x26816f=>{const _0x5ed67b=a26_0x3963,_0xd90b33=_0x607d1c?'\x20\x20'+_0x138605+'\x20('+_0x607d1c+'):\x20':'\x20\x20'+_0x138605+':\x20';_0x26bddd[_0x5ed67b(0x182)](_0xd90b33,_0x35362b=>{const _0x1d308b=_0x5ed67b;_0x54c257(),_0x26816f(_0x35362b[_0x1d308b(0x19b)]()||_0x607d1c);});});return Promise[_0x40d821(0x1aa)]([_0x35d05a,_0x544af4]);}async function promptYesNo(_0x15d6c4,_0x1ceb5a){const {rl:_0x3fe1cc,abortPromise:_0x23f4e4,disposeSuccess:_0x10c6a0}=createSafeRl(),_0x50ffec=new Promise(_0xb55376=>{const _0xe54be5=a26_0x3963,_0x54bef5=_0x1ceb5a?_0xe54be5(0x19c):_0xe54be5(0x1af);_0x3fe1cc[_0xe54be5(0x182)]('\x20\x20'+_0x15d6c4+'\x20'+_0x54bef5+':\x20',_0x5ed847=>{const _0x31bc75=_0xe54be5;_0x10c6a0();const _0x57db1d=_0x5ed847[_0x31bc75(0x19b)]()[_0x31bc75(0x199)]();if(_0x57db1d==='y'||_0x57db1d===_0x31bc75(0x186))_0xb55376(!![]);else{if(_0x57db1d==='n'||_0x57db1d==='no')_0xb55376(![]);else _0xb55376(_0x1ceb5a);}});});return Promise['race']([_0x50ffec,_0x23f4e4]);}function loadExisting(_0x341c34){if(!existsSync(_0x341c34))return null;return readConfigFile(_0x341c34);}function resolveFilePath(_0x2c2f43){const _0x3bc4b2=a26_0xe50726;return isAbsolute(_0x2c2f43)?_0x2c2f43:resolve(process[_0x3bc4b2(0x179)](),_0x2c2f43);}function readSourceFile(_0x1c181e){const _0x446294=a26_0xe50726;try{const _0x861f5f=readFileSync(_0x1c181e,{'encoding':'utf8'});return JSON[_0x446294(0x174)](_0x861f5f);}catch(_0x2cf9c5){throw CliErrors[_0x446294(0x177)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x2cf9c5[_0x446294(0x187)]);}}function a26_0x2d59(){const _0x330863=['Invalid\x20env\x20\x22','Aborted.','appcode','parse','global','string','validation','boolean','cwd','AbortPrompt','3586vxXvjq','\x20init\x20—\x20Create\x20','839168nAeSFp','env','\x22.\x20Allowed:\x20','12MMfYYE','log','question','\x20already\x20exists.\x20Overwrite?','removeListener','7194gBrLNF','yes','message','SIGINT','stdout','Initialized\x20','App\x20code\x20cannot\x20be\x20empty.','16DZvZUr','27XDXKFb','135598YuhlXz','699853EvVITE','close','Target\x20environment\x20(default\x20','apiDir','apps','\x20\x20appcode:\x20','flagMissing','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.',')\x20instead\x20of\x20project','6GEMgUL','toLowerCase','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','[Y/n]','object','169340vodBSL','\x20\x20env:\x20\x20\x20\x20\x20','includes','App\x20code','file','299875LhPiGr','Source\x20file\x20not\x20found:\x20','app','Imported\x20from\x20','Override\x20imported\x20default\x20appcode','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','Usage:\x20','newConfigFileName','60LTEVlk','File\x20','[y/N]','\x20\x20config:\x20\x20','User\x20aborted\x20prompt','Write\x20to\x20global\x20(~/','defaultApp','\x0aInitialized\x20','join','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','App\x20code\x20for\x20the\x20project','project','riskLevel'];a26_0x2d59=function(){return _0x330863;};return a26_0x2d59();}function resolveInitEnv(_0x40a349){const _0x490a19=a26_0xe50726,_0x603a71=_0x40a349[_0x490a19(0x17e)];if(_0x603a71===undefined||_0x603a71==='')return DEFAULT_CONFIG_VALUES[_0x490a19(0x17e)];if(!RUNTIME_ENV_VALUES[_0x490a19(0x1a0)](_0x603a71))throw CliErrors['validation'](_0x490a19(0x171)+_0x603a71+_0x490a19(0x17f)+RUNTIME_ENV_VALUES[_0x490a19(0x16c)](',\x20'));return _0x603a71;}
|
|
1
|
+
const a26_0x55fb77=a26_0x5ad1;(function(_0x309c56,_0x3ee1f2){const _0x48c319=a26_0x5ad1,_0x196562=_0x309c56();while(!![]){try{const _0x4f77b1=-parseInt(_0x48c319(0xdd))/0x1+-parseInt(_0x48c319(0xc9))/0x2*(-parseInt(_0x48c319(0xc3))/0x3)+-parseInt(_0x48c319(0xc6))/0x4+-parseInt(_0x48c319(0xd1))/0x5*(parseInt(_0x48c319(0xee))/0x6)+-parseInt(_0x48c319(0xca))/0x7+parseInt(_0x48c319(0xd8))/0x8*(parseInt(_0x48c319(0xbe))/0x9)+parseInt(_0x48c319(0xf1))/0xa;if(_0x4f77b1===_0x3ee1f2)break;else _0x196562['push'](_0x196562['shift']());}catch(_0xde06){_0x196562['push'](_0x196562['shift']());}}}(a26_0x143f,0xa6b8c));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a26_0x5ad1(_0x5d70dc,_0x148e97){_0x5d70dc=_0x5d70dc-0xb3;const _0x143fc4=a26_0x143f();let _0x5ad1eb=_0x143fc4[_0x5d70dc];return _0x5ad1eb;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a26_0x143f(){const _0x261f48=['7525260fqYYfz','app','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',')\x20instead\x20of\x20project','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20already\x20exists.\x20Overwrite?','Target\x20environment\x20(default\x20','apps','boolean','toLowerCase','race','includes','Source\x20file\x20not\x20found:\x20','cwd','join','validation','AbortPrompt','utf8','1278znwmBQ','):\x20','Skip\x20confirmation\x20when\x20overwriting','Invalid\x20env\x20\x22','[y/N]','12777XunNra','\x20\x20appcode:\x20','Usage:\x20','1895192pDNRSu','\x22.\x20Allowed:\x20','riskLevel','578xFXEMF','3058349dDfIwy','parse','Imported\x20from\x20','defaultApp','project','close','string','103675gDThRq','Override\x20imported\x20default\x20appcode','trim','log','yes','env','Aborted.','63352bkGtKA','appcode','SIGINT','message','removeListener','1244723aBWUSm','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','\x20\x20default:\x20','\x20\x20config:\x20\x20','question','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','entries','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','stdout','User\x20aborted\x20prompt','newConfigFileName','Override\x20imported\x20default\x20env','Write\x20to\x20global\x20(~/','Failed\x20to\x20parse\x20source\x20file:\x20','\x20\x20env:\x20\x20\x20\x20\x20','[Y/n]','78IWZAiw','App\x20code','global'];a26_0x143f=function(){return _0x261f48;};return a26_0x143f();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a26_0x55fb77(0xd0),'description':a26_0x55fb77(0xe2)},{'name':a26_0x55fb77(0xd6),'type':a26_0x55fb77(0xd0),'description':a26_0x55fb77(0xf7)+DEFAULT_CONFIG_VALUES[a26_0x55fb77(0xd6)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a26_0x55fb77(0xea)+PRODUCT_CONFIG[a26_0x55fb77(0xe8)]+a26_0x55fb77(0xf4),'default':![]},{'name':a26_0x55fb77(0xd5),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a26_0x55fb77(0xd0),'description':a26_0x55fb77(0xf5),'required':!![]},{'name':a26_0x55fb77(0xd9),'type':a26_0x55fb77(0xd0),'description':a26_0x55fb77(0xd2)},{'name':a26_0x55fb77(0xd6),'type':'string','description':a26_0x55fb77(0xe9),'enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x55fb77(0xf0),'type':a26_0x55fb77(0xb4),'description':a26_0x55fb77(0xea)+PRODUCT_CONFIG[a26_0x55fb77(0xe8)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a26_0x55fb77(0xb4),'description':a26_0x55fb77(0xc0),'default':![]}];export async function runInit(_0x38113a){const _0xc6dc02=a26_0x55fb77,_0x2baeeb=isNonInteractiveMode(_0x38113a),_0x2fa80d=_0x38113a[_0xc6dc02(0xf0)]?_0xc6dc02(0xf0):'project',_0x49ad41=resolveWriteConfigPath(_0x2fa80d);try{_0x2baeeb?await runNonInteractive(_0x38113a,_0x49ad41):await runInteractive(_0x38113a,_0x49ad41);}catch(_0x11fe97){if(_0x11fe97 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x11fe97;}}export async function runInitImport(_0x3e352a){const _0xb4a732=a26_0x55fb77,_0x464c89=_0x3e352a[_0xb4a732(0xf0)]?_0xb4a732(0xf0):_0xb4a732(0xce),_0x3b852b=resolveWriteConfigPath(_0x464c89);await runFromImport(_0x3e352a,_0x3b852b);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x3e5a0a,_0x4ef05d){const _0x3badd9=a26_0x55fb77,_0xf85415=resolveFilePath(_0x3e5a0a['file']);if(!existsSync(_0xf85415))throw CliErrors['validation'](_0x3badd9(0xb8)+_0xf85415);const _0x3fd139=readSourceFile(_0xf85415),_0x84f467=convertToRuntimeConfig(_0x3fd139);_0x3e5a0a[_0x3badd9(0xd9)]&&(_0x84f467[_0x3badd9(0xd9)]=String(_0x3e5a0a['appcode']));_0x3e5a0a[_0x3badd9(0xd6)]&&(_0x84f467[_0x3badd9(0xd6)]=resolveInitEnv(_0x3e5a0a));if(!_0x84f467[_0x3badd9(0xd9)])throw CliErrors[_0x3badd9(0xbb)](_0x3badd9(0xf3),_0x3badd9(0xde));await writeInitConfig(_0x4ef05d,_0x84f467,_0x3e5a0a),console[_0x3badd9(0xd4)](_0x3badd9(0xcc)+_0xf85415),console[_0x3badd9(0xd4)](_0x3badd9(0xe0)+_0x4ef05d),console[_0x3badd9(0xd4)]('\x20\x20appcode:\x20'+_0x84f467[_0x3badd9(0xd9)]);if(_0x84f467[_0x3badd9(0xcd)])console[_0x3badd9(0xd4)](_0x3badd9(0xdf)+_0x84f467['defaultApp']);}function convertToRuntimeConfig(_0x395aa6){const _0x1dc7c6=a26_0x55fb77;if(_0x395aa6[_0x1dc7c6(0xb3)]&&typeof _0x395aa6['apps']==='object')throw CliErrors[_0x1dc7c6(0xbb)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x1dc7c6(0xe5));const _0x66bb7c={};for(const _0x7462d7 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x395aa6[_0x7462d7]!==undefined&&(_0x66bb7c[_0x7462d7]=_0x395aa6[_0x7462d7]);}return!_0x66bb7c['riskLevel']&&(_0x66bb7c[_0x1dc7c6(0xc8)]=DEFAULT_CONFIG_VALUES[_0x1dc7c6(0xc8)]),_0x66bb7c;}async function runNonInteractive(_0x52397a,_0x323c74){const _0x488c2b=a26_0x55fb77,_0x56c0e7=_0x52397a['appcode'];if(!_0x56c0e7)throw CliErrors['flagMissing'](_0x488c2b(0xd9),_0x488c2b(0xc5)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x5be52e=resolveInitEnv(_0x52397a);await writeInitConfig(_0x323c74,{'appcode':_0x56c0e7,'env':_0x5be52e},_0x52397a),console[_0x488c2b(0xd4)]('Initialized\x20'+_0x323c74),console['log'](_0x488c2b(0xc4)+_0x56c0e7),console['log'](_0x488c2b(0xec)+_0x5be52e);}async function runInteractive(_0x6563d2,_0x38ab57){const _0x9f119d=a26_0x55fb77,_0x549325=loadExisting(_0x38ab57),_0xc23c5=typeof _0x549325?.[_0x9f119d(0xd9)]===_0x9f119d(0xd0)?_0x549325[_0x9f119d(0xd9)]:'',_0x5bf1b5=resolveInitEnv(_0x6563d2);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x38ab57)&&!_0x6563d2[_0x9f119d(0xd5)]){const _0x13f661=await promptYesNo('File\x20'+_0x38ab57+_0x9f119d(0xf6),![]);if(!_0x13f661){console[_0x9f119d(0xd4)](_0x9f119d(0xd7));return;}}const _0xb5ebc3=typeof _0x6563d2[_0x9f119d(0xd9)]===_0x9f119d(0xd0)?_0x6563d2[_0x9f119d(0xd9)][_0x9f119d(0xd3)]():'';let _0x116634=_0xb5ebc3;!_0x116634&&(_0x116634=await promptInput(_0x9f119d(0xef),_0xc23c5));if(!_0x116634[_0x9f119d(0xd3)]())throw CliErrors[_0x9f119d(0xbb)](_0x9f119d(0xe3));await writeInitConfig(_0x38ab57,{'appcode':_0x116634[_0x9f119d(0xd3)](),'env':_0x5bf1b5},_0x6563d2),console[_0x9f119d(0xd4)]('\x0aInitialized\x20'+_0x38ab57),console[_0x9f119d(0xd4)](_0x9f119d(0xc4)+_0x116634[_0x9f119d(0xd3)]()),console['log'](_0x9f119d(0xec)+_0x5bf1b5);}async function writeInitConfig(_0x3aa10e,_0x431aec,_0x225f83){const _0x3121dc=a26_0x55fb77;let _0x24a0f9={};existsSync(_0x3aa10e)&&!_0x225f83[_0x3121dc(0xd5)]&&(_0x24a0f9=readConfigFile(_0x3aa10e));for(const [_0x780a6a,_0x4964d3]of Object[_0x3121dc(0xe4)](_0x431aec)){_0x4964d3!==undefined&&(_0x24a0f9[_0x780a6a]=_0x4964d3);}if(_0x24a0f9[_0x3121dc(0xf2)])delete _0x24a0f9[_0x3121dc(0xf2)];writeConfigFile(_0x3aa10e,_0x24a0f9);}class AbortPrompt extends Error{constructor(){const _0x49e9ad=a26_0x55fb77;super(_0x49e9ad(0xe7)),this['name']=_0x49e9ad(0xbc);}}function createSafeRl(){const _0x139988=a26_0x55fb77,_0x20cabb=createInterface({'input':process['stdin'],'output':process[_0x139988(0xe6)]});let _0x5607db;const _0x4b5b26=new Promise((_0x346446,_0x4ab9e2)=>{const _0x5f0b5c=_0x139988;_0x5607db=()=>{const _0x2dc874=a26_0x5ad1;_0x5607db&&(_0x20cabb[_0x2dc874(0xdc)](_0x2dc874(0xda),_0x5607db),_0x5607db=undefined);try{_0x20cabb[_0x2dc874(0xcf)]();}catch{}_0x4ab9e2(new AbortPrompt());},_0x20cabb['once'](_0x5f0b5c(0xda),_0x5607db);}),_0x45e6ec=()=>{const _0x516411=_0x139988;_0x5607db&&(_0x20cabb[_0x516411(0xdc)](_0x516411(0xda),_0x5607db),_0x5607db=undefined);try{_0x20cabb[_0x516411(0xcf)]();}catch{}};return{'rl':_0x20cabb,'abortPromise':_0x4b5b26,'disposeSuccess':_0x45e6ec};}async function promptInput(_0x16f3d5,_0x44c42e){const _0x2f81da=a26_0x55fb77,{rl:_0x24b440,abortPromise:_0x277de1,disposeSuccess:_0x10f910}=createSafeRl(),_0x245304=new Promise(_0x91946d=>{const _0x32a3f1=a26_0x5ad1,_0x3905b6=_0x44c42e?'\x20\x20'+_0x16f3d5+'\x20('+_0x44c42e+_0x32a3f1(0xbf):'\x20\x20'+_0x16f3d5+':\x20';_0x24b440[_0x32a3f1(0xe1)](_0x3905b6,_0x28148c=>{const _0x215fcd=_0x32a3f1;_0x10f910(),_0x91946d(_0x28148c[_0x215fcd(0xd3)]()||_0x44c42e);});});return Promise[_0x2f81da(0xb6)]([_0x245304,_0x277de1]);}async function promptYesNo(_0x2cd094,_0x55fbcd){const _0x5efdae=a26_0x55fb77,{rl:_0x452bb5,abortPromise:_0x69ec68,disposeSuccess:_0x2e9bc1}=createSafeRl(),_0x2d7313=new Promise(_0x516bbb=>{const _0x4774d2=a26_0x5ad1,_0x3d4468=_0x55fbcd?_0x4774d2(0xed):_0x4774d2(0xc2);_0x452bb5['question']('\x20\x20'+_0x2cd094+'\x20'+_0x3d4468+':\x20',_0x54eccd=>{const _0x3b07e0=_0x4774d2;_0x2e9bc1();const _0x31afeb=_0x54eccd['trim']()[_0x3b07e0(0xb5)]();if(_0x31afeb==='y'||_0x31afeb==='yes')_0x516bbb(!![]);else{if(_0x31afeb==='n'||_0x31afeb==='no')_0x516bbb(![]);else _0x516bbb(_0x55fbcd);}});});return Promise[_0x5efdae(0xb6)]([_0x2d7313,_0x69ec68]);}function loadExisting(_0xa4502b){if(!existsSync(_0xa4502b))return null;return readConfigFile(_0xa4502b);}function resolveFilePath(_0x4d0475){const _0x3ac06e=a26_0x55fb77;return isAbsolute(_0x4d0475)?_0x4d0475:resolve(process[_0x3ac06e(0xb9)](),_0x4d0475);}function readSourceFile(_0x4951c1){const _0x4572ab=a26_0x55fb77;try{const _0x1e12db=readFileSync(_0x4951c1,{'encoding':_0x4572ab(0xbd)});return JSON[_0x4572ab(0xcb)](_0x1e12db);}catch(_0x54236a){throw CliErrors[_0x4572ab(0xbb)](_0x4572ab(0xeb)+_0x54236a[_0x4572ab(0xdb)]);}}function resolveInitEnv(_0x1e50e2){const _0x249a73=a26_0x55fb77,_0x5f383a=_0x1e50e2[_0x249a73(0xd6)];if(_0x5f383a===undefined||_0x5f383a==='')return DEFAULT_CONFIG_VALUES[_0x249a73(0xd6)];if(!RUNTIME_ENV_VALUES[_0x249a73(0xb7)](_0x5f383a))throw CliErrors[_0x249a73(0xbb)](_0x249a73(0xc1)+_0x5f383a+_0x249a73(0xc7)+RUNTIME_ENV_VALUES[_0x249a73(0xba)](',\x20'));return _0x5f383a;}
|