@lovrabet/lovrabet-cli 2.0.1-beta.9 → 2.0.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/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/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/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/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/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/risk.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/help.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/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a16_0x56d80a=a16_0x50f1;(function(_0x56c9b6,_0x440071){const _0x5d652b=a16_0x50f1,_0x29ceac=_0x56c9b6();while(!![]){try{const _0x52e92f=parseInt(_0x5d652b(0x1f4))/0x1+-parseInt(_0x5d652b(0x1f8))/0x2+parseInt(_0x5d652b(0x1fc))/0x3+-parseInt(_0x5d652b(0x1c9))/0x4+-parseInt(_0x5d652b(0x1fe))/0x5*(parseInt(_0x5d652b(0x1bf))/0x6)+parseInt(_0x5d652b(0x1c8))/0x7+parseInt(_0x5d652b(0x1eb))/0x8;if(_0x52e92f===_0x440071)break;else _0x29ceac['push'](_0x29ceac['shift']());}catch(_0x5471b8){_0x29ceac['push'](_0x29ceac['shift']());}}}(a16_0x341d,0x21a7c));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a16_0x50f1(_0x484b2b,_0x3b0f1e){_0x484b2b=_0x484b2b-0x1bd;const _0x341db3=a16_0x341d();let _0x50f101=_0x341db3[_0x484b2b];return _0x50f101;}import{requireAnyOf}from'../../commands/common/constraints.js';function a16_0x341d(){const _0x1b7d76=['\x20\x20AGGREGATE\x20TYPES','5HmAsiY','\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}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','data\x20','\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','paramsRequired','\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}','POST','getOne','operation','92334PwCfBq','write','Get\x20a\x20single\x20record\x20by\x20ID','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','command','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\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}','description','risk','1762516MqfhQY','1055740KrUVJE','\x20\x20PAGINATION','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','Filter\x20dataset\x20records\x20with\x20query\x20conditions','build','now','delete','\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}}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\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\x20PARAMS\x20STRUCTURE','filter','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','update','str','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20WHERE\x20OPERATORS','\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\x20EXAMPLES','dryRun','\x20completed\x20in\x20','\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\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\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$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}}]}','read','\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]','create','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','48704UZPtFP','params','aggregate','\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}}','batchCreate','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','\x20on\x20dataset\x20','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','122951Lorful','\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}','Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\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}}','42900aSsOKx','code','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','173397amxeqG'];a16_0x341d=function(){return _0x1b7d76;};return a16_0x341d();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a16_0x56d80a(0x1d4),'operation':a16_0x56d80a(0x1d4),'risk':a16_0x56d80a(0x1e5),'paramsRequired':![],'description':a16_0x56d80a(0x1cc),'paramsHint':a16_0x56d80a(0x1f2)+a16_0x56d80a(0x1d1),'helpExtra':[a16_0x56d80a(0x1db),a16_0x56d80a(0x1d6),'\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}}',a16_0x56d80a(0x1f7),a16_0x56d80a(0x1ee),a16_0x56d80a(0x1ff),'\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\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]}}',a16_0x56d80a(0x1d0),a16_0x56d80a(0x201),a16_0x56d80a(0x1d5),'',a16_0x56d80a(0x205),'\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}}]}',a16_0x56d80a(0x1e4),'',a16_0x56d80a(0x1c4),a16_0x56d80a(0x1ea),a16_0x56d80a(0x1e6),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x56d80a(0x1e8),'',a16_0x56d80a(0x1ca),a16_0x56d80a(0x1d7),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a16_0x56d80a(0x202)]['join']('\x0a')},{'command':'getOne','operation':a16_0x56d80a(0x1bd),'risk':a16_0x56d80a(0x1e5),'paramsRequired':!![],'description':a16_0x56d80a(0x1c1),'paramsHint':a16_0x56d80a(0x1f3)},{'command':a16_0x56d80a(0x1e7),'operation':a16_0x56d80a(0x1e7),'risk':a16_0x56d80a(0x1c0),'paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x56d80a(0x1fa)},{'command':a16_0x56d80a(0x1ef),'operation':a16_0x56d80a(0x1ef),'risk':a16_0x56d80a(0x1c0),'paramsRequired':!![],'description':a16_0x56d80a(0x1e9),'paramsHint':a16_0x56d80a(0x1c2)},{'command':a16_0x56d80a(0x1d8),'operation':a16_0x56d80a(0x1d8),'risk':a16_0x56d80a(0x1c0),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a16_0x56d80a(0x1cf),'operation':a16_0x56d80a(0x1cf),'risk':'high-risk-write','paramsRequired':!![],'description':a16_0x56d80a(0x1fb),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a16_0x56d80a(0x1ed),'operation':'aggregate','risk':a16_0x56d80a(0x1e5),'paramsRequired':![],'description':a16_0x56d80a(0x1f0),'paramsHint':a16_0x56d80a(0x200)+a16_0x56d80a(0x1f6),'helpExtra':[a16_0x56d80a(0x1fd),'\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}',a16_0x56d80a(0x207),a16_0x56d80a(0x204),'\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}',a16_0x56d80a(0x1c5),a16_0x56d80a(0x1d2),a16_0x56d80a(0x1f5),'',a16_0x56d80a(0x1d3),a16_0x56d80a(0x1e0),a16_0x56d80a(0x1e2),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)',a16_0x56d80a(0x1e3),a16_0x56d80a(0x1dc),a16_0x56d80a(0x1e1),'',a16_0x56d80a(0x1dd),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\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','',a16_0x56d80a(0x1cb),a16_0x56d80a(0x1da)]['join']('\x0a')}];function makeDataCommand(_0x14ecbc){const _0x132fa7=a16_0x56d80a,_0xdc2a5a=_0x132fa7(0x203)+_0x14ecbc[_0x132fa7(0x1c3)],_0x22a2b1={'service':'data','command':_0x14ecbc[_0x132fa7(0x1c3)],'description':_0x14ecbc[_0x132fa7(0x1c6)],'risk':_0x14ecbc[_0x132fa7(0x1c7)],'helpExtra':_0x14ecbc['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x14ecbc['paramsHint']}],'validate':async _0x189740=>{const _0x4d52ee=_0x132fa7;_0x14ecbc[_0x4d52ee(0x206)]&&requireAnyOf(_0x189740,[_0x4d52ee(0x1ec)],_0xdc2a5a),_0x14ecbc[_0x4d52ee(0x1be)]===_0x4d52ee(0x1ef)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x189740['str'](_0x4d52ee(0x1ec))));},async 'execute'(_0x533920){const _0x5cbe81=_0x132fa7,_0x2a9534=_0x533920[_0x5cbe81(0x1d9)](_0x5cbe81(0x1f9)),_0x28d00d=_0x14ecbc[_0x5cbe81(0x1be)]===_0x5cbe81(0x1ef)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x533920['str'](_0x5cbe81(0x1ec)))):parseJsonParams(_0x533920[_0x5cbe81(0x1d9)]('params'))??{},_0x59df0b=Date[_0x5cbe81(0x1ce)](),_0x5c8f9b=await executeData(_0x2a9534,_0x14ecbc[_0x5cbe81(0x1be)],_0x28d00d),_0x1bb5e0=Date[_0x5cbe81(0x1ce)]()-_0x59df0b;return{'ok':!![],'data':{'result':_0x5c8f9b,'elapsed':_0x1bb5e0},'message':_0x5cbe81(0x203)+_0x14ecbc['command']+_0x5cbe81(0x1df)+_0x1bb5e0+'ms'};}};return _0x14ecbc['risk']!=='read'&&(_0x22a2b1[_0x132fa7(0x1de)]=async _0x2769b4=>{const _0x106d5a=_0x132fa7,_0x1e2ab0=_0x2769b4['str'](_0x106d5a(0x1f9)),_0x529da2=_0x14ecbc[_0x106d5a(0x1be)]===_0x106d5a(0x1ef)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2769b4['str'](_0x106d5a(0x1ec)))):parseJsonParams(_0x2769b4['str']('params'))??{};return dryRun(_0x106d5a(0x208),'/api/{appCode}/'+_0x1e2ab0+'/'+_0x14ecbc['operation'])['body'](_0x529da2)[_0x106d5a(0x1c6)]('Preview:\x20data\x20'+_0x14ecbc['command']+_0x106d5a(0x1f1)+_0x1e2ab0)[_0x106d5a(0x1cd)]();}),_0x22a2b1;}export const dataDefinitions=specs['map'](makeDataCommand);
|
|
1
|
+
function a16_0x6c0a(_0x204982,_0x401459){_0x204982=_0x204982-0x1ab;const _0x3c04f1=a16_0x3c04();let _0x6c0a41=_0x3c04f1[_0x204982];return _0x6c0a41;}const a16_0x968d7b=a16_0x6c0a;(function(_0x495806,_0x36c309){const _0x300e21=a16_0x6c0a,_0x25a7fa=_0x495806();while(!![]){try{const _0x8fa301=parseInt(_0x300e21(0x1dd))/0x1*(parseInt(_0x300e21(0x1b0))/0x2)+parseInt(_0x300e21(0x1b8))/0x3*(-parseInt(_0x300e21(0x1cc))/0x4)+-parseInt(_0x300e21(0x1e5))/0x5+-parseInt(_0x300e21(0x1f2))/0x6+-parseInt(_0x300e21(0x1da))/0x7*(-parseInt(_0x300e21(0x1f9))/0x8)+-parseInt(_0x300e21(0x1b3))/0x9+parseInt(_0x300e21(0x1cf))/0xa;if(_0x8fa301===_0x36c309)break;else _0x25a7fa['push'](_0x25a7fa['shift']());}catch(_0xa1f6df){_0x25a7fa['push'](_0x25a7fa['shift']());}}}(a16_0x3c04,0x7a684));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a16_0x3c04(){const _0x5ad0bb=['713178BepCkQ','\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}}','paramsRequired','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','getOne','61554wFsPgi','update','\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}','risk','\x20\x20WHERE\x20OPERATORS','now','\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\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','str','map','data','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','operation','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','aggregate','64oukPNQ','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\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}}','11001030LSkkor','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\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}','join','description','command','\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}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','/api/{appCode}/','308Avwyxv','\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#\x20Count\x20orders\x20per\x20region\x20with\x20filter','211CuWyrD','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','build','data\x20','read','batchCreate','write','\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}}','421615tPaUcI','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20completed\x20in\x20','\x20\x20\x20\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}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','delete','POST','code','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','4015158AAmzBy','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','dryRun','params','filter','\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\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}}','65680qJzDxO','\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\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20on\x20dataset\x20','helpExtra','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\x20\x20\x20\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}}','body','\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\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','1906kFblVD','create','\x20\x20PARAMS\x20STRUCTURE'];a16_0x3c04=function(){return _0x5ad0bb;};return a16_0x3c04();}const specs=[{'command':a16_0x968d7b(0x1f6),'operation':a16_0x968d7b(0x1f6),'risk':a16_0x968d7b(0x1e1),'paramsRequired':![],'description':a16_0x968d7b(0x1d7),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a16_0x968d7b(0x1e9),'helpExtra':[a16_0x968d7b(0x1bc),a16_0x968d7b(0x1b4),a16_0x968d7b(0x1f8),'\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}}',a16_0x968d7b(0x1e4),a16_0x968d7b(0x1ab),a16_0x968d7b(0x1ce),a16_0x968d7b(0x1be),'\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}}',a16_0x968d7b(0x1d5),a16_0x968d7b(0x1ac),'',a16_0x968d7b(0x1bf),'\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}}]}',a16_0x968d7b(0x1c8),'','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a16_0x968d7b(0x1d0),a16_0x968d7b(0x1c9),a16_0x968d7b(0x1db),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a16_0x968d7b(0x1f1),'','\x20\x20PAGINATION',a16_0x968d7b(0x1ca),a16_0x968d7b(0x1c0),a16_0x968d7b(0x1f3)][a16_0x968d7b(0x1d2)]('\x0a')},{'command':'getOne','operation':a16_0x968d7b(0x1b7),'risk':a16_0x968d7b(0x1e1),'paramsRequired':!![],'description':a16_0x968d7b(0x1ea),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'create','operation':a16_0x968d7b(0x1b1),'risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a16_0x968d7b(0x1af)},{'command':'batchCreate','operation':'batchCreate','risk':a16_0x968d7b(0x1e3),'paramsRequired':!![],'description':a16_0x968d7b(0x1c5),'paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':'update','operation':a16_0x968d7b(0x1b9),'risk':a16_0x968d7b(0x1e3),'paramsRequired':!![],'description':'Update\x20an\x20existing\x20record','paramsHint':a16_0x968d7b(0x1de)},{'command':'delete','operation':a16_0x968d7b(0x1ee),'risk':'high-risk-write','paramsRequired':!![],'description':a16_0x968d7b(0x1d8),'paramsHint':a16_0x968d7b(0x1ec)},{'command':'aggregate','operation':a16_0x968d7b(0x1cb),'risk':a16_0x968d7b(0x1e1),'paramsRequired':![],'description':a16_0x968d7b(0x1b6),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+'Example:\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a16_0x968d7b(0x1c7),a16_0x968d7b(0x1ae),a16_0x968d7b(0x1eb),a16_0x968d7b(0x1d1),a16_0x968d7b(0x1f7),a16_0x968d7b(0x1e8),a16_0x968d7b(0x1ba),a16_0x968d7b(0x1fa),'',a16_0x968d7b(0x1b2),'\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]',a16_0x968d7b(0x1e6),a16_0x968d7b(0x1d6),a16_0x968d7b(0x1c4),'\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}}',a16_0x968d7b(0x1ed),'','\x20\x20EXAMPLES','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a16_0x968d7b(0x1fb),'',a16_0x968d7b(0x1dc),a16_0x968d7b(0x1cd)]['join']('\x0a')}];function makeDataCommand(_0x51af36){const _0x148d50=a16_0x968d7b,_0x4b29d3=_0x148d50(0x1e0)+_0x51af36[_0x148d50(0x1d4)],_0x56f172={'service':_0x148d50(0x1c3),'command':_0x51af36['command'],'description':_0x51af36[_0x148d50(0x1d3)],'risk':_0x51af36['risk'],'helpExtra':_0x51af36[_0x148d50(0x1fd)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x51af36['paramsHint']}],'validate':async _0x2f6ea8=>{const _0x3cb081=_0x148d50;_0x51af36[_0x3cb081(0x1b5)]&&requireAnyOf(_0x2f6ea8,['params'],_0x4b29d3),_0x51af36['operation']===_0x3cb081(0x1e2)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x2f6ea8['str']('params')));},async 'execute'(_0x322560){const _0x401c7b=_0x148d50,_0x4c7478=_0x322560['str'](_0x401c7b(0x1f0)),_0x36f662=_0x51af36['operation']===_0x401c7b(0x1e2)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x322560[_0x401c7b(0x1c1)](_0x401c7b(0x1f5)))):parseJsonParams(_0x322560[_0x401c7b(0x1c1)](_0x401c7b(0x1f5)))??{},_0x26d7e2=Date[_0x401c7b(0x1bd)](),_0xb88326=await executeData(_0x4c7478,_0x51af36['operation'],_0x36f662),_0x259e42=Date[_0x401c7b(0x1bd)]()-_0x26d7e2;return{'ok':!![],'data':{'result':_0xb88326,'elapsed':_0x259e42},'message':_0x401c7b(0x1e0)+_0x51af36[_0x401c7b(0x1d4)]+_0x401c7b(0x1e7)+_0x259e42+'ms'};}};return _0x51af36[_0x148d50(0x1bb)]!==_0x148d50(0x1e1)&&(_0x56f172[_0x148d50(0x1f4)]=async _0x4a2628=>{const _0x1452f0=_0x148d50,_0x3cc953=_0x4a2628['str']('code'),_0x59eb8f=_0x51af36[_0x1452f0(0x1c6)]===_0x1452f0(0x1e2)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4a2628[_0x1452f0(0x1c1)]('params'))):parseJsonParams(_0x4a2628['str'](_0x1452f0(0x1f5)))??{};return dryRun(_0x1452f0(0x1ef),_0x1452f0(0x1d9)+_0x3cc953+'/'+_0x51af36[_0x1452f0(0x1c6)])[_0x1452f0(0x1ad)](_0x59eb8f)[_0x1452f0(0x1d3)]('Preview:\x20data\x20'+_0x51af36['command']+_0x1452f0(0x1fc)+_0x3cc953)[_0x1452f0(0x1df)]();}),_0x56f172;}export const dataDefinitions=specs[a16_0x968d7b(0x1c2)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a17_0xa243(){const _0x505364=['name','6391578qHZOwo','beforeScriptId','formatRules','allFieldNames','requestFields','creatorIdField','toFieldLabel','indexes','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','path','code','doType','string','validateRules','type','allFields','fields','source','extend','displayName','isArray','dbType','dataset','datasetKey','detail','relatedPageInfoList','options','push','responseBody','dataType','requestBody','7WXHaSx','toField','description','dbId','afterScriptId','2775110YZLvNH','modifierIdField','5601896rOvgny','deleted','map','labelField','sourceType','tableName','4UdZrmQ','responseFields','logicField','object','doVersion','dbName','17805546YZJvqh','parse','modelId','columnCodeListWithDeleted','title','12086WHIDnd','method','175yrbOXQ','required','updateTimeField','creatorNameField','host','dbtableConfig','modelCode','filter','trim','entries','operations','pkField','length','5688390YRLcWd','9THKLud','toTableName','967101xjdMbv'];a17_0xa243=function(){return _0x505364;};return a17_0xa243();}const a17_0x2ab6e6=a17_0x2473;(function(_0x5bbdbe,_0x4f2df9){const _0xf16c39=a17_0x2473,_0x166ebe=_0x5bbdbe();while(!![]){try{const _0x3773a5=-parseInt(_0xf16c39(0x1d3))/0x1*(-parseInt(_0xf16c39(0x1d1))/0x2)+-parseInt(_0xf16c39(0x198))/0x3+-parseInt(_0xf16c39(0x1c6))/0x4*(parseInt(_0xf16c39(0x195))/0x5)+parseInt(_0xf16c39(0x19a))/0x6*(-parseInt(_0xf16c39(0x1b9))/0x7)+-parseInt(_0xf16c39(0x1c0))/0x8*(-parseInt(_0xf16c39(0x196))/0x9)+-parseInt(_0xf16c39(0x1be))/0xa+parseInt(_0xf16c39(0x1cc))/0xb;if(_0x3773a5===_0x4f2df9)break;else _0x166ebe['push'](_0x166ebe['shift']());}catch(_0x13701d){_0x166ebe['push'](_0x166ebe['shift']());}}}(a17_0xa243,0x8c0bd));function a17_0x2473(_0x4e91e0,_0x2c3ab3){_0x4e91e0=_0x4e91e0-0x193;const _0xa24376=a17_0xa243();let _0x2473e9=_0xa24376[_0x4e91e0];return _0x2473e9;}import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x292d06){const _0x51368a=a17_0x2473;if(_0x292d06[_0x51368a(0x1c1)])return null;const _0x84ba49=Boolean(_0x292d06[_0x51368a(0x1ad)]!==undefined||_0x292d06[_0x51368a(0x1a5)]!==undefined);let _0x9fe98e={};if(!_0x84ba49&&typeof _0x292d06[_0x51368a(0x1ac)]===_0x51368a(0x1a6))try{_0x9fe98e=JSON['parse'](_0x292d06[_0x51368a(0x1ac)]);}catch{}const _0x10f099=_0x84ba49?_0x292d06['name']:_0x292d06['code'],_0x3e7926=_0x84ba49?_0x292d06[_0x51368a(0x1ad)]:_0x292d06['name'],_0x33c028=_0x84ba49?_0x292d06[_0x51368a(0x1a5)]:_0x292d06['type']||_0x292d06[_0x51368a(0x1b7)],_0x30460f=_0x84ba49?_0x292d06[_0x51368a(0x193)]===!![]:_0x9fe98e[_0x51368a(0x193)]===!![],_0x5eb26e=_0x84ba49?_0x292d06['required']===!![]:_0x9fe98e[_0x51368a(0x1d4)]===!![],_0x4d931a=_0x84ba49?_0x292d06[_0x51368a(0x1b4)]??null:_0x9fe98e[_0x51368a(0x1b4)]??null,_0x5c4da9={'name':_0x10f099,'displayName':_0x3e7926||_0x10f099,'type':_0x33c028,'dbType':_0x292d06[_0x51368a(0x1af)],'pk':_0x30460f,'required':_0x5eb26e,'description':_0x292d06[_0x51368a(0x1bb)]||undefined};return Array[_0x51368a(0x1ae)](_0x4d931a)&&_0x4d931a['length']>0x0&&(_0x5c4da9[_0x51368a(0x1b4)]=_0x4d931a),_0x5c4da9;}function parseJsonMaybe(_0x584664){const _0xca84f2=a17_0x2473;if(typeof _0x584664!=='string')return _0x584664;try{return JSON[_0xca84f2(0x1cd)](_0x584664);}catch{return _0x584664;}}function normalizeOperationEntry(_0xd56297,_0x4e4290){const _0x35a948=a17_0x2473;if(!_0x4e4290||typeof _0x4e4290!==_0x35a948(0x1c9))return null;if(!_0x4e4290[_0x35a948(0x1d2)]||!_0x4e4290[_0x35a948(0x1a3)])return null;const _0x130d1f={'name':_0xd56297,'method':_0x4e4290[_0x35a948(0x1d2)],'path':_0x4e4290[_0x35a948(0x1a3)]};if(_0x4e4290[_0x35a948(0x1d7)])_0x130d1f[_0x35a948(0x1d7)]=_0x4e4290[_0x35a948(0x1d7)];if(_0x4e4290[_0x35a948(0x1b8)]!=null)_0x130d1f[_0x35a948(0x1b8)]=parseJsonMaybe(_0x4e4290[_0x35a948(0x1b8)]);if(_0x4e4290[_0x35a948(0x1b6)]!=null)_0x130d1f['responseBody']=parseJsonMaybe(_0x4e4290[_0x35a948(0x1b6)]);if(_0x4e4290[_0x35a948(0x19b)]!=null)_0x130d1f['beforeScriptId']=_0x4e4290[_0x35a948(0x19b)];if(_0x4e4290[_0x35a948(0x1bd)]!=null)_0x130d1f[_0x35a948(0x1bd)]=_0x4e4290['afterScriptId'];if(Array[_0x35a948(0x1ae)](_0x4e4290[_0x35a948(0x19e)]))_0x130d1f['requestFields']=_0x4e4290[_0x35a948(0x19e)];if(Array[_0x35a948(0x1ae)](_0x4e4290[_0x35a948(0x1c7)]))_0x130d1f[_0x35a948(0x1c7)]=_0x4e4290[_0x35a948(0x1c7)];return _0x130d1f;}function summarizeDbtable(_0xbf35c6){const _0x727181=a17_0x2473,_0x31bd0b={},_0x4001b2=[_0x727181(0x1bc),_0x727181(0x1cb),_0x727181(0x1c5),_0x727181(0x1b1),_0x727181(0x193),_0x727181(0x1a9),_0x727181(0x1c8),'createTimeField',_0x727181(0x1d5),_0x727181(0x19f),_0x727181(0x1d6),_0x727181(0x1bf),'modifierNameField',_0x727181(0x1c3),'dblinkInfoDTO'];for(const _0x5e533e of _0x4001b2){if(_0xbf35c6[_0x5e533e]!==undefined)_0x31bd0b[_0x5e533e]=_0xbf35c6[_0x5e533e];}return typeof _0x31bd0b[_0x727181(0x1a9)]===_0x727181(0x1a6)&&_0x31bd0b[_0x727181(0x1a9)][_0x727181(0x194)]>0x0&&(_0x31bd0b[_0x727181(0x19d)]=_0x31bd0b[_0x727181(0x1a9)]['split'](',')[_0x727181(0x1c2)](_0x50daad=>_0x50daad[_0x727181(0x1db)]())[_0x727181(0x1da)](Boolean)),_0x31bd0b;}function normalizeRelatedPages(_0x33afe2){const _0x552cbf=a17_0x2473;if(!Array[_0x552cbf(0x1ae)](_0x33afe2))return[];return _0x33afe2[_0x552cbf(0x1da)](_0x47861e=>_0x47861e&&typeof _0x47861e===_0x552cbf(0x1c9))[_0x552cbf(0x1c2)](_0x58a339=>({'id':_0x58a339['id'],'type':_0x58a339[_0x552cbf(0x1a8)],'code':_0x58a339[_0x552cbf(0x1a4)],'title':_0x58a339[_0x552cbf(0x1d0)],'deleted':_0x58a339[_0x552cbf(0x1c1)]===!![]}));}export const datasetDetail={'service':a17_0x2ab6e6(0x1b0),'command':a17_0x2ab6e6(0x1b2),'description':a17_0x2ab6e6(0x1a2),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x39c563){const _0x585688=a17_0x2ab6e6,_0x234255=await getDatasetDetail(_0x39c563['str'](_0x585688(0x1a4))),_0xfd7024=Array[_0x585688(0x1ae)](_0x234255[_0x585688(0x1aa)])?_0x234255[_0x585688(0x1aa)]:Array[_0x585688(0x1ae)](_0x234255['properties'])?_0x234255['properties']:[],_0x6866ab=_0xfd7024[_0x585688(0x1c2)](_0x14d386=>normalizeField(_0x14d386))[_0x585688(0x1da)](_0x473fbc=>_0x473fbc!==null),_0x5d296c=_0x234255[_0x585688(0x1dd)]??{},_0x1045fc=[];for(const [_0x376ee1,_0x5c2d75]of Object[_0x585688(0x1dc)](_0x5d296c)){const _0x39e755=normalizeOperationEntry(_0x376ee1,_0x5c2d75);if(_0x39e755)_0x1045fc[_0x585688(0x1b5)](_0x39e755);}const _0x3a31be=_0x234255[_0x585688(0x1d8)]??{},_0x309421=_0x234255[_0x585688(0x1b0)]??{},_0x20dba9=_0x3a31be[_0x585688(0x1bc)]!=null?{'id':_0x3a31be[_0x585688(0x1bc)],'name':_0x3a31be[_0x585688(0x1cb)]??null}:undefined;let _0x59d8e6;return typeof _0x234255[_0x585688(0x1ac)]===_0x585688(0x1a6)&&(_0x59d8e6=parseJsonMaybe(_0x234255[_0x585688(0x1ac)])),{'ok':!![],'data':{'id':_0x234255[_0x585688(0x1ce)]??_0x234255['id'],'name':_0x234255[_0x585688(0x199)],'code':_0x234255[_0x585688(0x1d9)]||_0x234255['code'],'doVersion':_0x234255[_0x585688(0x1ca)],'description':_0x234255[_0x585688(0x1bb)]||_0x309421['tableComment']||undefined,'source':_0x234255[_0x585688(0x1ab)]||_0x309421[_0x585688(0x1c4)],'table':_0x3a31be[_0x585688(0x1c5)]||_0x309421[_0x585688(0x1c5)],'datasetKey':_0x3a31be[_0x585688(0x1b1)],'pk':_0x3a31be[_0x585688(0x193)],'db':_0x20dba9,'dbtable':summarizeDbtable(_0x3a31be),'fields':_0x6866ab,'operations':_0x1045fc,'indexes':Array[_0x585688(0x1ae)](_0x309421['indexes'])?_0x309421[_0x585688(0x1a1)]:[],'relations':Array[_0x585688(0x1ae)](_0x234255['relations'])?_0x234255['relations'][_0x585688(0x1c2)](_0x486122=>({'fromField':_0x486122['fromField'],'toDataset':_0x486122['toDatasetName'],'toCode':_0x486122['toDatasetCode'],'toTable':_0x486122[_0x585688(0x197)],'toField':_0x486122[_0x585688(0x1ba)],'labelField':_0x486122[_0x585688(0x1a0)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x234255[_0x585688(0x1b3)]),...Array[_0x585688(0x1ae)](_0x234255[_0x585688(0x1cf)])?{'columnCodeListWithDeleted':_0x234255[_0x585688(0x1cf)]}:{},'formatRules':Array[_0x585688(0x1ae)](_0x234255[_0x585688(0x19c)])?_0x234255[_0x585688(0x19c)]:[],'validateRules':Array[_0x585688(0x1ae)](_0x234255[_0x585688(0x1a7)])?_0x234255[_0x585688(0x1a7)]:[],..._0x59d8e6!==undefined?{'extend':_0x59d8e6}:{},'stats':{'fieldCount':_0x6866ab['length'],'operationCount':_0x1045fc[_0x585688(0x194)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x423193,_0x25d722){const _0x4bdac6=a18_0x1e17,_0x52defa=_0x423193();while(!![]){try{const _0x24e66f=-parseInt(_0x4bdac6(0x100))/0x1+-parseInt(_0x4bdac6(0xfc))/0x2+-parseInt(_0x4bdac6(0xff))/0x3+parseInt(_0x4bdac6(0x101))/0x4+parseInt(_0x4bdac6(0xfb))/0x5*(parseInt(_0x4bdac6(0xfe))/0x6)+parseInt(_0x4bdac6(0xfa))/0x7*(-parseInt(_0x4bdac6(0xfd))/0x8)+-parseInt(_0x4bdac6(0x102))/0x9*(-parseInt(_0x4bdac6(0xf9))/0xa);if(_0x24e66f===_0x25d722)break;else _0x52defa['push'](_0x52defa['shift']());}catch(_0x58e231){_0x52defa['push'](_0x52defa['shift']());}}}(a18_0x5285,0xdf057));function a18_0x5285(){const _0x47d97d=['520GILHzg','2843738SeJVhZ','104752VwzZMP','70068Jujxui','3876969nQoazP','1172072NgXceA','1933700BSfjKx','18IHpWRN','20419360FkJBQo','525IKKIUH'];a18_0x5285=function(){return _0x47d97d;};return a18_0x5285();}function a18_0x1e17(_0x423bbb,_0x259264){_0x423bbb=_0x423bbb-0xf9;const _0x528530=a18_0x5285();let _0x1e17f1=_0x528530[_0x423bbb];return _0x1e17f1;}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';export const datasetDefinitions=[datasetList,datasetDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x79f41a=a19_0x2c21;(function(_0x295963,_0x24da18){const _0x3630f9=a19_0x2c21,_0x17f285=_0x295963();while(!![]){try{const _0x18ebec=-parseInt(_0x3630f9(0x10f))/0x1*(parseInt(_0x3630f9(0x11a))/0x2)+-parseInt(_0x3630f9(0x127))/0x3*(parseInt(_0x3630f9(0x128))/0x4)+parseInt(_0x3630f9(0x10e))/0x5*(parseInt(_0x3630f9(0x11c))/0x6)+-parseInt(_0x3630f9(0x11b))/0x7*(parseInt(_0x3630f9(0x124))/0x8)+-parseInt(_0x3630f9(0x113))/0x9+parseInt(_0x3630f9(0x118))/0xa*(parseInt(_0x3630f9(0x110))/0xb)+parseInt(_0x3630f9(0x115))/0xc;if(_0x18ebec===_0x24da18)break;else _0x17f285['push'](_0x17f285['shift']());}catch(_0x3b4e2f){_0x17f285['push'](_0x17f285['shift']());}}}(a19_0x1d3b,0xa02df));function a19_0x1d3b(){const _0x51eea9=['609UdWbLo','17620WTyFEH','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','str','130QJLBmZ','39nPSPVj','44HMzENQ','source','name','9761859NKNoHs','list','47054856KjYSsJ','code','description','551520GxUuNb','string','59914sJsDZY','70SSGuBt','82308wrrNXW','allFields','tableName','dbtableConfig','appCode','map','dataset','datasetKey','556184zHvtho','trim','pkField'];a19_0x1d3b=function(){return _0x51eea9;};return a19_0x1d3b();}import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a19_0x2c21(_0x23decc,_0x8cf2fd){_0x23decc=_0x23decc-0x10d;const _0x1d3b44=a19_0x1d3b();let _0x2c2139=_0x1d3b44[_0x23decc];return _0x2c2139;}export const datasetList={'service':a19_0x79f41a(0x122),'command':a19_0x79f41a(0x114),'description':a19_0x79f41a(0x129),'risk':'read','flags':[{'name':a19_0x79f41a(0x112),'type':a19_0x79f41a(0x119),'description':a19_0x79f41a(0x12a)},{...CODE_FLAG,'required':![],'description':'Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)'}],async 'execute'(_0x1ab3a6){const _0xf62d15=a19_0x79f41a,_0x3c1ba6=_0x1ab3a6[_0xf62d15(0x10d)](_0xf62d15(0x112)),_0x49b318=_0x1ab3a6[_0xf62d15(0x10d)](_0xf62d15(0x116)),_0x383201=await listDatasets(_0x1ab3a6[_0xf62d15(0x120)],{..._0x3c1ba6&&{'name':_0x3c1ba6},..._0x49b318&&{'code':_0x49b318}});return{'ok':!![],'data':{'total':_0x383201['length'],'datasets':_0x383201['map'](_0x1d4f90=>{const _0x102d46=_0xf62d15,_0x308a94=_0x1d4f90[_0x102d46(0x11f)]??{};return{'id':_0x1d4f90['id'],'code':_0x1d4f90['code'],'name':_0x1d4f90[_0x102d46(0x112)],'source':_0x1d4f90[_0x102d46(0x111)],'description':_0x1d4f90[_0x102d46(0x117)],'table':_0x308a94[_0x102d46(0x11e)],'datasetKey':_0x308a94[_0x102d46(0x123)],'pk':_0x308a94[_0x102d46(0x126)],'fields':_0x308a94[_0x102d46(0x11d)]?_0x308a94[_0x102d46(0x11d)]['split'](',')[_0x102d46(0x121)](_0x494bfd=>_0x494bfd[_0x102d46(0x125)]()):[]};})}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0xe2d5df=a20_0x11ec;(function(_0x2a7c9f,_0x20b9c0){const _0x26abd4=a20_0x11ec,_0x3aa8f3=_0x2a7c9f();while(!![]){try{const _0x2306a4=-parseInt(_0x26abd4(0x1e3))/0x1*(parseInt(_0x26abd4(0x1d7))/0x2)+-parseInt(_0x26abd4(0x1d3))/0x3*(parseInt(_0x26abd4(0x1ee))/0x4)+-parseInt(_0x26abd4(0x1d6))/0x5*(parseInt(_0x26abd4(0x1e5))/0x6)+-parseInt(_0x26abd4(0x1d5))/0x7*(-parseInt(_0x26abd4(0x1e8))/0x8)+parseInt(_0x26abd4(0x1c2))/0x9*(parseInt(_0x26abd4(0x1b9))/0xa)+parseInt(_0x26abd4(0x1dd))/0xb+parseInt(_0x26abd4(0x1ba))/0xc*(parseInt(_0x26abd4(0x1df))/0xd);if(_0x2306a4===_0x20b9c0)break;else _0x3aa8f3['push'](_0x3aa8f3['shift']());}catch(_0x3fdcbb){_0x3aa8f3['push'](_0x3aa8f3['shift']());}}}(a20_0x2b45,0xb2ee7));import a20_0x386bad from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';function a20_0x11ec(_0x37ae73,_0x5c55c5){_0x37ae73=_0x37ae73-0x1ad;const _0x2b45ad=a20_0x2b45();let _0x11ec17=_0x2b45ad[_0x37ae73];return _0x11ec17;}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';async function execute(_0x46b417){const _0x57dd02=a20_0x11ec,_0x17a17b=getCliVersion(),_0x4a4809=buildConfigFromFlags({});await initGlobalEnvironment(_0x4a4809),console[_0x57dd02(0x1d1)](),console['log'](a20_0x386bad[_0x57dd02(0x1ae)](CLI_BIN_NAME+_0x57dd02(0x1bd))),console['log'](a20_0x386bad['gray']('─'['repeat'](0x32))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1ed)+_0x17a17b),console['log'](_0x57dd02(0x1dc)+process[_0x57dd02(0x1e7)]),console[_0x57dd02(0x1d1)](_0x57dd02(0x1db)+process[_0x57dd02(0x1bb)]+'\x20'+process[_0x57dd02(0x1c6)]),console[_0x57dd02(0x1d1)](),console[_0x57dd02(0x1d1)](a20_0x386bad['bold']('\x20\x20Config\x20Files')),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1cc)]('\x20\x20─'[_0x57dd02(0x1eb)](0x1e)));const _0x5a41f3=getGlobalConfigPath(),_0x3b42ea=getProjectConfigPath();console[_0x57dd02(0x1d1)](_0x57dd02(0x1ec)+(_0x5a41f3||a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1de)))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1c7)+(_0x3b42ea||a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1de)))),console[_0x57dd02(0x1d1)](),console['log'](a20_0x386bad['bold'](_0x57dd02(0x1c8))),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1cc)]('\x20\x20─'[_0x57dd02(0x1eb)](0x1e)));const _0x33ae64=(_0x3d7f60,_0x12e200)=>{const _0x206fb1=_0x57dd02;if(!_0x12e200){console[_0x206fb1(0x1d1)]('\x20\x20'+_0x3d7f60['padEnd'](0x11)+'\x20'+a20_0x386bad['gray'](_0x206fb1(0x1e2)));return;}const _0x2525d1=inspectCliConfigJsonFile(_0x12e200);if(_0x2525d1[_0x206fb1(0x1bc)]==='ok')console[_0x206fb1(0x1d1)]('\x20\x20'+_0x3d7f60[_0x206fb1(0x1b4)](0x11)+'\x20'+a20_0x386bad[_0x206fb1(0x1be)]('✓\x20Valid\x20JSON'));else{if(_0x2525d1[_0x206fb1(0x1bc)]===_0x206fb1(0x1e1))console[_0x206fb1(0x1d1)]('\x20\x20'+_0x3d7f60[_0x206fb1(0x1b4)](0x11)+'\x20'+a20_0x386bad['yellow'](_0x206fb1(0x1da)));else _0x2525d1['status']===_0x206fb1(0x1ce)?console[_0x206fb1(0x1d1)]('\x20\x20'+_0x3d7f60[_0x206fb1(0x1b4)](0x11)+'\x20'+a20_0x386bad['gray']('(missing)')):(console[_0x206fb1(0x1d1)]('\x20\x20'+_0x3d7f60[_0x206fb1(0x1b4)](0x11)+'\x20'+a20_0x386bad['red']('✗\x20Invalid\x20JSON')),console[_0x206fb1(0x1d1)]('\x20\x20'+''[_0x206fb1(0x1b4)](0x11)+'\x20'+a20_0x386bad['red'](_0x2525d1[_0x206fb1(0x1e9)])));}};_0x33ae64('Global',_0x5a41f3),_0x33ae64('Project',_0x3b42ea),console[_0x57dd02(0x1d1)](),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1ae)](_0x57dd02(0x1c1))),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1f3)[_0x57dd02(0x1eb)](0x1e))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1b2)+(_0x4a4809[_0x57dd02(0x1e0)]||a20_0x386bad['red'](_0x57dd02(0x1c9)))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1ea)+_0x4a4809[_0x57dd02(0x1af)]);const _0x3aba84=isLegacyCompatConfigKey(_0x57dd02(0x1d4))?a20_0x386bad['gray'](_0x4a4809[_0x57dd02(0x1d4)]+_0x57dd02(0x1cb)):_0x4a4809[_0x57dd02(0x1d4)];return console['log'](_0x57dd02(0x1cd)+_0x3aba84),console[_0x57dd02(0x1d1)](_0x57dd02(0x1b3)+(_0x4a4809['defaultApp']||a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1d2)))),console[_0x57dd02(0x1d1)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x4a4809[_0x57dd02(0x1bf)]||a20_0x386bad['gray'](_0x57dd02(0x1d2)))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1c4)+(_0x4a4809['format']||a20_0x386bad['gray'](_0x57dd02(0x1c3)+DEFAULT_CONFIG_VALUES['format']+')'))),console['log'](_0x57dd02(0x1e4)+(_0x4a4809['pageSize']??a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1b7)))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1b6)+_0x4a4809[_0x57dd02(0x1cf)]),console[_0x57dd02(0x1d1)](_0x57dd02(0x1c5)+_0x4a4809[_0x57dd02(0x1ca)]),console[_0x57dd02(0x1d1)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x57dd02(0x1d8)]),console['log'](_0x57dd02(0x1f2)+(_0x4a4809[_0x57dd02(0x1f1)]?a20_0x386bad[_0x57dd02(0x1be)]('(set,\x20length='+_0x4a4809['accessKey'][_0x57dd02(0x1e6)]+')'):a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1d2)))),console['log'](),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1ae)](_0x57dd02(0x1ef))),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1f3)[_0x57dd02(0x1eb)](0x1e))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1b1)+getApiDomain()),console[_0x57dd02(0x1d1)](_0x57dd02(0x1d0)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console['log'](a20_0x386bad[_0x57dd02(0x1ae)](_0x57dd02(0x1b8))),console[_0x57dd02(0x1d1)](a20_0x386bad[_0x57dd02(0x1cc)](_0x57dd02(0x1f3)['repeat'](0x1e))),console['log'](_0x57dd02(0x1f0)+a20_0x386bad[_0x57dd02(0x1be)](AUTH_MODE[_0x57dd02(0x1d8)]+_0x57dd02(0x1ad))),console[_0x57dd02(0x1d1)](_0x57dd02(0x1f4)+a20_0x386bad['gray']('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x57dd02(0x1d1)](),{'ok':!![]};}export const doctorDefinition={'service':a20_0xe2d5df(0x1b5),'command':a20_0xe2d5df(0x1b0),'description':a20_0xe2d5df(0x1d9),'risk':a20_0xe2d5df(0x1c0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};function a20_0x2b45(){const _0x26f8c2=['\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','riskLevel','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','log','(none)','753513HCDooh','locale','9576581YjIrkG','1293205NOUIgx','108560RunZix','ClientAk','Diagnose\x20CLI\x20configuration\x20and\x20environment','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','12712183BlbEyH','(not\x20found)','182dWUhjr','appCode','empty','(no\x20file)','20vlCtlp','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','12EMBhKx','length','version','8cunTKm','message','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','20brrnaA','\x20\x20API\x20Endpoints','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','\x20\x20Session\x20check:\x20\x20\x20','\x20(accessKey)','bold','env','check','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','padEnd','doctor','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(default)','\x20\x20Auth','12270TBRXqu','84492PxHTjj','platform','status','\x20doctor','green','currentApp','read','\x20\x20Merged\x20Config','7110oyiqYg','(default:\x20','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','arch','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','(not\x20set)','verbose','\x20(legacy/compat\x20only)','gray'];a20_0x2b45=function(){return _0x26f8c2;};return a20_0x2b45();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x5dc489=a21_0xfb55;(function(_0x1a0ddd,_0x3d69db){const _0x1f1986=a21_0xfb55,_0xe48c1e=_0x1a0ddd();while(!![]){try{const _0x6226c5=-parseInt(_0x1f1986(0x1a6))/0x1*(parseInt(_0x1f1986(0x19f))/0x2)+parseInt(_0x1f1986(0x1a5))/0x3*(-parseInt(_0x1f1986(0x19c))/0x4)+-parseInt(_0x1f1986(0x19a))/0x5+parseInt(_0x1f1986(0x1a4))/0x6*(-parseInt(_0x1f1986(0x1a7))/0x7)+-parseInt(_0x1f1986(0x196))/0x8+-parseInt(_0x1f1986(0x197))/0x9*(-parseInt(_0x1f1986(0x19d))/0xa)+parseInt(_0x1f1986(0x1a1))/0xb;if(_0x6226c5===_0x3d69db)break;else _0xe48c1e['push'](_0xe48c1e['shift']());}catch(_0x3b115f){_0xe48c1e['push'](_0xe48c1e['shift']());}}}(a21_0x4e55,0xaa2bf));import{runInit,initCreateFlagDefs}from'../../commands/init.js';function a21_0xfb55(_0x442464,_0x1214e2){_0x442464=_0x442464-0x195;const _0x4e55f2=a21_0x4e55();let _0xfb5597=_0x4e55f2[_0x442464];return _0xfb5597;}function a21_0x4e55(){const _0x50ef59=['6630360WDaVau','171MrLqJj','Initialize\x20.lovrabet.json\x20config\x20file','boolean','2131330szLAvb','bool','16LWMntL','388820PzZDrJ','create','15412mOipFB','write','30811979hvekNG','type','str','37002KUkvsF','611619nRSEHt','53eFeDFC','413QAvnoA','name'];a21_0x4e55=function(){return _0x50ef59;};return a21_0x4e55();}function collectFlags(_0x36f4fc,_0x73e0a9){const _0x1bb101=a21_0xfb55,_0x7684f7={};for(const _0x4fc1e0 of _0x73e0a9){const _0x365f43=_0x4fc1e0[_0x1bb101(0x1a2)]===_0x1bb101(0x199)?_0x36f4fc[_0x1bb101(0x19b)](_0x4fc1e0[_0x1bb101(0x195)]):_0x36f4fc[_0x1bb101(0x1a3)](_0x4fc1e0['name']);if(_0x365f43!==''&&_0x365f43!==![])_0x7684f7[_0x4fc1e0['name']]=_0x365f43;}if(_0x36f4fc['nonInteractive'])_0x7684f7['nonInteractive']=!![];return _0x7684f7;}export const initDefinitions=[{'service':'init','command':a21_0x5dc489(0x19e),'description':a21_0x5dc489(0x198),'risk':a21_0x5dc489(0x1a0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x4a83e3){return await runInit(collectFlags(_0x4a83e3,initCreateFlagDefs)),{'ok':!![]};}}];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x368ec7=a22_0xd289;(function(_0x5af9e0,_0x7f2a71){const _0x4d898b=a22_0xd289,_0x5469da=_0x5af9e0();while(!![]){try{const _0x2d79c8=-parseInt(_0x4d898b(0x186))/0x1*(-parseInt(_0x4d898b(0x1c0))/0x2)+parseInt(_0x4d898b(0x1b8))/0x3+parseInt(_0x4d898b(0x1aa))/0x4+-parseInt(_0x4d898b(0x195))/0x5*(-parseInt(_0x4d898b(0x19a))/0x6)+parseInt(_0x4d898b(0x1ad))/0x7+-parseInt(_0x4d898b(0x19c))/0x8*(parseInt(_0x4d898b(0x18a))/0x9)+-parseInt(_0x4d898b(0x1c7))/0xa;if(_0x2d79c8===_0x7f2a71)break;else _0x5469da['push'](_0x5469da['shift']());}catch(_0x5d6c2a){_0x5469da['push'](_0x5469da['shift']());}}}(a22_0x2e4e,0xd8d11));function a22_0x2e4e(){const _0x29742e=['object','apps','\x20\x20env:\x20\x20\x20\x20\x20','\x0aInitialized\x20','join','Failed\x20to\x20parse\x20source\x20file:\x20','validation','main','\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Usage:\x20','160dDccSc','trim','appcode','Specify\x20one\x20with\x20--appcode\x20<code>.','removeListener','42468qPfqYD','[y/N]','392NqhwkA','close','apiDir','\x20\x20config:\x20\x20','Initialized\x20','toLowerCase','once','\x20\x20apps:\x20\x20\x20\x20','length','keys','boolean','race','project','riskLevel','4987884bLZtDu','\x20\x20appcode:\x20','defaultApp','729673DhpBVf','cwd','App\x20code','Aborted.','User\x20aborted\x20prompt','Skip\x20confirmation\x20when\x20overwriting','AbortPrompt','App\x20code\x20for\x20the\x20project','parse','Invalid\x20env\x20\x22','message','1808862dvslut','file','app','env','stdout','utf8','yes','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','14972UPVhku','cancelled','log','Source\x20file\x20not\x20found:\x20','entries','Override\x20imported\x20default\x20appcode','global','7108400gqmOSc','includes','Use\x20upgraded\x20.rabetbase.json\x20with\x20apps/defaultApp,\x20then\x20run:\x20lovrabet\x20app\x20import\x20--file\x20<path>','\x20\x20app:\x20\x20\x20\x20\x20','File\x20','string','stdin','1WByJGz','\x20init\x20—\x20Create\x20.lovrabet.json\x0a','SIGINT','Imported\x20from\x20','108225dqpphN'];a22_0x2e4e=function(){return _0x29742e;};return a22_0x2e4e();}import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_APP_PROFILE_NAME,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';export const initCreateFlagDefs=[{'name':'appcode','type':a22_0x368ec7(0x184),'description':a22_0x368ec7(0x1b4)},{'name':a22_0x368ec7(0x1bb),'type':a22_0x368ec7(0x184),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a22_0x368ec7(0x1c6),'type':a22_0x368ec7(0x1a6),'description':'Write\x20to\x20global\x20(~/.lovrabet.json)\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a22_0x368ec7(0x1a6),'description':a22_0x368ec7(0x1b2),'default':![]}];export const initImportFlagDefs=[{'name':a22_0x368ec7(0x1b9),'type':a22_0x368ec7(0x184),'description':a22_0x368ec7(0x1bf),'required':!![]},{'name':a22_0x368ec7(0x197),'type':a22_0x368ec7(0x184),'description':a22_0x368ec7(0x1c5)},{'name':a22_0x368ec7(0x1bb),'type':a22_0x368ec7(0x184),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a22_0x368ec7(0x1c6),'type':a22_0x368ec7(0x1a6),'description':'Write\x20to\x20global\x20(~/.lovrabet.json)\x20instead\x20of\x20project','default':![]},{'name':a22_0x368ec7(0x1be),'type':a22_0x368ec7(0x1a6),'description':a22_0x368ec7(0x1b2),'default':![]}];export async function runInit(_0x1a334c){const _0x4edd95=a22_0x368ec7,_0x5bbc71=isNonInteractiveMode(_0x1a334c),_0x2a8d66=_0x1a334c['global']?'global':_0x4edd95(0x1a8),_0xbec28a=resolveWriteConfigPath(_0x2a8d66);try{_0x5bbc71?await runNonInteractive(_0x1a334c,_0xbec28a):await runInteractive(_0x1a334c,_0xbec28a);}catch(_0xccb7c2){if(_0xccb7c2 instanceof AbortPrompt)throw CliErrors[_0x4edd95(0x1c1)]();throw _0xccb7c2;}}export async function runInitImport(_0x335db9){const _0x587de2=a22_0x368ec7,_0x5bde1b=_0x335db9[_0x587de2(0x1c6)]?_0x587de2(0x1c6):_0x587de2(0x1a8),_0x1e63ca=resolveWriteConfigPath(_0x5bde1b);await runFromImport(_0x335db9,_0x1e63ca);}const RUNTIME_IRRELEVANT_KEYS=new Set([a22_0x368ec7(0x19e)]);async function runFromImport(_0x4c6f65,_0xe32c3f){const _0x2531a8=a22_0x368ec7,_0xf62e2c=resolveFilePath(_0x4c6f65['file']);if(!existsSync(_0xf62e2c))throw CliErrors[_0x2531a8(0x191)](_0x2531a8(0x1c3)+_0xf62e2c);const _0x44742e=readSourceFile(_0xf62e2c),_0x1f49b2=convertToRuntimeConfig(_0x44742e);if(_0x4c6f65[_0x2531a8(0x197)]){if(!_0x1f49b2['apps']||Object[_0x2531a8(0x1a5)](_0x1f49b2['apps'])[_0x2531a8(0x1a4)]===0x0)_0x1f49b2['apps']={'main':{'appcode':_0x4c6f65[_0x2531a8(0x197)]}},_0x1f49b2['defaultApp']=_0x2531a8(0x192);else{const _0x57d56c=_0x1f49b2['defaultApp']&&_0x1f49b2['apps'][_0x1f49b2[_0x2531a8(0x1ac)]]?_0x1f49b2[_0x2531a8(0x1ac)]:Object[_0x2531a8(0x1a5)](_0x1f49b2[_0x2531a8(0x18c)])[0x0],_0xd389ca=_0x57d56c||_0x2531a8(0x192);_0x1f49b2[_0x2531a8(0x18c)][_0xd389ca]={..._0x1f49b2['apps'][_0xd389ca]||{},'appcode':_0x4c6f65[_0x2531a8(0x197)]},_0x1f49b2[_0x2531a8(0x1ac)]=_0x1f49b2[_0x2531a8(0x1ac)]||_0xd389ca;}}if(_0x4c6f65[_0x2531a8(0x1bb)]){const _0x5e329f=resolveInitEnv(_0x4c6f65);if(!_0x1f49b2[_0x2531a8(0x18c)]||Object[_0x2531a8(0x1a5)](_0x1f49b2[_0x2531a8(0x18c)])['length']===0x0)_0x1f49b2[_0x2531a8(0x18c)]={'main':{'appcode':'','env':_0x5e329f}},_0x1f49b2[_0x2531a8(0x1ac)]=_0x2531a8(0x192);else{const _0x12a5b4=_0x1f49b2['defaultApp']&&_0x1f49b2['apps'][_0x1f49b2[_0x2531a8(0x1ac)]]?_0x1f49b2[_0x2531a8(0x1ac)]:Object[_0x2531a8(0x1a5)](_0x1f49b2[_0x2531a8(0x18c)])[0x0],_0x1ce676=_0x12a5b4||'main';_0x1f49b2['apps'][_0x1ce676]={..._0x1f49b2['apps'][_0x1ce676]||{},'env':_0x5e329f},_0x1f49b2['defaultApp']=_0x1f49b2[_0x2531a8(0x1ac)]||_0x1ce676;}}if(!_0x1f49b2['apps']||Object[_0x2531a8(0x1a5)](_0x1f49b2['apps'])['length']===0x0)throw CliErrors[_0x2531a8(0x191)]('Source\x20file\x20does\x20not\x20contain\x20any\x20app\x20profile.',_0x2531a8(0x1c9));const _0x5ca499=Object['values'](_0x1f49b2[_0x2531a8(0x18c)])['some'](_0x405a01=>_0x405a01?.[_0x2531a8(0x197)]);if(!_0x5ca499)throw CliErrors[_0x2531a8(0x191)]('Imported\x20app\x20profiles\x20do\x20not\x20contain\x20appcode.',_0x2531a8(0x198));await writeInitConfig(_0xe32c3f,_0x1f49b2,_0x4c6f65),console['log'](_0x2531a8(0x189)+_0xf62e2c),console[_0x2531a8(0x1c2)](_0x2531a8(0x19f)+_0xe32c3f),_0x1f49b2[_0x2531a8(0x18c)]&&Object[_0x2531a8(0x1a5)](_0x1f49b2[_0x2531a8(0x18c)])[_0x2531a8(0x1a4)]>0x0&&console[_0x2531a8(0x1c2)](_0x2531a8(0x1a3)+Object[_0x2531a8(0x1a5)](_0x1f49b2[_0x2531a8(0x18c)])[_0x2531a8(0x18f)](',\x20'));}function convertToRuntimeConfig(_0x38172e){const _0x587660=a22_0x368ec7,_0x398d79={};for(const _0x13ee97 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x38172e[_0x13ee97]!==undefined&&(_0x398d79[_0x13ee97]=_0x38172e[_0x13ee97]);}!_0x398d79[_0x587660(0x1a9)]&&(_0x398d79['riskLevel']=DEFAULT_CONFIG_VALUES[_0x587660(0x1a9)]);if(_0x38172e[_0x587660(0x18c)]&&typeof _0x38172e[_0x587660(0x18c)]===_0x587660(0x18b)){_0x398d79[_0x587660(0x18c)]={};for(const [_0xf97c12,_0x1b9b05]of Object['entries'](_0x38172e[_0x587660(0x18c)])){_0x1b9b05&&typeof _0x1b9b05===_0x587660(0x18b)&&(_0x398d79[_0x587660(0x18c)][_0xf97c12]=filterRuntimeProfile(_0x1b9b05));}_0x38172e[_0x587660(0x1ac)]&&(_0x398d79[_0x587660(0x1ac)]=_0x38172e[_0x587660(0x1ac)]);}return _0x398d79;}function filterRuntimeProfile(_0x5d9dc9){const _0xa62465=a22_0x368ec7,_0x5a0700={};for(const _0x3cc5a1 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5d9dc9[_0x3cc5a1]!==undefined&&(_0x5a0700[_0x3cc5a1]=_0x5d9dc9[_0x3cc5a1]);}return!_0x5a0700['appcode']&&_0x5d9dc9[_0xa62465(0x197)]&&(_0x5a0700['appcode']=String(_0x5d9dc9[_0xa62465(0x197)])),!_0x5a0700[_0xa62465(0x1a9)]&&(_0x5a0700[_0xa62465(0x1a9)]=DEFAULT_CONFIG_VALUES[_0xa62465(0x1a9)]),_0x5a0700;}async function runNonInteractive(_0x3ff458,_0x5f2e12){const _0x5c53bf=a22_0x368ec7,_0x373862=_0x3ff458[_0x5c53bf(0x197)];if(!_0x373862)throw CliErrors['flagMissing'](_0x5c53bf(0x197),_0x5c53bf(0x194)+CLI_BIN_NAME+_0x5c53bf(0x193));const _0x178311=resolveInitEnv(_0x3ff458);await writeInitConfig(_0x5f2e12,{'apps':{[DEFAULT_APP_PROFILE_NAME]:{'appcode':_0x373862,'env':_0x178311}},'defaultApp':DEFAULT_APP_PROFILE_NAME},_0x3ff458),console['log'](_0x5c53bf(0x1a0)+_0x5f2e12),console[_0x5c53bf(0x1c2)](_0x5c53bf(0x1ca)+DEFAULT_APP_PROFILE_NAME),console['log']('\x20\x20appcode:\x20'+_0x373862),console[_0x5c53bf(0x1c2)](_0x5c53bf(0x18d)+_0x178311);}async function runInteractive(_0x5c0813,_0x33abd9){const _0x3b2741=a22_0x368ec7,_0x500896=loadExisting(_0x33abd9),_0x248d50=_0x500896?.[_0x3b2741(0x18c)]&&typeof _0x500896[_0x3b2741(0x18c)]===_0x3b2741(0x18b)?_0x500896[_0x3b2741(0x18c)]:{},_0x356707=_0x500896?.[_0x3b2741(0x1ac)]&&_0x248d50[_0x500896[_0x3b2741(0x1ac)]]?_0x500896[_0x3b2741(0x1ac)]:Object[_0x3b2741(0x1a5)](_0x248d50)[0x0],_0x5a0ea9=_0x356707?_0x248d50[_0x356707]?.[_0x3b2741(0x197)]||'':'',_0x5b03a4=resolveInitEnv(_0x5c0813);console[_0x3b2741(0x1c2)](CLI_BIN_NAME+_0x3b2741(0x187));if(existsSync(_0x33abd9)&&!_0x5c0813['yes']){const _0x5a0969=await promptYesNo(_0x3b2741(0x183)+_0x33abd9+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x5a0969){console['log'](_0x3b2741(0x1b0));return;}}const _0x2c7212=typeof _0x5c0813['appcode']===_0x3b2741(0x184)?_0x5c0813[_0x3b2741(0x197)][_0x3b2741(0x196)]():'';let _0x162480=_0x2c7212;!_0x162480&&(_0x162480=await promptInput(_0x3b2741(0x1af),_0x5a0ea9));if(!_0x162480[_0x3b2741(0x196)]())throw CliErrors[_0x3b2741(0x191)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x33abd9,{'apps':{[_0x356707||DEFAULT_APP_PROFILE_NAME]:{'appcode':_0x162480[_0x3b2741(0x196)](),'env':_0x5b03a4}},'defaultApp':_0x356707||DEFAULT_APP_PROFILE_NAME},_0x5c0813),console[_0x3b2741(0x1c2)](_0x3b2741(0x18e)+_0x33abd9),console[_0x3b2741(0x1c2)]('\x20\x20app:\x20\x20\x20\x20\x20'+(_0x356707||DEFAULT_APP_PROFILE_NAME)),console[_0x3b2741(0x1c2)](_0x3b2741(0x1ab)+_0x162480[_0x3b2741(0x196)]()),console[_0x3b2741(0x1c2)](_0x3b2741(0x18d)+_0x5b03a4);}async function writeInitConfig(_0x4c71ff,_0x2f4549,_0x51a4a9){const _0x127531=a22_0x368ec7;let _0x3026ca={};existsSync(_0x4c71ff)&&!_0x51a4a9[_0x127531(0x1be)]&&(_0x3026ca=readConfigFile(_0x4c71ff));for(const [_0x5208cd,_0x4d35de]of Object[_0x127531(0x1c4)](_0x2f4549)){_0x4d35de!==undefined&&(_0x3026ca[_0x5208cd]=_0x4d35de);}(_0x3026ca[_0x127531(0x197)]||_0x3026ca[_0x127531(0x1ba)])&&(delete _0x3026ca['appcode'],delete _0x3026ca[_0x127531(0x1ba)]),writeConfigFile(_0x4c71ff,_0x3026ca);}class AbortPrompt extends Error{constructor(){const _0xd34c51=a22_0x368ec7;super(_0xd34c51(0x1b1)),this['name']=_0xd34c51(0x1b3);}}function createSafeRl(){const _0x13c130=a22_0x368ec7,_0x27aa29=createInterface({'input':process[_0x13c130(0x185)],'output':process[_0x13c130(0x1bc)]});let _0x4b31ac;const _0x4a1a56=new Promise((_0x3ba34a,_0x21b972)=>{const _0x36d1dc=_0x13c130;_0x4b31ac=()=>{const _0x1ffa6f=a22_0xd289;_0x4b31ac&&(_0x27aa29['removeListener'](_0x1ffa6f(0x188),_0x4b31ac),_0x4b31ac=undefined);try{_0x27aa29[_0x1ffa6f(0x19d)]();}catch{}_0x21b972(new AbortPrompt());},_0x27aa29[_0x36d1dc(0x1a2)](_0x36d1dc(0x188),_0x4b31ac);}),_0x3c7cfc=()=>{const _0x5c3d70=_0x13c130;_0x4b31ac&&(_0x27aa29[_0x5c3d70(0x199)](_0x5c3d70(0x188),_0x4b31ac),_0x4b31ac=undefined);try{_0x27aa29[_0x5c3d70(0x19d)]();}catch{}};return{'rl':_0x27aa29,'abortPromise':_0x4a1a56,'disposeSuccess':_0x3c7cfc};}async function promptInput(_0x1e3173,_0x5d4f65){const {rl:_0x467554,abortPromise:_0x1ec747,disposeSuccess:_0x5cf85d}=createSafeRl(),_0xacd1b4=new Promise(_0x5e11a7=>{const _0x33f206=_0x5d4f65?'\x20\x20'+_0x1e3173+'\x20('+_0x5d4f65+'):\x20':'\x20\x20'+_0x1e3173+':\x20';_0x467554['question'](_0x33f206,_0x57a9e0=>{const _0x4e3eaf=a22_0xd289;_0x5cf85d(),_0x5e11a7(_0x57a9e0[_0x4e3eaf(0x196)]()||_0x5d4f65);});});return Promise['race']([_0xacd1b4,_0x1ec747]);}async function promptYesNo(_0x39b100,_0x163406){const _0x2b2781=a22_0x368ec7,{rl:_0x35c4ab,abortPromise:_0x46aaf4,disposeSuccess:_0x35f373}=createSafeRl(),_0x287aee=new Promise(_0xb39ae9=>{const _0x5dc368=a22_0xd289,_0x2923aa=_0x163406?'[Y/n]':_0x5dc368(0x19b);_0x35c4ab['question']('\x20\x20'+_0x39b100+'\x20'+_0x2923aa+':\x20',_0x3c929c=>{const _0x3c07f4=_0x5dc368;_0x35f373();const _0x205d6e=_0x3c929c[_0x3c07f4(0x196)]()[_0x3c07f4(0x1a1)]();if(_0x205d6e==='y'||_0x205d6e===_0x3c07f4(0x1be))_0xb39ae9(!![]);else{if(_0x205d6e==='n'||_0x205d6e==='no')_0xb39ae9(![]);else _0xb39ae9(_0x163406);}});});return Promise[_0x2b2781(0x1a7)]([_0x287aee,_0x46aaf4]);}function loadExisting(_0x45c01b){if(!existsSync(_0x45c01b))return null;return readConfigFile(_0x45c01b);}function resolveFilePath(_0x25aed4){const _0xe29e8c=a22_0x368ec7;return isAbsolute(_0x25aed4)?_0x25aed4:resolve(process[_0xe29e8c(0x1ae)](),_0x25aed4);}function a22_0xd289(_0x276e30,_0x24ec8e){_0x276e30=_0x276e30-0x183;const _0x2e4e59=a22_0x2e4e();let _0xd289bc=_0x2e4e59[_0x276e30];return _0xd289bc;}function readSourceFile(_0x35e9b9){const _0x1adf6a=a22_0x368ec7;try{const _0x5ca074=readFileSync(_0x35e9b9,{'encoding':_0x1adf6a(0x1bd)});return JSON[_0x1adf6a(0x1b5)](_0x5ca074);}catch(_0x15b157){throw CliErrors[_0x1adf6a(0x191)](_0x1adf6a(0x190)+_0x15b157[_0x1adf6a(0x1b7)]);}}function resolveInitEnv(_0x3d6130){const _0x2e80c2=a22_0x368ec7,_0x1ee65b=_0x3d6130[_0x2e80c2(0x1bb)];if(_0x1ee65b===undefined||_0x1ee65b==='')return DEFAULT_CONFIG_VALUES[_0x2e80c2(0x1bb)];if(!RUNTIME_ENV_VALUES[_0x2e80c2(0x1c8)](_0x1ee65b))throw CliErrors['validation'](_0x2e80c2(0x1b6)+_0x1ee65b+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x1ee65b;}
|
|
1
|
+
const a22_0x143e3e=a22_0x4078;(function(_0xd8defe,_0x140c94){const _0x5649f4=a22_0x4078,_0x397f79=_0xd8defe();while(!![]){try{const _0x417f65=-parseInt(_0x5649f4(0xc5))/0x1+-parseInt(_0x5649f4(0xb5))/0x2*(parseInt(_0x5649f4(0x8a))/0x3)+-parseInt(_0x5649f4(0x94))/0x4+-parseInt(_0x5649f4(0x90))/0x5+parseInt(_0x5649f4(0xc1))/0x6+-parseInt(_0x5649f4(0xaa))/0x7*(-parseInt(_0x5649f4(0xbf))/0x8)+parseInt(_0x5649f4(0xb7))/0x9*(parseInt(_0x5649f4(0x89))/0xa);if(_0x417f65===_0x140c94)break;else _0x397f79['push'](_0x397f79['shift']());}catch(_0x3077eb){_0x397f79['push'](_0x397f79['shift']());}}}(a22_0x25a6,0x8ff25));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';export const initCreateFlagDefs=[{'name':a22_0x143e3e(0xcb),'type':'string','description':a22_0x143e3e(0xc8)},{'name':a22_0x143e3e(0xa2),'type':'string','description':a22_0x143e3e(0x8c)+DEFAULT_CONFIG_VALUES[a22_0x143e3e(0xa2)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a22_0x143e3e(0xbc),'type':a22_0x143e3e(0xa4),'description':a22_0x143e3e(0xac),'default':![]},{'name':'yes','type':a22_0x143e3e(0xa4),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a22_0x143e3e(0xbe),'type':a22_0x143e3e(0x92),'description':a22_0x143e3e(0x9c),'required':!![]},{'name':'appcode','type':'string','description':'Override\x20imported\x20default\x20appcode'},{'name':a22_0x143e3e(0xa2),'type':a22_0x143e3e(0x92),'description':a22_0x143e3e(0xbd),'enum':[...RUNTIME_ENV_VALUES]},{'name':a22_0x143e3e(0xbc),'type':'boolean','description':'Write\x20to\x20global\x20(~/.lovrabet.json)\x20instead\x20of\x20project','default':![]},{'name':a22_0x143e3e(0xca),'type':a22_0x143e3e(0xa4),'description':a22_0x143e3e(0x9e),'default':![]}];export async function runInit(_0x5cd5e0){const _0x3e6a29=a22_0x143e3e,_0x5aff32=isNonInteractiveMode(_0x5cd5e0),_0x2f5ddb=_0x5cd5e0[_0x3e6a29(0xbc)]?_0x3e6a29(0xbc):'project',_0x12c93d=resolveWriteConfigPath(_0x2f5ddb);try{_0x5aff32?await runNonInteractive(_0x5cd5e0,_0x12c93d):await runInteractive(_0x5cd5e0,_0x12c93d);}catch(_0x599296){if(_0x599296 instanceof AbortPrompt)throw CliErrors[_0x3e6a29(0xab)]();throw _0x599296;}}function a22_0x25a6(){const _0x5bea4b=['file','24eeKnUN','User\x20aborted\x20prompt','6040158PSMvoR','includes','\x20already\x20exists.\x20Overwrite?','Aborted.','467948EOCXob','\x0aInitialized\x20','\x20\x20default:\x20','App\x20code\x20for\x20the\x20project','validation','yes','appcode','100gMEXyf','3VTqNed','log','Target\x20environment\x20(default\x20','toLowerCase','utf8','flagMissing','4725765zmxVCN','trim','string','join','1438536zixuXT','apiDir','entries','\x20init\x20—\x20Create\x20.lovrabet.json\x0a','\x20\x20config:\x20\x20','apps','Failed\x20to\x20parse\x20source\x20file:\x20','Usage:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','[Y/n]','Skip\x20confirmation\x20when\x20overwriting','race','Imported\x20from\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','env','name','boolean','message','Source\x20file\x20not\x20found:\x20','close','File\x20','):\x20','613606AMlZiB','cancelled','Write\x20to\x20global\x20(~/.lovrabet.json)\x20instead\x20of\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`.','Invalid\x20env\x20\x22','\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','SIGINT','\x20\x20env:\x20\x20\x20\x20\x20','project','removeListener','question','580874OvhYwS','parse','1244799rFAljH','\x20\x20appcode:\x20','stdin','App\x20code\x20cannot\x20be\x20empty.','defaultApp','global','Override\x20imported\x20default\x20env'];a22_0x25a6=function(){return _0x5bea4b;};return a22_0x25a6();}export async function runInitImport(_0xa80160){const _0x4baf3c=a22_0x143e3e,_0x5d2a81=_0xa80160[_0x4baf3c(0xbc)]?_0x4baf3c(0xbc):_0x4baf3c(0xb2),_0xd630a5=resolveWriteConfigPath(_0x5d2a81);await runFromImport(_0xa80160,_0xd630a5);}const RUNTIME_IRRELEVANT_KEYS=new Set([a22_0x143e3e(0x95)]);async function runFromImport(_0xb3438f,_0x30443b){const _0x5a2056=a22_0x143e3e,_0x20010f=resolveFilePath(_0xb3438f[_0x5a2056(0xbe)]);if(!existsSync(_0x20010f))throw CliErrors[_0x5a2056(0xc9)](_0x5a2056(0xa6)+_0x20010f);const _0x25f7fe=readSourceFile(_0x20010f),_0xa3a110=convertToRuntimeConfig(_0x25f7fe);_0xb3438f[_0x5a2056(0xcb)]&&(_0xa3a110[_0x5a2056(0xcb)]=String(_0xb3438f['appcode']));_0xb3438f[_0x5a2056(0xa2)]&&(_0xa3a110[_0x5a2056(0xa2)]=resolveInitEnv(_0xb3438f));if(!_0xa3a110[_0x5a2056(0xcb)])throw CliErrors[_0x5a2056(0xc9)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x5a2056(0xad));await writeInitConfig(_0x30443b,_0xa3a110,_0xb3438f),console[_0x5a2056(0x8b)](_0x5a2056(0xa0)+_0x20010f),console['log'](_0x5a2056(0x98)+_0x30443b),console[_0x5a2056(0x8b)]('\x20\x20appcode:\x20'+_0xa3a110[_0x5a2056(0xcb)]);if(_0xa3a110[_0x5a2056(0xbb)])console[_0x5a2056(0x8b)](_0x5a2056(0xc7)+_0xa3a110[_0x5a2056(0xbb)]);}function convertToRuntimeConfig(_0x1d2b74){const _0x168979=a22_0x143e3e;if(_0x1d2b74[_0x168979(0x99)]&&typeof _0x1d2b74[_0x168979(0x99)]==='object')throw CliErrors[_0x168979(0xc9)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x168979(0xa1));const _0x590ada={};for(const _0x5af518 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1d2b74[_0x5af518]!==undefined&&(_0x590ada[_0x5af518]=_0x1d2b74[_0x5af518]);}return!_0x590ada['riskLevel']&&(_0x590ada['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x590ada;}async function runNonInteractive(_0x3b98fa,_0x42bb66){const _0x464799=a22_0x143e3e,_0x1c679c=_0x3b98fa[_0x464799(0xcb)];if(!_0x1c679c)throw CliErrors[_0x464799(0x8f)](_0x464799(0xcb),_0x464799(0x9b)+CLI_BIN_NAME+_0x464799(0xaf));const _0x4bd1f3=resolveInitEnv(_0x3b98fa);await writeInitConfig(_0x42bb66,{'appcode':_0x1c679c,'env':_0x4bd1f3},_0x3b98fa),console[_0x464799(0x8b)]('Initialized\x20'+_0x42bb66),console['log'](_0x464799(0xb8)+_0x1c679c),console[_0x464799(0x8b)](_0x464799(0xb1)+_0x4bd1f3);}async function runInteractive(_0x25a016,_0x5ccbc5){const _0x14ea23=a22_0x143e3e,_0xe99c55=loadExisting(_0x5ccbc5),_0x27701f=typeof _0xe99c55?.[_0x14ea23(0xcb)]==='string'?_0xe99c55['appcode']:'',_0x53ffcc=resolveInitEnv(_0x25a016);console[_0x14ea23(0x8b)](CLI_BIN_NAME+_0x14ea23(0x97));if(existsSync(_0x5ccbc5)&&!_0x25a016[_0x14ea23(0xca)]){const _0xa28859=await promptYesNo(_0x14ea23(0xa8)+_0x5ccbc5+_0x14ea23(0xc3),![]);if(!_0xa28859){console[_0x14ea23(0x8b)](_0x14ea23(0xc4));return;}}const _0x636c00=typeof _0x25a016[_0x14ea23(0xcb)]===_0x14ea23(0x92)?_0x25a016[_0x14ea23(0xcb)][_0x14ea23(0x91)]():'';let _0x1bd67a=_0x636c00;!_0x1bd67a&&(_0x1bd67a=await promptInput('App\x20code',_0x27701f));if(!_0x1bd67a['trim']())throw CliErrors[_0x14ea23(0xc9)](_0x14ea23(0xba));await writeInitConfig(_0x5ccbc5,{'appcode':_0x1bd67a[_0x14ea23(0x91)](),'env':_0x53ffcc},_0x25a016),console['log'](_0x14ea23(0xc6)+_0x5ccbc5),console['log']('\x20\x20appcode:\x20'+_0x1bd67a['trim']()),console[_0x14ea23(0x8b)](_0x14ea23(0xb1)+_0x53ffcc);}async function writeInitConfig(_0xb83909,_0x8a5f41,_0x34437c){const _0x2ba79f=a22_0x143e3e;let _0x2ddb17={};existsSync(_0xb83909)&&!_0x34437c[_0x2ba79f(0xca)]&&(_0x2ddb17=readConfigFile(_0xb83909));for(const [_0x2e2e7e,_0x8fc682]of Object[_0x2ba79f(0x96)](_0x8a5f41)){_0x8fc682!==undefined&&(_0x2ddb17[_0x2e2e7e]=_0x8fc682);}if(_0x2ddb17['app'])delete _0x2ddb17['app'];writeConfigFile(_0xb83909,_0x2ddb17);}class AbortPrompt extends Error{constructor(){const _0x57b663=a22_0x143e3e;super(_0x57b663(0xc0)),this[_0x57b663(0xa3)]='AbortPrompt';}}function createSafeRl(){const _0x3c7dc1=a22_0x143e3e,_0x2f95de=createInterface({'input':process[_0x3c7dc1(0xb9)],'output':process['stdout']});let _0x957ccd;const _0x12fd7a=new Promise((_0x42c9d6,_0x43c59c)=>{const _0x1c2c63=_0x3c7dc1;_0x957ccd=()=>{const _0x1830a1=a22_0x4078;_0x957ccd&&(_0x2f95de[_0x1830a1(0xb3)](_0x1830a1(0xb0),_0x957ccd),_0x957ccd=undefined);try{_0x2f95de[_0x1830a1(0xa7)]();}catch{}_0x43c59c(new AbortPrompt());},_0x2f95de['once'](_0x1c2c63(0xb0),_0x957ccd);}),_0xada519=()=>{const _0x50d619=_0x3c7dc1;_0x957ccd&&(_0x2f95de[_0x50d619(0xb3)](_0x50d619(0xb0),_0x957ccd),_0x957ccd=undefined);try{_0x2f95de[_0x50d619(0xa7)]();}catch{}};return{'rl':_0x2f95de,'abortPromise':_0x12fd7a,'disposeSuccess':_0xada519};}async function promptInput(_0x2861ad,_0x249095){const _0x3d3318=a22_0x143e3e,{rl:_0x40026d,abortPromise:_0xc0fb5e,disposeSuccess:_0x44cd87}=createSafeRl(),_0x4261d8=new Promise(_0x580e1a=>{const _0xebb15e=a22_0x4078,_0x51a551=_0x249095?'\x20\x20'+_0x2861ad+'\x20('+_0x249095+_0xebb15e(0xa9):'\x20\x20'+_0x2861ad+':\x20';_0x40026d[_0xebb15e(0xb4)](_0x51a551,_0x1e401e=>{const _0x71cbf8=_0xebb15e;_0x44cd87(),_0x580e1a(_0x1e401e[_0x71cbf8(0x91)]()||_0x249095);});});return Promise[_0x3d3318(0x9f)]([_0x4261d8,_0xc0fb5e]);}async function promptYesNo(_0x22b335,_0x520e24){const _0x1f0250=a22_0x143e3e,{rl:_0x18409f,abortPromise:_0x1d41a1,disposeSuccess:_0x4cb545}=createSafeRl(),_0x5dd19b=new Promise(_0x234239=>{const _0xc05697=a22_0x4078,_0x476b7d=_0x520e24?_0xc05697(0x9d):'[y/N]';_0x18409f[_0xc05697(0xb4)]('\x20\x20'+_0x22b335+'\x20'+_0x476b7d+':\x20',_0x5cf632=>{const _0x5a73bd=_0xc05697;_0x4cb545();const _0x32bc52=_0x5cf632['trim']()[_0x5a73bd(0x8d)]();if(_0x32bc52==='y'||_0x32bc52===_0x5a73bd(0xca))_0x234239(!![]);else{if(_0x32bc52==='n'||_0x32bc52==='no')_0x234239(![]);else _0x234239(_0x520e24);}});});return Promise[_0x1f0250(0x9f)]([_0x5dd19b,_0x1d41a1]);}function loadExisting(_0x4a8203){if(!existsSync(_0x4a8203))return null;return readConfigFile(_0x4a8203);}function resolveFilePath(_0x54afc6){return isAbsolute(_0x54afc6)?_0x54afc6:resolve(process['cwd'](),_0x54afc6);}function a22_0x4078(_0x596be6,_0x551d28){_0x596be6=_0x596be6-0x89;const _0x25a6d2=a22_0x25a6();let _0x4078bb=_0x25a6d2[_0x596be6];return _0x4078bb;}function readSourceFile(_0x150583){const _0x4b7b17=a22_0x143e3e;try{const _0x29ffe3=readFileSync(_0x150583,{'encoding':_0x4b7b17(0x8e)});return JSON[_0x4b7b17(0xb6)](_0x29ffe3);}catch(_0x5de5e8){throw CliErrors[_0x4b7b17(0xc9)](_0x4b7b17(0x9a)+_0x5de5e8[_0x4b7b17(0xa5)]);}}function resolveInitEnv(_0x166b02){const _0x70fbbe=a22_0x143e3e,_0x2bd18f=_0x166b02[_0x70fbbe(0xa2)];if(_0x2bd18f===undefined||_0x2bd18f==='')return DEFAULT_CONFIG_VALUES[_0x70fbbe(0xa2)];if(!RUNTIME_ENV_VALUES[_0x70fbbe(0xc2)](_0x2bd18f))throw CliErrors[_0x70fbbe(0xc9)](_0x70fbbe(0xae)+_0x2bd18f+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x70fbbe(0x93)](',\x20'));return _0x2bd18f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a23_0x64a9(_0x629cda,_0x3f8b84){_0x629cda=_0x629cda-0xb6;const _0x2681b1=a23_0x2681();let _0x64a9a0=_0x2681b1[_0x629cda];return _0x64a9a0;}const a23_0x55c0c0=a23_0x64a9;(function(_0xfa68c4,_0x496fde){const _0x3fd67c=a23_0x64a9,_0x374b49=_0xfa68c4();while(!![]){try{const _0x24fd7d=-parseInt(_0x3fd67c(0xbd))/0x1*(-parseInt(_0x3fd67c(0xc7))/0x2)+parseInt(_0x3fd67c(0xc2))/0x3*(parseInt(_0x3fd67c(0xce))/0x4)+parseInt(_0x3fd67c(0xcf))/0x5+-parseInt(_0x3fd67c(0xcc))/0x6*(parseInt(_0x3fd67c(0xd9))/0x7)+-parseInt(_0x3fd67c(0xd7))/0x8+parseInt(_0x3fd67c(0xc8))/0x9*(parseInt(_0x3fd67c(0xba))/0xa)+-parseInt(_0x3fd67c(0xb8))/0xb*(parseInt(_0x3fd67c(0xd6))/0xc);if(_0x24fd7d===_0x496fde)break;else _0x374b49['push'](_0x374b49['shift']());}catch(_0x11c4c1){_0x374b49['push'](_0x374b49['shift']());}}}(a23_0x2681,0x95e86));import{logger}from'../../utils/logger.js';function a23_0x2681(){const _0x4bfa44=['readLogs','849327tgajGy','*\x20Lovrabet\x20Runtime\x20CLI\x20logs:\x0a','forEach','View\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','5182IazQpp','5123142BadrqE','\x20\x20\x20Time:\x20','message','clear','2730wApPeg','logs','12AGtAlE','4572895GODmOz','*\x20No\x20logs\x20found','details','success','length','timestamp','command','3921204oFHIQm','9037520ewGvwn','read','13643ehKwdf','stringify','en-US','22bNgZLC','clearLogs','10AEcMqK','level','\x20\x20\x20Details:\x20','367aAvgmm','warn','*\x20Logs\x20cleared','log'];a23_0x2681=function(){return _0x4bfa44;};return a23_0x2681();}function printLogs(_0x34fa36){const _0x264596=a23_0x64a9;if(_0x34fa36[_0x264596(0xd3)]===0x0){console['log'](_0x264596(0xd0));return;}console[_0x264596(0xc0)](_0x264596(0xc3)),_0x34fa36[_0x264596(0xc4)]((_0x4e3153,_0x980600)=>{const _0x29aa54=_0x264596,_0x161836=new Date(_0x4e3153[_0x29aa54(0xd4)])['toLocaleString'](_0x29aa54(0xb7)),_0x199977=_0x4e3153[_0x29aa54(0xbb)]===_0x29aa54(0xd2)?'√':_0x4e3153['level']==='error'?'×':_0x4e3153['level']===_0x29aa54(0xbe)?'!':'i';console['log'](_0x980600+0x1+'.\x20'+_0x199977+'\x20['+_0x4e3153[_0x29aa54(0xd5)]+']\x20'+_0x4e3153[_0x29aa54(0xca)]),console['log'](_0x29aa54(0xc9)+_0x161836),_0x4e3153['duration']&&console[_0x29aa54(0xc0)](_0x29aa54(0xc6)+_0x4e3153['duration']+'ms'),_0x4e3153['details']&&Object['keys'](_0x4e3153[_0x29aa54(0xd1)])[_0x29aa54(0xd3)]>0x0&&console['log'](_0x29aa54(0xbc)+JSON[_0x29aa54(0xb6)](_0x4e3153['details'],null,0x2)),console[_0x29aa54(0xc0)]('');});}export const logsDefinitions=[{'service':a23_0x55c0c0(0xcd),'command':'show','description':a23_0x55c0c0(0xc5),'risk':a23_0x55c0c0(0xd8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x99e796){const _0x525b09=a23_0x55c0c0;return printLogs(logger[_0x525b09(0xc1)]()),{'ok':!![]};}},{'service':'logs','command':a23_0x55c0c0(0xcb),'description':'Clear\x20command\x20history\x20logs','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2bb8c8){const _0x3de935=a23_0x55c0c0;return logger[_0x3de935(0xb9)](),console[_0x3de935(0xc0)](_0x3de935(0xbf)),{'ok':!![]};}}];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x4d9beb=a24_0xae0d;(function(_0x48f3d4,_0xd125e7){const _0x3f0dfb=a24_0xae0d,_0x5078ab=_0x48f3d4();while(!![]){try{const _0x60efb6=-parseInt(_0x3f0dfb(0x170))/0x1*(parseInt(_0x3f0dfb(0x16a))/0x2)+-parseInt(_0x3f0dfb(0x17b))/0x3+-parseInt(_0x3f0dfb(0x189))/0x4+parseInt(_0x3f0dfb(0x173))/0x5+-parseInt(_0x3f0dfb(0x188))/0x6*(parseInt(_0x3f0dfb(0x17a))/0x7)+-parseInt(_0x3f0dfb(0x171))/0x8+-parseInt(_0x3f0dfb(0x18b))/0x9*(-parseInt(_0x3f0dfb(0x176))/0xa);if(_0x60efb6===_0xd125e7)break;else _0x5078ab['push'](_0x5078ab['shift']());}catch(_0xe86751){_0x5078ab['push'](_0x5078ab['shift']());}}}(a24_0x4494,0x34921));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';function a24_0x4494(){const _0x181867=['Logs','App\x20Management','77RNUrgd','441279cksIlW','Authentication','from','push','Datasets','service','isSingleCommand','command','\x20\x20[write]','show','map','set','Configuration','7302ysXPVA','1116684KmxSDm','BFF\x20Scripts','2097549QGDugV','18YwwyOX','Schema','Initialize\x20project\x20config','Data\x20CRUD','get','list','21305yKXHqW','1675040ZOgsjV','read','619305hraXpG','SQL\x20Queries','description','40yMIodp','values'];a24_0x4494=function(){return _0x181867;};return a24_0x4494();}import{initDefinitions}from'../commands/init/index.js';import{appDefinitions}from'../commands/app/definitions.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';export const serviceRegistry=[];const serviceByName=new Map();function a24_0xae0d(_0x23f862,_0x176543){_0x23f862=_0x23f862-0x16a;const _0x449412=a24_0x4494();let _0xae0dda=_0x449412[_0x23f862];return _0xae0dda;}export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5bdee4){const _0x264d51=a24_0xae0d;for(const _0x10d7ec of _0x5bdee4){definitions[_0x264d51(0x186)](_0x10d7ec[_0x264d51(0x180)]+':'+_0x10d7ec[_0x264d51(0x182)],_0x10d7ec);let _0x59fd66=serviceGroups[_0x264d51(0x16e)](_0x10d7ec['service']);!_0x59fd66&&(_0x59fd66=[],serviceGroups[_0x264d51(0x186)](_0x10d7ec[_0x264d51(0x180)],_0x59fd66)),_0x59fd66[_0x264d51(0x17e)](_0x10d7ec);}}function registerService(_0x22e4d1,_0x5d94c8,_0x613c1c){const _0x1a541f=a24_0xae0d;registerDefinitions(_0x5d94c8);const _0x571f88=_0x530c36=>_0x530c36===_0x1a541f(0x172)?'':_0x530c36==='write'?_0x1a541f(0x183):'\x20\x20[high-risk-write]',_0x57a53d={'service':_0x5d94c8[0x0][_0x1a541f(0x180)],'label':_0x22e4d1,'commands':_0x5d94c8[_0x1a541f(0x185)](_0x307d20=>({'command':_0x307d20[_0x1a541f(0x182)],'description':_0x307d20[_0x1a541f(0x175)],'tag':_0x571f88(_0x307d20['risk'])})),'defaultCommand':_0x613c1c?.['defaultCommand']??(_0x613c1c?.[_0x1a541f(0x181)]?_0x5d94c8[0x0][_0x1a541f(0x182)]:undefined),'isSingleCommand':_0x613c1c?.[_0x1a541f(0x181)]};serviceRegistry['push'](_0x57a53d),serviceByName[_0x1a541f(0x186)](_0x57a53d[_0x1a541f(0x180)],_0x57a53d);}registerService(a24_0x4d9beb(0x17c),authDefinitions,{'defaultCommand':'login'}),registerService(a24_0x4d9beb(0x17f),datasetDefinitions),registerService(a24_0x4d9beb(0x16d),dataDefinitions),registerService(a24_0x4d9beb(0x174),sqlDefinitions),registerService(a24_0x4d9beb(0x18a),bffDefinitions),registerService(a24_0x4d9beb(0x179),appDefinitions,{'defaultCommand':a24_0x4d9beb(0x16f)}),registerService(a24_0x4d9beb(0x187),configDefinitions,{'defaultCommand':a24_0x4d9beb(0x16f)}),registerService(a24_0x4d9beb(0x16c),initDefinitions,{'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a24_0x4d9beb(0x16b),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a24_0x4d9beb(0x178),logsDefinitions,{'defaultCommand':a24_0x4d9beb(0x184)});export function findDefinition(_0x1f6d2e,_0x589419){return definitions['get'](_0x1f6d2e+':'+_0x589419);}export function isKnownService(_0xf99ef2){return serviceByName['has'](_0xf99ef2);}export function getServiceEntry(_0x31674d){const _0x34bf2f=a24_0x4d9beb;return serviceByName[_0x34bf2f(0x16e)](_0x31674d);}export function getAllDefinitions(){const _0x281d2e=a24_0x4d9beb;return Array[_0x281d2e(0x17d)](definitions[_0x281d2e(0x177)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4d01aa=a25_0x3aa7;function a25_0x1227(){const _0x374ca9=['25084PBhzGf','31011060qKieUh','read','46LJtdFQ','schema','7173pETECa','7286344FfNuuk','6850242aURQgt','1396sSdJeW','585AQuOci','6788322xMbySk','63414vxScKJ','Export\x20machine-readable\x20command\x20schema\x20(JSON)'];a25_0x1227=function(){return _0x374ca9;};return a25_0x1227();}(function(_0xe21e55,_0x1e5625){const _0x4c639e=a25_0x3aa7,_0x2135e7=_0xe21e55();while(!![]){try{const _0x2901d5=parseInt(_0x4c639e(0x1f1))/0x1*(parseInt(_0x4c639e(0x1e7))/0x2)+-parseInt(_0x4c639e(0x1e9))/0x3*(-parseInt(_0x4c639e(0x1ec))/0x4)+-parseInt(_0x4c639e(0x1ed))/0x5*(parseInt(_0x4c639e(0x1ef))/0x6)+-parseInt(_0x4c639e(0x1eb))/0x7+-parseInt(_0x4c639e(0x1ea))/0x8+-parseInt(_0x4c639e(0x1ee))/0x9+parseInt(_0x4c639e(0x1f2))/0xa;if(_0x2901d5===_0x1e5625)break;else _0x2135e7['push'](_0x2135e7['shift']());}catch(_0x6f0f9e){_0x2135e7['push'](_0x2135e7['shift']());}}}(a25_0x1227,0x9a5cb));function a25_0x3aa7(_0x4607e0,_0x2eb4f0){_0x4607e0=_0x4607e0-0x1e6;const _0x122776=a25_0x1227();let _0x3aa7e9=_0x122776[_0x4607e0];return _0x3aa7e9;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x4f3256){const _0x4f106e=await buildSchemaPayload();return{'ok':!![],'data':_0x4f106e};}export const schemaDefinition={'service':a25_0x4d01aa(0x1e8),'command':'export','description':a25_0x4d01aa(0x1f0),'risk':a25_0x4d01aa(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x5e9ff2=a26_0x3b0e;(function(_0x4aa909,_0x4c91d6){const _0x8129f9=a26_0x3b0e,_0x20f964=_0x4aa909();while(!![]){try{const _0x4e6914=-parseInt(_0x8129f9(0x1c4))/0x1*(-parseInt(_0x8129f9(0x1b8))/0x2)+-parseInt(_0x8129f9(0x1bc))/0x3*(parseInt(_0x8129f9(0x1b1))/0x4)+parseInt(_0x8129f9(0x1b5))/0x5+-parseInt(_0x8129f9(0x1c5))/0x6*(-parseInt(_0x8129f9(0x1b7))/0x7)+parseInt(_0x8129f9(0x1b4))/0x8+-parseInt(_0x8129f9(0x1b2))/0x9*(-parseInt(_0x8129f9(0x1c0))/0xa)+-parseInt(_0x8129f9(0x1bd))/0xb;if(_0x4e6914===_0x4c91d6)break;else _0x20f964['push'](_0x20f964['shift']());}catch(_0x527093){_0x20f964['push'](_0x20f964['shift']());}}}(a26_0x11ac,0xd8ead));import{getSqlQueryInfo}from'../../core/api-client.js';function a26_0x3b0e(_0x4ec71b,_0x3b0a39){_0x4ec71b=_0x4ec71b-0x1b0;const _0x11ac5d=a26_0x11ac();let _0x3b0efb=_0x11ac5d[_0x4ec71b];return _0x3b0efb;}import{getDbName}from'../../core/db-resolver.js';function a26_0x11ac(){const _0x376470=['50634JxQqvh','sqlCode','11384504mdmDhE','6322235lTPKQA','verbose','1718542ISacMU','1763778MVyfCZ','str','appCode','sqlName','21dSpAEP','43349185waBUQP','sqlContent','sqlcode','1810QIeGuk','bool','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','dbId','1wVfPhk','12ECMFfe','detail','142508agiHEO'];a26_0x11ac=function(){return _0x376470;};return a26_0x11ac();}import{SQLCODE_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a26_0x5e9ff2(0x1b0),'description':a26_0x5e9ff2(0x1c2),'risk':'read','flags':[SQLCODE_FLAG,VERBOSE_FLAG],async 'execute'(_0x5ce420){const _0x3a77bd=a26_0x5e9ff2,_0x1a7607=await getSqlQueryInfo(_0x5ce420[_0x3a77bd(0x1ba)],_0x5ce420[_0x3a77bd(0x1b9)](_0x3a77bd(0x1bf))),_0x32964b=_0x5ce420[_0x3a77bd(0x1c1)](_0x3a77bd(0x1b6));if(_0x32964b)return{'ok':!![],'data':_0x1a7607};const _0xfc871=_0x1a7607[_0x3a77bd(0x1c3)]?await getDbName(_0x5ce420[_0x3a77bd(0x1ba)],_0x1a7607['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x1a7607[_0x3a77bd(0x1b3)],'sqlName':_0x1a7607[_0x3a77bd(0x1bb)],'db':_0xfc871?_0xfc871+'\x20('+_0x1a7607['dbId']+')':_0x1a7607[_0x3a77bd(0x1c3)]??'','description':_0x1a7607['description']??'','sqlContent':_0x1a7607[_0x3a77bd(0x1be)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0xd4624c=a27_0x4f33;(function(_0x3585c6,_0xd36d0e){const _0x56540e=a27_0x4f33,_0x158190=_0x3585c6();while(!![]){try{const _0x2243fc=parseInt(_0x56540e(0x83))/0x1*(parseInt(_0x56540e(0x92))/0x2)+-parseInt(_0x56540e(0x8a))/0x3*(-parseInt(_0x56540e(0x96))/0x4)+-parseInt(_0x56540e(0x88))/0x5+-parseInt(_0x56540e(0x97))/0x6+parseInt(_0x56540e(0x87))/0x7+-parseInt(_0x56540e(0x91))/0x8+parseInt(_0x56540e(0x8c))/0x9;if(_0x2243fc===_0xd36d0e)break;else _0x158190['push'](_0x158190['shift']());}catch(_0x15b17a){_0x158190['push'](_0x158190['shift']());}}}(a27_0xe4f4,0x72528));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a27_0xe4f4(){const _0x583e5e=['Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','437116zmlFpq','2309574dKNGcj','101291ldbBwS','isArray','execError','sqlcode','5775252HmiECB','3610250xuJxkU','Returned\x20','3AowOfT','sql','7206021IOZIeU','str','exec','execResult','now','2088256nlXskn','2UUUWRW','\x20row(s)\x20in\x20','SQL\x20execution\x20failed'];a27_0xe4f4=function(){return _0x583e5e;};return a27_0xe4f4();}import{parseJsonParams}from'../../utils/params.js';function a27_0x4f33(_0x5b4bcf,_0x4d6127){_0x5b4bcf=_0x5b4bcf-0x83;const _0xe4f427=a27_0xe4f4();let _0x4f33ce=_0xe4f427[_0x5b4bcf];return _0x4f33ce;}export const sqlExec={'service':a27_0xd4624c(0x8b),'command':a27_0xd4624c(0x8e),'description':a27_0xd4624c(0x95),'risk':'read','flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x593d65){const _0x188b93=a27_0xd4624c,_0x406fcd=parseJsonParams(_0x593d65[_0x188b93(0x8d)]('params')),_0x150890=Date['now'](),_0xa7be72=await executeSdkSql(_0x593d65[_0x188b93(0x8d)](_0x188b93(0x86)),_0x406fcd),_0x1cfa5d=Date[_0x188b93(0x90)]()-_0x150890,_0x278f41=_0xa7be72?.[_0x188b93(0x8f)]??_0xa7be72,_0x1bc287=_0xa7be72?.['execSuccess']??!![];if(!_0x1bc287)return{'ok':![],'data':{'error':_0xa7be72?.[_0x188b93(0x85)]||'SQL\x20execution\x20failed','elapsed':_0x1cfa5d},'message':_0x188b93(0x94)};const _0x3e2a20=Array[_0x188b93(0x84)](_0x278f41)?_0x278f41:[];return{'ok':!![],'data':{'rows':_0x3e2a20,'rowCount':_0x3e2a20['length'],'elapsed':_0x1cfa5d},'message':_0x188b93(0x89)+_0x3e2a20['length']+_0x188b93(0x93)+_0x1cfa5d+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b7864,_0x1779c5){const _0x5b4a0d=a28_0x70e8,_0x48cbb0=_0x2b7864();while(!![]){try{const _0x158d5f=parseInt(_0x5b4a0d(0x14b))/0x1+parseInt(_0x5b4a0d(0x145))/0x2*(parseInt(_0x5b4a0d(0x143))/0x3)+parseInt(_0x5b4a0d(0x142))/0x4*(-parseInt(_0x5b4a0d(0x146))/0x5)+-parseInt(_0x5b4a0d(0x148))/0x6+parseInt(_0x5b4a0d(0x141))/0x7+-parseInt(_0x5b4a0d(0x144))/0x8*(parseInt(_0x5b4a0d(0x149))/0x9)+parseInt(_0x5b4a0d(0x14a))/0xa*(parseInt(_0x5b4a0d(0x147))/0xb);if(_0x158d5f===_0x1779c5)break;else _0x48cbb0['push'](_0x48cbb0['shift']());}catch(_0x18fe7c){_0x48cbb0['push'](_0x48cbb0['shift']());}}}(a28_0x2cf5,0x65195));import{sqlDetail}from'../../commands/sql/detail.js';function a28_0x2cf5(){const _0x248739=['29536tGbKsU','2606jHJKEi','470mZqxPT','11ORSkaO','2807208gtTjdZ','27jVueEH','2981870pBFfYr','197491DRJNoz','3310412nuPUsU','11920TfcNTo','471FBDBhu'];a28_0x2cf5=function(){return _0x248739;};return a28_0x2cf5();}import{sqlExec}from'../../commands/sql/exec.js';function a28_0x70e8(_0x32b662,_0x2e6529){_0x32b662=_0x32b662-0x141;const _0x2cf57c=a28_0x2cf5();let _0x70e80a=_0x2cf57c[_0x32b662];return _0x70e80a;}export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x24cde2=a29_0x514c;(function(_0x1cd788,_0x21d467){const _0x4adac3=a29_0x514c,_0x4510f7=_0x1cd788();while(!![]){try{const _0x460858=parseInt(_0x4adac3(0x1e8))/0x1+parseInt(_0x4adac3(0x1ee))/0x2*(-parseInt(_0x4adac3(0x1d4))/0x3)+-parseInt(_0x4adac3(0x1ed))/0x4*(parseInt(_0x4adac3(0x1e6))/0x5)+-parseInt(_0x4adac3(0x1e4))/0x6+-parseInt(_0x4adac3(0x1e2))/0x7+parseInt(_0x4adac3(0x1d6))/0x8*(-parseInt(_0x4adac3(0x1e9))/0x9)+parseInt(_0x4adac3(0x1dd))/0xa;if(_0x460858===_0x21d467)break;else _0x4510f7['push'](_0x4510f7['shift']());}catch(_0x578a3f){_0x4510f7['push'](_0x4510f7['shift']());}}}(a29_0x3e47,0xa8880));function a29_0x514c(_0x4fa55d,_0x347ae3){_0x4fa55d=_0x4fa55d-0x1d3;const _0x3e47da=a29_0x3e47();let _0x514cd6=_0x3e47da[_0x4fa55d];return _0x514cd6;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':'Target\x20environment','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a29_0x24cde2(0x1d9)],'importable':!![]},'format':{'description':a29_0x24cde2(0x1eb),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a29_0x24cde2(0x1e3)],'importable':!![]},'pageSize':{'description':a29_0x24cde2(0x1e0),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a29_0x24cde2(0x1e5),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':'Override\x20user\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a29_0x24cde2(0x1da),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':'Access\x20key\x20(client-ak\x20auth)','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a29_0x24cde2(0x1d7),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a29_0x24cde2(0x1e1)],'importable':!![]},'locale':{'description':a29_0x24cde2(0x1de),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a29_0x24cde2(0x1d5)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object['entries'](CONFIG_FIELD_SCHEMAS)[a29_0x24cde2(0x1d8)](([,_0x1c8993])=>_0x1c8993[a29_0x24cde2(0x1dc)])[a29_0x24cde2(0x1d3)](([_0x1049d9])=>_0x1049d9));export const CONFIG_ENUM_VALUES=Object[a29_0x24cde2(0x1df)](Object[a29_0x24cde2(0x1ef)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x5aff86])=>_0x5aff86['enumValues'])[a29_0x24cde2(0x1d3)](([_0xda491e,_0x2455ac])=>[_0xda491e,[..._0x2455ac[a29_0x24cde2(0x1ec)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a29_0x24cde2(0x1ef)](CONFIG_FIELD_SCHEMAS)[a29_0x24cde2(0x1d8)](([,_0x5d15ab])=>_0x5d15ab['importable'])['map'](([_0x3d3fb0])=>_0x3d3fb0);export function getConfigFieldSchema(_0x2701e2){return CONFIG_FIELD_SCHEMAS[_0x2701e2];}export function getConfigEnumValues(_0x506687){const _0x5e6bc0=a29_0x24cde2;return getConfigFieldSchema(_0x506687)?.[_0x5e6bc0(0x1ec)];}export function getConfigDefaultValue(_0xdb348f){return getConfigFieldSchema(_0xdb348f)?.['defaultValue'];}export function isTopLevelConfigKey(_0x50ea61){const _0x122549=a29_0x24cde2;return TOP_LEVEL_CONFIG_KEYS[_0x122549(0x1db)](_0x50ea61);}export function isLegacyCompatConfigKey(_0x2bb2bb){const _0x508348=a29_0x24cde2;return getConfigFieldSchema(_0x2bb2bb)?.[_0x508348(0x1ea)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x40fb01){const _0x45b25d=a29_0x24cde2;return[..._0x40fb01][_0x45b25d(0x1e7)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key.\x20Top-level:\x20'+getTopLevelConfigKeySummary();}export function buildAppProfileListFields(_0x31dad4){return{'env':_0x31dad4,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}function a29_0x3e47(){const _0x32c9bb=['254218KPbihg','27yOyzGP','legacyCompatOnly','Default\x20output\x20format','enumValues','22448YgJGgm','1429678GEymmM','entries','map','3HBbVEV','locale','2257040YCXVEr','Risk\x20level','filter','env','Override\x20runtime\x20domain','has','cliSettableTopLevel','48309210MLEAKj','Locale','fromEntries','Default\x20page\x20size','riskLevel','3433948oChvLr','format','8232996fOHhAS','Override\x20API\x20domain','865BTuMtg','join'];a29_0x3e47=function(){return _0x32c9bb;};return a29_0x3e47();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a30_0x1fb8(_0x57943,_0x4c483e){_0x57943=_0x57943-0x154;const _0x1cdc6f=a30_0x1cdc();let _0x1fb845=_0x1cdc6f[_0x57943];return _0x1fb845;}function a30_0x1cdc(){const _0x579b0b=['4810400GzIhbg','1161879EEGFuV','33NZIFvI','68134goiaZV','12JpayLJ','6138710jcNDCw','1573490xClzJS','7489692qwXbbu','8MXQLxG','client-ak','492hslNej','301bKlCfR'];a30_0x1cdc=function(){return _0x579b0b;};return a30_0x1cdc();}const a30_0x176f0d=a30_0x1fb8;(function(_0x25d72e,_0x5b4855){const _0x3e5af1=a30_0x1fb8,_0x5cda93=_0x25d72e();while(!![]){try{const _0x83438e=parseInt(_0x3e5af1(0x15a))/0x1*(parseInt(_0x3e5af1(0x15f))/0x2)+-parseInt(_0x3e5af1(0x158))/0x3*(-parseInt(_0x3e5af1(0x15b))/0x4)+-parseInt(_0x3e5af1(0x15d))/0x5+-parseInt(_0x3e5af1(0x155))/0x6*(-parseInt(_0x3e5af1(0x156))/0x7)+parseInt(_0x3e5af1(0x157))/0x8+parseInt(_0x3e5af1(0x15e))/0x9+parseInt(_0x3e5af1(0x15c))/0xa*(-parseInt(_0x3e5af1(0x159))/0xb);if(_0x83438e===_0x5b4855)break;else _0x5cda93['push'](_0x5cda93['shift']());}catch(_0xd85217){_0x5cda93['push'](_0x5cda93['shift']());}}}(a30_0x1cdc,0xae96e));export const AUTH_MODE={'ClientAk':a30_0x176f0d(0x154)};export function isAuthMode(_0x30a2b6){return _0x30a2b6===AUTH_MODE['ClientAk'];}
|