@lovrabet/lovrabet-cli 2.0.13 → 2.0.14-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/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/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/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -0
- package/lib/commands/skill/validate.js +1 -0
- 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/config/schema.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.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a15_0xb685(_0x5c69c2,_0x841f40){_0x5c69c2=_0x5c69c2-0x1e1;const _0x17b191=a15_0x17b1();let _0xb68510=_0x17b191[_0x5c69c2];return _0xb68510;}const a15_0x467b8a=a15_0xb685;(function(_0x1c10b7,_0x24bba7){const _0x3ad640=a15_0xb685,_0x35590=_0x1c10b7();while(!![]){try{const _0x379669=-parseInt(_0x3ad640(0x1ea))/0x1+-parseInt(_0x3ad640(0x1f1))/0x2+-parseInt(_0x3ad640(0x1f8))/0x3*(-parseInt(_0x3ad640(0x1f9))/0x4)+parseInt(_0x3ad640(0x1f4))/0x5*(parseInt(_0x3ad640(0x1ed))/0x6)+-parseInt(_0x3ad640(0x1f3))/0x7*(-parseInt(_0x3ad640(0x1f6))/0x8)+-parseInt(_0x3ad640(0x1e5))/0x9+parseInt(_0x3ad640(0x1e6))/0xa*(parseInt(_0x3ad640(0x1ec))/0xb);if(_0x379669===_0x24bba7)break;else _0x35590['push'](_0x35590['shift']());}catch(_0x1c44b5){_0x35590['push'](_0x35590['shift']());}}}(a15_0x17b1,0x8284a));export const CODE_FLAG={'name':a15_0x467b8a(0x1f0),'type':a15_0x467b8a(0x1e4),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};export const SQLCODE_FLAG={'name':a15_0x467b8a(0x1e1),'type':a15_0x467b8a(0x1e4),'required':!![],'description':a15_0x467b8a(0x1e9),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x467b8a(0x1f7)}};export const VERBOSE_FLAG={'name':a15_0x467b8a(0x1f2),'type':a15_0x467b8a(0x1e8),'description':a15_0x467b8a(0x1f5)};function a15_0x17b1(){const _0x3efbc7=['4723956mkhBzb','127760NoYWpa','number','boolean','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','244129KKDfIv','name','33ITmqfU','128382mDciQE','Resource\x20name\x20for\x20lookup','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','code','415956cNXJBT','verbose','28qwZlYI','160aUtnYl','Return\x20full\x20raw\x20response\x20object','930272Zaukyd','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','2283korwrs','1700WpbAFy','sqlcode','params','Resource\x20ID','string'];a15_0x17b1=function(){return _0x3efbc7;};return a15_0x17b1();}export const PARAMS_FLAG={'name':a15_0x467b8a(0x1e2),'type':a15_0x467b8a(0x1e4),'description':a15_0x467b8a(0x1ef)};export const NAME_FLAG={'name':a15_0x467b8a(0x1eb),'type':a15_0x467b8a(0x1e4),'description':a15_0x467b8a(0x1ee)};export const ID_FLAG={'name':'id','type':a15_0x467b8a(0x1e7),'required':!![],'description':a15_0x467b8a(0x1e3)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x491b58=a16_0x167b;(function(_0x1bca99,_0x119832){const _0x1d1a7f=a16_0x167b,_0x3429d9=_0x1bca99();while(!![]){try{const _0x2105de=-parseInt(_0x1d1a7f(0x18f))/0x1+-parseInt(_0x1d1a7f(0x174))/0x2+-parseInt(_0x1d1a7f(0x166))/0x3+-parseInt(_0x1d1a7f(0x19b))/0x4+-parseInt(_0x1d1a7f(0x170))/0x5*(-parseInt(_0x1d1a7f(0x18b))/0x6)+-parseInt(_0x1d1a7f(0x17c))/0x7+-parseInt(_0x1d1a7f(0x16e))/0x8*(-parseInt(_0x1d1a7f(0x161))/0x9);if(_0x2105de===_0x119832)break;else _0x3429d9['push'](_0x3429d9['shift']());}catch(_0x9a0b1e){_0x3429d9['push'](_0x3429d9['shift']());}}}(a16_0x47a3,0x4cc41));function a16_0x167b(_0x753224,_0x42dd15){_0x753224=_0x753224-0x15e;const _0x47a3bc=a16_0x47a3();let _0x167bd7=_0x47a3bc[_0x753224];return _0x167bd7;}function a16_0x47a3(){const _0x1fafcf=['Config\x20files:\x0a','alias','1576jXxqEh','validation','5qmIpAR','Key\x20\x22','Missing\x20key\x20or\x20value.','get','644506lOrCjC','write','Set\x20`','config','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','length','apps','object','1716722fxALib','`\x20=\x20\x22','raw','../../context.js','pageSize\x20must\x20be\x20a\x20positive\x20number','keys','Missing\x20key\x20argument.','Usage:\x20','includes','stringify','\x22\x20is\x20not\x20settable.','global','bool','\x20\x20global:\x20\x20','pageSize','608376AvXCUa','key','isArray','Set\x20a\x20config\x20value','501400TLYTwN','trim','Key\x20not\x20found:\x20','Write\x20to\x20global\x20config','riskLevel','args','\x20(global)','project-or-global-explicit','split','\x20config\x20delete\x20<key>\x20[--global]','Get\x20a\x20config\x20value','appcode','2274404dnrPAw','delete','\x22\x20not\x20found\x20at\x20top\x20level.','\x20config\x20get\x20<key>','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','85599ipwijt','list','log','Deleted\x20`','format','69390kpBLtZ','join','set','field','read','\x20\x20project:\x20'];a16_0x47a3=function(){return _0x1fafcf;};return a16_0x47a3();}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':a16_0x491b58(0x187),'type':'boolean','description':a16_0x491b58(0x192),'default':![]};function parseAliasAppcodeSetKey(_0x23a4f7){const _0x11ebec=a16_0x491b58,_0xdfc686=_0x23a4f7['split']('.');if(_0xdfc686[_0x11ebec(0x179)]!==0x3||_0xdfc686[0x0]!==_0x11ebec(0x17a)||_0xdfc686[0x2]!=='appcode')return undefined;const _0x117258=_0xdfc686[0x1]?.[_0x11ebec(0x190)]();return _0x117258?_0x117258:undefined;}function parseAliasDeleteKey(_0x354d9f){const _0x152d16=a16_0x491b58,_0x39f726=_0x354d9f['split']('.');if(_0x39f726[_0x152d16(0x179)]===0x2&&_0x39f726[0x0]==='apps'){const _0x136fbf=_0x39f726[0x1]?.['trim']();return _0x136fbf?{'alias':_0x136fbf}:undefined;}if(_0x39f726[_0x152d16(0x179)]===0x3&&_0x39f726[0x0]==='apps'&&_0x39f726[0x2]===_0x152d16(0x19a)){const _0x4479dc=_0x39f726[0x1]?.['trim']();return _0x4479dc?{'alias':_0x4479dc,'field':_0x152d16(0x19a)}:undefined;}return undefined;}function setLocalAppAlias(_0x2b88fd,_0x241344,_0x510564){const _0x5e9ace=a16_0x491b58,_0x22e1dd=_0x2b88fd[_0x5e9ace(0x17a)]&&typeof _0x2b88fd[_0x5e9ace(0x17a)]===_0x5e9ace(0x17b)&&!Array[_0x5e9ace(0x18d)](_0x2b88fd['apps'])?_0x2b88fd[_0x5e9ace(0x17a)]:{},_0x13ad21=_0x22e1dd[_0x241344]&&typeof _0x22e1dd[_0x241344]==='object'&&!Array[_0x5e9ace(0x18d)](_0x22e1dd[_0x241344])?_0x22e1dd[_0x241344]:{};_0x13ad21[_0x5e9ace(0x19a)]=_0x510564,_0x22e1dd[_0x241344]=_0x13ad21,_0x2b88fd[_0x5e9ace(0x17a)]=_0x22e1dd;}function deleteLocalAppAlias(_0x53cdc1,_0x5d4f4f){const _0x4c2e08=a16_0x491b58;if(!_0x53cdc1[_0x4c2e08(0x17a)]||typeof _0x53cdc1[_0x4c2e08(0x17a)]!==_0x4c2e08(0x17b)||Array[_0x4c2e08(0x18d)](_0x53cdc1[_0x4c2e08(0x17a)]))return![];const _0x394e69=_0x53cdc1[_0x4c2e08(0x17a)],_0x2441e6=_0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]];if(!_0x2441e6||typeof _0x2441e6!==_0x4c2e08(0x17b)||Array[_0x4c2e08(0x18d)](_0x2441e6))return![];if(!_0x5d4f4f[_0x4c2e08(0x169)])return delete _0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]],!![];if(!(_0x5d4f4f[_0x4c2e08(0x169)]in _0x2441e6))return![];return delete _0x2441e6[_0x5d4f4f[_0x4c2e08(0x169)]],Object[_0x4c2e08(0x181)](_0x2441e6)[_0x4c2e08(0x179)]===0x0&&delete _0x394e69[_0x5d4f4f[_0x4c2e08(0x16d)]],!![];}const listDef={'service':'config','command':a16_0x491b58(0x162),'description':'List\x20current\x20config','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x244ba5){const _0x158029=a16_0x491b58,{buildConfigFromFlags:_0x574372}=await import(_0x158029(0x17f)),_0x436960=_0x574372({}),_0xf24bd7=getProjectConfigPath(),_0x5c6b68=resolveWriteConfigPath(_0x158029(0x187));if(_0x244ba5[_0x158029(0x165)]==='pretty')return{'ok':!![],'message':_0x158029(0x178)+(JSON[_0x158029(0x185)](_0x436960['raw'],null,0x2)+'\x0a\x0a')+_0x158029(0x16c)+(_0x158029(0x16b)+(_0xf24bd7??'(none)')+'\x0a')+(_0x158029(0x189)+_0x5c6b68)};return{'ok':!![],'data':{'effective':_0x436960[_0x158029(0x17e)],'configFiles':{'project':_0xf24bd7??null,'global':_0x5c6b68}}};}},getDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x173),'description':a16_0x491b58(0x199),'risk':a16_0x491b58(0x16a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x491b58(0x18c),'description':a16_0x491b58(0x160),'required':!![]}],'flags':[],async 'execute'(_0x1a7266){const _0x173e03=a16_0x491b58,_0xf380bc=_0x1a7266['args'][0x0];if(!_0xf380bc)throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x182),_0x173e03(0x183)+CLI_BIN_NAME+_0x173e03(0x15f));const {buildConfigFromFlags:_0x18ae92}=await import('../../context.js'),{raw:_0x60a1ac}=_0x18ae92({});if(_0xf380bc['includes']('.')){const _0x501116=_0xf380bc[_0x173e03(0x197)]('.');let _0x1b02ac=_0x60a1ac;for(const _0xe86382 of _0x501116){if(_0x1b02ac==null||typeof _0x1b02ac!=='object')throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x191)+_0xf380bc);_0x1b02ac=_0x1b02ac[_0xe86382];}if(_0x1b02ac===undefined)throw CliErrors['validation'](_0x173e03(0x191)+_0xf380bc);return console['log'](typeof _0x1b02ac===_0x173e03(0x17b)?JSON[_0x173e03(0x185)](_0x1b02ac,null,0x2):String(_0x1b02ac)),{'ok':!![]};}const _0x2d2927=_0x60a1ac[_0xf380bc];if(_0x2d2927===undefined)throw CliErrors[_0x173e03(0x16f)](_0x173e03(0x191)+_0xf380bc);return console[_0x173e03(0x163)](typeof _0x2d2927===_0x173e03(0x17b)?JSON[_0x173e03(0x185)](_0x2d2927,null,0x2):String(_0x2d2927)),{'ok':!![]};}},setDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x168),'description':a16_0x491b58(0x18e),'risk':a16_0x491b58(0x175),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x491b58(0x18c),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x157f87){const _0x1584e3=a16_0x491b58,_0x1d51f7=_0x157f87[_0x1584e3(0x194)][0x0],_0x1370d4=_0x157f87[_0x1584e3(0x194)][0x1];if(!_0x1d51f7||_0x1370d4===undefined)throw CliErrors['validation'](_0x1584e3(0x172),_0x1584e3(0x183)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x1d51f7]&&!ENUM_KEYS[_0x1d51f7][_0x1584e3(0x184)](_0x1370d4))throw CliErrors[_0x1584e3(0x16f)]('Invalid\x20value\x20for\x20\x22'+_0x1d51f7+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x1d51f7][_0x1584e3(0x167)](',\x20'));if(_0x1d51f7===_0x1584e3(0x193))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x1d51f7===_0x1584e3(0x18a)){const _0x3d87dd=Number(_0x1370d4);if(isNaN(_0x3d87dd)||_0x3d87dd<=0x0)throw CliErrors['validation'](_0x1584e3(0x180));}const _0x37ee4b=resolveWriteScope({'explicitGlobal':_0x157f87[_0x1584e3(0x188)](_0x1584e3(0x187)),'policy':_0x1584e3(0x196)}),_0x2fd2e7=toScopeFlags(_0x37ee4b),_0x194f85=readScopedConfig(_0x2fd2e7),_0x32e8ff=parseAliasAppcodeSetKey(_0x1d51f7);if(!_0x32e8ff&&!isTopLevelConfigKey(_0x1d51f7))throw CliErrors[_0x1584e3(0x16f)]('Top-level\x20key\x20\x22'+_0x1d51f7+_0x1584e3(0x186),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0x32e8ff?setLocalAppAlias(_0x194f85,_0x32e8ff,_0x1370d4):_0x194f85[_0x1d51f7]=_0x1d51f7===_0x1584e3(0x18a)?Number(_0x1370d4):_0x1370d4,console[_0x1584e3(0x163)](_0x1584e3(0x176)+_0x1d51f7+_0x1584e3(0x17d)+_0x1370d4+'\x22'+(_0x37ee4b==='global'?_0x1584e3(0x195):'')),writeScopedConfig(_0x194f85,_0x2fd2e7),{'ok':!![]};}},deleteDef={'service':a16_0x491b58(0x177),'command':a16_0x491b58(0x19c),'description':'Delete\x20a\x20config\x20value','risk':a16_0x491b58(0x175),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5c0f2c){const _0x2425bf=a16_0x491b58,_0x3d8d1b=_0x5c0f2c['args'][0x0];if(!_0x3d8d1b)throw CliErrors['validation']('Missing\x20key\x20argument.',_0x2425bf(0x183)+CLI_BIN_NAME+_0x2425bf(0x198));const _0x2296ba=resolveWriteScope({'explicitGlobal':_0x5c0f2c[_0x2425bf(0x188)](_0x2425bf(0x187)),'policy':_0x2425bf(0x196)}),_0x56bc24=toScopeFlags(_0x2296ba),_0x425afa=readScopedConfig(_0x56bc24),_0x1bc9be=parseAliasDeleteKey(_0x3d8d1b);if(_0x1bc9be){if(!deleteLocalAppAlias(_0x425afa,_0x1bc9be))throw CliErrors[_0x2425bf(0x16f)]('Key\x20not\x20found:\x20'+_0x3d8d1b);return console[_0x2425bf(0x163)](_0x2425bf(0x164)+_0x3d8d1b+'`'+(_0x2296ba==='global'?_0x2425bf(0x195):'')),writeScopedConfig(_0x425afa,_0x56bc24),{'ok':!![]};}if(_0x425afa[_0x3d8d1b]===undefined)throw CliErrors['validation'](_0x2425bf(0x171)+_0x3d8d1b+_0x2425bf(0x15e));return delete _0x425afa[_0x3d8d1b],console['log'](_0x2425bf(0x164)+_0x3d8d1b+'`'+(_0x2296ba===_0x2425bf(0x187)?_0x2425bf(0x195):'')),writeScopedConfig(_0x425afa,_0x56bc24),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a16_0x1b6f7d=a16_0x4b9c;(function(_0x3340b8,_0x2644ce){const _0x2eb6cf=a16_0x4b9c,_0x25f81d=_0x3340b8();while(!![]){try{const _0x247157=parseInt(_0x2eb6cf(0x1d1))/0x1*(parseInt(_0x2eb6cf(0x1d4))/0x2)+-parseInt(_0x2eb6cf(0x1f0))/0x3*(-parseInt(_0x2eb6cf(0x1db))/0x4)+-parseInt(_0x2eb6cf(0x1f9))/0x5+parseInt(_0x2eb6cf(0x1c1))/0x6+parseInt(_0x2eb6cf(0x1fe))/0x7*(parseInt(_0x2eb6cf(0x1f7))/0x8)+-parseInt(_0x2eb6cf(0x1c8))/0x9+-parseInt(_0x2eb6cf(0x1c4))/0xa;if(_0x247157===_0x2644ce)break;else _0x25f81d['push'](_0x25f81d['shift']());}catch(_0x593ac0){_0x25f81d['push'](_0x25f81d['shift']());}}}(a16_0xdd46,0xb117f));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';function a16_0xdd46(){const _0x2b27d6=['Get\x20a\x20config\x20value','log','read','15787Dpikcg','Delete\x20a\x20config\x20value','Value\x20to\x20assign','148oBrAXa','appcode','set','apps','`\x20=\x20\x22','Missing\x20key\x20argument.','Top-level\x20key\x20\x22','48MJfQyK','../../context.js','Key\x20not\x20found:\x20','bool','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Deleted\x20`','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20config\x20set\x20<key>\x20<value>\x20[--global]','key','Set\x20`','length','config','alias','object','field','isArray','Settable\x20keys:\x20','Usage:\x20','list','project-or-global-explicit','stringify','101859bpemiu','write','keys','join','Missing\x20key\x20or\x20value.','Invalid\x20value\x20for\x20\x22','pretty','13248IBIOQx','raw','5484730LoRuqH','pageSize','List\x20current\x20config',';\x20apps.<alias>.appcode','get','4816ZOETQR','(none)','\x22.\x20Allowed:\x20','\x20config\x20get\x20<key>','split','format','validation','5276868CmBkmM','\x22\x20is\x20not\x20settable.','Write\x20to\x20global\x20config','10519880IHummA','Set\x20a\x20config\x20value','\x20\x20global:\x20\x20','args','6481539SumhQR','\x20(global)','trim','value','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','global'];a16_0xdd46=function(){return _0x2b27d6;};return a16_0xdd46();}import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':'global','type':'boolean','description':a16_0x1b6f7d(0x1c3),'default':![]};function parseAliasAppcodeSetKey(_0x294be1){const _0x3828fb=a16_0x1b6f7d,_0x14abde=_0x294be1[_0x3828fb(0x1be)]('.');if(_0x14abde['length']!==0x3||_0x14abde[0x0]!==_0x3828fb(0x1d7)||_0x14abde[0x2]!==_0x3828fb(0x1d5))return undefined;const _0x438571=_0x14abde[0x1]?.['trim']();return _0x438571?_0x438571:undefined;}function parseAliasDeleteKey(_0x1e4083){const _0xcf3e35=a16_0x1b6f7d,_0x3cf6a4=_0x1e4083[_0xcf3e35(0x1be)]('.');if(_0x3cf6a4['length']===0x2&&_0x3cf6a4[0x0]===_0xcf3e35(0x1d7)){const _0x20dbda=_0x3cf6a4[0x1]?.[_0xcf3e35(0x1ca)]();return _0x20dbda?{'alias':_0x20dbda}:undefined;}if(_0x3cf6a4[_0xcf3e35(0x1e5)]===0x3&&_0x3cf6a4[0x0]===_0xcf3e35(0x1d7)&&_0x3cf6a4[0x2]===_0xcf3e35(0x1d5)){const _0x3d478d=_0x3cf6a4[0x1]?.[_0xcf3e35(0x1ca)]();return _0x3d478d?{'alias':_0x3d478d,'field':_0xcf3e35(0x1d5)}:undefined;}return undefined;}function setLocalAppAlias(_0x543ac5,_0x3a3b56,_0x15a8c5){const _0xe23aa4=a16_0x1b6f7d,_0x15ef29=_0x543ac5['apps']&&typeof _0x543ac5[_0xe23aa4(0x1d7)]===_0xe23aa4(0x1e8)&&!Array['isArray'](_0x543ac5['apps'])?_0x543ac5[_0xe23aa4(0x1d7)]:{},_0x5a207d=_0x15ef29[_0x3a3b56]&&typeof _0x15ef29[_0x3a3b56]===_0xe23aa4(0x1e8)&&!Array[_0xe23aa4(0x1ea)](_0x15ef29[_0x3a3b56])?_0x15ef29[_0x3a3b56]:{};_0x5a207d[_0xe23aa4(0x1d5)]=_0x15a8c5,_0x15ef29[_0x3a3b56]=_0x5a207d,_0x543ac5[_0xe23aa4(0x1d7)]=_0x15ef29;}function deleteLocalAppAlias(_0x29f906,_0x4e9a63){const _0x144c29=a16_0x1b6f7d;if(!_0x29f906['apps']||typeof _0x29f906[_0x144c29(0x1d7)]!==_0x144c29(0x1e8)||Array[_0x144c29(0x1ea)](_0x29f906['apps']))return![];const _0x191c41=_0x29f906[_0x144c29(0x1d7)],_0x57db10=_0x191c41[_0x4e9a63[_0x144c29(0x1e7)]];if(!_0x57db10||typeof _0x57db10!=='object'||Array[_0x144c29(0x1ea)](_0x57db10))return![];if(!_0x4e9a63[_0x144c29(0x1e9)])return delete _0x191c41[_0x4e9a63[_0x144c29(0x1e7)]],!![];if(!(_0x4e9a63[_0x144c29(0x1e9)]in _0x57db10))return![];return delete _0x57db10[_0x4e9a63[_0x144c29(0x1e9)]],Object[_0x144c29(0x1f2)](_0x57db10)[_0x144c29(0x1e5)]===0x0&&delete _0x191c41[_0x4e9a63['alias']],!![];}const listDef={'service':'config','command':a16_0x1b6f7d(0x1ed),'description':a16_0x1b6f7d(0x1fb),'risk':a16_0x1b6f7d(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5357f0){const _0x126775=a16_0x1b6f7d,{buildConfigFromFlags:_0x50fda3}=await import(_0x126775(0x1dc)),_0x40f4d7=_0x50fda3({}),_0x659fbd=getProjectConfigPath(),_0x2b9e25=resolveWriteConfigPath(_0x126775(0x1cd));if(_0x5357f0[_0x126775(0x1bf)]===_0x126775(0x1f6))return{'ok':!![],'message':_0x126775(0x1cc)+(JSON[_0x126775(0x1ef)](_0x40f4d7[_0x126775(0x1f8)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+('\x20\x20project:\x20'+(_0x659fbd??_0x126775(0x1ff))+'\x0a')+(_0x126775(0x1c6)+_0x2b9e25)};return{'ok':!![],'data':{'effective':_0x40f4d7[_0x126775(0x1f8)],'configFiles':{'project':_0x659fbd??null,'global':_0x2b9e25}}};}},getDef={'service':a16_0x1b6f7d(0x1e6),'command':a16_0x1b6f7d(0x1fd),'description':a16_0x1b6f7d(0x1ce),'risk':a16_0x1b6f7d(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x4d6d4d){const _0x2916ed=a16_0x1b6f7d,_0x374f9b=_0x4d6d4d[_0x2916ed(0x1c7)][0x0];if(!_0x374f9b)throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1d9),_0x2916ed(0x1ec)+CLI_BIN_NAME+_0x2916ed(0x1bd));const {buildConfigFromFlags:_0x3efb72}=await import(_0x2916ed(0x1dc)),{raw:_0x14a5fd}=_0x3efb72({});if(_0x374f9b['includes']('.')){const _0x38405e=_0x374f9b[_0x2916ed(0x1be)]('.');let _0x52f139=_0x14a5fd;for(const _0x5248bb of _0x38405e){if(_0x52f139==null||typeof _0x52f139!=='object')throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1dd)+_0x374f9b);_0x52f139=_0x52f139[_0x5248bb];}if(_0x52f139===undefined)throw CliErrors[_0x2916ed(0x1c0)]('Key\x20not\x20found:\x20'+_0x374f9b);return console[_0x2916ed(0x1cf)](typeof _0x52f139===_0x2916ed(0x1e8)?JSON[_0x2916ed(0x1ef)](_0x52f139,null,0x2):String(_0x52f139)),{'ok':!![]};}const _0x22cac2=_0x14a5fd[_0x374f9b];if(_0x22cac2===undefined)throw CliErrors[_0x2916ed(0x1c0)](_0x2916ed(0x1dd)+_0x374f9b);return console[_0x2916ed(0x1cf)](typeof _0x22cac2===_0x2916ed(0x1e8)?JSON[_0x2916ed(0x1ef)](_0x22cac2,null,0x2):String(_0x22cac2)),{'ok':!![]};}},setDef={'service':a16_0x1b6f7d(0x1e6),'command':a16_0x1b6f7d(0x1d6),'description':a16_0x1b6f7d(0x1c5),'risk':a16_0x1b6f7d(0x1f1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x1b6f7d(0x1cb),'description':a16_0x1b6f7d(0x1d3),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4983a8){const _0x59b8af=a16_0x1b6f7d,_0x26d447=_0x4983a8[_0x59b8af(0x1c7)][0x0],_0x60facd=_0x4983a8[_0x59b8af(0x1c7)][0x1];if(!_0x26d447||_0x60facd===undefined)throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1f4),_0x59b8af(0x1ec)+CLI_BIN_NAME+_0x59b8af(0x1e2));if(ENUM_KEYS[_0x26d447]&&!ENUM_KEYS[_0x26d447]['includes'](_0x60facd))throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1f5)+_0x26d447+_0x59b8af(0x1bc)+ENUM_KEYS[_0x26d447][_0x59b8af(0x1f3)](',\x20'));if(_0x26d447==='riskLevel')throw CliErrors['validation'](_0x59b8af(0x1df));if(_0x26d447===_0x59b8af(0x1fa)){const _0x5c6278=Number(_0x60facd);if(isNaN(_0x5c6278)||_0x5c6278<=0x0)throw CliErrors[_0x59b8af(0x1c0)](_0x59b8af(0x1e1));}const _0x5c6bc4=resolveWriteScope({'explicitGlobal':_0x4983a8[_0x59b8af(0x1de)](_0x59b8af(0x1cd)),'policy':_0x59b8af(0x1ee)}),_0xb764b2=toScopeFlags(_0x5c6bc4),_0x315d64=readScopedConfig(_0xb764b2),_0x4d7b67=parseAliasAppcodeSetKey(_0x26d447);if(!_0x4d7b67&&!isTopLevelConfigKey(_0x26d447))throw CliErrors['validation'](_0x59b8af(0x1da)+_0x26d447+_0x59b8af(0x1c2),_0x59b8af(0x1eb)+getTopLevelConfigKeySummary()+_0x59b8af(0x1fc));return _0x4d7b67?setLocalAppAlias(_0x315d64,_0x4d7b67,_0x60facd):_0x315d64[_0x26d447]=_0x26d447==='pageSize'?Number(_0x60facd):_0x60facd,console['log'](_0x59b8af(0x1e4)+_0x26d447+_0x59b8af(0x1d8)+_0x60facd+'\x22'+(_0x5c6bc4===_0x59b8af(0x1cd)?_0x59b8af(0x1c9):'')),writeScopedConfig(_0x315d64,_0xb764b2),{'ok':!![]};}},deleteDef={'service':a16_0x1b6f7d(0x1e6),'command':'delete','description':a16_0x1b6f7d(0x1d2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x1b6f7d(0x1e3),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x56ff96){const _0x1e9719=a16_0x1b6f7d,_0x29c6b1=_0x56ff96[_0x1e9719(0x1c7)][0x0];if(!_0x29c6b1)throw CliErrors[_0x1e9719(0x1c0)](_0x1e9719(0x1d9),_0x1e9719(0x1ec)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x4b5275=resolveWriteScope({'explicitGlobal':_0x56ff96[_0x1e9719(0x1de)](_0x1e9719(0x1cd)),'policy':'project-or-global-explicit'}),_0x50e564=toScopeFlags(_0x4b5275),_0x2136fd=readScopedConfig(_0x50e564),_0x2ab259=parseAliasDeleteKey(_0x29c6b1);if(_0x2ab259){if(!deleteLocalAppAlias(_0x2136fd,_0x2ab259))throw CliErrors[_0x1e9719(0x1c0)](_0x1e9719(0x1dd)+_0x29c6b1);return console[_0x1e9719(0x1cf)](_0x1e9719(0x1e0)+_0x29c6b1+'`'+(_0x4b5275===_0x1e9719(0x1cd)?_0x1e9719(0x1c9):'')),writeScopedConfig(_0x2136fd,_0x50e564),{'ok':!![]};}if(_0x2136fd[_0x29c6b1]===undefined)throw CliErrors[_0x1e9719(0x1c0)]('Key\x20\x22'+_0x29c6b1+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x2136fd[_0x29c6b1],console[_0x1e9719(0x1cf)](_0x1e9719(0x1e0)+_0x29c6b1+'`'+(_0x4b5275===_0x1e9719(0x1cd)?_0x1e9719(0x1c9):'')),writeScopedConfig(_0x2136fd,_0x50e564),{'ok':!![]};}};function a16_0x4b9c(_0x3307dc,_0x5c2ddf){_0x3307dc=_0x3307dc-0x1bc;const _0xdd46ab=a16_0xdd46();let _0x4b9c4d=_0xdd46ab[_0x3307dc];return _0x4b9c4d;}export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xcf186b,_0x282ed8){var _0xdce02f=a17_0x2847,_0xa7c5f9=_0xcf186b();while(!![]){try{var _0x5a0e54=parseInt(_0xdce02f(0x10c))/0x1*(parseInt(_0xdce02f(0x105))/0x2)+parseInt(_0xdce02f(0x109))/0x3+parseInt(_0xdce02f(0x107))/0x4+parseInt(_0xdce02f(0x10d))/0x5+-parseInt(_0xdce02f(0x10b))/0x6*(-parseInt(_0xdce02f(0x10a))/0x7)+parseInt(_0xdce02f(0x10e))/0x8*(-parseInt(_0xdce02f(0x106))/0x9)+-parseInt(_0xdce02f(0x108))/0xa;if(_0x5a0e54===_0x282ed8)break;else _0xa7c5f9['push'](_0xa7c5f9['shift']());}catch(_0x1759b1){_0xa7c5f9['push'](_0xa7c5f9['shift']());}}}(a17_0x1234,0x79d89));import{CLI_BIN_NAME}from'../../constant/cli.js';function a17_0x2847(_0x4e9e96,_0x1c0254){_0x4e9e96=_0x4e9e96-0x105;var _0x1234f8=a17_0x1234();var _0x284722=_0x1234f8[_0x4e9e96];return _0x284722;}export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';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';function a17_0x1234(){var _0x590b6a=['4532KdjORQ','531351vqxifH','2227428oGgKaq','24602720LSItTB','2951715RXifJf','707lBxHcG','38118iDPTFR','409BADkUs','3088255kDKmxz','104VnJmvh'];a17_0x1234=function(){return _0x590b6a;};return a17_0x1234();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a18_0x84fe(_0x2c0f53,_0x18ecc7){_0x2c0f53=_0x2c0f53-0x179;const _0x268342=a18_0x2683();let _0x84fee0=_0x268342[_0x2c0f53];return _0x84fee0;}const a18_0x2db958=a18_0x84fe;(function(_0x293acc,_0x1a5aea){const _0x4784f6=a18_0x84fe,_0x240410=_0x293acc();while(!![]){try{const _0x3e6efd=-parseInt(_0x4784f6(0x1a7))/0x1*(-parseInt(_0x4784f6(0x1c2))/0x2)+-parseInt(_0x4784f6(0x199))/0x3*(-parseInt(_0x4784f6(0x198))/0x4)+-parseInt(_0x4784f6(0x1ad))/0x5+parseInt(_0x4784f6(0x18e))/0x6*(parseInt(_0x4784f6(0x1cb))/0x7)+parseInt(_0x4784f6(0x17a))/0x8+-parseInt(_0x4784f6(0x19b))/0x9+parseInt(_0x4784f6(0x191))/0xa*(-parseInt(_0x4784f6(0x185))/0xb);if(_0x3e6efd===_0x1a5aea)break;else _0x240410['push'](_0x240410['shift']());}catch(_0x57cf3e){_0x240410['push'](_0x240410['shift']());}}}(a18_0x2683,0xd278e));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';const specs=[{'command':a18_0x2db958(0x18b),'operation':a18_0x2db958(0x18b),'risk':a18_0x2db958(0x17b),'paramsRequired':![],'description':a18_0x2db958(0x1a3),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a18_0x2db958(0x17e),'helpExtra':[a18_0x2db958(0x1bc),a18_0x2db958(0x1af),a18_0x2db958(0x1cc),a18_0x2db958(0x193),a18_0x2db958(0x1a0),a18_0x2db958(0x1a1),a18_0x2db958(0x1c3),a18_0x2db958(0x1a5),a18_0x2db958(0x1ba),'\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}}',a18_0x2db958(0x19a),'',a18_0x2db958(0x182),a18_0x2db958(0x1b1),'\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}}]}','',a18_0x2db958(0x1b6),a18_0x2db958(0x19e),a18_0x2db958(0x1c1),a18_0x2db958(0x1aa),a18_0x2db958(0x1bf),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a18_0x2db958(0x1ac),a18_0x2db958(0x1bd),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x2db958(0x1b3)][a18_0x2db958(0x196)]('\x0a')},{'command':a18_0x2db958(0x1ce),'operation':a18_0x2db958(0x1ce),'risk':a18_0x2db958(0x17b),'paramsRequired':!![],'description':a18_0x2db958(0x1be),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x2db958(0x1ca),'operation':a18_0x2db958(0x1ca),'risk':'write','paramsRequired':!![],'description':a18_0x2db958(0x195),'paramsHint':a18_0x2db958(0x187)},{'command':a18_0x2db958(0x1a2),'operation':a18_0x2db958(0x1a2),'risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a18_0x2db958(0x17f),'operation':'update','risk':a18_0x2db958(0x1c5),'paramsRequired':!![],'description':a18_0x2db958(0x18a),'paramsHint':a18_0x2db958(0x19d)},{'command':a18_0x2db958(0x183),'operation':'delete','risk':'high-risk-write','paramsRequired':!![],'description':a18_0x2db958(0x190),'paramsHint':a18_0x2db958(0x1c6)},{'command':'aggregate','operation':a18_0x2db958(0x1cd),'risk':a18_0x2db958(0x17b),'paramsRequired':![],'description':a18_0x2db958(0x1b4),'paramsHint':a18_0x2db958(0x1bb)+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a18_0x2db958(0x19f),'\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}',a18_0x2db958(0x181),a18_0x2db958(0x1c7),a18_0x2db958(0x186),a18_0x2db958(0x1c8),a18_0x2db958(0x179),'\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','',a18_0x2db958(0x1c4),a18_0x2db958(0x192),'\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a18_0x2db958(0x188),a18_0x2db958(0x1b9),a18_0x2db958(0x1b8),a18_0x2db958(0x1a4),'','\x20\x20EXAMPLES',a18_0x2db958(0x1ae),a18_0x2db958(0x180),'',a18_0x2db958(0x189),a18_0x2db958(0x1a6)][a18_0x2db958(0x196)]('\x0a')}];function makeDataCommand(_0x5a7695){const _0x9b55bf=a18_0x2db958,_0x3cd155=_0x9b55bf(0x1c9)+_0x5a7695['command'],_0x55f3f2={'service':_0x9b55bf(0x18f),'command':_0x5a7695['command'],'description':_0x5a7695[_0x9b55bf(0x1c0)],'risk':_0x5a7695[_0x9b55bf(0x18d)],'helpExtra':_0x5a7695[_0x9b55bf(0x1a8)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5a7695[_0x9b55bf(0x1ab)]}],'validate':async _0x541755=>{const _0x128050=_0x9b55bf;_0x5a7695[_0x128050(0x17c)]&&requireAnyOf(_0x541755,[_0x128050(0x1a9)],_0x3cd155),_0x5a7695['operation']==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x541755[_0x128050(0x1b7)](_0x128050(0x1a9))));},async 'execute'(_0x2f63dc){const _0x383560=_0x9b55bf,_0x4949f1=_0x2f63dc['str'](_0x383560(0x1b5)),_0x114832=_0x5a7695[_0x383560(0x194)]===_0x383560(0x1a2)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2f63dc[_0x383560(0x1b7)]('params'))):parseJsonParams(_0x2f63dc['str']('params'))??{},_0x16165c=Date[_0x383560(0x19c)](),_0x41851e=await executeData(_0x4949f1,_0x5a7695[_0x383560(0x194)],_0x114832),_0x56a8ed=Date[_0x383560(0x19c)]()-_0x16165c;return{'ok':!![],'data':{'result':_0x41851e,'elapsed':_0x56a8ed},'message':_0x383560(0x1c9)+_0x5a7695[_0x383560(0x17d)]+'\x20completed\x20in\x20'+_0x56a8ed+'ms'};}};return _0x5a7695['risk']!=='read'&&(_0x55f3f2[_0x9b55bf(0x184)]=async _0x3fb643=>{const _0x1a8676=_0x9b55bf,_0x3560f9=_0x3fb643['str'](_0x1a8676(0x1b5)),_0x3b0dc3=_0x5a7695['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3fb643[_0x1a8676(0x1b7)](_0x1a8676(0x1a9)))):parseJsonParams(_0x3fb643[_0x1a8676(0x1b7)](_0x1a8676(0x1a9)))??{};return dryRun(_0x1a8676(0x18c),_0x1a8676(0x1b0)+_0x3560f9+'/'+_0x5a7695[_0x1a8676(0x194)])['body'](_0x3b0dc3)['description']('Preview:\x20data\x20'+_0x5a7695[_0x1a8676(0x17d)]+_0x1a8676(0x197)+_0x3560f9)[_0x1a8676(0x1b2)]();}),_0x55f3f2;}function a18_0x2683(){const _0x20bc9b=['data','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','17084810BXVGIT','\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$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}}','operation','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','join','\x20on\x20dataset\x20','1868592bSwuah','3EpQkjA','\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}}','634140AkvOWd','now','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20AGGREGATE\x20TYPES','\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\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}}','batchCreate','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\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]}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\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','1662Zboalw','helpExtra','params','\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}]','paramsHint','\x20\x20PAGINATION','1435495QOvCax','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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}}','/api/{appCode}/','\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}}]}','build','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','code','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','str','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\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}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','description','\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]','1906NkLzQE','\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\x20PARAMS\x20STRUCTURE','write','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','data\x20','create','2999528uqNCvM','\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}}','aggregate','getOne','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','6972520fZiiag','read','paramsRequired','command','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','update','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20LOGICAL\x20COMBINATORS','delete','dryRun','22ssJxTW','\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\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\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Update\x20an\x20existing\x20record','filter','POST','risk','24JKhyok'];a18_0x2683=function(){return _0x20bc9b;};return a18_0x2683();}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
const a18_0x2436e9=a18_0x56fb;(function(_0x4b0e92,_0x432a71){const _0x179cce=a18_0x56fb,_0x568442=_0x4b0e92();while(!![]){try{const _0xf054de=parseInt(_0x179cce(0x16c))/0x1*(-parseInt(_0x179cce(0x18a))/0x2)+-parseInt(_0x179cce(0x147))/0x3+-parseInt(_0x179cce(0x139))/0x4*(-parseInt(_0x179cce(0x137))/0x5)+-parseInt(_0x179cce(0x164))/0x6+parseInt(_0x179cce(0x166))/0x7*(-parseInt(_0x179cce(0x185))/0x8)+parseInt(_0x179cce(0x16e))/0x9+parseInt(_0x179cce(0x146))/0xa;if(_0xf054de===_0x432a71)break;else _0x568442['push'](_0x568442['shift']());}catch(_0x190c3f){_0x568442['push'](_0x568442['shift']());}}}(a18_0x1c3a,0xe0b4b));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 a18_0x1c3a(){const _0x44ed8e=['params','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\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}}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','5aWpXCL','write','5884364trnqGA','\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}}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\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#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20field\x20values\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','command','description','13538990TdLFYX','4129761XELZLN','str','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filter,\x20e.g.\x20{\x22total\x22:{\x22$gt\x22:1000}}','now','getOne','Update\x20an\x20existing\x20record','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\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\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','body','aggregate','code','build','\x20on\x20dataset\x20','paramsRequired','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','delete','data','\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]}}','\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\x20PAGINATION','paramsHint','\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}}','risk','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','read','\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$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)','4719126WCKzfJ','create','139090rJssaV','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','POST','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','6879CnTDHy','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','16269966hgdlqA','\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\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','operation','high-risk-write','\x20\x20EXAMPLES','\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{\x22field\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','join','\x20\x20LOGICAL\x20COMBINATORS','\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}}','update','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','filter','\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\x20PARAMS\x20STRUCTURE','data\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20completed\x20in\x20','\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}}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','dryRun','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','128MoAyjh','batchCreate','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','358BaeyTI','\x20\x20WHERE\x20OPERATORS','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\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}}'];a18_0x1c3a=function(){return _0x44ed8e;};return a18_0x1c3a();}const specs=[{'command':a18_0x2436e9(0x17a),'operation':a18_0x2436e9(0x17a),'risk':a18_0x2436e9(0x160),'paramsRequired':![],'description':a18_0x2436e9(0x187),'paramsHint':a18_0x2436e9(0x140)+a18_0x2436e9(0x184),'helpExtra':[a18_0x2436e9(0x18b),a18_0x2436e9(0x15d),a18_0x2436e9(0x161),a18_0x2436e9(0x16f),a18_0x2436e9(0x177),a18_0x2436e9(0x13a),a18_0x2436e9(0x180),a18_0x2436e9(0x159),a18_0x2436e9(0x135),a18_0x2436e9(0x18d),a18_0x2436e9(0x15a),'',a18_0x2436e9(0x176),'\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}}]}',a18_0x2436e9(0x162),'',a18_0x2436e9(0x163),a18_0x2436e9(0x134),a18_0x2436e9(0x170),a18_0x2436e9(0x17b),a18_0x2436e9(0x167),a18_0x2436e9(0x188),'',a18_0x2436e9(0x15b),a18_0x2436e9(0x15f),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x2436e9(0x13f)][a18_0x2436e9(0x175)]('\x0a')},{'command':a18_0x2436e9(0x14b),'operation':a18_0x2436e9(0x14b),'risk':'read','paramsRequired':!![],'description':a18_0x2436e9(0x142),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a18_0x2436e9(0x165),'operation':a18_0x2436e9(0x165),'risk':a18_0x2436e9(0x138),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a18_0x2436e9(0x13c)},{'command':'batchCreate','operation':a18_0x2436e9(0x186),'risk':'write','paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','paramsHint':a18_0x2436e9(0x14d)},{'command':a18_0x2436e9(0x178),'operation':a18_0x2436e9(0x178),'risk':'write','paramsRequired':!![],'description':a18_0x2436e9(0x14c),'paramsHint':a18_0x2436e9(0x136)},{'command':a18_0x2436e9(0x157),'operation':a18_0x2436e9(0x157),'risk':a18_0x2436e9(0x172),'paramsRequired':!![],'description':a18_0x2436e9(0x179),'paramsHint':a18_0x2436e9(0x143)},{'command':a18_0x2436e9(0x151),'operation':a18_0x2436e9(0x151),'risk':a18_0x2436e9(0x160),'paramsRequired':![],'description':a18_0x2436e9(0x181),'paramsHint':a18_0x2436e9(0x18c)+a18_0x2436e9(0x16b),'helpExtra':[a18_0x2436e9(0x169),a18_0x2436e9(0x141),a18_0x2436e9(0x13b),a18_0x2436e9(0x13e),a18_0x2436e9(0x189),'\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{\x22field\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}',a18_0x2436e9(0x16d),a18_0x2436e9(0x174),'',a18_0x2436e9(0x17c),'\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]',a18_0x2436e9(0x17e),a18_0x2436e9(0x14f),'\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a18_0x2436e9(0x149),a18_0x2436e9(0x182),'',a18_0x2436e9(0x173),a18_0x2436e9(0x13d),a18_0x2436e9(0x16a),'',a18_0x2436e9(0x156),a18_0x2436e9(0x14e)][a18_0x2436e9(0x175)]('\x0a')}];function a18_0x56fb(_0x470258,_0x4e80b4){_0x470258=_0x470258-0x133;const _0x1c3ae4=a18_0x1c3a();let _0x56fb22=_0x1c3ae4[_0x470258];return _0x56fb22;}function makeDataCommand(_0x3c6402){const _0x515d72=a18_0x2436e9,_0x270150=_0x515d72(0x17d)+_0x3c6402[_0x515d72(0x144)],_0x584e19={'service':_0x515d72(0x158),'command':_0x3c6402[_0x515d72(0x144)],'description':_0x3c6402[_0x515d72(0x145)],'risk':_0x3c6402[_0x515d72(0x15e)],'helpExtra':_0x3c6402['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x3c6402[_0x515d72(0x15c)]}],'validate':async _0x456450=>{const _0x42a163=_0x515d72;_0x3c6402[_0x42a163(0x155)]&&requireAnyOf(_0x456450,['params'],_0x270150),_0x3c6402[_0x42a163(0x171)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x456450[_0x42a163(0x148)](_0x42a163(0x133))));},async 'execute'(_0x40353b){const _0x4048d7=_0x515d72,_0x435989=_0x40353b[_0x4048d7(0x148)](_0x4048d7(0x152)),_0x4a7281=_0x3c6402[_0x4048d7(0x171)]===_0x4048d7(0x186)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x40353b[_0x4048d7(0x148)](_0x4048d7(0x133)))):parseJsonParams(_0x40353b['str']('params'))??{},_0x3db28e=Date[_0x4048d7(0x14a)](),_0x2e4fda=await executeData(_0x435989,_0x3c6402[_0x4048d7(0x171)],_0x4a7281),_0x3d0712=Date[_0x4048d7(0x14a)]()-_0x3db28e;return{'ok':!![],'data':{'result':_0x2e4fda,'elapsed':_0x3d0712},'message':_0x4048d7(0x17d)+_0x3c6402[_0x4048d7(0x144)]+_0x4048d7(0x17f)+_0x3d0712+'ms'};}};return _0x3c6402['risk']!=='read'&&(_0x584e19[_0x515d72(0x183)]=async _0x1e9a1c=>{const _0x1e5c0f=_0x515d72,_0x5de11c=_0x1e9a1c[_0x1e5c0f(0x148)]('code'),_0x4aa955=_0x3c6402[_0x1e5c0f(0x171)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1e9a1c['str'](_0x1e5c0f(0x133)))):parseJsonParams(_0x1e9a1c[_0x1e5c0f(0x148)](_0x1e5c0f(0x133)))??{};return dryRun(_0x1e5c0f(0x168),'/api/{appCode}/'+_0x5de11c+'/'+_0x3c6402['operation'])[_0x1e5c0f(0x150)](_0x4aa955)[_0x1e5c0f(0x145)]('Preview:\x20data\x20'+_0x3c6402[_0x1e5c0f(0x144)]+_0x1e5c0f(0x154)+_0x5de11c)[_0x1e5c0f(0x153)]();}),_0x584e19;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x2f92f0=a19_0x1927;(function(_0x2d9fd6,_0xac24f7){const _0x35e412=a19_0x1927,_0x5c37a3=_0x2d9fd6();while(!![]){try{const _0x196a71=parseInt(_0x35e412(0x184))/0x1+parseInt(_0x35e412(0x189))/0x2+parseInt(_0x35e412(0x162))/0x3*(-parseInt(_0x35e412(0x178))/0x4)+-parseInt(_0x35e412(0x172))/0x5*(parseInt(_0x35e412(0x177))/0x6)+parseInt(_0x35e412(0x14c))/0x7+parseInt(_0x35e412(0x146))/0x8+-parseInt(_0x35e412(0x17c))/0x9;if(_0x196a71===_0xac24f7)break;else _0x5c37a3['push'](_0x5c37a3['shift']());}catch(_0x1f23bc){_0x5c37a3['push'](_0x5c37a3['shift']());}}}(a19_0x2bbe,0x83ba8));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x34372d){const _0x2d66a0=a19_0x1927;if(_0x34372d[_0x2d66a0(0x14d)])return null;const _0x2ee7f1=Boolean(_0x34372d[_0x2d66a0(0x163)]!==undefined||_0x34372d['doType']!==undefined);let _0x14eef3={};if(!_0x2ee7f1&&typeof _0x34372d[_0x2d66a0(0x188)]===_0x2d66a0(0x174))try{_0x14eef3=JSON[_0x2d66a0(0x187)](_0x34372d[_0x2d66a0(0x188)]);}catch{}const _0x12cdc8=_0x2ee7f1?_0x34372d[_0x2d66a0(0x157)]:_0x34372d[_0x2d66a0(0x167)],_0x2a2fa3=_0x2ee7f1?_0x34372d[_0x2d66a0(0x163)]:_0x34372d[_0x2d66a0(0x157)],_0x491d52=_0x2ee7f1?_0x34372d[_0x2d66a0(0x15a)]:_0x34372d['type']||_0x34372d['dataType'],_0x2870dc=_0x2ee7f1?_0x34372d[_0x2d66a0(0x183)]===!![]:_0x14eef3[_0x2d66a0(0x183)]===!![],_0x4c9873=_0x2ee7f1?_0x34372d[_0x2d66a0(0x16d)]===!![]:_0x14eef3[_0x2d66a0(0x16d)]===!![],_0x4bdbd6=_0x2ee7f1?_0x34372d[_0x2d66a0(0x165)]??null:_0x14eef3[_0x2d66a0(0x165)]??null,_0x365b15={'name':_0x12cdc8,'displayName':_0x2a2fa3||_0x12cdc8,'type':_0x491d52,'dbType':_0x34372d[_0x2d66a0(0x161)],'pk':_0x2870dc,'required':_0x4c9873,'description':_0x34372d['description']||undefined};return Array[_0x2d66a0(0x175)](_0x4bdbd6)&&_0x4bdbd6[_0x2d66a0(0x164)]>0x0&&(_0x365b15['options']=_0x4bdbd6),_0x365b15;}function parseJsonMaybe(_0x5cf4ac){const _0x18a195=a19_0x1927;if(typeof _0x5cf4ac!==_0x18a195(0x174))return _0x5cf4ac;try{return JSON[_0x18a195(0x187)](_0x5cf4ac);}catch{return _0x5cf4ac;}}function normalizeOperationEntry(_0x4b3f63,_0x129760){const _0x2bcff1=a19_0x1927;if(!_0x129760||typeof _0x129760!==_0x2bcff1(0x180))return null;if(!_0x129760[_0x2bcff1(0x147)]||!_0x129760[_0x2bcff1(0x16b)])return null;const _0x5d784e={'name':_0x4b3f63,'method':_0x129760[_0x2bcff1(0x147)],'path':_0x129760[_0x2bcff1(0x16b)]};if(_0x129760[_0x2bcff1(0x16e)])_0x5d784e['host']=_0x129760[_0x2bcff1(0x16e)];if(_0x129760[_0x2bcff1(0x17e)]!=null)_0x5d784e['requestBody']=parseJsonMaybe(_0x129760[_0x2bcff1(0x17e)]);if(_0x129760['responseBody']!=null)_0x5d784e[_0x2bcff1(0x149)]=parseJsonMaybe(_0x129760['responseBody']);if(_0x129760[_0x2bcff1(0x155)]!=null)_0x5d784e[_0x2bcff1(0x155)]=_0x129760[_0x2bcff1(0x155)];if(_0x129760[_0x2bcff1(0x144)]!=null)_0x5d784e['afterScriptId']=_0x129760[_0x2bcff1(0x144)];if(Array[_0x2bcff1(0x175)](_0x129760[_0x2bcff1(0x182)]))_0x5d784e['requestFields']=_0x129760[_0x2bcff1(0x182)];if(Array[_0x2bcff1(0x175)](_0x129760[_0x2bcff1(0x141)]))_0x5d784e[_0x2bcff1(0x141)]=_0x129760[_0x2bcff1(0x141)];return _0x5d784e;}function a19_0x1927(_0x1ef5d3,_0x49d78d){_0x1ef5d3=_0x1ef5d3-0x13d;const _0x2bbe0a=a19_0x2bbe();let _0x1927ad=_0x2bbe0a[_0x1ef5d3];return _0x1927ad;}function summarizeDbtable(_0x52baf7){const _0x452d8c=a19_0x1927,_0x39dd1e={},_0x2ec81a=[_0x452d8c(0x169),'dbName','tableName',_0x452d8c(0x186),_0x452d8c(0x183),_0x452d8c(0x17f),'logicField',_0x452d8c(0x185),_0x452d8c(0x143),'creatorIdField',_0x452d8c(0x170),'modifierIdField',_0x452d8c(0x14a),'labelField','dblinkInfoDTO'];for(const _0x1fdb20 of _0x2ec81a){if(_0x52baf7[_0x1fdb20]!==undefined)_0x39dd1e[_0x1fdb20]=_0x52baf7[_0x1fdb20];}return typeof _0x39dd1e['allFields']==='string'&&_0x39dd1e[_0x452d8c(0x17f)][_0x452d8c(0x164)]>0x0&&(_0x39dd1e['allFieldNames']=_0x39dd1e[_0x452d8c(0x17f)][_0x452d8c(0x171)](',')['map'](_0x33d67b=>_0x33d67b['trim']())['filter'](Boolean)),_0x39dd1e;}function normalizeRelatedPages(_0x48d6b4){const _0x394234=a19_0x1927;if(!Array[_0x394234(0x175)](_0x48d6b4))return[];return _0x48d6b4[_0x394234(0x181)](_0x33d415=>_0x33d415&&typeof _0x33d415===_0x394234(0x180))[_0x394234(0x15f)](_0x1ccea1=>({'id':_0x1ccea1['id'],'type':_0x1ccea1[_0x394234(0x17d)],'code':_0x1ccea1[_0x394234(0x167)],'title':_0x1ccea1[_0x394234(0x13d)],'deleted':_0x1ccea1[_0x394234(0x14d)]===!![]}));}function a19_0x2bbe(){const _0x4f88cc=['587813OiLZWk','createTimeField','datasetKey','parse','extend','1377502fullHK','title','entries','str','toTableName','responseFields','dataset','updateTimeField','afterScriptId','sourceType','1967624euQOmn','method','relations','responseBody','modifierNameField','validateRules','4621071OclVfO','deleted','modelCode','operations','toDatasetName','doVersion','formatRules','detail','fromField','beforeScriptId','fields','name','columnCodeListWithDeleted','toField','doType','modelId','dbName','source','tableName','map','appCode','dbType','3MINzol','displayName','length','options','tableComment','code','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','dbId','find','path','read','required','host','properties','creatorNameField','split','1359235duRUnP','dbtableConfig','string','isArray','push','12FEmQMT','1563348nUFcEo','relatedPageInfoList','indexes','toDatasetCode','6377211uLlGkV','type','requestBody','allFields','object','filter','requestFields','pkField'];a19_0x2bbe=function(){return _0x4f88cc;};return a19_0x2bbe();}function normalizeFallbackFieldName(_0x2c7694,_0xb49a9e){const _0x5dc812=_0x2c7694['trim']();if(!_0x5dc812)return null;return{'name':_0x5dc812,'displayName':_0x5dc812,'type':undefined,'dbType':undefined,'pk':_0x5dc812===_0xb49a9e,'required':![],'description':undefined};}async function loadListFieldFallback(_0x4b30d4,_0x1af513){const _0x32bfb7=a19_0x1927;if(!_0x4b30d4||!_0x1af513)return[];try{const _0x1109a5=await listDatasets(_0x4b30d4,{'code':_0x1af513}),_0x299245=_0x1109a5[_0x32bfb7(0x16a)](_0x42ed0a=>_0x42ed0a['code']===_0x1af513)??_0x1109a5[0x0],_0x366ac8=_0x299245?.[_0x32bfb7(0x173)]??{},_0x468e87=typeof _0x366ac8['allFields']==='string'?_0x366ac8[_0x32bfb7(0x17f)][_0x32bfb7(0x171)](','):[];return _0x468e87['map'](_0x256ffd=>normalizeFallbackFieldName(_0x256ffd,_0x366ac8['pkField']))['filter'](_0x36ee85=>_0x36ee85!==null);}catch{return[];}}export const datasetDetail={'service':a19_0x2f92f0(0x142),'command':a19_0x2f92f0(0x153),'description':a19_0x2f92f0(0x168),'risk':a19_0x2f92f0(0x16c),'flags':[CODE_FLAG],async 'execute'(_0x2c5e5b){const _0xc1062a=a19_0x2f92f0,_0x1c83e1=await getDatasetDetail(_0x2c5e5b[_0xc1062a(0x13f)](_0xc1062a(0x167))),_0x2ee4a3=Array['isArray'](_0x1c83e1[_0xc1062a(0x156)])?_0x1c83e1['fields']:Array[_0xc1062a(0x175)](_0x1c83e1[_0xc1062a(0x16f)])?_0x1c83e1[_0xc1062a(0x16f)]:[];let _0x5cb3dc=_0x2ee4a3[_0xc1062a(0x15f)](_0x329a2b=>normalizeField(_0x329a2b))[_0xc1062a(0x181)](_0x31e80b=>_0x31e80b!==null);_0x5cb3dc['length']===0x0&&(_0x5cb3dc=await loadListFieldFallback(_0x2c5e5b[_0xc1062a(0x160)],_0x2c5e5b[_0xc1062a(0x13f)]('code')));const _0x4a9dea=_0x1c83e1[_0xc1062a(0x14f)]??{},_0x899efd=[];for(const [_0x27ac95,_0x5bba60]of Object[_0xc1062a(0x13e)](_0x4a9dea)){const _0x1dfb40=normalizeOperationEntry(_0x27ac95,_0x5bba60);if(_0x1dfb40)_0x899efd[_0xc1062a(0x176)](_0x1dfb40);}const _0x34b6dd=_0x1c83e1[_0xc1062a(0x173)]??{},_0x8dbe8b=_0x1c83e1[_0xc1062a(0x142)]??{},_0x34823f=_0x34b6dd[_0xc1062a(0x169)]!=null?{'id':_0x34b6dd['dbId'],'name':_0x34b6dd[_0xc1062a(0x15c)]??null}:undefined;let _0x4ea887;return typeof _0x1c83e1[_0xc1062a(0x188)]===_0xc1062a(0x174)&&(_0x4ea887=parseJsonMaybe(_0x1c83e1['extend'])),{'ok':!![],'data':{'id':_0x1c83e1[_0xc1062a(0x15b)]??_0x1c83e1['id'],'name':_0x1c83e1[_0xc1062a(0x157)],'code':_0x1c83e1[_0xc1062a(0x14e)]||_0x1c83e1['code'],'doVersion':_0x1c83e1[_0xc1062a(0x151)],'description':_0x1c83e1['description']||_0x8dbe8b[_0xc1062a(0x166)]||undefined,'source':_0x1c83e1[_0xc1062a(0x15d)]||_0x8dbe8b[_0xc1062a(0x145)],'table':_0x34b6dd[_0xc1062a(0x15e)]||_0x8dbe8b[_0xc1062a(0x15e)],'datasetKey':_0x34b6dd[_0xc1062a(0x186)],'pk':_0x34b6dd[_0xc1062a(0x183)],'db':_0x34823f,'dbtable':summarizeDbtable(_0x34b6dd),'fields':_0x5cb3dc,'operations':_0x899efd,'indexes':Array[_0xc1062a(0x175)](_0x8dbe8b[_0xc1062a(0x17a)])?_0x8dbe8b['indexes']:[],'relations':Array[_0xc1062a(0x175)](_0x1c83e1[_0xc1062a(0x148)])?_0x1c83e1[_0xc1062a(0x148)][_0xc1062a(0x15f)](_0x8e59ff=>({'fromField':_0x8e59ff[_0xc1062a(0x154)],'toDataset':_0x8e59ff[_0xc1062a(0x150)],'toCode':_0x8e59ff[_0xc1062a(0x17b)],'toTable':_0x8e59ff[_0xc1062a(0x140)],'toField':_0x8e59ff[_0xc1062a(0x159)],'labelField':_0x8e59ff['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0x1c83e1[_0xc1062a(0x179)]),...Array[_0xc1062a(0x175)](_0x1c83e1['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x1c83e1[_0xc1062a(0x158)]}:{},'formatRules':Array['isArray'](_0x1c83e1[_0xc1062a(0x152)])?_0x1c83e1[_0xc1062a(0x152)]:[],'validateRules':Array['isArray'](_0x1c83e1[_0xc1062a(0x14b)])?_0x1c83e1[_0xc1062a(0x14b)]:[],..._0x4ea887!==undefined?{'extend':_0x4ea887}:{},'stats':{'fieldCount':_0x5cb3dc['length'],'operationCount':_0x899efd['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x3099(_0x551b1c,_0x15886a){_0x551b1c=_0x551b1c-0xaa;const _0x11a57f=a20_0x11a5();let _0x3099a0=_0x11a57f[_0x551b1c];return _0x3099a0;}(function(_0x58a749,_0x4b8422){const _0xf7f293=a20_0x3099,_0x4a6735=_0x58a749();while(!![]){try{const _0xe67ce3=-parseInt(_0xf7f293(0xb1))/0x1*(-parseInt(_0xf7f293(0xb4))/0x2)+-parseInt(_0xf7f293(0xaf))/0x3+-parseInt(_0xf7f293(0xb0))/0x4+parseInt(_0xf7f293(0xae))/0x5+-parseInt(_0xf7f293(0xb3))/0x6*(parseInt(_0xf7f293(0xaa))/0x7)+parseInt(_0xf7f293(0xab))/0x8*(-parseInt(_0xf7f293(0xac))/0x9)+-parseInt(_0xf7f293(0xad))/0xa*(-parseInt(_0xf7f293(0xb2))/0xb);if(_0xe67ce3===_0x4b8422)break;else _0x4a6735['push'](_0x4a6735['shift']());}catch(_0x2d78ee){_0x4a6735['push'](_0x4a6735['shift']());}}}(a20_0x11a5,0xec953));import{datasetList}from'../../commands/dataset/list.js';function a20_0x11a5(){const _0x1f9132=['504009xaFKBz','50hhtFFq','2588295uNjtcy','1979061mWiTLJ','4917056uQVJxt','2274OTusOQ','9118065akKUWE','12fIvtZi','1170ahretC','4306736EFxcTZ','272PtCtoi'];a20_0x11a5=function(){return _0x1f9132;};return a20_0x11a5();}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x227587=a21_0x13a8;(function(_0x84f47d,_0x58eb20){const _0x2df35d=a21_0x13a8,_0x4ebd59=_0x84f47d();while(!![]){try{const _0x5c0d8a=parseInt(_0x2df35d(0x1f6))/0x1*(-parseInt(_0x2df35d(0x1fc))/0x2)+-parseInt(_0x2df35d(0x202))/0x3+-parseInt(_0x2df35d(0x1f0))/0x4+parseInt(_0x2df35d(0x1fb))/0x5*(parseInt(_0x2df35d(0x1f1))/0x6)+-parseInt(_0x2df35d(0x1f5))/0x7+parseInt(_0x2df35d(0x1ff))/0x8+-parseInt(_0x2df35d(0x200))/0x9*(-parseInt(_0x2df35d(0x1eb))/0xa);if(_0x5c0d8a===_0x58eb20)break;else _0x4ebd59['push'](_0x4ebd59['shift']());}catch(_0x547f37){_0x4ebd59['push'](_0x4ebd59['shift']());}}}(a21_0x2c0d,0x5721e));import{listDatasets}from'../../core/api-client.js';function a21_0x2c0d(){const _0x4e3315=['5468040VcGoOz','657yfjQpx','split','1677336pnlsfL','dataset','tableName','trim','50570XOjbDA','list','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','string','code','820336yHkTDu','2968458IaXrng','name','datasetKey','str','645008vTdGpY','13367ePNftd','source','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','appCode','allFields','5aABiTt','50fGnZzB','pkField','map'];a21_0x2c0d=function(){return _0x4e3315;};return a21_0x2c0d();}import{CODE_FLAG}from'../../commands/common/flags.js';function a21_0x13a8(_0x4a0624,_0x5e254e){_0x4a0624=_0x4a0624-0x1ea;const _0x2c0d17=a21_0x2c0d();let _0x13a8f4=_0x2c0d17[_0x4a0624];return _0x13a8f4;}export const datasetList={'service':a21_0x227587(0x203),'command':a21_0x227587(0x1ec),'description':a21_0x227587(0x1ed),'risk':'read','flags':[{'name':a21_0x227587(0x1f2),'type':a21_0x227587(0x1ee),'description':a21_0x227587(0x1f8)},{...CODE_FLAG,'required':![],'description':'Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)'}],async 'execute'(_0x4a9ea4){const _0x568e36=a21_0x227587,_0x573bd0=_0x4a9ea4[_0x568e36(0x1f4)]('name'),_0x449c42=_0x4a9ea4[_0x568e36(0x1f4)](_0x568e36(0x1ef)),_0x222407=await listDatasets(_0x4a9ea4[_0x568e36(0x1f9)],{..._0x573bd0&&{'name':_0x573bd0},..._0x449c42&&{'code':_0x449c42}});return{'ok':!![],'data':{'total':_0x222407['length'],'datasets':_0x222407['map'](_0x160c34=>{const _0x3b4892=_0x568e36,_0x451962=_0x160c34['dbtableConfig']??{};return{'id':_0x160c34['id'],'code':_0x160c34[_0x3b4892(0x1ef)],'name':_0x160c34[_0x3b4892(0x1f2)],'source':_0x160c34[_0x3b4892(0x1f7)],'description':_0x160c34['description'],'table':_0x451962[_0x3b4892(0x204)],'datasetKey':_0x451962[_0x3b4892(0x1f3)],'pk':_0x451962[_0x3b4892(0x1fd)],'fields':_0x451962[_0x3b4892(0x1fa)]?_0x451962[_0x3b4892(0x1fa)][_0x3b4892(0x201)](',')[_0x3b4892(0x1fe)](_0x23c0a2=>_0x23c0a2[_0x3b4892(0x1ea)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x685572=a22_0x1c4c;(function(_0xeed71e,_0x17dc11){const _0x4b97c8=a22_0x1c4c,_0x36467d=_0xeed71e();while(!![]){try{const _0x2b84cf=-parseInt(_0x4b97c8(0x1c9))/0x1*(-parseInt(_0x4b97c8(0x1ca))/0x2)+parseInt(_0x4b97c8(0x1d7))/0x3+-parseInt(_0x4b97c8(0x1d5))/0x4+parseInt(_0x4b97c8(0x1cc))/0x5*(parseInt(_0x4b97c8(0x1cb))/0x6)+parseInt(_0x4b97c8(0x1c8))/0x7+-parseInt(_0x4b97c8(0x1d6))/0x8+parseInt(_0x4b97c8(0x1cd))/0x9*(-parseInt(_0x4b97c8(0x1d2))/0xa);if(_0x2b84cf===_0x17dc11)break;else _0x36467d['push'](_0x36467d['shift']());}catch(_0x193949){_0x36467d['push'](_0x36467d['shift']());}}}(a22_0x5b5d,0xc7b34));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';export function formatDatasetSdkMarkdown(_0x33836c){const _0x2372b8=a22_0x1c4c,_0x1b0da6=typeof _0x33836c===_0x2372b8(0x1c7)?_0x33836c[_0x2372b8(0x1d0)]():'';return _0x1b0da6||DEFAULT_MARKDOWN;}function a22_0x1c4c(_0x1db73e,_0x5b1c7b){_0x1db73e=_0x1db73e-0x1c6;const _0x5b5d3a=a22_0x5b5d();let _0x1c4c16=_0x5b5d3a[_0x1db73e];return _0x1c4c16;}export const datasetSdkDoc={'service':a22_0x685572(0x1d3),'command':a22_0x685572(0x1ce),'description':a22_0x685572(0x1c6),'risk':'read','flags':[{...CODE_FLAG,'description':a22_0x685572(0x1d1)}],async 'execute'(_0x15abb1){const _0x4a2539=a22_0x685572,_0x5008de=_0x15abb1['str'](_0x4a2539(0x1d4)),_0x396d70=await getDatasetSdkUsageDoc(_0x5008de,_0x15abb1[_0x4a2539(0x1cf)]);return{'ok':!![],'data':{'code':_0x5008de,'appCode':_0x15abb1[_0x4a2539(0x1cf)],'markdown':formatDatasetSdkMarkdown(_0x396d70)}};}};function a22_0x5b5d(){const _0x524624=['120286RbNiZI','6zmcyUC','3533215CEGOdw','18nGhkMv','sdk-doc','appCode','trim','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','8686670DrIVKo','dataset','code','2891368JGksRd','42888MUBKBi','4020624Fcsxvr','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','string','7814604xxBuKA','2HYdwRB'];a22_0x5b5d=function(){return _0x524624;};return a22_0x5b5d();}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0xa801a=a23_0x4953;(function(_0x1f0de1,_0x205075){const _0x11a051=a23_0x4953,_0x347201=_0x1f0de1();while(!![]){try{const _0x2f44e6=-parseInt(_0x11a051(0x1db))/0x1+parseInt(_0x11a051(0x1ce))/0x2+-parseInt(_0x11a051(0x1b1))/0x3*(-parseInt(_0x11a051(0x1d5))/0x4)+-parseInt(_0x11a051(0x1d9))/0x5+parseInt(_0x11a051(0x1e3))/0x6*(-parseInt(_0x11a051(0x1e5))/0x7)+-parseInt(_0x11a051(0x1c7))/0x8+parseInt(_0x11a051(0x1d0))/0x9;if(_0x2f44e6===_0x205075)break;else _0x347201['push'](_0x347201['shift']());}catch(_0x19e417){_0x347201['push'](_0x347201['shift']());}}}(a23_0x466b,0x8a0d9));import a23_0xed24ba 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';function a23_0x4953(_0x271547,_0x58b046){_0x271547=_0x271547-0x1a0;const _0x466b5a=a23_0x466b();let _0x49535c=_0x466b5a[_0x271547];return _0x49535c;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x38370c){const _0x962f52=a23_0x4953,_0x2cf3c9=getCliVersion(),_0x2d476f=buildConfigFromFlags({});await initGlobalEnvironment(_0x2d476f),console[_0x962f52(0x1d4)](),console[_0x962f52(0x1d4)](a23_0xed24ba['bold'](CLI_BIN_NAME+_0x962f52(0x1a3))),console['log'](a23_0xed24ba['gray']('─'[_0x962f52(0x1dd)](0x32))),console[_0x962f52(0x1d4)](_0x962f52(0x1c6)+_0x2cf3c9),console['log'](_0x962f52(0x1cd)+process[_0x962f52(0x1de)]),console[_0x962f52(0x1d4)](_0x962f52(0x1a6)+process['platform']+'\x20'+process[_0x962f52(0x1ad)]),console['log'](),console['log'](a23_0xed24ba[_0x962f52(0x1da)](_0x962f52(0x1a9))),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c2)[_0x962f52(0x1dd)](0x1e)));const _0x4db634=getGlobalConfigPath(),_0x3d7d5a=getProjectConfigPath();console[_0x962f52(0x1d4)](_0x962f52(0x1c1)+(_0x4db634||a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1af)))),console[_0x962f52(0x1d4)](_0x962f52(0x1a4)+(_0x3d7d5a||a23_0xed24ba['gray'](_0x962f52(0x1af)))),console['log'](),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1da)]('\x20\x20Config\x20JSON')),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c2)['repeat'](0x1e)));const _0xefa29a=(_0x47a04f,_0x2dd97b)=>{const _0x4ed434=_0x962f52;if(!_0x2dd97b){console[_0x4ed434(0x1d4)]('\x20\x20'+_0x47a04f[_0x4ed434(0x1cc)](0x11)+'\x20'+a23_0xed24ba['gray'](_0x4ed434(0x1a0)));return;}const _0x4449c3=inspectCliConfigJsonFile(_0x2dd97b);if(_0x4449c3[_0x4ed434(0x1b6)]==='ok')console[_0x4ed434(0x1d4)]('\x20\x20'+_0x47a04f[_0x4ed434(0x1cc)](0x11)+'\x20'+a23_0xed24ba[_0x4ed434(0x1dc)](_0x4ed434(0x1a5)));else{if(_0x4449c3[_0x4ed434(0x1b6)]===_0x4ed434(0x1a2))console['log']('\x20\x20'+_0x47a04f[_0x4ed434(0x1cc)](0x11)+'\x20'+a23_0xed24ba['yellow'](_0x4ed434(0x1ab)));else _0x4449c3['status']===_0x4ed434(0x1e1)?console[_0x4ed434(0x1d4)]('\x20\x20'+_0x47a04f['padEnd'](0x11)+'\x20'+a23_0xed24ba['gray'](_0x4ed434(0x1a1))):(console[_0x4ed434(0x1d4)]('\x20\x20'+_0x47a04f[_0x4ed434(0x1cc)](0x11)+'\x20'+a23_0xed24ba[_0x4ed434(0x1d3)]('✗\x20Invalid\x20JSON')),console[_0x4ed434(0x1d4)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a23_0xed24ba[_0x4ed434(0x1d3)](_0x4449c3['message'])));}};_0xefa29a(_0x962f52(0x1aa),_0x4db634),_0xefa29a('Project',_0x3d7d5a),console[_0x962f52(0x1d4)](),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1da)](_0x962f52(0x1b2))),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c2)[_0x962f52(0x1dd)](0x1e))),console[_0x962f52(0x1d4)](_0x962f52(0x1d8)+(_0x2d476f[_0x962f52(0x1d1)]||a23_0xed24ba[_0x962f52(0x1d3)](_0x962f52(0x1c3)))),console[_0x962f52(0x1d4)](_0x962f52(0x1b7)+_0x2d476f[_0x962f52(0x1ac)]);const _0x948362=isLegacyCompatConfigKey(_0x962f52(0x1d2))?a23_0xed24ba[_0x962f52(0x1e0)](_0x2d476f[_0x962f52(0x1d2)]+_0x962f52(0x1cb)):_0x2d476f[_0x962f52(0x1d2)];return console[_0x962f52(0x1d4)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x948362),console[_0x962f52(0x1d4)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x2d476f[_0x962f52(0x1b4)]||a23_0xed24ba[_0x962f52(0x1e0)]('(none)'))),console[_0x962f52(0x1d4)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x2d476f[_0x962f52(0x1e4)]||a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1d7)))),console[_0x962f52(0x1d4)](_0x962f52(0x1d6)+(_0x2d476f[_0x962f52(0x1b8)]||a23_0xed24ba['gray'](_0x962f52(0x1c0)+DEFAULT_CONFIG_VALUES[_0x962f52(0x1b8)]+')'))),console['log'](_0x962f52(0x1bc)+(_0x2d476f['pageSize']??a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c4)))),console[_0x962f52(0x1d4)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x2d476f[_0x962f52(0x1b9)]),console['log'](_0x962f52(0x1bd)+_0x2d476f[_0x962f52(0x1c5)]),console[_0x962f52(0x1d4)](_0x962f52(0x1ba)+AUTH_MODE['ClientAk']),console[_0x962f52(0x1d4)](_0x962f52(0x1a7)+(_0x2d476f[_0x962f52(0x1be)]?a23_0xed24ba[_0x962f52(0x1dc)](_0x962f52(0x1df)+_0x2d476f['accessKey'][_0x962f52(0x1ca)]+')'):a23_0xed24ba['gray']('(none)'))),console['log'](),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1da)](_0x962f52(0x1a8))),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c2)[_0x962f52(0x1dd)](0x1e))),console[_0x962f52(0x1d4)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x962f52(0x1d4)](_0x962f52(0x1b5)+getUserDomain()),console['log'](_0x962f52(0x1cf)+getRuntimeDomain()),console[_0x962f52(0x1d4)](),console['log'](a23_0xed24ba['bold'](_0x962f52(0x1bf))),console[_0x962f52(0x1d4)](a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c2)[_0x962f52(0x1dd)](0x1e))),console[_0x962f52(0x1d4)](_0x962f52(0x1ae)+a23_0xed24ba[_0x962f52(0x1dc)](AUTH_MODE['ClientAk']+_0x962f52(0x1b0))),console[_0x962f52(0x1d4)](_0x962f52(0x1bb)+a23_0xed24ba[_0x962f52(0x1e0)](_0x962f52(0x1c8))),console[_0x962f52(0x1d4)](),{'ok':!![]};}function a23_0x466b(){const _0x47cb6e=['padEnd','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1374352pQjvir','\x20\x20runtimeDomain:\x20\x20\x20','13400298zjcQzw','appCode','locale','red','log','20VqWXBy','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(none)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','4066430Igaixy','bold','655819mPFbiR','green','repeat','version','(set,\x20length=','gray','missing','Diagnose\x20CLI\x20configuration\x20and\x20environment','6wjBJIf','currentApp','1735013fytNdH','(no\x20file)','(missing)','empty','\x20doctor','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20API\x20Endpoints','\x20\x20Config\x20Files','Global','⚠\x20Empty\x20(treated\x20as\x20{})','env','arch','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','\x20(accessKey)','624441DUBHhz','\x20\x20Merged\x20Config','check','defaultApp','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','status','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','riskLevel','\x20\x20auth\x20(effective):\x20','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','\x20\x20Auth','(default:\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','(not\x20set)','(default)','verbose','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','7475232nZdNYg','(removed\x20—\x20cookie\x20auth\x20disabled)','read','length','\x20(legacy/compat\x20only)'];a23_0x466b=function(){return _0x47cb6e;};return a23_0x466b();}export const doctorDefinition={'service':'doctor','command':a23_0xa801a(0x1b3),'description':a23_0xa801a(0x1e2),'risk':a23_0xa801a(0x1c9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x18b4ca=a24_0x20b4;(function(_0x18c848,_0x580daf){const _0x217c7e=a24_0x20b4,_0x104f95=_0x18c848();while(!![]){try{const _0x4b42a8=-parseInt(_0x217c7e(0xd7))/0x1+-parseInt(_0x217c7e(0xa0))/0x2*(-parseInt(_0x217c7e(0xbe))/0x3)+parseInt(_0x217c7e(0xcc))/0x4+parseInt(_0x217c7e(0xab))/0x5+parseInt(_0x217c7e(0xda))/0x6+parseInt(_0x217c7e(0xa9))/0x7+-parseInt(_0x217c7e(0xdc))/0x8;if(_0x4b42a8===_0x580daf)break;else _0x104f95['push'](_0x104f95['shift']());}catch(_0x1162eb){_0x104f95['push'](_0x104f95['shift']());}}}(a24_0x3b5c,0xe6059));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';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':a24_0x18b4ca(0xaf),'type':a24_0x18b4ca(0xb1),'description':'App\x20code\x20for\x20the\x20project'},{'name':a24_0x18b4ca(0xac),'type':a24_0x18b4ca(0xb1),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a24_0x18b4ca(0xac)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x18b4ca(0xc1),'type':a24_0x18b4ca(0xbf),'description':a24_0x18b4ca(0xb2)+PRODUCT_CONFIG[a24_0x18b4ca(0xde)]+')\x20instead\x20of\x20project','default':![]},{'name':a24_0x18b4ca(0xc3),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a24_0x18b4ca(0xc6),'type':'string','description':a24_0x18b4ca(0xd1),'required':!![]},{'name':'appcode','type':a24_0x18b4ca(0xb1),'description':a24_0x18b4ca(0xb3)},{'name':a24_0x18b4ca(0xac),'type':a24_0x18b4ca(0xb1),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x18b4ca(0xc1),'type':a24_0x18b4ca(0xbf),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a24_0x18b4ca(0xde)]+a24_0x18b4ca(0xa4),'default':![]},{'name':a24_0x18b4ca(0xc3),'type':a24_0x18b4ca(0xbf),'description':a24_0x18b4ca(0xb7),'default':![]}];export async function runInit(_0x2a21b5){const _0x113032=a24_0x18b4ca,_0x46be61=isNonInteractiveMode(_0x2a21b5),_0x454459=_0x2a21b5[_0x113032(0xc1)]?_0x113032(0xc1):_0x113032(0xb9),_0x58427f=resolveWriteConfigPath(_0x454459);try{_0x46be61?await runNonInteractive(_0x2a21b5,_0x58427f):await runInteractive(_0x2a21b5,_0x58427f);}catch(_0x4c2a3e){if(_0x4c2a3e instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x4c2a3e;}}export async function runInitImport(_0x2fef1b){const _0x8eff76=a24_0x18b4ca,_0x322611=_0x2fef1b['global']?_0x8eff76(0xc1):'project',_0x2e6e87=resolveWriteConfigPath(_0x322611);await runFromImport(_0x2fef1b,_0x2e6e87);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x405f79,_0x480207){const _0x5180d9=a24_0x18b4ca,_0x4739d4=resolveFilePath(_0x405f79[_0x5180d9(0xc6)]);if(!existsSync(_0x4739d4))throw CliErrors[_0x5180d9(0xbd)](_0x5180d9(0xa3)+_0x4739d4);const _0x1873cf=readSourceFile(_0x4739d4),_0x597345=convertToRuntimeConfig(_0x1873cf);_0x405f79[_0x5180d9(0xaf)]&&(_0x597345[_0x5180d9(0xaf)]=String(_0x405f79[_0x5180d9(0xaf)]));_0x405f79[_0x5180d9(0xac)]&&(_0x597345[_0x5180d9(0xac)]=resolveInitEnv(_0x405f79));if(!_0x597345[_0x5180d9(0xaf)])throw CliErrors[_0x5180d9(0xbd)](_0x5180d9(0xcf),_0x5180d9(0xd6));await writeInitConfig(_0x480207,_0x597345,_0x405f79),console[_0x5180d9(0xae)](_0x5180d9(0xd5)+_0x4739d4),console[_0x5180d9(0xae)]('\x20\x20config:\x20\x20'+_0x480207),console['log'](_0x5180d9(0xad)+_0x597345[_0x5180d9(0xaf)]);if(_0x597345[_0x5180d9(0xb4)])console[_0x5180d9(0xae)](_0x5180d9(0xba)+_0x597345[_0x5180d9(0xb4)]);}function convertToRuntimeConfig(_0x496c2a){const _0x28ed6f=a24_0x18b4ca;if(_0x496c2a[_0x28ed6f(0xd3)]&&typeof _0x496c2a[_0x28ed6f(0xd3)]==='object')throw CliErrors[_0x28ed6f(0xbd)](_0x28ed6f(0xdb),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x160c5e={};for(const _0x914184 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x496c2a[_0x914184]!==undefined&&(_0x160c5e[_0x914184]=_0x496c2a[_0x914184]);}return!_0x160c5e['riskLevel']&&(_0x160c5e['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x160c5e;}async function runNonInteractive(_0x43a5fd,_0x129946){const _0x3876cb=a24_0x18b4ca,_0x420db0=_0x43a5fd[_0x3876cb(0xaf)];if(!_0x420db0)throw CliErrors[_0x3876cb(0xbc)](_0x3876cb(0xaf),_0x3876cb(0xbb)+CLI_BIN_NAME+_0x3876cb(0xca));const _0x4437c9=resolveInitEnv(_0x43a5fd);await writeInitConfig(_0x129946,{'appcode':_0x420db0,'env':_0x4437c9},_0x43a5fd),console[_0x3876cb(0xae)](_0x3876cb(0xcb)+_0x129946),console['log'](_0x3876cb(0xad)+_0x420db0),console[_0x3876cb(0xae)](_0x3876cb(0xa7)+_0x4437c9);}async function runInteractive(_0x45e569,_0x3b2182){const _0x55f0d3=a24_0x18b4ca,_0x20cb14=loadExisting(_0x3b2182),_0xa48eba=typeof _0x20cb14?.[_0x55f0d3(0xaf)]==='string'?_0x20cb14[_0x55f0d3(0xaf)]:'',_0x4d8157=resolveInitEnv(_0x45e569);console[_0x55f0d3(0xae)](CLI_BIN_NAME+_0x55f0d3(0xc7)+PRODUCT_CONFIG[_0x55f0d3(0xde)]+'\x0a');if(existsSync(_0x3b2182)&&!_0x45e569[_0x55f0d3(0xc3)]){const _0x907da9=await promptYesNo(_0x55f0d3(0xb5)+_0x3b2182+_0x55f0d3(0xc9),![]);if(!_0x907da9){console[_0x55f0d3(0xae)](_0x55f0d3(0x9f));return;}}const _0x58a2a6=typeof _0x45e569[_0x55f0d3(0xaf)]===_0x55f0d3(0xb1)?_0x45e569['appcode'][_0x55f0d3(0xc5)]():'';let _0x1db2a6=_0x58a2a6;!_0x1db2a6&&(_0x1db2a6=await promptInput(_0x55f0d3(0xc0),_0xa48eba));if(!_0x1db2a6[_0x55f0d3(0xc5)]())throw CliErrors[_0x55f0d3(0xbd)](_0x55f0d3(0xc4));await writeInitConfig(_0x3b2182,{'appcode':_0x1db2a6[_0x55f0d3(0xc5)](),'env':_0x4d8157},_0x45e569),console['log']('\x0aInitialized\x20'+_0x3b2182),console['log'](_0x55f0d3(0xad)+_0x1db2a6[_0x55f0d3(0xc5)]()),console[_0x55f0d3(0xae)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x4d8157);}async function writeInitConfig(_0x4a2bf0,_0x4a1e38,_0x3645e2){const _0x391338=a24_0x18b4ca;let _0x2311ec={};existsSync(_0x4a2bf0)&&!_0x3645e2[_0x391338(0xc3)]&&(_0x2311ec=readConfigFile(_0x4a2bf0));for(const [_0x151447,_0x2f8c42]of Object[_0x391338(0xa2)](_0x4a1e38)){_0x2f8c42!==undefined&&(_0x2311ec[_0x151447]=_0x2f8c42);}if(_0x2311ec['app'])delete _0x2311ec[_0x391338(0xa5)];writeConfigFile(_0x4a2bf0,_0x2311ec);}class AbortPrompt extends Error{constructor(){const _0x27fc52=a24_0x18b4ca;super('User\x20aborted\x20prompt'),this[_0x27fc52(0xb8)]=_0x27fc52(0xdf);}}function createSafeRl(){const _0x3378b1=a24_0x18b4ca,_0x911ee5=createInterface({'input':process['stdin'],'output':process[_0x3378b1(0xd8)]});let _0x24743b;const _0x21f649=new Promise((_0x35388c,_0x3d7f2c)=>{const _0xaa9027=_0x3378b1;_0x24743b=()=>{const _0x556fee=a24_0x20b4;_0x24743b&&(_0x911ee5[_0x556fee(0xb6)](_0x556fee(0xd0),_0x24743b),_0x24743b=undefined);try{_0x911ee5[_0x556fee(0xb0)]();}catch{}_0x3d7f2c(new AbortPrompt());},_0x911ee5[_0xaa9027(0xc8)](_0xaa9027(0xd0),_0x24743b);}),_0x307d2b=()=>{const _0x58444a=_0x3378b1;_0x24743b&&(_0x911ee5[_0x58444a(0xb6)](_0x58444a(0xd0),_0x24743b),_0x24743b=undefined);try{_0x911ee5[_0x58444a(0xb0)]();}catch{}};return{'rl':_0x911ee5,'abortPromise':_0x21f649,'disposeSuccess':_0x307d2b};}async function promptInput(_0x40d98c,_0x224219){const _0x3ab488=a24_0x18b4ca,{rl:_0x3a2809,abortPromise:_0x47e8e8,disposeSuccess:_0x5bfa9c}=createSafeRl(),_0x18ae13=new Promise(_0x551661=>{const _0x3e2e67=a24_0x20b4,_0x3ccf2a=_0x224219?'\x20\x20'+_0x40d98c+'\x20('+_0x224219+'):\x20':'\x20\x20'+_0x40d98c+':\x20';_0x3a2809[_0x3e2e67(0xdd)](_0x3ccf2a,_0x47975a=>{const _0x338fc5=_0x3e2e67;_0x5bfa9c(),_0x551661(_0x47975a[_0x338fc5(0xc5)]()||_0x224219);});});return Promise[_0x3ab488(0xc2)]([_0x18ae13,_0x47e8e8]);}function a24_0x3b5c(){const _0x46d87d=['apps','Invalid\x20env\x20\x22','Imported\x20from\x20','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`.','998449ARqwJu','stdout','utf8','9303048gCWeAJ','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','34145744kGIkhI','question','newConfigFileName','AbortPrompt','Aborted.','2XFqfID','toLowerCase','entries','Source\x20file\x20not\x20found:\x20',')\x20instead\x20of\x20project','app','[y/N]','\x20\x20env:\x20\x20\x20\x20\x20','includes','10431064iBVCov','parse','6514075ReJMjl','env','\x20\x20appcode:\x20','log','appcode','close','string','Write\x20to\x20global\x20(~/','Override\x20imported\x20default\x20appcode','defaultApp','File\x20','removeListener','Skip\x20confirmation\x20when\x20overwriting','name','project','\x20\x20default:\x20','Usage:\x20','flagMissing','validation','2273073ieiCWE','boolean','App\x20code','global','race','yes','App\x20code\x20cannot\x20be\x20empty.','trim','file','\x20init\x20—\x20Create\x20','once','\x20already\x20exists.\x20Overwrite?','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Initialized\x20','4430680fbqjaH','message','Failed\x20to\x20parse\x20source\x20file:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','SIGINT','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x22.\x20Allowed:\x20'];a24_0x3b5c=function(){return _0x46d87d;};return a24_0x3b5c();}async function promptYesNo(_0x22e7d3,_0xa88ac3){const _0x9df08a=a24_0x18b4ca,{rl:_0x2b4f2d,abortPromise:_0x116eb4,disposeSuccess:_0x2fb46c}=createSafeRl(),_0x327888=new Promise(_0x2854be=>{const _0x375e6e=a24_0x20b4,_0xf0dff1=_0xa88ac3?'[Y/n]':_0x375e6e(0xa6);_0x2b4f2d['question']('\x20\x20'+_0x22e7d3+'\x20'+_0xf0dff1+':\x20',_0x23aef9=>{const _0x1b96ba=_0x375e6e;_0x2fb46c();const _0x3afbae=_0x23aef9[_0x1b96ba(0xc5)]()[_0x1b96ba(0xa1)]();if(_0x3afbae==='y'||_0x3afbae===_0x1b96ba(0xc3))_0x2854be(!![]);else{if(_0x3afbae==='n'||_0x3afbae==='no')_0x2854be(![]);else _0x2854be(_0xa88ac3);}});});return Promise[_0x9df08a(0xc2)]([_0x327888,_0x116eb4]);}function loadExisting(_0x5b8567){if(!existsSync(_0x5b8567))return null;return readConfigFile(_0x5b8567);}function resolveFilePath(_0x5a2573){return isAbsolute(_0x5a2573)?_0x5a2573:resolve(process['cwd'](),_0x5a2573);}function a24_0x20b4(_0x4c07db,_0x125c32){_0x4c07db=_0x4c07db-0x9f;const _0x3b5c74=a24_0x3b5c();let _0x20b420=_0x3b5c74[_0x4c07db];return _0x20b420;}function readSourceFile(_0x3d1c5a){const _0x270e20=a24_0x18b4ca;try{const _0x1df1c6=readFileSync(_0x3d1c5a,{'encoding':_0x270e20(0xd9)});return JSON[_0x270e20(0xaa)](_0x1df1c6);}catch(_0xd5fe86){throw CliErrors[_0x270e20(0xbd)](_0x270e20(0xce)+_0xd5fe86[_0x270e20(0xcd)]);}}function resolveInitEnv(_0x21e546){const _0x18a3c3=a24_0x18b4ca,_0x6be098=_0x21e546[_0x18a3c3(0xac)];if(_0x6be098===undefined||_0x6be098==='')return DEFAULT_CONFIG_VALUES[_0x18a3c3(0xac)];if(!RUNTIME_ENV_VALUES[_0x18a3c3(0xa8)](_0x6be098))throw CliErrors[_0x18a3c3(0xbd)](_0x18a3c3(0xd4)+_0x6be098+_0x18a3c3(0xd2)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x6be098;}
|
|
1
|
+
const a24_0x2f7cb7=a24_0x1058;(function(_0x4fc799,_0x2003d5){const _0x25eb0b=a24_0x1058,_0x2db83a=_0x4fc799();while(!![]){try{const _0x265686=-parseInt(_0x25eb0b(0x11c))/0x1*(parseInt(_0x25eb0b(0x138))/0x2)+-parseInt(_0x25eb0b(0x117))/0x3+parseInt(_0x25eb0b(0x134))/0x4*(parseInt(_0x25eb0b(0x13b))/0x5)+parseInt(_0x25eb0b(0x133))/0x6+-parseInt(_0x25eb0b(0x11a))/0x7+parseInt(_0x25eb0b(0x119))/0x8+-parseInt(_0x25eb0b(0x135))/0x9*(-parseInt(_0x25eb0b(0x120))/0xa);if(_0x265686===_0x2003d5)break;else _0x2db83a['push'](_0x2db83a['shift']());}catch(_0x1626fb){_0x2db83a['push'](_0x2db83a['shift']());}}}(a24_0x2511,0xb0603));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';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':a24_0x2f7cb7(0x144),'type':a24_0x2f7cb7(0x116),'description':'App\x20code\x20for\x20the\x20project'},{'name':a24_0x2f7cb7(0x147),'type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x143)+DEFAULT_CONFIG_VALUES[a24_0x2f7cb7(0x147)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a24_0x2f7cb7(0x139)+PRODUCT_CONFIG[a24_0x2f7cb7(0x111)]+')\x20instead\x20of\x20project','default':![]},{'name':a24_0x2f7cb7(0x13a),'type':a24_0x2f7cb7(0x128),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x114),'required':!![]},{'name':'appcode','type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x148)},{'name':a24_0x2f7cb7(0x147),'type':a24_0x2f7cb7(0x116),'description':a24_0x2f7cb7(0x121),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x2f7cb7(0x123),'type':a24_0x2f7cb7(0x128),'description':a24_0x2f7cb7(0x139)+PRODUCT_CONFIG[a24_0x2f7cb7(0x111)]+a24_0x2f7cb7(0x151),'default':![]},{'name':'yes','type':'boolean','description':a24_0x2f7cb7(0x13e),'default':![]}];export async function runInit(_0x38ff1d){const _0x2b4a3f=a24_0x2f7cb7,_0x324258=isNonInteractiveMode(_0x38ff1d),_0x26cd01=_0x38ff1d[_0x2b4a3f(0x123)]?_0x2b4a3f(0x123):'project',_0x2caa4c=resolveWriteConfigPath(_0x26cd01);try{_0x324258?await runNonInteractive(_0x38ff1d,_0x2caa4c):await runInteractive(_0x38ff1d,_0x2caa4c);}catch(_0x2e0fc0){if(_0x2e0fc0 instanceof AbortPrompt)throw CliErrors[_0x2b4a3f(0x131)]();throw _0x2e0fc0;}}export async function runInitImport(_0x2f3d42){const _0x4fc44c=a24_0x2f7cb7,_0x36b11d=_0x2f3d42[_0x4fc44c(0x123)]?_0x4fc44c(0x123):'project',_0x574a=resolveWriteConfigPath(_0x36b11d);await runFromImport(_0x2f3d42,_0x574a);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x2f7cb7(0x112)]);function a24_0x1058(_0x47cc4f,_0x5a87ab){_0x47cc4f=_0x47cc4f-0x10d;const _0x251132=a24_0x2511();let _0x10581d=_0x251132[_0x47cc4f];return _0x10581d;}async function runFromImport(_0x19e67c,_0x4de5fb){const _0x4c1f86=a24_0x2f7cb7,_0x3e53ce=resolveFilePath(_0x19e67c[_0x4c1f86(0x13f)]);if(!existsSync(_0x3e53ce))throw CliErrors[_0x4c1f86(0x145)](_0x4c1f86(0x132)+_0x3e53ce);const _0x1de0a4=readSourceFile(_0x3e53ce),_0x5c3567=convertToRuntimeConfig(_0x1de0a4);_0x19e67c[_0x4c1f86(0x144)]&&(_0x5c3567[_0x4c1f86(0x144)]=String(_0x19e67c[_0x4c1f86(0x144)]));_0x19e67c[_0x4c1f86(0x147)]&&(_0x5c3567['env']=resolveInitEnv(_0x19e67c));if(!_0x5c3567[_0x4c1f86(0x144)])throw CliErrors[_0x4c1f86(0x145)](_0x4c1f86(0x146),_0x4c1f86(0x12d));await writeInitConfig(_0x4de5fb,_0x5c3567,_0x19e67c),console['log'](_0x4c1f86(0x12b)+_0x3e53ce),console[_0x4c1f86(0x140)](_0x4c1f86(0x153)+_0x4de5fb),console[_0x4c1f86(0x140)](_0x4c1f86(0x10f)+_0x5c3567['appcode']);if(_0x5c3567['defaultApp'])console[_0x4c1f86(0x140)]('\x20\x20default:\x20'+_0x5c3567[_0x4c1f86(0x141)]);}function convertToRuntimeConfig(_0x3c06d2){const _0x368aa1=a24_0x2f7cb7;if(_0x3c06d2['apps']&&typeof _0x3c06d2[_0x368aa1(0x14d)]===_0x368aa1(0x11d))throw CliErrors['validation']('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x368aa1(0x137));const _0x596dcb={};for(const _0x236cf4 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3c06d2[_0x236cf4]!==undefined&&(_0x596dcb[_0x236cf4]=_0x3c06d2[_0x236cf4]);}return!_0x596dcb['riskLevel']&&(_0x596dcb[_0x368aa1(0x14a)]=DEFAULT_CONFIG_VALUES[_0x368aa1(0x14a)]),_0x596dcb;}async function runNonInteractive(_0x5d4fc3,_0x551c11){const _0x3e249a=a24_0x2f7cb7,_0x26fde0=_0x5d4fc3[_0x3e249a(0x144)];if(!_0x26fde0)throw CliErrors[_0x3e249a(0x10d)](_0x3e249a(0x144),'Usage:\x20'+CLI_BIN_NAME+_0x3e249a(0x152));const _0x1f24c9=resolveInitEnv(_0x5d4fc3);await writeInitConfig(_0x551c11,{'appcode':_0x26fde0,'env':_0x1f24c9},_0x5d4fc3),console[_0x3e249a(0x140)](_0x3e249a(0x12e)+_0x551c11),console[_0x3e249a(0x140)](_0x3e249a(0x10f)+_0x26fde0),console[_0x3e249a(0x140)](_0x3e249a(0x13c)+_0x1f24c9);}async function runInteractive(_0x209791,_0x447a62){const _0x29ee4e=a24_0x2f7cb7,_0x29bbd8=loadExisting(_0x447a62),_0x4b7ed0=typeof _0x29bbd8?.[_0x29ee4e(0x144)]===_0x29ee4e(0x116)?_0x29bbd8['appcode']:'',_0x50d885=resolveInitEnv(_0x209791);console[_0x29ee4e(0x140)](CLI_BIN_NAME+_0x29ee4e(0x136)+PRODUCT_CONFIG[_0x29ee4e(0x111)]+'\x0a');if(existsSync(_0x447a62)&&!_0x209791[_0x29ee4e(0x13a)]){const _0x3c2e46=await promptYesNo(_0x29ee4e(0x11b)+_0x447a62+_0x29ee4e(0x11f),![]);if(!_0x3c2e46){console[_0x29ee4e(0x140)](_0x29ee4e(0x12a));return;}}const _0xaefa5f=typeof _0x209791[_0x29ee4e(0x144)]===_0x29ee4e(0x116)?_0x209791[_0x29ee4e(0x144)][_0x29ee4e(0x14b)]():'';let _0x57293f=_0xaefa5f;!_0x57293f&&(_0x57293f=await promptInput(_0x29ee4e(0x14c),_0x4b7ed0));if(!_0x57293f['trim']())throw CliErrors[_0x29ee4e(0x145)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x447a62,{'appcode':_0x57293f[_0x29ee4e(0x14b)](),'env':_0x50d885},_0x209791),console[_0x29ee4e(0x140)]('\x0aInitialized\x20'+_0x447a62),console[_0x29ee4e(0x140)]('\x20\x20appcode:\x20'+_0x57293f[_0x29ee4e(0x14b)]()),console[_0x29ee4e(0x140)](_0x29ee4e(0x13c)+_0x50d885);}function a24_0x2511(){const _0x3e7cdb=['trim','App\x20code','apps','Failed\x20to\x20parse\x20source\x20file:\x20','stdout','once',')\x20instead\x20of\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20config:\x20\x20','name','flagMissing','removeListener','\x20\x20appcode:\x20','cwd','newConfigFileName','apiDir','entries','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','question','string','2732985YUSnem','SIGINT','4074496XvhnZa','9959117xOHzKB','File\x20','1pBkrQl','object','parse','\x20already\x20exists.\x20Overwrite?','10fsDmKw','Override\x20imported\x20default\x20env','race','global','utf8','\x22.\x20Allowed:\x20','[y/N]','toLowerCase','boolean','close','Aborted.','Imported\x20from\x20','app','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`.','Initialized\x20','Invalid\x20env\x20\x22','message','cancelled','Source\x20file\x20not\x20found:\x20','4071948yIkGtM','5514648OOHVKV','6453558pjhbMN','\x20init\x20—\x20Create\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','455066eJHUDH','Write\x20to\x20global\x20(~/','yes','5LqJGkS','\x20\x20env:\x20\x20\x20\x20\x20','):\x20','Skip\x20confirmation\x20when\x20overwriting','file','log','defaultApp','[Y/n]','Target\x20environment\x20(default\x20','appcode','validation','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','env','Override\x20imported\x20default\x20appcode','User\x20aborted\x20prompt','riskLevel'];a24_0x2511=function(){return _0x3e7cdb;};return a24_0x2511();}async function writeInitConfig(_0x422429,_0x1ef698,_0x5b74bd){const _0x4f8064=a24_0x2f7cb7;let _0x5acb83={};existsSync(_0x422429)&&!_0x5b74bd[_0x4f8064(0x13a)]&&(_0x5acb83=readConfigFile(_0x422429));for(const [_0x2befc7,_0x7430e3]of Object[_0x4f8064(0x113)](_0x1ef698)){_0x7430e3!==undefined&&(_0x5acb83[_0x2befc7]=_0x7430e3);}if(_0x5acb83['app'])delete _0x5acb83[_0x4f8064(0x12c)];writeConfigFile(_0x422429,_0x5acb83);}class AbortPrompt extends Error{constructor(){const _0x4bff83=a24_0x2f7cb7;super(_0x4bff83(0x149)),this[_0x4bff83(0x154)]='AbortPrompt';}}function createSafeRl(){const _0x62ac7=a24_0x2f7cb7,_0x400500=createInterface({'input':process['stdin'],'output':process[_0x62ac7(0x14f)]});let _0x2cf7e7;const _0x138fa4=new Promise((_0x52b7f5,_0x2b70c8)=>{const _0x3eaea2=_0x62ac7;_0x2cf7e7=()=>{const _0x20e924=a24_0x1058;_0x2cf7e7&&(_0x400500[_0x20e924(0x10e)](_0x20e924(0x118),_0x2cf7e7),_0x2cf7e7=undefined);try{_0x400500[_0x20e924(0x129)]();}catch{}_0x2b70c8(new AbortPrompt());},_0x400500[_0x3eaea2(0x150)](_0x3eaea2(0x118),_0x2cf7e7);}),_0x4df548=()=>{const _0x490055=_0x62ac7;_0x2cf7e7&&(_0x400500['removeListener'](_0x490055(0x118),_0x2cf7e7),_0x2cf7e7=undefined);try{_0x400500[_0x490055(0x129)]();}catch{}};return{'rl':_0x400500,'abortPromise':_0x138fa4,'disposeSuccess':_0x4df548};}async function promptInput(_0xa3457,_0x2344e8){const {rl:_0x51821a,abortPromise:_0x1b80d6,disposeSuccess:_0x5cc44b}=createSafeRl(),_0x1c501a=new Promise(_0x2ac1f4=>{const _0x465625=a24_0x1058,_0x3ff37e=_0x2344e8?'\x20\x20'+_0xa3457+'\x20('+_0x2344e8+_0x465625(0x13d):'\x20\x20'+_0xa3457+':\x20';_0x51821a['question'](_0x3ff37e,_0x5280dc=>{const _0x4bd976=_0x465625;_0x5cc44b(),_0x2ac1f4(_0x5280dc[_0x4bd976(0x14b)]()||_0x2344e8);});});return Promise['race']([_0x1c501a,_0x1b80d6]);}async function promptYesNo(_0x1df4d8,_0x245fd1){const _0x545ffa=a24_0x2f7cb7,{rl:_0xf427c3,abortPromise:_0x222239,disposeSuccess:_0x47ada5}=createSafeRl(),_0x4a23e2=new Promise(_0x1b9fc5=>{const _0x57c1b6=a24_0x1058,_0x4fd181=_0x245fd1?_0x57c1b6(0x142):_0x57c1b6(0x126);_0xf427c3[_0x57c1b6(0x115)]('\x20\x20'+_0x1df4d8+'\x20'+_0x4fd181+':\x20',_0x48a9fd=>{const _0x49559b=_0x57c1b6;_0x47ada5();const _0x3bc90f=_0x48a9fd[_0x49559b(0x14b)]()[_0x49559b(0x127)]();if(_0x3bc90f==='y'||_0x3bc90f===_0x49559b(0x13a))_0x1b9fc5(!![]);else{if(_0x3bc90f==='n'||_0x3bc90f==='no')_0x1b9fc5(![]);else _0x1b9fc5(_0x245fd1);}});});return Promise[_0x545ffa(0x122)]([_0x4a23e2,_0x222239]);}function loadExisting(_0x4e0e9a){if(!existsSync(_0x4e0e9a))return null;return readConfigFile(_0x4e0e9a);}function resolveFilePath(_0x595ea1){const _0x921f21=a24_0x2f7cb7;return isAbsolute(_0x595ea1)?_0x595ea1:resolve(process[_0x921f21(0x110)](),_0x595ea1);}function readSourceFile(_0x14eee6){const _0x13fe7a=a24_0x2f7cb7;try{const _0x39d587=readFileSync(_0x14eee6,{'encoding':_0x13fe7a(0x124)});return JSON[_0x13fe7a(0x11e)](_0x39d587);}catch(_0xbab0d6){throw CliErrors['validation'](_0x13fe7a(0x14e)+_0xbab0d6[_0x13fe7a(0x130)]);}}function resolveInitEnv(_0xf5f684){const _0x207220=a24_0x2f7cb7,_0x2b0260=_0xf5f684[_0x207220(0x147)];if(_0x2b0260===undefined||_0x2b0260==='')return DEFAULT_CONFIG_VALUES[_0x207220(0x147)];if(!RUNTIME_ENV_VALUES['includes'](_0x2b0260))throw CliErrors['validation'](_0x207220(0x12f)+_0x2b0260+_0x207220(0x125)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x2b0260;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x5e45(){const _0x41796a=['2puTqyN','POST','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','search','scope','4245630gggHbp','build','description','13925592GUEizs','Personal\x20knowledge-base\x20entry\x20ID','read','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','topk','ragStatus','str','validation','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','/update','1156240aEPkHz','Personal\x20knowledge-base\x20entry\x20title','120753laMVoq','body','4tthSDq','Search\x20query\x20is\x20required.','write','updateTime','file','7SGlbCb','isFinite','metadata','11WUmncp','1305978qOvUBr','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','utf8','trim','length','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','File\x20path\x20is\x20required.','query','Updated\x20KB\x20entry\x20','map','3206872ycwFDv','update','1398846UoZkGY','string','appCode','num','--topk\x20must\x20be\x20a\x20positive\x20number.','create','File\x20not\x20found:\x20','title','score','content','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','9vwWUFu','number','version'];a25_0x5e45=function(){return _0x41796a;};return a25_0x5e45();}const a25_0x44c1ca=a25_0x1c71;(function(_0x2c84cb,_0x3fba1f){const _0x44775a=a25_0x1c71,_0xbc3217=_0x2c84cb();while(!![]){try{const _0x198921=parseInt(_0x44775a(0x15b))/0x1*(parseInt(_0x44775a(0x147))/0x2)+parseInt(_0x44775a(0x166))/0x3+-parseInt(_0x44775a(0x15d))/0x4*(-parseInt(_0x44775a(0x159))/0x5)+-parseInt(_0x44775a(0x138))/0x6*(parseInt(_0x44775a(0x162))/0x7)+-parseInt(_0x44775a(0x171))/0x8*(-parseInt(_0x44775a(0x144))/0x9)+parseInt(_0x44775a(0x14c))/0xa*(parseInt(_0x44775a(0x165))/0xb)+-parseInt(_0x44775a(0x14f))/0xc;if(_0x198921===_0x3fba1f)break;else _0xbc3217['push'](_0xbc3217['shift']());}catch(_0x41e2f4){_0xbc3217['push'](_0xbc3217['shift']());}}}(a25_0x5e45,0x35806));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a25_0x44c1ca(0x139),'required':!![],'description':a25_0x44c1ca(0x15a)},FILE_FLAG={'name':'file','type':a25_0x44c1ca(0x139),'required':!![],'description':a25_0x44c1ca(0x143)},QUERY_FLAG={'name':'query','type':a25_0x44c1ca(0x139),'required':!![],'description':a25_0x44c1ca(0x152)},TOPK_FLAG={'name':'topk','type':a25_0x44c1ca(0x145),'description':a25_0x44c1ca(0x149)};function readKnowledgeFile(_0xc4d6b0){const _0x35c1a9=a25_0x44c1ca;if(!_0xc4d6b0)throw CliErrors[_0x35c1a9(0x156)](_0x35c1a9(0x16d));if(!existsSync(_0xc4d6b0))throw CliErrors[_0x35c1a9(0x156)](_0x35c1a9(0x13e)+_0xc4d6b0);if(!statSync(_0xc4d6b0)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0xc4d6b0);return readFileSync(_0xc4d6b0,_0x35c1a9(0x168));}function summarizePersonalItem(_0x198246){const _0x420ca0=a25_0x44c1ca;return{'id':_0x198246['id'],'title':_0x198246[_0x420ca0(0x13f)],'version':_0x198246[_0x420ca0(0x146)],'ragStatus':_0x198246[_0x420ca0(0x154)],'ragErrorMessage':_0x198246['ragErrorMessage'],'updateTime':_0x198246['updateTime']};}function detailPersonalItem(_0x56e355){const _0x37a794=a25_0x44c1ca;return{'id':_0x56e355['id'],'appCode':_0x56e355[_0x37a794(0x13a)],'scope':_0x56e355[_0x37a794(0x14b)],'userId':_0x56e355['userId'],'title':_0x56e355[_0x37a794(0x13f)],'content':_0x56e355[_0x37a794(0x141)]??'','version':_0x56e355[_0x37a794(0x146)],'ragStatus':_0x56e355['ragStatus'],'ragErrorMessage':_0x56e355['ragErrorMessage'],'createTime':_0x56e355['createTime'],'updateTime':_0x56e355[_0x37a794(0x160)]};}function summarizeSearchHit(_0x59bdcb){const _0x289674=a25_0x44c1ca;return{'scope':_0x59bdcb[_0x289674(0x14b)],'docId':_0x59bdcb['docId'],'score':_0x59bdcb[_0x289674(0x140)],'weightedScore':_0x59bdcb['weightedScore'],'content':_0x59bdcb[_0x289674(0x141)],'metadata':_0x59bdcb[_0x289674(0x164)]};}function a25_0x1c71(_0x22b75d,_0x35f919){_0x22b75d=_0x22b75d-0x138;const _0x5e4572=a25_0x5e45();let _0x1c71b6=_0x5e4572[_0x22b75d];return _0x1c71b6;}function readTopK(_0x26777a){const _0x4b8ced=a25_0x44c1ca,_0x69230a=_0x26777a['flag'](_0x4b8ced(0x153));if(_0x69230a===undefined||_0x69230a===null||_0x69230a==='')return undefined;const _0x47d902=_0x26777a[_0x4b8ced(0x13b)](_0x4b8ced(0x153));if(!Number[_0x4b8ced(0x163)](_0x47d902)||_0x47d902<0x1)throw CliErrors[_0x4b8ced(0x156)](_0x4b8ced(0x13c));return _0x47d902;}const kbList={'service':'kb','command':'list','description':a25_0x44c1ca(0x16b),'risk':a25_0x44c1ca(0x151),'flags':[VERBOSE_FLAG],async 'execute'(_0x1d8c9e){const _0x1e3c36=a25_0x44c1ca,_0x32523c=await listPersonalKnowledgeBaseItems(_0x1d8c9e['appCode']);if(_0x1d8c9e['bool']('verbose'))return{'ok':!![],'data':{'total':_0x32523c[_0x1e3c36(0x16a)],'items':_0x32523c}};return{'ok':!![],'data':{'total':_0x32523c['length'],'items':_0x32523c[_0x1e3c36(0x170)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a25_0x44c1ca(0x157),'risk':a25_0x44c1ca(0x151),'flags':[{...ID_FLAG,'description':a25_0x44c1ca(0x150)}],async 'execute'(_0x5aa87e){const _0x25ff32=a25_0x44c1ca,_0x462ae2=await getPersonalKnowledgeBaseItem(_0x5aa87e[_0x25ff32(0x13b)]('id'),_0x5aa87e[_0x25ff32(0x13a)]);return{'ok':!![],'data':detailPersonalItem(_0x462ae2)};}},kbCreate={'service':'kb','command':a25_0x44c1ca(0x13d),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a25_0x44c1ca(0x15f),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x5e63e2){const _0xfcf0d7=a25_0x44c1ca,_0x384798=_0x5e63e2['str']('title'),_0x4f9b12=readKnowledgeFile(_0x5e63e2[_0xfcf0d7(0x155)](_0xfcf0d7(0x161))),_0x311281=await createPersonalKnowledgeBaseItem(_0x5e63e2[_0xfcf0d7(0x13a)],{'title':_0x384798,'content':_0x4f9b12});return{'ok':!![],'data':summarizePersonalItem(_0x311281),'message':'Created\x20KB\x20entry\x20'+_0x311281['id']+'\x20('+_0x311281[_0xfcf0d7(0x13f)]+')'};},async 'dryRun'(_0x4c6897){const _0x4d4e85=a25_0x44c1ca,_0x5499eb=_0x4c6897[_0x4d4e85(0x155)]('title'),_0x35f32b=readKnowledgeFile(_0x4c6897[_0x4d4e85(0x155)](_0x4d4e85(0x161)));return dryRun('POST','/client/knowledge-base/personal/create')[_0x4d4e85(0x15c)]({'appCode':_0x4c6897[_0x4d4e85(0x13a)],'title':_0x5499eb,'content':_0x35f32b})[_0x4d4e85(0x14e)](_0x4d4e85(0x167)+_0x5499eb+'\x22')[_0x4d4e85(0x14d)]();}},kbUpdate={'service':'kb','command':a25_0x44c1ca(0x172),'description':a25_0x44c1ca(0x16c),'risk':'write','flags':[{...ID_FLAG,'description':a25_0x44c1ca(0x150)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x36df3f){const _0xd56243=a25_0x44c1ca,_0x5af7b6=_0x36df3f[_0xd56243(0x13b)]('id'),_0x34c0b8=readKnowledgeFile(_0x36df3f[_0xd56243(0x155)](_0xd56243(0x161))),_0x21f503=_0x36df3f[_0xd56243(0x155)](_0xd56243(0x13f))||(await getPersonalKnowledgeBaseItem(_0x5af7b6,_0x36df3f[_0xd56243(0x13a)]))['title'],_0x1abe3a=await updatePersonalKnowledgeBaseItem(_0x5af7b6,_0x36df3f[_0xd56243(0x13a)],{'title':_0x21f503,'content':_0x34c0b8});return{'ok':!![],'data':summarizePersonalItem(_0x1abe3a),'message':_0xd56243(0x16f)+_0x1abe3a['id']+'\x20('+_0x1abe3a['title']+')'};},async 'dryRun'(_0xb2a515){const _0x5fd3bc=a25_0x44c1ca,_0x3b36ec=_0xb2a515['num']('id'),_0x5cc6bc=readKnowledgeFile(_0xb2a515[_0x5fd3bc(0x155)](_0x5fd3bc(0x161))),_0x973ae9=_0xb2a515[_0x5fd3bc(0x155)](_0x5fd3bc(0x13f))||(await getPersonalKnowledgeBaseItem(_0x3b36ec,_0xb2a515[_0x5fd3bc(0x13a)]))[_0x5fd3bc(0x13f)];return dryRun(_0x5fd3bc(0x148),'/client/knowledge-base/personal/'+_0x3b36ec+_0x5fd3bc(0x158))[_0x5fd3bc(0x15c)]({'appCode':_0xb2a515[_0x5fd3bc(0x13a)],'title':_0x973ae9,'content':_0x5cc6bc})['description'](_0x5fd3bc(0x142)+_0x3b36ec)[_0x5fd3bc(0x14d)]();}},kbSearch={'service':'kb','command':a25_0x44c1ca(0x14a),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a25_0x44c1ca(0x151),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4cf31e){const _0xe95fbc=a25_0x44c1ca;if(!_0x4cf31e[_0xe95fbc(0x155)](_0xe95fbc(0x16e))[_0xe95fbc(0x169)]())throw CliErrors[_0xe95fbc(0x156)](_0xe95fbc(0x15e));readTopK(_0x4cf31e);},async 'execute'(_0x4e8b28){const _0x4a4135=a25_0x44c1ca,_0x56b0f0=_0x4e8b28['str'](_0x4a4135(0x16e))[_0x4a4135(0x169)](),_0x54e85d=readTopK(_0x4e8b28),_0x49ee83=await searchKnowledgeBase(_0x4e8b28[_0x4a4135(0x13a)],{'query':_0x56b0f0,'topK':_0x54e85d});return{'ok':!![],'data':{'total':_0x49ee83[_0x4a4135(0x16a)],'hits':_0x49ee83['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x3bdff0=a26_0x51d3;function a26_0x51d3(_0x466fef,_0x396535){_0x466fef=_0x466fef-0xa3;const _0x27e143=a26_0x27e1();let _0x51d352=_0x27e143[_0x466fef];return _0x51d352;}(function(_0x521a13,_0x4bc1b1){const _0x37eafe=a26_0x51d3,_0x47c995=_0x521a13();while(!![]){try{const _0x1945c2=-parseInt(_0x37eafe(0xbd))/0x1*(-parseInt(_0x37eafe(0xa7))/0x2)+parseInt(_0x37eafe(0xad))/0x3+parseInt(_0x37eafe(0xaf))/0x4+-parseInt(_0x37eafe(0xb0))/0x5+parseInt(_0x37eafe(0xb8))/0x6*(parseInt(_0x37eafe(0xa3))/0x7)+parseInt(_0x37eafe(0xab))/0x8*(-parseInt(_0x37eafe(0xc5))/0x9)+parseInt(_0x37eafe(0xac))/0xa*(parseInt(_0x37eafe(0xba))/0xb);if(_0x1945c2===_0x4bc1b1)break;else _0x47c995['push'](_0x47c995['shift']());}catch(_0x2d3a8d){_0x47c995['push'](_0x47c995['shift']());}}}(a26_0x27e1,0x7ac89));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a26_0x27e1(){const _0x4125a4=['details','*\x20Logs\x20cleared','clear','8013496QasOGH','70lKMeLu','682113hwODdH','level','2302932QuTlGD','4109295gEnTNm','clearLogs','Clear\x20command\x20history\x20logs','show','command','keys','timestamp','\x20\x20\x20Details:\x20','48eHqIMq','success','455037DsqLAO','length','toLocaleString','27EbBZEP','\x20logs:\x0a','\x20\x20\x20Duration:\x20','stringify','forEach','log','duration','en-US','9vQsScV','787801sgsrZI','View\x20command\x20history\x20logs','read','error','24700OuyQWY'];a26_0x27e1=function(){return _0x4125a4;};return a26_0x27e1();}function printLogs(_0x537aa5){const _0x9bb25d=a26_0x51d3;if(_0x537aa5[_0x9bb25d(0xbb)]===0x0){console[_0x9bb25d(0xc2)]('*\x20No\x20logs\x20found');return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x9bb25d(0xbe)),_0x537aa5[_0x9bb25d(0xc1)]((_0x3bd968,_0xb29f84)=>{const _0x1955b0=_0x9bb25d,_0x3ae236=new Date(_0x3bd968[_0x1955b0(0xb6)])[_0x1955b0(0xbc)](_0x1955b0(0xc4)),_0xeef659=_0x3bd968['level']===_0x1955b0(0xb9)?'√':_0x3bd968[_0x1955b0(0xae)]===_0x1955b0(0xa6)?'×':_0x3bd968[_0x1955b0(0xae)]==='warn'?'!':'i';console[_0x1955b0(0xc2)](_0xb29f84+0x1+'.\x20'+_0xeef659+'\x20['+_0x3bd968[_0x1955b0(0xb4)]+']\x20'+_0x3bd968['message']),console['log']('\x20\x20\x20Time:\x20'+_0x3ae236),_0x3bd968[_0x1955b0(0xc3)]&&console['log'](_0x1955b0(0xbf)+_0x3bd968[_0x1955b0(0xc3)]+'ms'),_0x3bd968[_0x1955b0(0xa8)]&&Object[_0x1955b0(0xb5)](_0x3bd968['details'])['length']>0x0&&console[_0x1955b0(0xc2)](_0x1955b0(0xb7)+JSON[_0x1955b0(0xc0)](_0x3bd968[_0x1955b0(0xa8)],null,0x2)),console[_0x1955b0(0xc2)]('');});}export const logsDefinitions=[{'service':'logs','command':a26_0x3bdff0(0xb3),'description':a26_0x3bdff0(0xa4),'risk':a26_0x3bdff0(0xa5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5b87db){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':'logs','command':a26_0x3bdff0(0xaa),'description':a26_0x3bdff0(0xb2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2c9941){const _0x4b7b68=a26_0x3bdff0;return logger[_0x4b7b68(0xb1)](),console[_0x4b7b68(0xc2)](_0x4b7b68(0xa9)),{'ok':!![]};}}];
|