@lovrabet/lovrabet-cli 2.0.13 → 2.0.14-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/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
|
+
const a15_0x38e648=a15_0x34a7;(function(_0x4621d6,_0x1f680b){const _0x38c52e=a15_0x34a7,_0x150f79=_0x4621d6();while(!![]){try{const _0x2b88e2=-parseInt(_0x38c52e(0x190))/0x1*(parseInt(_0x38c52e(0x19e))/0x2)+-parseInt(_0x38c52e(0x195))/0x3*(-parseInt(_0x38c52e(0x199))/0x4)+parseInt(_0x38c52e(0x196))/0x5+parseInt(_0x38c52e(0x19d))/0x6+parseInt(_0x38c52e(0x18f))/0x7+-parseInt(_0x38c52e(0x1a1))/0x8*(-parseInt(_0x38c52e(0x198))/0x9)+-parseInt(_0x38c52e(0x1a0))/0xa;if(_0x2b88e2===_0x1f680b)break;else _0x150f79['push'](_0x150f79['shift']());}catch(_0x2a8dcd){_0x150f79['push'](_0x150f79['shift']());}}}(a15_0x562f,0xeb953));export const CODE_FLAG={'name':a15_0x38e648(0x191),'type':a15_0x38e648(0x193),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a15_0x38e648(0x19a)}};export const SQLCODE_FLAG={'name':a15_0x38e648(0x19f),'type':a15_0x38e648(0x193),'required':!![],'description':a15_0x38e648(0x192),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x38e648(0x197)}};export const VERBOSE_FLAG={'name':a15_0x38e648(0x18d),'type':'boolean','description':'Return\x20full\x20raw\x20response\x20object'};export const PARAMS_FLAG={'name':a15_0x38e648(0x18e),'type':a15_0x38e648(0x193),'description':a15_0x38e648(0x19c)};function a15_0x34a7(_0x234778,_0x41ac6d){_0x234778=_0x234778-0x18c;const _0x562f26=a15_0x562f();let _0x34a760=_0x562f26[_0x234778];return _0x34a760;}function a15_0x562f(){const _0x2a2bcf=['a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','Resource\x20ID','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','8621334lTGjHq','206352ulyxqP','sqlcode','25790330oXloWX','5151448zKjJxi','number','verbose','params','7793660VmDnvz','16dbLQdx','code','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','string','name','2256HLxWkI','4693860dGxnJa','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','9iHqrME','5648YHOXkt'];a15_0x562f=function(){return _0x2a2bcf;};return a15_0x562f();}export const NAME_FLAG={'name':a15_0x38e648(0x194),'type':a15_0x38e648(0x193),'description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':a15_0x38e648(0x18c),'required':!![],'description':a15_0x38e648(0x19b)};
|
|
@@ -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_0xb8d3d3=a16_0x3e4f;(function(_0x4acbae,_0x40bcca){const _0x140b7c=a16_0x3e4f,_0x46cedb=_0x4acbae();while(!![]){try{const _0x3446a6=parseInt(_0x140b7c(0xa4))/0x1+parseInt(_0x140b7c(0xb5))/0x2*(-parseInt(_0x140b7c(0xb8))/0x3)+-parseInt(_0x140b7c(0xd2))/0x4+-parseInt(_0x140b7c(0xb0))/0x5*(-parseInt(_0x140b7c(0xa0))/0x6)+parseInt(_0x140b7c(0xa1))/0x7*(-parseInt(_0x140b7c(0xbd))/0x8)+-parseInt(_0x140b7c(0xa9))/0x9*(parseInt(_0x140b7c(0xb6))/0xa)+parseInt(_0x140b7c(0xd6))/0xb;if(_0x3446a6===_0x40bcca)break;else _0x46cedb['push'](_0x46cedb['shift']());}catch(_0xee77da){_0x46cedb['push'](_0x46cedb['shift']());}}}(a16_0x5f39,0x20043));import{CliErrors}from'../../errors.js';function a16_0x5f39(){const _0x1b4345=['write','2874333OrnBei',';\x20apps.<alias>.appcode','field','keys','key','\x20\x20global:\x20\x20','project-or-global-explicit','bool','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','config','../../context.js','Settable\x20keys:\x20','pageSize\x20must\x20be\x20a\x20positive\x20number','Get\x20a\x20config\x20value','1257570ahDjgF','1211vwjItw','validation','alias','222072txeUPF','read','Key\x20\x22','Missing\x20key\x20argument.','Set\x20`','3888vFYqoA','\x22.\x20Allowed:\x20','join','\x22\x20is\x20not\x20settable.','log','apps','boolean','5flrLfq','riskLevel','value','List\x20current\x20config','stringify','28kTasas','2110xPpTxz','Write\x20to\x20global\x20config','26673rkDzeK','split','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','pretty','raw','5352jgunIo','Invalid\x20value\x20for\x20\x22','Deleted\x20`','Value\x20to\x20assign','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','format','appcode','isArray','\x20(global)','Usage:\x20','includes','`\x20=\x20\x22','length','object','(none)','Key\x20not\x20found:\x20','\x22\x20not\x20found\x20at\x20top\x20level.','pageSize','args','Delete\x20a\x20config\x20value','Config\x20files:\x0a','921872QASQYi','trim','global'];a16_0x5f39=function(){return _0x1b4345;};return a16_0x5f39();}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_0xb8d3d3(0xd4),'type':a16_0xb8d3d3(0xaf),'description':a16_0xb8d3d3(0xb7),'default':![]};function parseAliasAppcodeSetKey(_0x464359){const _0x5a5442=a16_0xb8d3d3,_0xe6e271=_0x464359[_0x5a5442(0xb9)]('.');if(_0xe6e271['length']!==0x3||_0xe6e271[0x0]!=='apps'||_0xe6e271[0x2]!==_0x5a5442(0xc3))return undefined;const _0x5ae375=_0xe6e271[0x1]?.[_0x5a5442(0xd3)]();return _0x5ae375?_0x5ae375:undefined;}function a16_0x3e4f(_0x2963e4,_0x1d86e8){_0x2963e4=_0x2963e4-0x94;const _0x5f39e9=a16_0x5f39();let _0x3e4f33=_0x5f39e9[_0x2963e4];return _0x3e4f33;}function parseAliasDeleteKey(_0x4686a5){const _0x4934c2=a16_0xb8d3d3,_0x3a5580=_0x4686a5['split']('.');if(_0x3a5580[_0x4934c2(0xc9)]===0x2&&_0x3a5580[0x0]===_0x4934c2(0xae)){const _0x3ec5e4=_0x3a5580[0x1]?.[_0x4934c2(0xd3)]();return _0x3ec5e4?{'alias':_0x3ec5e4}:undefined;}if(_0x3a5580[_0x4934c2(0xc9)]===0x3&&_0x3a5580[0x0]===_0x4934c2(0xae)&&_0x3a5580[0x2]===_0x4934c2(0xc3)){const _0x5d0430=_0x3a5580[0x1]?.[_0x4934c2(0xd3)]();return _0x5d0430?{'alias':_0x5d0430,'field':_0x4934c2(0xc3)}:undefined;}return undefined;}function setLocalAppAlias(_0x4b811b,_0x45765e,_0x537abb){const _0x2fa1e9=a16_0xb8d3d3,_0x43af90=_0x4b811b['apps']&&typeof _0x4b811b['apps']===_0x2fa1e9(0xca)&&!Array[_0x2fa1e9(0xc4)](_0x4b811b[_0x2fa1e9(0xae)])?_0x4b811b[_0x2fa1e9(0xae)]:{},_0x57b84e=_0x43af90[_0x45765e]&&typeof _0x43af90[_0x45765e]==='object'&&!Array[_0x2fa1e9(0xc4)](_0x43af90[_0x45765e])?_0x43af90[_0x45765e]:{};_0x57b84e[_0x2fa1e9(0xc3)]=_0x537abb,_0x43af90[_0x45765e]=_0x57b84e,_0x4b811b[_0x2fa1e9(0xae)]=_0x43af90;}function deleteLocalAppAlias(_0xfb636a,_0x282d62){const _0x14dff0=a16_0xb8d3d3;if(!_0xfb636a[_0x14dff0(0xae)]||typeof _0xfb636a[_0x14dff0(0xae)]!==_0x14dff0(0xca)||Array[_0x14dff0(0xc4)](_0xfb636a[_0x14dff0(0xae)]))return![];const _0x5bf1db=_0xfb636a['apps'],_0x274d61=_0x5bf1db[_0x282d62['alias']];if(!_0x274d61||typeof _0x274d61!==_0x14dff0(0xca)||Array[_0x14dff0(0xc4)](_0x274d61))return![];if(!_0x282d62[_0x14dff0(0x94)])return delete _0x5bf1db[_0x282d62['alias']],!![];if(!(_0x282d62[_0x14dff0(0x94)]in _0x274d61))return![];return delete _0x274d61[_0x282d62[_0x14dff0(0x94)]],Object[_0x14dff0(0x95)](_0x274d61)[_0x14dff0(0xc9)]===0x0&&delete _0x5bf1db[_0x282d62[_0x14dff0(0xa3)]],!![];}const listDef={'service':a16_0xb8d3d3(0x9b),'command':'list','description':a16_0xb8d3d3(0xb3),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4967c7){const _0x3b3635=a16_0xb8d3d3,{buildConfigFromFlags:_0x14d3c1}=await import(_0x3b3635(0x9c)),_0x1cf0d3=_0x14d3c1({}),_0x592c6e=getProjectConfigPath(),_0x116816=resolveWriteConfigPath(_0x3b3635(0xd4));if(_0x4967c7[_0x3b3635(0xc2)]===_0x3b3635(0xbb))return{'ok':!![],'message':_0x3b3635(0xc1)+(JSON[_0x3b3635(0xb4)](_0x1cf0d3[_0x3b3635(0xbc)],null,0x2)+'\x0a\x0a')+_0x3b3635(0xd1)+('\x20\x20project:\x20'+(_0x592c6e??_0x3b3635(0xcb))+'\x0a')+(_0x3b3635(0x97)+_0x116816)};return{'ok':!![],'data':{'effective':_0x1cf0d3[_0x3b3635(0xbc)],'configFiles':{'project':_0x592c6e??null,'global':_0x116816}}};}},getDef={'service':a16_0xb8d3d3(0x9b),'command':'get','description':a16_0xb8d3d3(0x9f),'risk':a16_0xb8d3d3(0xa5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0xb8d3d3(0x96),'description':a16_0xb8d3d3(0x9a),'required':!![]}],'flags':[],async 'execute'(_0x54ebfd){const _0x3c4b22=a16_0xb8d3d3,_0x533380=_0x54ebfd[_0x3c4b22(0xcf)][0x0];if(!_0x533380)throw CliErrors['validation'](_0x3c4b22(0xa7),_0x3c4b22(0xc6)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x418133}=await import(_0x3c4b22(0x9c)),{raw:_0x24b989}=_0x418133({});if(_0x533380[_0x3c4b22(0xc7)]('.')){const _0x5178e8=_0x533380['split']('.');let _0x2c0d94=_0x24b989;for(const _0x1e9fe3 of _0x5178e8){if(_0x2c0d94==null||typeof _0x2c0d94!==_0x3c4b22(0xca))throw CliErrors[_0x3c4b22(0xa2)](_0x3c4b22(0xcc)+_0x533380);_0x2c0d94=_0x2c0d94[_0x1e9fe3];}if(_0x2c0d94===undefined)throw CliErrors[_0x3c4b22(0xa2)](_0x3c4b22(0xcc)+_0x533380);return console[_0x3c4b22(0xad)](typeof _0x2c0d94===_0x3c4b22(0xca)?JSON['stringify'](_0x2c0d94,null,0x2):String(_0x2c0d94)),{'ok':!![]};}const _0x3a80d5=_0x24b989[_0x533380];if(_0x3a80d5===undefined)throw CliErrors[_0x3c4b22(0xa2)](_0x3c4b22(0xcc)+_0x533380);return console['log'](typeof _0x3a80d5===_0x3c4b22(0xca)?JSON[_0x3c4b22(0xb4)](_0x3a80d5,null,0x2):String(_0x3a80d5)),{'ok':!![]};}},setDef={'service':a16_0xb8d3d3(0x9b),'command':'set','description':'Set\x20a\x20config\x20value','risk':a16_0xb8d3d3(0xd5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0xb8d3d3(0x96),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0xb8d3d3(0xb2),'description':a16_0xb8d3d3(0xc0),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x3e14ff){const _0x585cee=a16_0xb8d3d3,_0xd91b9a=_0x3e14ff[_0x585cee(0xcf)][0x0],_0x5e3a97=_0x3e14ff[_0x585cee(0xcf)][0x1];if(!_0xd91b9a||_0x5e3a97===undefined)throw CliErrors[_0x585cee(0xa2)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0xd91b9a]&&!ENUM_KEYS[_0xd91b9a]['includes'](_0x5e3a97))throw CliErrors[_0x585cee(0xa2)](_0x585cee(0xbe)+_0xd91b9a+_0x585cee(0xaa)+ENUM_KEYS[_0xd91b9a][_0x585cee(0xab)](',\x20'));if(_0xd91b9a===_0x585cee(0xb1))throw CliErrors['validation'](_0x585cee(0xba));if(_0xd91b9a===_0x585cee(0xce)){const _0x25a67f=Number(_0x5e3a97);if(isNaN(_0x25a67f)||_0x25a67f<=0x0)throw CliErrors[_0x585cee(0xa2)](_0x585cee(0x9e));}const _0x12758a=resolveWriteScope({'explicitGlobal':_0x3e14ff[_0x585cee(0x99)](_0x585cee(0xd4)),'policy':_0x585cee(0x98)}),_0x5197e2=toScopeFlags(_0x12758a),_0x2d23b0=readScopedConfig(_0x5197e2),_0x15ea19=parseAliasAppcodeSetKey(_0xd91b9a);if(!_0x15ea19&&!isTopLevelConfigKey(_0xd91b9a))throw CliErrors['validation']('Top-level\x20key\x20\x22'+_0xd91b9a+_0x585cee(0xac),_0x585cee(0x9d)+getTopLevelConfigKeySummary()+_0x585cee(0xd7));return _0x15ea19?setLocalAppAlias(_0x2d23b0,_0x15ea19,_0x5e3a97):_0x2d23b0[_0xd91b9a]=_0xd91b9a===_0x585cee(0xce)?Number(_0x5e3a97):_0x5e3a97,console[_0x585cee(0xad)](_0x585cee(0xa8)+_0xd91b9a+_0x585cee(0xc8)+_0x5e3a97+'\x22'+(_0x12758a===_0x585cee(0xd4)?_0x585cee(0xc5):'')),writeScopedConfig(_0x2d23b0,_0x5197e2),{'ok':!![]};}},deleteDef={'service':'config','command':'delete','description':a16_0xb8d3d3(0xd0),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x42a1e0){const _0x354b37=a16_0xb8d3d3,_0x4fb293=_0x42a1e0[_0x354b37(0xcf)][0x0];if(!_0x4fb293)throw CliErrors[_0x354b37(0xa2)](_0x354b37(0xa7),_0x354b37(0xc6)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x4118e2=resolveWriteScope({'explicitGlobal':_0x42a1e0[_0x354b37(0x99)](_0x354b37(0xd4)),'policy':'project-or-global-explicit'}),_0x2cb1a3=toScopeFlags(_0x4118e2),_0xaa5b11=readScopedConfig(_0x2cb1a3),_0x15f5a7=parseAliasDeleteKey(_0x4fb293);if(_0x15f5a7){if(!deleteLocalAppAlias(_0xaa5b11,_0x15f5a7))throw CliErrors[_0x354b37(0xa2)](_0x354b37(0xcc)+_0x4fb293);return console[_0x354b37(0xad)](_0x354b37(0xbf)+_0x4fb293+'`'+(_0x4118e2===_0x354b37(0xd4)?_0x354b37(0xc5):'')),writeScopedConfig(_0xaa5b11,_0x2cb1a3),{'ok':!![]};}if(_0xaa5b11[_0x4fb293]===undefined)throw CliErrors[_0x354b37(0xa2)](_0x354b37(0xa6)+_0x4fb293+_0x354b37(0xcd));return delete _0xaa5b11[_0x4fb293],console[_0x354b37(0xad)](_0x354b37(0xbf)+_0x4fb293+'`'+(_0x4118e2===_0x354b37(0xd4)?_0x354b37(0xc5):'')),writeScopedConfig(_0xaa5b11,_0x2cb1a3),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0x4523(_0x30306b,_0x5c3410){_0x30306b=_0x30306b-0x91;var _0x22e4a8=a17_0x22e4();var _0x45232f=_0x22e4a8[_0x30306b];return _0x45232f;}(function(_0x4e1ec5,_0x2ec929){var _0x146b7b=a17_0x4523,_0x410b3f=_0x4e1ec5();while(!![]){try{var _0xd35c8f=parseInt(_0x146b7b(0x98))/0x1*(parseInt(_0x146b7b(0x95))/0x2)+parseInt(_0x146b7b(0x93))/0x3*(-parseInt(_0x146b7b(0x96))/0x4)+parseInt(_0x146b7b(0x91))/0x5+-parseInt(_0x146b7b(0x99))/0x6*(-parseInt(_0x146b7b(0x97))/0x7)+-parseInt(_0x146b7b(0x94))/0x8+parseInt(_0x146b7b(0x92))/0x9+-parseInt(_0x146b7b(0x9a))/0xa*(parseInt(_0x146b7b(0x9b))/0xb);if(_0xd35c8f===_0x2ec929)break;else _0x410b3f['push'](_0x410b3f['shift']());}catch(_0x5f4412){_0x410b3f['push'](_0x410b3f['shift']());}}}(a17_0x22e4,0x3bf72));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a17_0x22e4(){var _0x34ada4=['52OKUlET','7nlPPXZ','23947sWvXQI','189066QLJMtD','110TLBnQX','86493BwYLNA','954820elctxb','394677PZaGBc','26067TJrwpK','1826872HKrRRC','34mdItDR'];a17_0x22e4=function(){return _0x34ada4;};return a17_0x22e4();}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';
|
|
@@ -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_0x5b2fa3=a18_0x3564;(function(_0x1420df,_0x46d398){const _0x4c5470=a18_0x3564,_0x22c088=_0x1420df();while(!![]){try{const _0x51bfaa=parseInt(_0x4c5470(0x12a))/0x1+parseInt(_0x4c5470(0x11b))/0x2*(-parseInt(_0x4c5470(0x11d))/0x3)+parseInt(_0x4c5470(0x152))/0x4+-parseInt(_0x4c5470(0x155))/0x5*(parseInt(_0x4c5470(0x126))/0x6)+parseInt(_0x4c5470(0x13f))/0x7*(parseInt(_0x4c5470(0x119))/0x8)+-parseInt(_0x4c5470(0x14b))/0x9+parseInt(_0x4c5470(0x13a))/0xa;if(_0x51bfaa===_0x46d398)break;else _0x22c088['push'](_0x22c088['shift']());}catch(_0x2140fd){_0x22c088['push'](_0x22c088['shift']());}}}(a18_0x5dcc,0x95aae));function a18_0x3564(_0x5d58c7,_0x3b236e){_0x5d58c7=_0x5d58c7-0x110;const _0x5dccc7=a18_0x5dcc();let _0x3564fc=_0x5dccc7[_0x5d58c7];return _0x3564fc;}function a18_0x5dcc(){const _0x328d49=['create','\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\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}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','helpExtra','getOne','params','update','3111372onsMYZ','map','description','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','delete','\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]}}','paramsRequired','3765192PFySZz','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','515VIhESX','operation','POST','\x20on\x20dataset\x20','Update\x20an\x20existing\x20record','join','\x20\x20EXAMPLES','\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}}','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','str','\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\x20LOGICAL\x20COMBINATORS','aggregate','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','read','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20PAGINATION','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','102576PAIUHZ','code','241412dVqhjT','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','27mpBazH','\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}}','command','risk','/api/{appCode}/','now','batchCreate','\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}}','14298QzlYGg','\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\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}','\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]','22092jRHSeW','high-risk-write','\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}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','build','data','data\x20','\x20completed\x20in\x20','body','dryRun','\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}}','filter','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\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}}]}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','13015150AAzLhb','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','write','\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}}','14ydByAk','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\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}}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27'];a18_0x5dcc=function(){return _0x328d49;};return a18_0x5dcc();}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_0x5b2fa3(0x135),'operation':a18_0x5b2fa3(0x135),'risk':'read','paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a18_0x5b2fa3(0x139),'helpExtra':['\x20\x20WHERE\x20OPERATORS',a18_0x5b2fa3(0x125),'\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}}',a18_0x5b2fa3(0x13b),a18_0x5b2fa3(0x144),a18_0x5b2fa3(0x11e),a18_0x5b2fa3(0x15c),a18_0x5b2fa3(0x150),a18_0x5b2fa3(0x116),a18_0x5b2fa3(0x13e),a18_0x5b2fa3(0x141),'',a18_0x5b2fa3(0x111),a18_0x5b2fa3(0x138),'\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)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a18_0x5b2fa3(0x129),a18_0x5b2fa3(0x137),a18_0x5b2fa3(0x118),a18_0x5b2fa3(0x153),'',a18_0x5b2fa3(0x117),a18_0x5b2fa3(0x146),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a18_0x5b2fa3(0x140)][a18_0x5b2fa3(0x15a)]('\x0a')},{'command':a18_0x5b2fa3(0x148),'operation':a18_0x5b2fa3(0x148),'risk':a18_0x5b2fa3(0x114),'paramsRequired':!![],'description':a18_0x5b2fa3(0x115),'paramsHint':a18_0x5b2fa3(0x15e)},{'command':a18_0x5b2fa3(0x143),'operation':a18_0x5b2fa3(0x143),'risk':a18_0x5b2fa3(0x13d),'paramsRequired':!![],'description':a18_0x5b2fa3(0x15d),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':'batchCreate','operation':a18_0x5b2fa3(0x123),'risk':a18_0x5b2fa3(0x13d),'paramsRequired':!![],'description':a18_0x5b2fa3(0x14e),'paramsHint':a18_0x5b2fa3(0x113)},{'command':a18_0x5b2fa3(0x14a),'operation':a18_0x5b2fa3(0x14a),'risk':'write','paramsRequired':!![],'description':a18_0x5b2fa3(0x159),'paramsHint':a18_0x5b2fa3(0x12d)},{'command':a18_0x5b2fa3(0x14f),'operation':'delete','risk':a18_0x5b2fa3(0x12b),'paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a18_0x5b2fa3(0x15e)},{'command':a18_0x5b2fa3(0x112),'operation':a18_0x5b2fa3(0x112),'risk':a18_0x5b2fa3(0x114),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+a18_0x5b2fa3(0x142),'helpExtra':[a18_0x5b2fa3(0x136),a18_0x5b2fa3(0x12c),'\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}',a18_0x5b2fa3(0x110),'\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}','\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_0x5b2fa3(0x145),a18_0x5b2fa3(0x128),'','\x20\x20PARAMS\x20STRUCTURE','\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\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)',a18_0x5b2fa3(0x11c),a18_0x5b2fa3(0x154),a18_0x5b2fa3(0x134),a18_0x5b2fa3(0x127),'',a18_0x5b2fa3(0x15b),a18_0x5b2fa3(0x124),a18_0x5b2fa3(0x13c),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\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'][a18_0x5b2fa3(0x15a)]('\x0a')}];function makeDataCommand(_0x31f1a6){const _0x22b077=a18_0x5b2fa3,_0x212337=_0x22b077(0x130)+_0x31f1a6['command'],_0x37b0cf={'service':_0x22b077(0x12f),'command':_0x31f1a6[_0x22b077(0x11f)],'description':_0x31f1a6[_0x22b077(0x14d)],'risk':_0x31f1a6[_0x22b077(0x120)],'helpExtra':_0x31f1a6[_0x22b077(0x147)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x31f1a6['paramsHint']}],'validate':async _0x4817f6=>{const _0x177454=_0x22b077;_0x31f1a6[_0x177454(0x151)]&&requireAnyOf(_0x4817f6,['params'],_0x212337),_0x31f1a6[_0x177454(0x156)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4817f6[_0x177454(0x15f)]('params')));},async 'execute'(_0x2999e5){const _0xac9305=_0x22b077,_0x1d163d=_0x2999e5[_0xac9305(0x15f)](_0xac9305(0x11a)),_0x29b4aa=_0x31f1a6[_0xac9305(0x156)]===_0xac9305(0x123)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2999e5[_0xac9305(0x15f)](_0xac9305(0x149)))):parseJsonParams(_0x2999e5['str'](_0xac9305(0x149)))??{},_0x3d2648=Date[_0xac9305(0x122)](),_0x333b3e=await executeData(_0x1d163d,_0x31f1a6[_0xac9305(0x156)],_0x29b4aa),_0x1d1ef7=Date[_0xac9305(0x122)]()-_0x3d2648;return{'ok':!![],'data':{'result':_0x333b3e,'elapsed':_0x1d1ef7},'message':_0xac9305(0x130)+_0x31f1a6[_0xac9305(0x11f)]+_0xac9305(0x131)+_0x1d1ef7+'ms'};}};return _0x31f1a6[_0x22b077(0x120)]!==_0x22b077(0x114)&&(_0x37b0cf[_0x22b077(0x133)]=async _0x5127d2=>{const _0x3ab047=_0x22b077,_0x33a7a7=_0x5127d2['str'](_0x3ab047(0x11a)),_0x3087c5=_0x31f1a6['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x5127d2[_0x3ab047(0x15f)](_0x3ab047(0x149)))):parseJsonParams(_0x5127d2['str']('params'))??{};return dryRun(_0x3ab047(0x157),_0x3ab047(0x121)+_0x33a7a7+'/'+_0x31f1a6[_0x3ab047(0x156)])[_0x3ab047(0x132)](_0x3087c5)[_0x3ab047(0x14d)]('Preview:\x20data\x20'+_0x31f1a6[_0x3ab047(0x11f)]+_0x3ab047(0x158)+_0x33a7a7)[_0x3ab047(0x12e)]();}),_0x37b0cf;}export const dataDefinitions=specs[a18_0x5b2fa3(0x14c)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x10ace9=a19_0x499a;(function(_0x182a9d,_0x3e8ded){const _0x3e2cf8=a19_0x499a,_0x27b24d=_0x182a9d();while(!![]){try{const _0x8b227e=parseInt(_0x3e2cf8(0x197))/0x1+-parseInt(_0x3e2cf8(0x190))/0x2*(-parseInt(_0x3e2cf8(0x178))/0x3)+parseInt(_0x3e2cf8(0x174))/0x4+parseInt(_0x3e2cf8(0x1b0))/0x5+parseInt(_0x3e2cf8(0x1a5))/0x6+-parseInt(_0x3e2cf8(0x196))/0x7*(-parseInt(_0x3e2cf8(0x17e))/0x8)+-parseInt(_0x3e2cf8(0x1ac))/0x9*(parseInt(_0x3e2cf8(0x1a8))/0xa);if(_0x8b227e===_0x3e8ded)break;else _0x27b24d['push'](_0x27b24d['shift']());}catch(_0x465afc){_0x27b24d['push'](_0x27b24d['shift']());}}}(a19_0x1b3e,0xd57e0));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x3c0816){const _0x5f9476=a19_0x499a;if(_0x3c0816[_0x5f9476(0x16c)])return null;const _0x4c99c9=Boolean(_0x3c0816[_0x5f9476(0x1af)]!==undefined||_0x3c0816['doType']!==undefined);let _0x17e4c0={};if(!_0x4c99c9&&typeof _0x3c0816['extend']===_0x5f9476(0x175))try{_0x17e4c0=JSON[_0x5f9476(0x1a1)](_0x3c0816[_0x5f9476(0x19c)]);}catch{}const _0x2e5231=_0x4c99c9?_0x3c0816[_0x5f9476(0x1a0)]:_0x3c0816[_0x5f9476(0x176)],_0x8ec06a=_0x4c99c9?_0x3c0816[_0x5f9476(0x1af)]:_0x3c0816[_0x5f9476(0x1a0)],_0x59a2f8=_0x4c99c9?_0x3c0816['doType']:_0x3c0816[_0x5f9476(0x1a3)]||_0x3c0816['dataType'],_0x33e92e=_0x4c99c9?_0x3c0816[_0x5f9476(0x193)]===!![]:_0x17e4c0['pkField']===!![],_0x26c779=_0x4c99c9?_0x3c0816[_0x5f9476(0x17f)]===!![]:_0x17e4c0['required']===!![],_0x466cc2=_0x4c99c9?_0x3c0816['options']??null:_0x17e4c0[_0x5f9476(0x1aa)]??null,_0x50d1f4={'name':_0x2e5231,'displayName':_0x8ec06a||_0x2e5231,'type':_0x59a2f8,'dbType':_0x3c0816[_0x5f9476(0x179)],'pk':_0x33e92e,'required':_0x26c779,'description':_0x3c0816['description']||undefined};return Array[_0x5f9476(0x1a7)](_0x466cc2)&&_0x466cc2['length']>0x0&&(_0x50d1f4['options']=_0x466cc2),_0x50d1f4;}function parseJsonMaybe(_0x3a2c7f){const _0xa8a189=a19_0x499a;if(typeof _0x3a2c7f!==_0xa8a189(0x175))return _0x3a2c7f;try{return JSON['parse'](_0x3a2c7f);}catch{return _0x3a2c7f;}}function a19_0x499a(_0x17bed4,_0x29c1af){_0x17bed4=_0x17bed4-0x16a;const _0x1b3e00=a19_0x1b3e();let _0x499af9=_0x1b3e00[_0x17bed4];return _0x499af9;}function normalizeOperationEntry(_0x4f6335,_0x584c22){const _0x50d5ae=a19_0x499a;if(!_0x584c22||typeof _0x584c22!=='object')return null;if(!_0x584c22['method']||!_0x584c22[_0x50d5ae(0x1a6)])return null;const _0x3ce7d2={'name':_0x4f6335,'method':_0x584c22[_0x50d5ae(0x16e)],'path':_0x584c22[_0x50d5ae(0x1a6)]};if(_0x584c22[_0x50d5ae(0x173)])_0x3ce7d2[_0x50d5ae(0x173)]=_0x584c22[_0x50d5ae(0x173)];if(_0x584c22['requestBody']!=null)_0x3ce7d2[_0x50d5ae(0x181)]=parseJsonMaybe(_0x584c22[_0x50d5ae(0x181)]);if(_0x584c22['responseBody']!=null)_0x3ce7d2[_0x50d5ae(0x1a9)]=parseJsonMaybe(_0x584c22[_0x50d5ae(0x1a9)]);if(_0x584c22['beforeScriptId']!=null)_0x3ce7d2[_0x50d5ae(0x18d)]=_0x584c22['beforeScriptId'];if(_0x584c22[_0x50d5ae(0x19a)]!=null)_0x3ce7d2[_0x50d5ae(0x19a)]=_0x584c22[_0x50d5ae(0x19a)];if(Array['isArray'](_0x584c22[_0x50d5ae(0x19d)]))_0x3ce7d2['requestFields']=_0x584c22['requestFields'];if(Array[_0x50d5ae(0x1a7)](_0x584c22[_0x50d5ae(0x1b1)]))_0x3ce7d2['responseFields']=_0x584c22[_0x50d5ae(0x1b1)];return _0x3ce7d2;}function summarizeDbtable(_0x3dd811){const _0x54ace=a19_0x499a,_0xeb371e={},_0xdf74c7=[_0x54ace(0x16f),_0x54ace(0x186),_0x54ace(0x17c),'datasetKey',_0x54ace(0x193),_0x54ace(0x16b),_0x54ace(0x1a2),_0x54ace(0x18a),_0x54ace(0x189),_0x54ace(0x18c),_0x54ace(0x19b),'modifierIdField',_0x54ace(0x19f),'labelField','dblinkInfoDTO'];for(const _0x801a0b of _0xdf74c7){if(_0x3dd811[_0x801a0b]!==undefined)_0xeb371e[_0x801a0b]=_0x3dd811[_0x801a0b];}return typeof _0xeb371e[_0x54ace(0x16b)]===_0x54ace(0x175)&&_0xeb371e[_0x54ace(0x16b)][_0x54ace(0x1ad)]>0x0&&(_0xeb371e[_0x54ace(0x195)]=_0xeb371e[_0x54ace(0x16b)][_0x54ace(0x185)](',')['map'](_0x5412df=>_0x5412df[_0x54ace(0x17d)]())[_0x54ace(0x192)](Boolean)),_0xeb371e;}function a19_0x1b3e(){const _0x2a86dd=['afterScriptId','creatorNameField','extend','requestFields','find','modifierNameField','name','parse','logicField','type','doVersion','9750678rUrvjh','path','isArray','1506620HsIeaD','responseBody','options','map','279NTLPYK','length','description','displayName','3520585VHzumh','responseFields','object','allFields','deleted','str','method','dbId','indexes','validateRules','fromField','host','5614372jEcHXI','string','code','dataset','6tqjMau','dbType','dbtableConfig','push','tableName','trim','624cgbmgF','required','fields','requestBody','title','columnCodeListWithDeleted','relations','split','dbName','source','read','updateTimeField','createTimeField','formatRules','creatorIdField','beforeScriptId','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','toDatasetName','1665806xSvSoL','toField','filter','pkField','properties','allFieldNames','8911hLMkmh','47063pbzlOl','toDatasetCode','operations'];a19_0x1b3e=function(){return _0x2a86dd;};return a19_0x1b3e();}function normalizeRelatedPages(_0x3904d2){const _0x58d902=a19_0x499a;if(!Array['isArray'](_0x3904d2))return[];return _0x3904d2[_0x58d902(0x192)](_0x7fc920=>_0x7fc920&&typeof _0x7fc920===_0x58d902(0x16a))[_0x58d902(0x1ab)](_0x508a52=>({'id':_0x508a52['id'],'type':_0x508a52[_0x58d902(0x1a3)],'code':_0x508a52[_0x58d902(0x176)],'title':_0x508a52[_0x58d902(0x182)],'deleted':_0x508a52[_0x58d902(0x16c)]===!![]}));}function normalizeFallbackFieldName(_0x4d024a,_0xe363aa){const _0x392ffc=a19_0x499a,_0x4a659d=_0x4d024a[_0x392ffc(0x17d)]();if(!_0x4a659d)return null;return{'name':_0x4a659d,'displayName':_0x4a659d,'type':undefined,'dbType':undefined,'pk':_0x4a659d===_0xe363aa,'required':![],'description':undefined};}async function loadListFieldFallback(_0x2dd033,_0x306933){const _0x1cf657=a19_0x499a;if(!_0x2dd033||!_0x306933)return[];try{const _0x53621e=await listDatasets(_0x2dd033,{'code':_0x306933}),_0x7fdb60=_0x53621e[_0x1cf657(0x19e)](_0x100e79=>_0x100e79[_0x1cf657(0x176)]===_0x306933)??_0x53621e[0x0],_0x22d5dd=_0x7fdb60?.[_0x1cf657(0x17a)]??{},_0x1560cf=typeof _0x22d5dd[_0x1cf657(0x16b)]==='string'?_0x22d5dd[_0x1cf657(0x16b)][_0x1cf657(0x185)](','):[];return _0x1560cf[_0x1cf657(0x1ab)](_0x30453f=>normalizeFallbackFieldName(_0x30453f,_0x22d5dd[_0x1cf657(0x193)]))['filter'](_0x2e4878=>_0x2e4878!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':'detail','description':a19_0x10ace9(0x18e),'risk':a19_0x10ace9(0x188),'flags':[CODE_FLAG],async 'execute'(_0x5d0f95){const _0x3a443f=a19_0x10ace9,_0x302432=await getDatasetDetail(_0x5d0f95[_0x3a443f(0x16d)](_0x3a443f(0x176))),_0x2c8237=Array[_0x3a443f(0x1a7)](_0x302432[_0x3a443f(0x180)])?_0x302432[_0x3a443f(0x180)]:Array[_0x3a443f(0x1a7)](_0x302432[_0x3a443f(0x194)])?_0x302432['properties']:[];let _0x55f1b5=_0x2c8237[_0x3a443f(0x1ab)](_0x22c8d1=>normalizeField(_0x22c8d1))[_0x3a443f(0x192)](_0xdb194b=>_0xdb194b!==null);_0x55f1b5[_0x3a443f(0x1ad)]===0x0&&(_0x55f1b5=await loadListFieldFallback(_0x5d0f95['appCode'],_0x5d0f95[_0x3a443f(0x16d)](_0x3a443f(0x176))));const _0x466c72=_0x302432[_0x3a443f(0x199)]??{},_0x15face=[];for(const [_0x3c1ad9,_0x52facb]of Object['entries'](_0x466c72)){const _0x5162bc=normalizeOperationEntry(_0x3c1ad9,_0x52facb);if(_0x5162bc)_0x15face[_0x3a443f(0x17b)](_0x5162bc);}const _0x1be8b8=_0x302432[_0x3a443f(0x17a)]??{},_0xbf8f35=_0x302432[_0x3a443f(0x177)]??{},_0x298d25=_0x1be8b8['dbId']!=null?{'id':_0x1be8b8[_0x3a443f(0x16f)],'name':_0x1be8b8[_0x3a443f(0x186)]??null}:undefined;let _0x3c7c80;return typeof _0x302432[_0x3a443f(0x19c)]==='string'&&(_0x3c7c80=parseJsonMaybe(_0x302432[_0x3a443f(0x19c)])),{'ok':!![],'data':{'id':_0x302432['modelId']??_0x302432['id'],'name':_0x302432[_0x3a443f(0x1a0)],'code':_0x302432['modelCode']||_0x302432[_0x3a443f(0x176)],'doVersion':_0x302432[_0x3a443f(0x1a4)],'description':_0x302432[_0x3a443f(0x1ae)]||_0xbf8f35['tableComment']||undefined,'source':_0x302432[_0x3a443f(0x187)]||_0xbf8f35['sourceType'],'table':_0x1be8b8[_0x3a443f(0x17c)]||_0xbf8f35['tableName'],'datasetKey':_0x1be8b8['datasetKey'],'pk':_0x1be8b8[_0x3a443f(0x193)],'db':_0x298d25,'dbtable':summarizeDbtable(_0x1be8b8),'fields':_0x55f1b5,'operations':_0x15face,'indexes':Array['isArray'](_0xbf8f35[_0x3a443f(0x170)])?_0xbf8f35['indexes']:[],'relations':Array[_0x3a443f(0x1a7)](_0x302432[_0x3a443f(0x184)])?_0x302432['relations'][_0x3a443f(0x1ab)](_0xd5e6a1=>({'fromField':_0xd5e6a1[_0x3a443f(0x172)],'toDataset':_0xd5e6a1[_0x3a443f(0x18f)],'toCode':_0xd5e6a1[_0x3a443f(0x198)],'toTable':_0xd5e6a1['toTableName'],'toField':_0xd5e6a1[_0x3a443f(0x191)],'labelField':_0xd5e6a1['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0x302432['relatedPageInfoList']),...Array[_0x3a443f(0x1a7)](_0x302432['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x302432[_0x3a443f(0x183)]}:{},'formatRules':Array[_0x3a443f(0x1a7)](_0x302432[_0x3a443f(0x18b)])?_0x302432['formatRules']:[],'validateRules':Array[_0x3a443f(0x1a7)](_0x302432[_0x3a443f(0x171)])?_0x302432[_0x3a443f(0x171)]:[],..._0x3c7c80!==undefined?{'extend':_0x3c7c80}:{},'stats':{'fieldCount':_0x55f1b5[_0x3a443f(0x1ad)],'operationCount':_0x15face[_0x3a443f(0x1ad)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x418935,_0x277311){const _0x163ecf=a20_0x573a,_0x2b1410=_0x418935();while(!![]){try{const _0x7780b8=-parseInt(_0x163ecf(0x1dc))/0x1+parseInt(_0x163ecf(0x1db))/0x2*(-parseInt(_0x163ecf(0x1de))/0x3)+-parseInt(_0x163ecf(0x1da))/0x4+-parseInt(_0x163ecf(0x1dd))/0x5+parseInt(_0x163ecf(0x1d9))/0x6+-parseInt(_0x163ecf(0x1d8))/0x7+parseInt(_0x163ecf(0x1d7))/0x8;if(_0x7780b8===_0x277311)break;else _0x2b1410['push'](_0x2b1410['shift']());}catch(_0x215968){_0x2b1410['push'](_0x2b1410['shift']());}}}(a20_0x2f87,0x3e549));function a20_0x573a(_0x16613a,_0x11feca){_0x16613a=_0x16613a-0x1d7;const _0x2f8739=a20_0x2f87();let _0x573acd=_0x2f8739[_0x16613a];return _0x573acd;}import{datasetList}from'../../commands/dataset/list.js';function a20_0x2f87(){const _0x446054=['284012bZFYNT','110444EwNuxf','455256FKmeTK','2263525KECdVg','6wWXXfc','13474448OyTbUN','2536177nEkIku','136308hVDuWP'];a20_0x2f87=function(){return _0x446054;};return a20_0x2f87();}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
|
+
function a21_0x331e(_0x577bf8,_0xb8c300){_0x577bf8=_0x577bf8-0x131;const _0x371d71=a21_0x371d();let _0x331e4b=_0x371d71[_0x577bf8];return _0x331e4b;}const a21_0x4168f=a21_0x331e;function a21_0x371d(){const _0x4533d0=['length','4wxFYPk','string','list','map','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','allFields','2993179JOUCHM','18MJaRQi','563167EDKHmc','1869231LMUGTh','6YQoyFj','split','code','2397090exbnhT','trim','name','1jygIWT','1225200FhHvVO','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','pkField','str','dataset','12UQEOyq','171736TWqlOb','datasetKey','2547312wsKrnn'];a21_0x371d=function(){return _0x4533d0;};return a21_0x371d();}(function(_0x1b744e,_0x31576c){const _0x5661a7=a21_0x331e,_0x1b3401=_0x1b744e();while(!![]){try{const _0x31244c=-parseInt(_0x5661a7(0x143))/0x1*(parseInt(_0x5661a7(0x14a))/0x2)+parseInt(_0x5661a7(0x13c))/0x3+parseInt(_0x5661a7(0x133))/0x4*(-parseInt(_0x5661a7(0x140))/0x5)+parseInt(_0x5661a7(0x13d))/0x6*(-parseInt(_0x5661a7(0x139))/0x7)+parseInt(_0x5661a7(0x131))/0x8*(parseInt(_0x5661a7(0x13a))/0x9)+parseInt(_0x5661a7(0x144))/0xa+parseInt(_0x5661a7(0x13b))/0xb*(parseInt(_0x5661a7(0x149))/0xc);if(_0x31244c===_0x31576c)break;else _0x1b3401['push'](_0x1b3401['shift']());}catch(_0x1aac00){_0x1b3401['push'](_0x1b3401['shift']());}}}(a21_0x371d,0x6b9a3));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a21_0x4168f(0x148),'command':a21_0x4168f(0x135),'description':a21_0x4168f(0x137),'risk':'read','flags':[{'name':a21_0x4168f(0x142),'type':a21_0x4168f(0x134),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a21_0x4168f(0x145)}],async 'execute'(_0xc2c5ec){const _0x5e6c28=a21_0x4168f,_0x356b19=_0xc2c5ec[_0x5e6c28(0x147)](_0x5e6c28(0x142)),_0x5ab4fb=_0xc2c5ec[_0x5e6c28(0x147)](_0x5e6c28(0x13f)),_0x3b5d54=await listDatasets(_0xc2c5ec['appCode'],{..._0x356b19&&{'name':_0x356b19},..._0x5ab4fb&&{'code':_0x5ab4fb}});return{'ok':!![],'data':{'total':_0x3b5d54[_0x5e6c28(0x132)],'datasets':_0x3b5d54['map'](_0x25c3a7=>{const _0x40a2a1=_0x5e6c28,_0x59b69a=_0x25c3a7['dbtableConfig']??{};return{'id':_0x25c3a7['id'],'code':_0x25c3a7[_0x40a2a1(0x13f)],'name':_0x25c3a7['name'],'source':_0x25c3a7['source'],'description':_0x25c3a7['description'],'table':_0x59b69a['tableName'],'datasetKey':_0x59b69a[_0x40a2a1(0x14b)],'pk':_0x59b69a[_0x40a2a1(0x146)],'fields':_0x59b69a['allFields']?_0x59b69a[_0x40a2a1(0x138)][_0x40a2a1(0x13e)](',')[_0x40a2a1(0x136)](_0x1b0eca=>_0x1b0eca[_0x40a2a1(0x141)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x335138=a22_0x44e0;(function(_0x5bb1f0,_0x42a97d){const _0x54fe7d=a22_0x44e0,_0x3bb269=_0x5bb1f0();while(!![]){try{const _0x4be6aa=-parseInt(_0x54fe7d(0xbd))/0x1*(parseInt(_0x54fe7d(0xc7))/0x2)+parseInt(_0x54fe7d(0xc6))/0x3*(-parseInt(_0x54fe7d(0xc0))/0x4)+parseInt(_0x54fe7d(0xbc))/0x5*(parseInt(_0x54fe7d(0xbb))/0x6)+parseInt(_0x54fe7d(0xc9))/0x7+parseInt(_0x54fe7d(0xcd))/0x8*(parseInt(_0x54fe7d(0xc5))/0x9)+-parseInt(_0x54fe7d(0xc3))/0xa+parseInt(_0x54fe7d(0xbf))/0xb*(-parseInt(_0x54fe7d(0xc2))/0xc);if(_0x4be6aa===_0x42a97d)break;else _0x3bb269['push'](_0x3bb269['shift']());}catch(_0x4870f6){_0x3bb269['push'](_0x3bb269['shift']());}}}(a22_0x5b94,0x3cf08));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a22_0x44e0(_0x41db93,_0x6c59d2){_0x41db93=_0x41db93-0xb9;const _0x5b94ed=a22_0x5b94();let _0x44e067=_0x5b94ed[_0x41db93];return _0x44e067;}const DEFAULT_MARKDOWN=a22_0x335138(0xcb);export function formatDatasetSdkMarkdown(_0x317c05){const _0x11032b=a22_0x335138,_0x9c73fe=typeof _0x317c05===_0x11032b(0xcc)?_0x317c05[_0x11032b(0xba)]():'';return _0x9c73fe||DEFAULT_MARKDOWN;}function a22_0x5b94(){const _0xa0cf43=['Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','2142203Dcoogb','code','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','string','152YhJNnU','appCode','trim','1902vnbtwK','1695UnpiQG','1369wVsDrR','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','44QNnJTB','36484mfsioe','read','705084KLXOpI','1936230pFofnF','str','184419MbWGZA','9SwbKhV','142GLWwaL'];a22_0x5b94=function(){return _0xa0cf43;};return a22_0x5b94();}export const datasetSdkDoc={'service':'dataset','command':'sdk-doc','description':a22_0x335138(0xbe),'risk':a22_0x335138(0xc1),'flags':[{...CODE_FLAG,'description':a22_0x335138(0xc8)}],async 'execute'(_0x38da4b){const _0x54d581=a22_0x335138,_0x5e8efb=_0x38da4b[_0x54d581(0xc4)](_0x54d581(0xca)),_0x50b328=await getDatasetSdkUsageDoc(_0x5e8efb,_0x38da4b['appCode']);return{'ok':!![],'data':{'code':_0x5e8efb,'appCode':_0x38da4b[_0x54d581(0xb9)],'markdown':formatDatasetSdkMarkdown(_0x50b328)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x382b(){const _0x5827cf=['\x20(accessKey)','(default)','327970LWhtkW','doctor','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','\x20\x20auth\x20(effective):\x20','red','ClientAk','bold','(default:\x20','2841560qqqnok','accessKey','version','\x20\x20runtimeDomain:\x20\x20\x20','✗\x20Invalid\x20JSON','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','Project','status','\x20\x20Session\x20check:\x20\x20\x20','repeat','14IcWTKI','defaultApp','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','1048810FcCVqw','(removed\x20—\x20cookie\x20auth\x20disabled)','✓\x20Valid\x20JSON','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','env','\x20\x20Config\x20JSON','log','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','gray','platform','length','(not\x20found)','8zHktgJ','appCode','423333FSQIIT','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','arch','(missing)','yellow','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','(none)','\x20\x20Merged\x20Config','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Global','(set,\x20length=','(not\x20set)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','currentApp','\x20doctor','check','locale','1474722TGmOZW','97575OQuafJ','110NCGZTs','591010NqjpVb','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','read','message','format','pageSize','(no\x20file)'];a23_0x382b=function(){return _0x5827cf;};return a23_0x382b();}const a23_0x41d50e=a23_0xd94a;(function(_0x488d10,_0x1bbc6d){const _0x4c7b0e=a23_0xd94a,_0x11d400=_0x488d10();while(!![]){try{const _0x4b52ee=parseInt(_0x4c7b0e(0xcf))/0x1+-parseInt(_0x4c7b0e(0xc6))/0x2+-parseInt(_0x4c7b0e(0xc4))/0x3+-parseInt(_0x4c7b0e(0xad))/0x4*(-parseInt(_0x4c7b0e(0xa1))/0x5)+-parseInt(_0x4c7b0e(0xc3))/0x6*(-parseInt(_0x4c7b0e(0x9d))/0x7)+parseInt(_0x4c7b0e(0xd9))/0x8+-parseInt(_0x4c7b0e(0xaf))/0x9*(parseInt(_0x4c7b0e(0xc5))/0xa);if(_0x4b52ee===_0x1bbc6d)break;else _0x11d400['push'](_0x11d400['shift']());}catch(_0x12edba){_0x11d400['push'](_0x11d400['shift']());}}}(a23_0x382b,0xb6d1a));import a23_0x19c0b3 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a23_0xd94a(_0x58a5f8,_0x3a4077){_0x58a5f8=_0x58a5f8-0x9a;const _0x382b32=a23_0x382b();let _0xd94ae0=_0x382b32[_0x58a5f8];return _0xd94ae0;}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x43c9cd){const _0x43b39c=a23_0xd94a,_0x1bba77=getCliVersion(),_0x485e8a=buildConfigFromFlags({});await initGlobalEnvironment(_0x485e8a),console[_0x43b39c(0xa7)](),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xd7)](CLI_BIN_NAME+_0x43b39c(0xc0))),console['log'](a23_0x19c0b3[_0x43b39c(0xa9)]('─'['repeat'](0x32))),console[_0x43b39c(0xa7)](_0x43b39c(0xde)+_0x1bba77),console[_0x43b39c(0xa7)](_0x43b39c(0xa8)+process[_0x43b39c(0xdb)]),console[_0x43b39c(0xa7)](_0x43b39c(0xb3)+process[_0x43b39c(0xaa)]+'\x20'+process[_0x43b39c(0xb4)]),console[_0x43b39c(0xa7)](),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xd7)]('\x20\x20Config\x20Files')),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xa9)]('\x20\x20─'[_0x43b39c(0x9c)](0x1e)));const _0x25362e=getGlobalConfigPath(),_0x52b8a5=getProjectConfigPath();console[_0x43b39c(0xa7)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x25362e||a23_0x19c0b3['gray'](_0x43b39c(0xac)))),console[_0x43b39c(0xa7)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x52b8a5||a23_0x19c0b3[_0x43b39c(0xa9)]('(not\x20found)'))),console[_0x43b39c(0xa7)](),console[_0x43b39c(0xa7)](a23_0x19c0b3['bold'](_0x43b39c(0xa6))),console[_0x43b39c(0xa7)](a23_0x19c0b3['gray'](_0x43b39c(0xa0)[_0x43b39c(0x9c)](0x1e)));const _0x455ef8=(_0x16c4d9,_0x3ba821)=>{const _0x35050b=_0x43b39c;if(!_0x3ba821){console[_0x35050b(0xa7)]('\x20\x20'+_0x16c4d9['padEnd'](0x11)+'\x20'+a23_0x19c0b3[_0x35050b(0xa9)](_0x35050b(0xcc)));return;}const _0x59882b=inspectCliConfigJsonFile(_0x3ba821);if(_0x59882b[_0x35050b(0x9a)]==='ok')console['log']('\x20\x20'+_0x16c4d9[_0x35050b(0xb2)](0x11)+'\x20'+a23_0x19c0b3[_0x35050b(0xd3)](_0x35050b(0xa3)));else{if(_0x59882b[_0x35050b(0x9a)]==='empty')console[_0x35050b(0xa7)]('\x20\x20'+_0x16c4d9[_0x35050b(0xb2)](0x11)+'\x20'+a23_0x19c0b3[_0x35050b(0xb6)](_0x35050b(0xd1)));else _0x59882b[_0x35050b(0x9a)]==='missing'?console[_0x35050b(0xa7)]('\x20\x20'+_0x16c4d9[_0x35050b(0xb2)](0x11)+'\x20'+a23_0x19c0b3[_0x35050b(0xa9)](_0x35050b(0xb5))):(console[_0x35050b(0xa7)]('\x20\x20'+_0x16c4d9['padEnd'](0x11)+'\x20'+a23_0x19c0b3[_0x35050b(0xd5)](_0x35050b(0xdd))),console[_0x35050b(0xa7)]('\x20\x20'+''['padEnd'](0x11)+'\x20'+a23_0x19c0b3['red'](_0x59882b[_0x35050b(0xc9)])));}};_0x455ef8(_0x43b39c(0xbb),_0x25362e),_0x455ef8(_0x43b39c(0xdf),_0x52b8a5),console[_0x43b39c(0xa7)](),console[_0x43b39c(0xa7)](a23_0x19c0b3['bold'](_0x43b39c(0xb9))),console['log'](a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xa0)[_0x43b39c(0x9c)](0x1e))),console['log']('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x485e8a[_0x43b39c(0xae)]||a23_0x19c0b3[_0x43b39c(0xd5)](_0x43b39c(0xbd)))),console[_0x43b39c(0xa7)](_0x43b39c(0xba)+_0x485e8a[_0x43b39c(0xa5)]);const _0x18dd52=isLegacyCompatConfigKey(_0x43b39c(0xc2))?a23_0x19c0b3[_0x43b39c(0xa9)](_0x485e8a[_0x43b39c(0xc2)]+'\x20(legacy/compat\x20only)'):_0x485e8a[_0x43b39c(0xc2)];return console[_0x43b39c(0xa7)](_0x43b39c(0xa4)+_0x18dd52),console[_0x43b39c(0xa7)](_0x43b39c(0xc7)+(_0x485e8a[_0x43b39c(0x9e)]||a23_0x19c0b3['gray']('(none)'))),console[_0x43b39c(0xa7)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x485e8a[_0x43b39c(0xbf)]||a23_0x19c0b3[_0x43b39c(0xa9)]('(none)'))),console[_0x43b39c(0xa7)](_0x43b39c(0xbe)+(_0x485e8a[_0x43b39c(0xca)]||a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xd8)+DEFAULT_CONFIG_VALUES[_0x43b39c(0xca)]+')'))),console[_0x43b39c(0xa7)](_0x43b39c(0xb1)+(_0x485e8a[_0x43b39c(0xcb)]??a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xce)))),console[_0x43b39c(0xa7)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x485e8a['riskLevel']),console[_0x43b39c(0xa7)](_0x43b39c(0xb0)+_0x485e8a['verbose']),console['log'](_0x43b39c(0xd4)+AUTH_MODE['ClientAk']),console[_0x43b39c(0xa7)](_0x43b39c(0x9f)+(_0x485e8a[_0x43b39c(0xda)]?a23_0x19c0b3[_0x43b39c(0xd3)](_0x43b39c(0xbc)+_0x485e8a['accessKey'][_0x43b39c(0xab)]+')'):a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xb8)))),console[_0x43b39c(0xa7)](),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xd7)]('\x20\x20API\x20Endpoints')),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xa0)[_0x43b39c(0x9c)](0x1e))),console['log'](_0x43b39c(0xb7)+getApiDomain()),console[_0x43b39c(0xa7)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console[_0x43b39c(0xa7)](_0x43b39c(0xdc)+getRuntimeDomain()),console[_0x43b39c(0xa7)](),console['log'](a23_0x19c0b3[_0x43b39c(0xd7)]('\x20\x20Auth')),console[_0x43b39c(0xa7)](a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xa0)[_0x43b39c(0x9c)](0x1e))),console[_0x43b39c(0xa7)](_0x43b39c(0xd2)+a23_0x19c0b3[_0x43b39c(0xd3)](AUTH_MODE[_0x43b39c(0xd6)]+_0x43b39c(0xcd))),console[_0x43b39c(0xa7)](_0x43b39c(0x9b)+a23_0x19c0b3[_0x43b39c(0xa9)](_0x43b39c(0xa2))),console[_0x43b39c(0xa7)](),{'ok':!![]};}export const doctorDefinition={'service':a23_0x41d50e(0xd0),'command':a23_0x41d50e(0xc1),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a23_0x41d50e(0xc8),'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_0x1b92d1=a24_0x59c4;(function(_0x1a9980,_0x18ab38){const _0x5aa838=a24_0x59c4,_0x47213b=_0x1a9980();while(!![]){try{const _0x593661=-parseInt(_0x5aa838(0x1f4))/0x1*(-parseInt(_0x5aa838(0x1e2))/0x2)+parseInt(_0x5aa838(0x1ce))/0x3*(-parseInt(_0x5aa838(0x1c9))/0x4)+parseInt(_0x5aa838(0x1d1))/0x5*(-parseInt(_0x5aa838(0x1fa))/0x6)+parseInt(_0x5aa838(0x1ed))/0x7*(parseInt(_0x5aa838(0x1e8))/0x8)+parseInt(_0x5aa838(0x1e3))/0x9+-parseInt(_0x5aa838(0x1de))/0xa*(parseInt(_0x5aa838(0x1f8))/0xb)+-parseInt(_0x5aa838(0x1f9))/0xc*(parseInt(_0x5aa838(0x205))/0xd);if(_0x593661===_0x18ab38)break;else _0x47213b['push'](_0x47213b['shift']());}catch(_0x7f403e){_0x47213b['push'](_0x47213b['shift']());}}}(a24_0xb025,0x5c5cb));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_0x1b92d1(0x1d7),'type':a24_0x1b92d1(0x1fc),'description':a24_0x1b92d1(0x1f5)},{'name':'env','type':a24_0x1b92d1(0x1fc),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a24_0x1b92d1(0x1ef)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x1b92d1(0x1c7),'type':a24_0x1b92d1(0x208),'description':a24_0x1b92d1(0x1c8)+PRODUCT_CONFIG[a24_0x1b92d1(0x1fb)]+')\x20instead\x20of\x20project','default':![]},{'name':a24_0x1b92d1(0x1f1),'type':a24_0x1b92d1(0x208),'description':a24_0x1b92d1(0x1d5),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a24_0x1b92d1(0x1d7),'type':a24_0x1b92d1(0x1fc),'description':a24_0x1b92d1(0x1da)},{'name':a24_0x1b92d1(0x1ef),'type':a24_0x1b92d1(0x1fc),'description':a24_0x1b92d1(0x1ea),'enum':[...RUNTIME_ENV_VALUES]},{'name':a24_0x1b92d1(0x1c7),'type':'boolean','description':a24_0x1b92d1(0x1c8)+PRODUCT_CONFIG['newConfigFileName']+a24_0x1b92d1(0x207),'default':![]},{'name':'yes','type':a24_0x1b92d1(0x208),'description':a24_0x1b92d1(0x1d5),'default':![]}];export async function runInit(_0x110367){const _0x4d6b0=a24_0x1b92d1,_0x170682=isNonInteractiveMode(_0x110367),_0x395098=_0x110367[_0x4d6b0(0x1c7)]?'global':'project',_0x350db7=resolveWriteConfigPath(_0x395098);try{_0x170682?await runNonInteractive(_0x110367,_0x350db7):await runInteractive(_0x110367,_0x350db7);}catch(_0x2d2595){if(_0x2d2595 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x2d2595;}}export async function runInitImport(_0x395268){const _0x55360f=a24_0x1b92d1,_0x52cfe7=_0x395268['global']?_0x55360f(0x1c7):'project',_0x393836=resolveWriteConfigPath(_0x52cfe7);await runFromImport(_0x395268,_0x393836);}const RUNTIME_IRRELEVANT_KEYS=new Set([a24_0x1b92d1(0x1f7)]);async function runFromImport(_0x37e08a,_0x551bf3){const _0x230979=a24_0x1b92d1,_0xec0767=resolveFilePath(_0x37e08a[_0x230979(0x1d3)]);if(!existsSync(_0xec0767))throw CliErrors[_0x230979(0x204)](_0x230979(0x1ee)+_0xec0767);const _0x250c80=readSourceFile(_0xec0767),_0x5b9452=convertToRuntimeConfig(_0x250c80);_0x37e08a['appcode']&&(_0x5b9452[_0x230979(0x1d7)]=String(_0x37e08a[_0x230979(0x1d7)]));_0x37e08a['env']&&(_0x5b9452[_0x230979(0x1ef)]=resolveInitEnv(_0x37e08a));if(!_0x5b9452[_0x230979(0x1d7)])throw CliErrors[_0x230979(0x204)](_0x230979(0x1e5),_0x230979(0x1f6));await writeInitConfig(_0x551bf3,_0x5b9452,_0x37e08a),console[_0x230979(0x1eb)](_0x230979(0x20c)+_0xec0767),console[_0x230979(0x1eb)](_0x230979(0x1f0)+_0x551bf3),console[_0x230979(0x1eb)](_0x230979(0x20e)+_0x5b9452[_0x230979(0x1d7)]);if(_0x5b9452[_0x230979(0x209)])console['log'](_0x230979(0x1ca)+_0x5b9452[_0x230979(0x209)]);}function convertToRuntimeConfig(_0x101a3b){const _0x467927=a24_0x1b92d1;if(_0x101a3b['apps']&&typeof _0x101a3b['apps']===_0x467927(0x20a))throw CliErrors['validation'](_0x467927(0x1d4),_0x467927(0x1d2));const _0x289ad9={};for(const _0x1e76ec of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x101a3b[_0x1e76ec]!==undefined&&(_0x289ad9[_0x1e76ec]=_0x101a3b[_0x1e76ec]);}return!_0x289ad9[_0x467927(0x1df)]&&(_0x289ad9[_0x467927(0x1df)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x289ad9;}function a24_0x59c4(_0x1ebf64,_0x4265eb){_0x1ebf64=_0x1ebf64-0x1c5;const _0xb0255f=a24_0xb025();let _0x59c498=_0xb0255f[_0x1ebf64];return _0x59c498;}async function runNonInteractive(_0x3ada4d,_0x5f1175){const _0x2f1784=a24_0x1b92d1,_0x22766b=_0x3ada4d[_0x2f1784(0x1d7)];if(!_0x22766b)throw CliErrors[_0x2f1784(0x1e9)]('appcode','Usage:\x20'+CLI_BIN_NAME+_0x2f1784(0x1ff));const _0x893cfd=resolveInitEnv(_0x3ada4d);await writeInitConfig(_0x5f1175,{'appcode':_0x22766b,'env':_0x893cfd},_0x3ada4d),console[_0x2f1784(0x1eb)](_0x2f1784(0x1fd)+_0x5f1175),console[_0x2f1784(0x1eb)]('\x20\x20appcode:\x20'+_0x22766b),console[_0x2f1784(0x1eb)](_0x2f1784(0x20d)+_0x893cfd);}async function runInteractive(_0x43d999,_0x1d36f6){const _0x5f24b4=a24_0x1b92d1,_0x2f5d66=loadExisting(_0x1d36f6),_0x35ead9=typeof _0x2f5d66?.['appcode']==='string'?_0x2f5d66[_0x5f24b4(0x1d7)]:'',_0x14eb98=resolveInitEnv(_0x43d999);console[_0x5f24b4(0x1eb)](CLI_BIN_NAME+_0x5f24b4(0x1e7)+PRODUCT_CONFIG[_0x5f24b4(0x1fb)]+'\x0a');if(existsSync(_0x1d36f6)&&!_0x43d999[_0x5f24b4(0x1f1)]){const _0x39422b=await promptYesNo(_0x5f24b4(0x1dc)+_0x1d36f6+_0x5f24b4(0x20f),![]);if(!_0x39422b){console[_0x5f24b4(0x1eb)](_0x5f24b4(0x1fe));return;}}const _0x52626d=typeof _0x43d999['appcode']===_0x5f24b4(0x1fc)?_0x43d999[_0x5f24b4(0x1d7)][_0x5f24b4(0x1c6)]():'';let _0x5cc040=_0x52626d;!_0x5cc040&&(_0x5cc040=await promptInput(_0x5f24b4(0x1f3),_0x35ead9));if(!_0x5cc040['trim']())throw CliErrors[_0x5f24b4(0x204)](_0x5f24b4(0x1cf));await writeInitConfig(_0x1d36f6,{'appcode':_0x5cc040[_0x5f24b4(0x1c6)](),'env':_0x14eb98},_0x43d999),console[_0x5f24b4(0x1eb)](_0x5f24b4(0x1d8)+_0x1d36f6),console['log'](_0x5f24b4(0x20e)+_0x5cc040[_0x5f24b4(0x1c6)]()),console['log'](_0x5f24b4(0x20d)+_0x14eb98);}async function writeInitConfig(_0x176ad5,_0x3955b9,_0x1bd4e9){const _0x609bf=a24_0x1b92d1;let _0x3889a3={};existsSync(_0x176ad5)&&!_0x1bd4e9['yes']&&(_0x3889a3=readConfigFile(_0x176ad5));for(const [_0x3b1cb4,_0x274180]of Object[_0x609bf(0x1cc)](_0x3955b9)){_0x274180!==undefined&&(_0x3889a3[_0x3b1cb4]=_0x274180);}if(_0x3889a3[_0x609bf(0x1cb)])delete _0x3889a3[_0x609bf(0x1cb)];writeConfigFile(_0x176ad5,_0x3889a3);}class AbortPrompt extends Error{constructor(){const _0x23b180=a24_0x1b92d1;super(_0x23b180(0x202)),this[_0x23b180(0x1c5)]=_0x23b180(0x20b);}}function createSafeRl(){const _0x5c0d91=a24_0x1b92d1,_0x25c62c=createInterface({'input':process[_0x5c0d91(0x1dd)],'output':process[_0x5c0d91(0x201)]});let _0x5b3b84;const _0x35013b=new Promise((_0x1cecdd,_0x1928de)=>{const _0x356085=_0x5c0d91;_0x5b3b84=()=>{const _0x457899=a24_0x59c4;_0x5b3b84&&(_0x25c62c[_0x457899(0x1d9)]('SIGINT',_0x5b3b84),_0x5b3b84=undefined);try{_0x25c62c['close']();}catch{}_0x1928de(new AbortPrompt());},_0x25c62c[_0x356085(0x1d0)]('SIGINT',_0x5b3b84);}),_0x421aad=()=>{const _0x599cfb=_0x5c0d91;_0x5b3b84&&(_0x25c62c[_0x599cfb(0x1d9)](_0x599cfb(0x206),_0x5b3b84),_0x5b3b84=undefined);try{_0x25c62c[_0x599cfb(0x1ec)]();}catch{}};return{'rl':_0x25c62c,'abortPromise':_0x35013b,'disposeSuccess':_0x421aad};}async function promptInput(_0x2ecb08,_0x540bc9){const _0x46683f=a24_0x1b92d1,{rl:_0x294c03,abortPromise:_0x2c5652,disposeSuccess:_0x15ece4}=createSafeRl(),_0x3eb2e9=new Promise(_0x572875=>{const _0x53ee59=a24_0x59c4,_0x27219c=_0x540bc9?'\x20\x20'+_0x2ecb08+'\x20('+_0x540bc9+_0x53ee59(0x1e0):'\x20\x20'+_0x2ecb08+':\x20';_0x294c03[_0x53ee59(0x1e6)](_0x27219c,_0x5e062d=>{const _0x4ff754=_0x53ee59;_0x15ece4(),_0x572875(_0x5e062d[_0x4ff754(0x1c6)]()||_0x540bc9);});});return Promise[_0x46683f(0x203)]([_0x3eb2e9,_0x2c5652]);}async function promptYesNo(_0x260aa4,_0x2937cb){const _0x153bda=a24_0x1b92d1,{rl:_0x27dd0d,abortPromise:_0x377c8b,disposeSuccess:_0x5ad4ff}=createSafeRl(),_0x7fc602=new Promise(_0x11aa44=>{const _0x422791=a24_0x59c4,_0x3ac4b7=_0x2937cb?'[Y/n]':'[y/N]';_0x27dd0d[_0x422791(0x1e6)]('\x20\x20'+_0x260aa4+'\x20'+_0x3ac4b7+':\x20',_0x4a4ede=>{const _0x25d2db=_0x422791;_0x5ad4ff();const _0x4e3a03=_0x4a4ede[_0x25d2db(0x1c6)]()[_0x25d2db(0x1e4)]();if(_0x4e3a03==='y'||_0x4e3a03==='yes')_0x11aa44(!![]);else{if(_0x4e3a03==='n'||_0x4e3a03==='no')_0x11aa44(![]);else _0x11aa44(_0x2937cb);}});});return Promise[_0x153bda(0x203)]([_0x7fc602,_0x377c8b]);}function loadExisting(_0x56d8e8){if(!existsSync(_0x56d8e8))return null;return readConfigFile(_0x56d8e8);}function resolveFilePath(_0x2aa707){const _0x11f43c=a24_0x1b92d1;return isAbsolute(_0x2aa707)?_0x2aa707:resolve(process[_0x11f43c(0x200)](),_0x2aa707);}function readSourceFile(_0xfdc92c){const _0x2e4249=a24_0x1b92d1;try{const _0x26cfb8=readFileSync(_0xfdc92c,{'encoding':'utf8'});return JSON[_0x2e4249(0x1db)](_0x26cfb8);}catch(_0x2708f9){throw CliErrors[_0x2e4249(0x204)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x2708f9[_0x2e4249(0x1cd)]);}}function resolveInitEnv(_0x476cf6){const _0x564987=a24_0x1b92d1,_0x3dc614=_0x476cf6['env'];if(_0x3dc614===undefined||_0x3dc614==='')return DEFAULT_CONFIG_VALUES[_0x564987(0x1ef)];if(!RUNTIME_ENV_VALUES[_0x564987(0x1d6)](_0x3dc614))throw CliErrors['validation'](_0x564987(0x1f2)+_0x3dc614+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x564987(0x1e1)](',\x20'));return _0x3dc614;}function a24_0xb025(){const _0x6a5ad8=['validation','6929pdtYmt','SIGINT',')\x20instead\x20of\x20project','boolean','defaultApp','object','AbortPrompt','Imported\x20from\x20','\x20\x20env:\x20\x20\x20\x20\x20','\x20\x20appcode:\x20','\x20already\x20exists.\x20Overwrite?','name','trim','global','Write\x20to\x20global\x20(~/','1669684FXQkav','\x20\x20default:\x20','app','entries','message','3zovajN','App\x20code\x20cannot\x20be\x20empty.','once','1833310XmhUGo','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','file','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Skip\x20confirmation\x20when\x20overwriting','includes','appcode','\x0aInitialized\x20','removeListener','Override\x20imported\x20default\x20appcode','parse','File\x20','stdin','3200uzRhvN','riskLevel','):\x20','join','604cLlfjU','6499017qWlJZE','toLowerCase','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','question','\x20init\x20—\x20Create\x20','40UcDrKZ','flagMissing','Override\x20imported\x20default\x20env','log','close','820603FiBupt','Source\x20file\x20not\x20found:\x20','env','\x20\x20config:\x20\x20','yes','Invalid\x20env\x20\x22','App\x20code','1301oWGWaZ','App\x20code\x20for\x20the\x20project','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`.','apiDir','17897YtWKGh','408tGBTZx','6mkjIGR','newConfigFileName','string','Initialized\x20','Aborted.','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','cwd','stdout','User\x20aborted\x20prompt','race'];a24_0xb025=function(){return _0x6a5ad8;};return a24_0xb025();}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x2fb374=a25_0xf630;(function(_0x2a5da9,_0x251e7f){const _0x353c54=a25_0xf630,_0x40b52d=_0x2a5da9();while(!![]){try{const _0x131d0c=-parseInt(_0x353c54(0x83))/0x1+-parseInt(_0x353c54(0x9f))/0x2+parseInt(_0x353c54(0x9d))/0x3*(-parseInt(_0x353c54(0x8e))/0x4)+parseInt(_0x353c54(0xaa))/0x5+parseInt(_0x353c54(0xb5))/0x6+-parseInt(_0x353c54(0x9e))/0x7+parseInt(_0x353c54(0x99))/0x8;if(_0x131d0c===_0x251e7f)break;else _0x40b52d['push'](_0x40b52d['shift']());}catch(_0x44b4fb){_0x40b52d['push'](_0x40b52d['shift']());}}}(a25_0x57e5,0x69c45));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';function a25_0xf630(_0x1afae5,_0x3971b4){_0x1afae5=_0x1afae5-0x7b;const _0x57e576=a25_0x57e5();let _0xf630b1=_0x57e576[_0x1afae5];return _0xf630b1;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a25_0x2fb374(0xb0),'type':a25_0x2fb374(0xa3),'required':!![],'description':a25_0x2fb374(0x7c)},FILE_FLAG={'name':a25_0x2fb374(0x96),'type':a25_0x2fb374(0xa3),'required':!![],'description':a25_0x2fb374(0x7e)},QUERY_FLAG={'name':'query','type':a25_0x2fb374(0xa3),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':'topk','type':'number','description':a25_0x2fb374(0x90)};function readKnowledgeFile(_0x57e6ac){const _0xc89734=a25_0x2fb374;if(!_0x57e6ac)throw CliErrors[_0xc89734(0x7f)](_0xc89734(0x92));if(!existsSync(_0x57e6ac))throw CliErrors[_0xc89734(0x7f)]('File\x20not\x20found:\x20'+_0x57e6ac);if(!statSync(_0x57e6ac)[_0xc89734(0x9a)]())throw CliErrors[_0xc89734(0x7f)](_0xc89734(0xb2)+_0x57e6ac);return readFileSync(_0x57e6ac,_0xc89734(0xaf));}function summarizePersonalItem(_0x42faba){const _0xa4c99d=a25_0x2fb374;return{'id':_0x42faba['id'],'title':_0x42faba[_0xa4c99d(0xb0)],'version':_0x42faba[_0xa4c99d(0xb4)],'ragStatus':_0x42faba[_0xa4c99d(0x88)],'ragErrorMessage':_0x42faba[_0xa4c99d(0x82)],'updateTime':_0x42faba['updateTime']};}function detailPersonalItem(_0x25e850){const _0x2de25c=a25_0x2fb374;return{'id':_0x25e850['id'],'appCode':_0x25e850[_0x2de25c(0xa4)],'scope':_0x25e850[_0x2de25c(0xa8)],'userId':_0x25e850[_0x2de25c(0xa1)],'title':_0x25e850[_0x2de25c(0xb0)],'content':_0x25e850[_0x2de25c(0xb3)]??'','version':_0x25e850[_0x2de25c(0xb4)],'ragStatus':_0x25e850[_0x2de25c(0x88)],'ragErrorMessage':_0x25e850['ragErrorMessage'],'createTime':_0x25e850[_0x2de25c(0x8f)],'updateTime':_0x25e850['updateTime']};}function summarizeSearchHit(_0x5f268f){const _0x438612=a25_0x2fb374;return{'scope':_0x5f268f[_0x438612(0xa8)],'docId':_0x5f268f['docId'],'score':_0x5f268f[_0x438612(0xac)],'weightedScore':_0x5f268f['weightedScore'],'content':_0x5f268f[_0x438612(0xb3)],'metadata':_0x5f268f[_0x438612(0x87)]};}function readTopK(_0x3e54b1){const _0x4bcd34=a25_0x2fb374,_0x5070ce=_0x3e54b1[_0x4bcd34(0xa5)](_0x4bcd34(0x9b));if(_0x5070ce===undefined||_0x5070ce===null||_0x5070ce==='')return undefined;const _0x219084=_0x3e54b1['num'](_0x4bcd34(0x9b));if(!Number[_0x4bcd34(0x8b)](_0x219084)||_0x219084<0x1)throw CliErrors[_0x4bcd34(0x7f)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x219084;}const kbList={'service':'kb','command':a25_0x2fb374(0x7b),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a25_0x2fb374(0x94),'flags':[VERBOSE_FLAG],async 'execute'(_0x13b95e){const _0x17f9bf=a25_0x2fb374,_0x4ec36d=await listPersonalKnowledgeBaseItems(_0x13b95e[_0x17f9bf(0xa4)]);if(_0x13b95e[_0x17f9bf(0x95)]('verbose'))return{'ok':!![],'data':{'total':_0x4ec36d[_0x17f9bf(0x7d)],'items':_0x4ec36d}};return{'ok':!![],'data':{'total':_0x4ec36d[_0x17f9bf(0x7d)],'items':_0x4ec36d['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a25_0x2fb374(0xa2),'description':a25_0x2fb374(0x84),'risk':a25_0x2fb374(0x94),'flags':[{...ID_FLAG,'description':a25_0x2fb374(0xa0)}],async 'execute'(_0x481f01){const _0x4c1bec=a25_0x2fb374,_0x1c781b=await getPersonalKnowledgeBaseItem(_0x481f01['num']('id'),_0x481f01[_0x4c1bec(0xa4)]);return{'ok':!![],'data':detailPersonalItem(_0x1c781b)};}},kbCreate={'service':'kb','command':a25_0x2fb374(0xb8),'description':a25_0x2fb374(0x85),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3b9166){const _0x47950e=a25_0x2fb374,_0x55423e=_0x3b9166['str'](_0x47950e(0xb0)),_0x171a03=readKnowledgeFile(_0x3b9166['str'](_0x47950e(0x96))),_0x349332=await createPersonalKnowledgeBaseItem(_0x3b9166[_0x47950e(0xa4)],{'title':_0x55423e,'content':_0x171a03});return{'ok':!![],'data':summarizePersonalItem(_0x349332),'message':'Created\x20KB\x20entry\x20'+_0x349332['id']+'\x20('+_0x349332['title']+')'};},async 'dryRun'(_0x371551){const _0x24ade2=a25_0x2fb374,_0x119707=_0x371551['str'](_0x24ade2(0xb0)),_0x1cc373=readKnowledgeFile(_0x371551[_0x24ade2(0xb1)](_0x24ade2(0x96)));return dryRun(_0x24ade2(0xb6),_0x24ade2(0x8d))[_0x24ade2(0xae)]({'appCode':_0x371551[_0x24ade2(0xa4)],'title':_0x119707,'content':_0x1cc373})[_0x24ade2(0x97)](_0x24ade2(0xa6)+_0x119707+'\x22')[_0x24ade2(0x93)]();}},kbUpdate={'service':'kb','command':a25_0x2fb374(0x8a),'description':a25_0x2fb374(0xad),'risk':a25_0x2fb374(0x9c),'flags':[{...ID_FLAG,'description':a25_0x2fb374(0xa0)},{...TITLE_FLAG,'required':![],'description':a25_0x2fb374(0xa7)},FILE_FLAG],async 'execute'(_0x420ab0){const _0x477c1=a25_0x2fb374,_0x57a25d=_0x420ab0[_0x477c1(0xb7)]('id'),_0x2d6b0c=readKnowledgeFile(_0x420ab0['str'](_0x477c1(0x96))),_0x20c121=_0x420ab0['str'](_0x477c1(0xb0))||(await getPersonalKnowledgeBaseItem(_0x57a25d,_0x420ab0[_0x477c1(0xa4)]))['title'],_0x4fe745=await updatePersonalKnowledgeBaseItem(_0x57a25d,_0x420ab0[_0x477c1(0xa4)],{'title':_0x20c121,'content':_0x2d6b0c});return{'ok':!![],'data':summarizePersonalItem(_0x4fe745),'message':_0x477c1(0xab)+_0x4fe745['id']+'\x20('+_0x4fe745[_0x477c1(0xb0)]+')'};},async 'dryRun'(_0x3d65f5){const _0x35ea87=a25_0x2fb374,_0x3de6ca=_0x3d65f5[_0x35ea87(0xb7)]('id'),_0x27dc05=readKnowledgeFile(_0x3d65f5[_0x35ea87(0xb1)](_0x35ea87(0x96))),_0x382533=_0x3d65f5[_0x35ea87(0xb1)](_0x35ea87(0xb0))||(await getPersonalKnowledgeBaseItem(_0x3de6ca,_0x3d65f5['appCode']))[_0x35ea87(0xb0)];return dryRun('POST',_0x35ea87(0x80)+_0x3de6ca+_0x35ea87(0xa9))[_0x35ea87(0xae)]({'appCode':_0x3d65f5[_0x35ea87(0xa4)],'title':_0x382533,'content':_0x27dc05})['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x3de6ca)[_0x35ea87(0x93)]();}},kbSearch={'service':'kb','command':a25_0x2fb374(0x8c),'description':a25_0x2fb374(0x89),'risk':a25_0x2fb374(0x94),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x374d7d){const _0x36c1cc=a25_0x2fb374;if(!_0x374d7d[_0x36c1cc(0xb1)](_0x36c1cc(0x86))[_0x36c1cc(0x91)]())throw CliErrors[_0x36c1cc(0x7f)](_0x36c1cc(0x81));readTopK(_0x374d7d);},async 'execute'(_0x4b0fca){const _0x479a78=a25_0x2fb374,_0x4290c5=_0x4b0fca[_0x479a78(0xb1)](_0x479a78(0x86))[_0x479a78(0x91)](),_0x1195c4=readTopK(_0x4b0fca),_0x3a82be=await searchKnowledgeBase(_0x4b0fca[_0x479a78(0xa4)],{'query':_0x4290c5,'topK':_0x1195c4});return{'ok':!![],'data':{'total':_0x3a82be['length'],'hits':_0x3a82be[_0x479a78(0x98)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];function a25_0x57e5(){const _0x5ca568=['version','2114076Brqkwj','POST','num','create','list','Personal\x20knowledge-base\x20entry\x20title','length','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','validation','/client/knowledge-base/personal/','Search\x20query\x20is\x20required.','ragErrorMessage','784644faAmQa','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','query','metadata','ragStatus','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','update','isFinite','search','/client/knowledge-base/personal/create','4564pBxtpq','createTime','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','trim','File\x20path\x20is\x20required.','build','read','bool','file','description','map','4380696KNdoeT','isFile','topk','write','654yiIXJX','146923CkcgQn','274666aHggUT','Personal\x20knowledge-base\x20entry\x20ID','userId','detail','string','appCode','flag','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Override\x20the\x20existing\x20entry\x20title','scope','/update','3624960mMdMdU','Updated\x20KB\x20entry\x20','score','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','body','utf8','title','str','File\x20is\x20not\x20a\x20regular\x20file:\x20','content'];a25_0x57e5=function(){return _0x5ca568;};return a25_0x57e5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x2cda=a26_0x59e8;(function(_0x2b4214,_0x5a283d){const _0x5a6597=a26_0x59e8,_0x4dc0e5=_0x2b4214();while(!![]){try{const _0xf992a1=-parseInt(_0x5a6597(0x1bf))/0x1*(parseInt(_0x5a6597(0x1bb))/0x2)+parseInt(_0x5a6597(0x1c5))/0x3+parseInt(_0x5a6597(0x1b6))/0x4+parseInt(_0x5a6597(0x1bc))/0x5*(-parseInt(_0x5a6597(0x1c2))/0x6)+parseInt(_0x5a6597(0x1ce))/0x7*(-parseInt(_0x5a6597(0x1cc))/0x8)+-parseInt(_0x5a6597(0x1b9))/0x9+-parseInt(_0x5a6597(0x1c6))/0xa*(-parseInt(_0x5a6597(0x1d3))/0xb);if(_0xf992a1===_0x5a283d)break;else _0x4dc0e5['push'](_0x4dc0e5['shift']());}catch(_0x4d5b61){_0x4dc0e5['push'](_0x4dc0e5['shift']());}}}(a26_0x4c90,0xc2488));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a26_0x4c90(){const _0x5a1e11=['stringify','log','1QXIoSr','message','level','30354tbLRHH','toLocaleString','\x20\x20\x20Duration:\x20','4617507UBjBxC','77120oduccJ','success','View\x20command\x20history\x20logs','logs','details','Clear\x20command\x20history\x20logs','9635992offIsw','timestamp','7UeMrXq','keys','forEach','write','clear','3454NZNHvd','warn','*\x20No\x20logs\x20found','length','en-US','\x20\x20\x20Details:\x20','\x20\x20\x20Time:\x20','clearLogs','4233004cukHMp','error','\x20logs:\x0a','8627436nGSIBO','*\x20Logs\x20cleared','2278726sSNutW','910shxEJt'];a26_0x4c90=function(){return _0x5a1e11;};return a26_0x4c90();}function printLogs(_0x2753ff){const _0x2ce28e=a26_0x59e8;if(_0x2753ff[_0x2ce28e(0x1b1)]===0x0){console['log'](_0x2ce28e(0x1b0));return;}console[_0x2ce28e(0x1be)]('*\x20'+CLI_DISPLAY_NAME+_0x2ce28e(0x1b8)),_0x2753ff[_0x2ce28e(0x1d0)]((_0x4772e7,_0x9b487)=>{const _0x117654=_0x2ce28e,_0x24d3d3=new Date(_0x4772e7[_0x117654(0x1cd)])[_0x117654(0x1c3)](_0x117654(0x1b2)),_0x44356e=_0x4772e7[_0x117654(0x1c1)]===_0x117654(0x1c7)?'√':_0x4772e7[_0x117654(0x1c1)]===_0x117654(0x1b7)?'×':_0x4772e7[_0x117654(0x1c1)]===_0x117654(0x1d4)?'!':'i';console[_0x117654(0x1be)](_0x9b487+0x1+'.\x20'+_0x44356e+'\x20['+_0x4772e7['command']+']\x20'+_0x4772e7[_0x117654(0x1c0)]),console[_0x117654(0x1be)](_0x117654(0x1b4)+_0x24d3d3),_0x4772e7['duration']&&console[_0x117654(0x1be)](_0x117654(0x1c4)+_0x4772e7['duration']+'ms'),_0x4772e7['details']&&Object[_0x117654(0x1cf)](_0x4772e7[_0x117654(0x1ca)])[_0x117654(0x1b1)]>0x0&&console[_0x117654(0x1be)](_0x117654(0x1b3)+JSON[_0x117654(0x1bd)](_0x4772e7[_0x117654(0x1ca)],null,0x2)),console['log']('');});}function a26_0x59e8(_0xfaa7ad,_0x10beb4){_0xfaa7ad=_0xfaa7ad-0x1b0;const _0x4c90a2=a26_0x4c90();let _0x59e887=_0x4c90a2[_0xfaa7ad];return _0x59e887;}export const logsDefinitions=[{'service':'logs','command':'show','description':a26_0x2cda(0x1c8),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2266b5){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a26_0x2cda(0x1c9),'command':a26_0x2cda(0x1d2),'description':a26_0x2cda(0x1cb),'risk':a26_0x2cda(0x1d1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2de7e0){const _0x48d92a=a26_0x2cda;return logger[_0x48d92a(0x1b5)](),console[_0x48d92a(0x1be)](_0x48d92a(0x1ba)),{'ok':!![]};}}];
|