@lovrabet/lovrabet-cli 2.1.6-beta.4 → 2.1.6-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc0f1be,_0x152b12){const _0x5c4eed=a15_0x2335,_0x4d7ccf=_0xc0f1be();while(!![]){try{const _0x34435f=parseInt(_0x5c4eed(0x176))/0x1+parseInt(_0x5c4eed(0x17f))/0x2*(parseInt(_0x5c4eed(0x179))/0x3)+-parseInt(_0x5c4eed(0x171))/0x4*(parseInt(_0x5c4eed(0x17a))/0x5)+-parseInt(_0x5c4eed(0x16c))/0x6+parseInt(_0x5c4eed(0x17b))/0x7*(-parseInt(_0x5c4eed(0x16a))/0x8)+-parseInt(_0x5c4eed(0x174))/0x9*(parseInt(_0x5c4eed(0x17e))/0xa)+parseInt(_0x5c4eed(0x16b))/0xb*(parseInt(_0x5c4eed(0x172))/0xc);if(_0x34435f===_0x152b12)break;else _0x4d7ccf['push'](_0x4d7ccf['shift']());}catch(_0x45fbe4){_0x4d7ccf['push'](_0x4d7ccf['shift']());}}}(a15_0x24b6,0x98206));import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';function a15_0x2335(_0x325c37,_0x3afeb7){_0x325c37=_0x325c37-0x166;const _0x24b632=a15_0x24b6();let _0x233501=_0x24b632[_0x325c37];return _0x233501;}export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x20dcf1){const _0x100401=a15_0x2335,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x140fea}=_0x20dcf1;if(explicitGlobal&&explicitProject)throw CliErrors[_0x100401(0x178)](_0x100401(0x17c),_0x100401(0x168));if(explicitGlobal)return _0x100401(0x166);if(explicitProject)return _0x100401(0x167);switch(_0x140fea){case _0x100401(0x170):return _0x100401(0x166);case _0x100401(0x16d):return _0x20dcf1[_0x100401(0x16f)]??isInProject()?_0x100401(0x167):'global';case _0x100401(0x169):if(!(_0x20dcf1[_0x100401(0x16f)]??isInProject()))throw CliErrors['validation'](_0x100401(0x173)+PRODUCT_CONFIG[_0x100401(0x175)]+'\x20found).',_0x100401(0x177)+PRODUCT_CONFIG[_0x100401(0x175)]+_0x100401(0x17d)+CLI_BIN_NAME+_0x100401(0x16e));return _0x100401(0x167);}}export function toScopeFlags(_0x5e8553){const _0x5e2f46=a15_0x2335;return{'global':_0x5e8553===_0x5e2f46(0x166)};}function a15_0x24b6(){const _0x4888a8=['14ZUQjdf','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',',\x20or\x20run\x20`','26450kkBSYw','88MogQUW','global','project','Use\x20only\x20one\x20config\x20scope\x20flag.','project-or-global-explicit','4279496JVeoXy','48015rVVrxW','6823848LcfnJK','project-default','\x20init`\x20first.','inProject','global-default','20116KOkKgO','7956ajTjLQ','Not\x20inside\x20a\x20project\x20(no\x20','3267egyZBa','newConfigFileName','392543jeOchx','Add\x20--global\x20to\x20write\x20to\x20~/','validation','73788IdeKje','575pllrdh'];a15_0x24b6=function(){return _0x4888a8;};return a15_0x24b6();}export function formatScopeLabel(_0x15098d){const _0x1fd1ca=a15_0x2335;return _0x15098d===_0x1fd1ca(0x166)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa2d17c,_0x5525ba){const _0x49c6d1=a16_0x2426,_0x6f17f1=_0xa2d17c();while(!![]){try{const _0x24c069=parseInt(_0x49c6d1(0x1ed))/0x1*(parseInt(_0x49c6d1(0x1eb))/0x2)+parseInt(_0x49c6d1(0x1e5))/0x3*(-parseInt(_0x49c6d1(0x1f6))/0x4)+parseInt(_0x49c6d1(0x1f1))/0x5+parseInt(_0x49c6d1(0x1fd))/0x6*(parseInt(_0x49c6d1(0x1f4))/0x7)+-parseInt(_0x49c6d1(0x200))/0x8+-parseInt(_0x49c6d1(0x1ec))/0x9*(parseInt(_0x49c6d1(0x1fa))/0xa)+parseInt(_0x49c6d1(0x1fb))/0xb;if(_0x24c069===_0x5525ba)break;else _0x6f17f1['push'](_0x6f17f1['shift']());}catch(_0x112103){_0x6f17f1['push'](_0x6f17f1['shift']());}}}(a16_0x4883,0x44ab8));import{CliErrors}from'../../errors.js';function a16_0x2426(_0x12427a,_0x49196b){_0x12427a=_0x12427a-0x1e5;const _0x48832a=a16_0x4883();let _0x24260a=_0x48832a[_0x12427a];return _0x24260a;}function isSet(_0x335beb,_0x3a1129){const _0x35164d=_0x335beb['flag'](_0x3a1129);return _0x35164d!==undefined&&_0x35164d!==''&&_0x35164d!==![]&&_0x35164d!==0x0;}function fmtNames(_0x14878e){const _0x3bc5d2=a16_0x2426;return _0x14878e[_0x3bc5d2(0x1fe)](_0x38fa8d=>'--'+_0x38fa8d)[_0x3bc5d2(0x1f9)](',\x20');}export function requireOneOf(_0x57041d,_0x46b266,_0x3fad83){const _0x3da84e=a16_0x2426,_0x168b37=_0x46b266[_0x3da84e(0x1f0)](_0x255ee8=>isSet(_0x57041d,_0x255ee8));if(_0x168b37[_0x3da84e(0x1ef)]!==0x1)throw CliErrors[_0x3da84e(0x1e7)](_0x168b37[_0x3da84e(0x1ef)]===0x0?_0x3da84e(0x1e9)+fmtNames(_0x46b266)+_0x3da84e(0x1fc)+_0x3fad83+'`.':_0x3da84e(0x1f3)+fmtNames(_0x46b266)+_0x3da84e(0x1ff)+fmtNames(_0x168b37)+'.',_0x168b37[_0x3da84e(0x1ef)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x46b266):_0x3da84e(0x1ee));}function a16_0x4883(){const _0x3b48b9=['\x20is\x20required\x20for\x20`','109710vgrjZy','map','\x20is\x20allowed,\x20found:\x20','3121128Zszqmf','At\x20least\x20one\x20of\x20','4065dPTsHe','some','validation','test','Exactly\x20one\x20of\x20',':\x20expected\x20','94LbwNrX','1077426KRiLvP','9169remrTv','Remove\x20all\x20but\x20one.','length','filter','1793305cSHjcY','str','Only\x20one\x20of\x20','63bxkEPX','Flags\x20','592XOfHrK','\x20are\x20mutually\x20exclusive\x20for\x20`','Provide\x20one\x20of:\x20','join','10UPfJOQ','412478vvrCLw'];a16_0x4883=function(){return _0x3b48b9;};return a16_0x4883();}export function requireAnyOf(_0x20c86d,_0x441d9d,_0x5f2f54){const _0x3ca632=a16_0x2426;if(!_0x441d9d[_0x3ca632(0x1e6)](_0x184e13=>isSet(_0x20c86d,_0x184e13)))throw CliErrors[_0x3ca632(0x1e7)](_0x3ca632(0x201)+fmtNames(_0x441d9d)+'\x20is\x20required\x20for\x20`'+_0x5f2f54+'`.',_0x3ca632(0x1f8)+fmtNames(_0x441d9d));}export function mutuallyExclusive(_0x28dab0,_0x1e7bd8,_0x4a1c82){const _0x45af8b=a16_0x2426,_0x1dc9a6=_0x1e7bd8[_0x45af8b(0x1f0)](_0x537688=>isSet(_0x28dab0,_0x537688));if(_0x1dc9a6[_0x45af8b(0x1ef)]>0x1)throw CliErrors[_0x45af8b(0x1e7)](_0x45af8b(0x1f5)+fmtNames(_0x1dc9a6)+_0x45af8b(0x1f7)+_0x4a1c82+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x1e7bd8));}export function validatePattern(_0x4792e0,_0x4aa80a,_0x34c3e3,_0x3c2fd0){const _0x209a34=a16_0x2426,_0x27a904=_0x4792e0[_0x209a34(0x1f2)](_0x4aa80a);if(_0x27a904&&!_0x34c3e3[_0x209a34(0x1e8)](_0x27a904))throw CliErrors['validation']('Invalid\x20--'+_0x4aa80a+_0x209a34(0x1ea)+_0x3c2fd0+',\x20got\x20\x22'+_0x27a904+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x768042=a17_0x3f75;(function(_0x4353e6,_0x28526a){const _0x55ef0e=a17_0x3f75,_0x58ec36=_0x4353e6();while(!![]){try{const _0x36212b=-parseInt(_0x55ef0e(0x96))/0x1+-parseInt(_0x55ef0e(0xa0))/0x2+-parseInt(_0x55ef0e(0x9d))/0x3*(parseInt(_0x55ef0e(0x98))/0x4)+parseInt(_0x55ef0e(0x9f))/0x5+parseInt(_0x55ef0e(0x9e))/0x6+-parseInt(_0x55ef0e(0xa1))/0x7+parseInt(_0x55ef0e(0x9b))/0x8*(parseInt(_0x55ef0e(0xa6))/0x9);if(_0x36212b===_0x28526a)break;else _0x58ec36['push'](_0x58ec36['shift']());}catch(_0x3467b7){_0x58ec36['push'](_0x58ec36['shift']());}}}(a17_0x50bb,0xdd1b1));export const CODE_FLAG={'name':'code','type':a17_0x768042(0x9c),'required':!![],'description':a17_0x768042(0xa2),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a17_0x768042(0x94)}};export const SQLCODE_FLAG={'name':'sqlcode','type':'string','required':!![],'description':a17_0x768042(0xa5),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a17_0x768042(0x92)}};export const VERBOSE_FLAG={'name':a17_0x768042(0x95),'type':a17_0x768042(0x99),'description':a17_0x768042(0xa4)};export const PARAMS_FLAG={'name':'params','type':a17_0x768042(0x9c),'description':a17_0x768042(0x9a)};function a17_0x3f75(_0xb0c44f,_0x3e1489){_0xb0c44f=_0xb0c44f-0x92;const _0x50bb5d=a17_0x50bb();let _0x3f7502=_0x50bb5d[_0xb0c44f];return _0x3f7502;}export const NAME_FLAG={'name':'name','type':a17_0x768042(0x9c),'description':a17_0x768042(0x97)};function a17_0x50bb(){const _0x38defd=['a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','verbose','1733751ssHDSQ','Resource\x20name\x20for\x20lookup','3028NrASIV','boolean','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','16312oDlmIU','string','2931xbrtIp','6453912AbxJkU','353755UiRWGK','2154684lSzuJC','11199888govZLQ','Dataset\x20code\x20(32-char\x20hex\x20UUID)','number','Return\x20full\x20raw\x20response\x20object','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','21672DucUFi','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','Resource\x20ID'];a17_0x50bb=function(){return _0x38defd;};return a17_0x50bb();}export const ID_FLAG={'name':'id','type':a17_0x768042(0xa3),'required':!![],'description':a17_0x768042(0x93)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a18_0x97340d=a18_0xda9e;(function(_0x17aba0,_0x21254b){const _0x321bdd=a18_0xda9e,_0x1c28c1=_0x17aba0();while(!![]){try{const _0x445b40=-parseInt(_0x321bdd(0x210))/0x1+parseInt(_0x321bdd(0x225))/0x2*(-parseInt(_0x321bdd(0x1e8))/0x3)+-parseInt(_0x321bdd(0x200))/0x4+parseInt(_0x321bdd(0x219))/0x5+-parseInt(_0x321bdd(0x1f3))/0x6*(-parseInt(_0x321bdd(0x218))/0x7)+-parseInt(_0x321bdd(0x20a))/0x8+parseInt(_0x321bdd(0x1ee))/0x9*(parseInt(_0x321bdd(0x206))/0xa);if(_0x445b40===_0x21254b)break;else _0x1c28c1['push'](_0x1c28c1['shift']());}catch(_0x2671d8){_0x1c28c1['push'](_0x1c28c1['shift']());}}}(a18_0x3cd6,0x779bf));import{CliErrors}from'../../errors.js';function a18_0xda9e(_0x38daf5,_0x40feea){_0x38daf5=_0x38daf5-0x1e6;const _0x3cd628=a18_0x3cd6();let _0xda9e75=_0x3cd628[_0x38daf5];return _0xda9e75;}import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x97340d(0x1f2),'type':a18_0x97340d(0x1e7),'description':a18_0x97340d(0x216),'default':![]};function parseAliasAppcodeSetKey(_0x5da583){const _0x3de57e=a18_0x97340d,_0x610367=_0x5da583['split']('.');if(_0x610367[_0x3de57e(0x208)]!==0x3||_0x610367[0x0]!==_0x3de57e(0x212)||_0x610367[0x2]!==_0x3de57e(0x1f4))return undefined;const _0x3c4c6d=_0x610367[0x1]?.[_0x3de57e(0x1f1)]();return _0x3c4c6d?_0x3c4c6d:undefined;}function parseAliasDeleteKey(_0x1c4d95){const _0x1627ea=a18_0x97340d,_0x29c83f=_0x1c4d95[_0x1627ea(0x1f9)]('.');if(_0x29c83f['length']===0x2&&_0x29c83f[0x0]===_0x1627ea(0x212)){const _0xd5a03c=_0x29c83f[0x1]?.[_0x1627ea(0x1f1)]();return _0xd5a03c?{'alias':_0xd5a03c}:undefined;}if(_0x29c83f['length']===0x3&&_0x29c83f[0x0]===_0x1627ea(0x212)&&_0x29c83f[0x2]==='appcode'){const _0x1927f1=_0x29c83f[0x1]?.[_0x1627ea(0x1f1)]();return _0x1927f1?{'alias':_0x1927f1,'field':_0x1627ea(0x1f4)}:undefined;}return undefined;}function a18_0x3cd6(){const _0x4f5b44=['bool','Deleted\x20`','stringify','Missing\x20key\x20argument.','Set\x20`','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','3851848lQxSww','\x20(global)','\x20config\x20delete\x20<key>\x20[--global]','Set\x20a\x20config\x20value','pageSize\x20must\x20be\x20a\x20positive\x20number','raw','10feIHCz','riskLevel','length','join','6906120kfvBwt','Usage:\x20','get','List\x20current\x20config','set','\x22\x20is\x20not\x20settable.','796649gmqdWY','write','apps','Settable\x20keys:\x20','Config\x20files:\x0a','validation','Write\x20to\x20global\x20config','format','679YraLNI','3566865tOaeUo','delete','object','keys','key','alias','log','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','read','pageSize','args','value','987074DntmLD','\x20config\x20set\x20<key>\x20<value>\x20[--global]','Get\x20a\x20config\x20value','boolean','3huqSAn','\x22.\x20Allowed:\x20','Invalid\x20value\x20for\x20\x22','isArray',';\x20apps.<alias>.appcode','(none)','19431513aSvTHU','Top-level\x20key\x20\x22','includes','trim','global','45396EXfTpE','appcode','config','Key\x20not\x20found:\x20','field','Delete\x20a\x20config\x20value','split'];a18_0x3cd6=function(){return _0x4f5b44;};return a18_0x3cd6();}function setLocalAppAlias(_0xfeb6b5,_0x4b044f,_0x449ed2){const _0x1f119b=a18_0x97340d,_0x811fb4=_0xfeb6b5['apps']&&typeof _0xfeb6b5[_0x1f119b(0x212)]==='object'&&!Array['isArray'](_0xfeb6b5['apps'])?_0xfeb6b5[_0x1f119b(0x212)]:{},_0xbafa86=_0x811fb4[_0x4b044f]&&typeof _0x811fb4[_0x4b044f]==='object'&&!Array[_0x1f119b(0x1eb)](_0x811fb4[_0x4b044f])?_0x811fb4[_0x4b044f]:{};_0xbafa86['appcode']=_0x449ed2,_0x811fb4[_0x4b044f]=_0xbafa86,_0xfeb6b5[_0x1f119b(0x212)]=_0x811fb4;}function deleteLocalAppAlias(_0x258350,_0x3cc506){const _0x4dc04a=a18_0x97340d;if(!_0x258350[_0x4dc04a(0x212)]||typeof _0x258350[_0x4dc04a(0x212)]!=='object'||Array[_0x4dc04a(0x1eb)](_0x258350['apps']))return![];const _0x4ab834=_0x258350[_0x4dc04a(0x212)],_0x373c4f=_0x4ab834[_0x3cc506[_0x4dc04a(0x21e)]];if(!_0x373c4f||typeof _0x373c4f!==_0x4dc04a(0x21b)||Array[_0x4dc04a(0x1eb)](_0x373c4f))return![];if(!_0x3cc506[_0x4dc04a(0x1f7)])return delete _0x4ab834[_0x3cc506[_0x4dc04a(0x21e)]],!![];if(!(_0x3cc506[_0x4dc04a(0x1f7)]in _0x373c4f))return![];return delete _0x373c4f[_0x3cc506[_0x4dc04a(0x1f7)]],Object[_0x4dc04a(0x21c)](_0x373c4f)[_0x4dc04a(0x208)]===0x0&&delete _0x4ab834[_0x3cc506['alias']],!![];}const listDef={'service':a18_0x97340d(0x1f5),'command':'list','description':a18_0x97340d(0x20d),'risk':a18_0x97340d(0x221),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x52f28f){const _0x58efa3=a18_0x97340d,{buildConfigFromFlags:_0x2fe011}=await import('../../context.js'),_0x473e64=_0x2fe011({}),_0x1c0052=getProjectConfigPath(),_0x2a7f3b=resolveWriteConfigPath(_0x58efa3(0x1f2));if(_0x52f28f[_0x58efa3(0x217)]==='pretty')return{'ok':!![],'message':_0x58efa3(0x220)+(JSON[_0x58efa3(0x1fc)](_0x473e64[_0x58efa3(0x205)],null,0x2)+'\x0a\x0a')+_0x58efa3(0x214)+('\x20\x20project:\x20'+(_0x1c0052??_0x58efa3(0x1ed))+'\x0a')+('\x20\x20global:\x20\x20'+_0x2a7f3b)};return{'ok':!![],'data':{'effective':_0x473e64[_0x58efa3(0x205)],'configFiles':{'project':_0x1c0052??null,'global':_0x2a7f3b}}};}},getDef={'service':a18_0x97340d(0x1f5),'command':a18_0x97340d(0x20c),'description':a18_0x97340d(0x1e6),'risk':a18_0x97340d(0x221),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x97340d(0x21d),'description':a18_0x97340d(0x1ff),'required':!![]}],'flags':[],async 'execute'(_0x4add76){const _0x22016c=a18_0x97340d,_0x27cbe7=_0x4add76[_0x22016c(0x223)][0x0];if(!_0x27cbe7)throw CliErrors['validation']('Missing\x20key\x20argument.',_0x22016c(0x20b)+CLI_BIN_NAME+'\x20config\x20get\x20<key>');const {buildConfigFromFlags:_0x1158df}=await import('../../context.js'),{raw:_0x6fc41a}=_0x1158df({});if(_0x27cbe7[_0x22016c(0x1f0)]('.')){const _0x1bb384=_0x27cbe7[_0x22016c(0x1f9)]('.');let _0x4e11ff=_0x6fc41a;for(const _0x5417c4 of _0x1bb384){if(_0x4e11ff==null||typeof _0x4e11ff!==_0x22016c(0x21b))throw CliErrors['validation'](_0x22016c(0x1f6)+_0x27cbe7);_0x4e11ff=_0x4e11ff[_0x5417c4];}if(_0x4e11ff===undefined)throw CliErrors[_0x22016c(0x215)](_0x22016c(0x1f6)+_0x27cbe7);return console['log'](typeof _0x4e11ff===_0x22016c(0x21b)?JSON[_0x22016c(0x1fc)](_0x4e11ff,null,0x2):String(_0x4e11ff)),{'ok':!![]};}const _0x58ea3a=_0x6fc41a[_0x27cbe7];if(_0x58ea3a===undefined)throw CliErrors[_0x22016c(0x215)](_0x22016c(0x1f6)+_0x27cbe7);return console[_0x22016c(0x21f)](typeof _0x58ea3a===_0x22016c(0x21b)?JSON['stringify'](_0x58ea3a,null,0x2):String(_0x58ea3a)),{'ok':!![]};}},setDef={'service':a18_0x97340d(0x1f5),'command':a18_0x97340d(0x20e),'description':a18_0x97340d(0x203),'risk':a18_0x97340d(0x211),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x97340d(0x21d),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x97340d(0x224),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5466c7){const _0xa76842=a18_0x97340d,_0x30f147=_0x5466c7['args'][0x0],_0x196dc7=_0x5466c7[_0xa76842(0x223)][0x1];if(!_0x30f147||_0x196dc7===undefined)throw CliErrors[_0xa76842(0x215)]('Missing\x20key\x20or\x20value.',_0xa76842(0x20b)+CLI_BIN_NAME+_0xa76842(0x226));if(ENUM_KEYS[_0x30f147]&&!ENUM_KEYS[_0x30f147][_0xa76842(0x1f0)](_0x196dc7))throw CliErrors[_0xa76842(0x215)](_0xa76842(0x1ea)+_0x30f147+_0xa76842(0x1e9)+ENUM_KEYS[_0x30f147][_0xa76842(0x209)](',\x20'));if(_0x30f147===_0xa76842(0x207))throw CliErrors[_0xa76842(0x215)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x30f147===_0xa76842(0x222)){const _0x8674e9=Number(_0x196dc7);if(isNaN(_0x8674e9)||_0x8674e9<=0x0)throw CliErrors[_0xa76842(0x215)](_0xa76842(0x204));}const _0x3b3ccb=resolveWriteScope({'explicitGlobal':_0x5466c7[_0xa76842(0x1fa)](_0xa76842(0x1f2)),'policy':'project-or-global-explicit'}),_0x306e46=toScopeFlags(_0x3b3ccb),_0x104b78=readScopedConfig(_0x306e46),_0x106082=parseAliasAppcodeSetKey(_0x30f147);if(!_0x106082&&!isTopLevelConfigKey(_0x30f147))throw CliErrors[_0xa76842(0x215)](_0xa76842(0x1ef)+_0x30f147+_0xa76842(0x20f),_0xa76842(0x213)+getTopLevelConfigKeySummary()+_0xa76842(0x1ec));return _0x106082?setLocalAppAlias(_0x104b78,_0x106082,_0x196dc7):_0x104b78[_0x30f147]=_0x30f147===_0xa76842(0x222)?Number(_0x196dc7):_0x196dc7,console['log'](_0xa76842(0x1fe)+_0x30f147+'`\x20=\x20\x22'+_0x196dc7+'\x22'+(_0x3b3ccb===_0xa76842(0x1f2)?_0xa76842(0x201):'')),writeScopedConfig(_0x104b78,_0x306e46),{'ok':!![]};}},deleteDef={'service':a18_0x97340d(0x1f5),'command':a18_0x97340d(0x21a),'description':a18_0x97340d(0x1f8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x97340d(0x21d),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x389278){const _0xead404=a18_0x97340d,_0x3fa432=_0x389278[_0xead404(0x223)][0x0];if(!_0x3fa432)throw CliErrors[_0xead404(0x215)](_0xead404(0x1fd),'Usage:\x20'+CLI_BIN_NAME+_0xead404(0x202));const _0x138afb=resolveWriteScope({'explicitGlobal':_0x389278[_0xead404(0x1fa)](_0xead404(0x1f2)),'policy':'project-or-global-explicit'}),_0x27bccd=toScopeFlags(_0x138afb),_0xaa9a7f=readScopedConfig(_0x27bccd),_0x49e0de=parseAliasDeleteKey(_0x3fa432);if(_0x49e0de){if(!deleteLocalAppAlias(_0xaa9a7f,_0x49e0de))throw CliErrors[_0xead404(0x215)](_0xead404(0x1f6)+_0x3fa432);return console[_0xead404(0x21f)](_0xead404(0x1fb)+_0x3fa432+'`'+(_0x138afb===_0xead404(0x1f2)?_0xead404(0x201):'')),writeScopedConfig(_0xaa9a7f,_0x27bccd),{'ok':!![]};}if(_0xaa9a7f[_0x3fa432]===undefined)throw CliErrors[_0xead404(0x215)]('Key\x20\x22'+_0x3fa432+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0xaa9a7f[_0x3fa432],console[_0xead404(0x21f)]('Deleted\x20`'+_0x3fa432+'`'+(_0x138afb==='global'?'\x20(global)':'')),writeScopedConfig(_0xaa9a7f,_0x27bccd),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a18_0x2b06dc=a18_0x2707;(function(_0x5e9fed,_0x573e98){const _0x3496bd=a18_0x2707,_0x392b71=_0x5e9fed();while(!![]){try{const _0x45c8e1=-parseInt(_0x3496bd(0x1cb))/0x1+parseInt(_0x3496bd(0x1a3))/0x2*(parseInt(_0x3496bd(0x1b2))/0x3)+-parseInt(_0x3496bd(0x1c5))/0x4+parseInt(_0x3496bd(0x1b1))/0x5*(parseInt(_0x3496bd(0x19c))/0x6)+parseInt(_0x3496bd(0x1d0))/0x7*(parseInt(_0x3496bd(0x1a0))/0x8)+parseInt(_0x3496bd(0x1c2))/0x9*(-parseInt(_0x3496bd(0x195))/0xa)+parseInt(_0x3496bd(0x196))/0xb*(-parseInt(_0x3496bd(0x1b8))/0xc);if(_0x45c8e1===_0x573e98)break;else _0x392b71['push'](_0x392b71['shift']());}catch(_0x1eb9d5){_0x392b71['push'](_0x392b71['shift']());}}}(a18_0x53b3,0xda8d2));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a18_0x2b06dc(0x1b9),'type':a18_0x2b06dc(0x199),'description':a18_0x2b06dc(0x1a4),'default':![]};function parseAliasAppcodeSetKey(_0x21359a){const _0x34b350=a18_0x2b06dc,_0x30e03b=_0x21359a['split']('.');if(_0x30e03b[_0x34b350(0x1a7)]!==0x3||_0x30e03b[0x0]!==_0x34b350(0x1cd)||_0x30e03b[0x2]!=='appcode')return undefined;const _0x1ad48b=_0x30e03b[0x1]?.['trim']();return _0x1ad48b?_0x1ad48b:undefined;}function parseAliasDeleteKey(_0x2adf4a){const _0x24d846=a18_0x2b06dc,_0x27285a=_0x2adf4a[_0x24d846(0x1a2)]('.');if(_0x27285a[_0x24d846(0x1a7)]===0x2&&_0x27285a[0x0]===_0x24d846(0x1cd)){const _0x29b146=_0x27285a[0x1]?.[_0x24d846(0x1b6)]();return _0x29b146?{'alias':_0x29b146}:undefined;}if(_0x27285a[_0x24d846(0x1a7)]===0x3&&_0x27285a[0x0]===_0x24d846(0x1cd)&&_0x27285a[0x2]===_0x24d846(0x18c)){const _0x410bf9=_0x27285a[0x1]?.[_0x24d846(0x1b6)]();return _0x410bf9?{'alias':_0x410bf9,'field':_0x24d846(0x18c)}:undefined;}return undefined;}function setLocalAppAlias(_0x472628,_0x59d48a,_0x167a0a){const _0x2e46fd=a18_0x2b06dc,_0x5c837b=_0x472628[_0x2e46fd(0x1cd)]&&typeof _0x472628[_0x2e46fd(0x1cd)]===_0x2e46fd(0x198)&&!Array[_0x2e46fd(0x1af)](_0x472628[_0x2e46fd(0x1cd)])?_0x472628['apps']:{},_0x2dc5d9=_0x5c837b[_0x59d48a]&&typeof _0x5c837b[_0x59d48a]===_0x2e46fd(0x198)&&!Array[_0x2e46fd(0x1af)](_0x5c837b[_0x59d48a])?_0x5c837b[_0x59d48a]:{};_0x2dc5d9[_0x2e46fd(0x18c)]=_0x167a0a,_0x5c837b[_0x59d48a]=_0x2dc5d9,_0x472628['apps']=_0x5c837b;}function deleteLocalAppAlias(_0x2ad34e,_0x4a5bf8){const _0x2e928b=a18_0x2b06dc;if(!_0x2ad34e[_0x2e928b(0x1cd)]||typeof _0x2ad34e[_0x2e928b(0x1cd)]!==_0x2e928b(0x198)||Array[_0x2e928b(0x1af)](_0x2ad34e[_0x2e928b(0x1cd)]))return![];const _0x95e3c9=_0x2ad34e[_0x2e928b(0x1cd)],_0x56bd50=_0x95e3c9[_0x4a5bf8[_0x2e928b(0x19e)]];if(!_0x56bd50||typeof _0x56bd50!==_0x2e928b(0x198)||Array[_0x2e928b(0x1af)](_0x56bd50))return![];if(!_0x4a5bf8['field'])return delete _0x95e3c9[_0x4a5bf8[_0x2e928b(0x19e)]],!![];if(!(_0x4a5bf8[_0x2e928b(0x1cc)]in _0x56bd50))return![];return delete _0x56bd50[_0x4a5bf8['field']],Object[_0x2e928b(0x1b3)](_0x56bd50)[_0x2e928b(0x1a7)]===0x0&&delete _0x95e3c9[_0x4a5bf8[_0x2e928b(0x19e)]],!![];}function a18_0x2707(_0x47f26a,_0x5487e6){_0x47f26a=_0x47f26a-0x18a;const _0x53b37b=a18_0x53b3();let _0x2707c3=_0x53b37b[_0x47f26a];return _0x2707c3;}const listDef={'service':a18_0x2b06dc(0x1bb),'command':a18_0x2b06dc(0x1ce),'description':a18_0x2b06dc(0x1bf),'risk':a18_0x2b06dc(0x1c8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x491d1f){const _0x26e7a8=a18_0x2b06dc,{buildConfigFromFlags:_0x72487c}=await import(_0x26e7a8(0x1b7)),_0x5229b7=_0x72487c({}),_0x57e5b4=getProjectConfigPath(),_0x20ba37=resolveWriteConfigPath(_0x26e7a8(0x1b9));if(_0x491d1f[_0x26e7a8(0x1c3)]==='pretty')return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x26e7a8(0x190)](_0x5229b7[_0x26e7a8(0x1b4)],null,0x2)+'\x0a\x0a')+_0x26e7a8(0x18b)+(_0x26e7a8(0x1a1)+(_0x57e5b4??_0x26e7a8(0x19f))+'\x0a')+(_0x26e7a8(0x18f)+_0x20ba37)};return{'ok':!![],'data':{'effective':_0x5229b7[_0x26e7a8(0x1b4)],'configFiles':{'project':_0x57e5b4??null,'global':_0x20ba37}}};}},getDef={'service':a18_0x2b06dc(0x1bb),'command':a18_0x2b06dc(0x194),'description':'Get\x20a\x20config\x20value','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a18_0x2b06dc(0x1c4),'description':a18_0x2b06dc(0x193),'required':!![]}],'flags':[],async 'execute'(_0x2a5410){const _0x5df16c=a18_0x2b06dc,_0x2e2c9a=_0x2a5410[_0x5df16c(0x1c1)][0x0];if(!_0x2e2c9a)throw CliErrors['validation'](_0x5df16c(0x1ba),'Usage:\x20'+CLI_BIN_NAME+_0x5df16c(0x18e));const {buildConfigFromFlags:_0x43bdcb}=await import('../../context.js'),{raw:_0x545070}=_0x43bdcb({});if(_0x2e2c9a['includes']('.')){const _0x556b20=_0x2e2c9a[_0x5df16c(0x1a2)]('.');let _0x38279d=_0x545070;for(const _0x3aa263 of _0x556b20){if(_0x38279d==null||typeof _0x38279d!=='object')throw CliErrors['validation'](_0x5df16c(0x1be)+_0x2e2c9a);_0x38279d=_0x38279d[_0x3aa263];}if(_0x38279d===undefined)throw CliErrors[_0x5df16c(0x18a)](_0x5df16c(0x1be)+_0x2e2c9a);return console['log'](typeof _0x38279d==='object'?JSON[_0x5df16c(0x190)](_0x38279d,null,0x2):String(_0x38279d)),{'ok':!![]};}const _0x84abdc=_0x545070[_0x2e2c9a];if(_0x84abdc===undefined)throw CliErrors[_0x5df16c(0x18a)](_0x5df16c(0x1be)+_0x2e2c9a);return console[_0x5df16c(0x1ac)](typeof _0x84abdc===_0x5df16c(0x198)?JSON[_0x5df16c(0x190)](_0x84abdc,null,0x2):String(_0x84abdc)),{'ok':!![]};}},setDef={'service':'config','command':a18_0x2b06dc(0x1b0),'description':a18_0x2b06dc(0x1ca),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a18_0x2b06dc(0x1c7),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x114483){const _0x1184d6=a18_0x2b06dc,_0x31a1f6=_0x114483[_0x1184d6(0x1c1)][0x0],_0x3407da=_0x114483[_0x1184d6(0x1c1)][0x1];if(!_0x31a1f6||_0x3407da===undefined)throw CliErrors[_0x1184d6(0x18a)](_0x1184d6(0x1ae),_0x1184d6(0x19a)+CLI_BIN_NAME+_0x1184d6(0x19d));if(ENUM_KEYS[_0x31a1f6]&&!ENUM_KEYS[_0x31a1f6][_0x1184d6(0x1bd)](_0x3407da))throw CliErrors[_0x1184d6(0x18a)]('Invalid\x20value\x20for\x20\x22'+_0x31a1f6+_0x1184d6(0x1c0)+ENUM_KEYS[_0x31a1f6]['join'](',\x20'));if(_0x31a1f6==='riskLevel')throw CliErrors['validation'](_0x1184d6(0x1a8));if(_0x31a1f6==='pageSize'){const _0x1b6405=Number(_0x3407da);if(isNaN(_0x1b6405)||_0x1b6405<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x550cdd=resolveWriteScope({'explicitGlobal':_0x114483[_0x1184d6(0x18d)](_0x1184d6(0x1b9)),'policy':_0x1184d6(0x1c6)}),_0x3b94b1=toScopeFlags(_0x550cdd),_0x3a6cda=readScopedConfig(_0x3b94b1),_0xc71ea9=parseAliasAppcodeSetKey(_0x31a1f6);if(!_0xc71ea9&&!isTopLevelConfigKey(_0x31a1f6))throw CliErrors['validation'](_0x1184d6(0x1b5)+_0x31a1f6+_0x1184d6(0x1a6),_0x1184d6(0x1aa)+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0xc71ea9?setLocalAppAlias(_0x3a6cda,_0xc71ea9,_0x3407da):_0x3a6cda[_0x31a1f6]=_0x31a1f6===_0x1184d6(0x1c9)?Number(_0x3407da):_0x3407da,console[_0x1184d6(0x1ac)](_0x1184d6(0x1a5)+_0x31a1f6+_0x1184d6(0x1ad)+_0x3407da+'\x22'+(_0x550cdd==='global'?_0x1184d6(0x192):'')),writeScopedConfig(_0x3a6cda,_0x3b94b1),{'ok':!![]};}},deleteDef={'service':a18_0x2b06dc(0x1bb),'command':a18_0x2b06dc(0x1bc),'description':a18_0x2b06dc(0x1a9),'risk':a18_0x2b06dc(0x191),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x1145cb){const _0x2f72dd=a18_0x2b06dc,_0x3a185a=_0x1145cb[_0x2f72dd(0x1c1)][0x0];if(!_0x3a185a)throw CliErrors[_0x2f72dd(0x18a)](_0x2f72dd(0x1ba),_0x2f72dd(0x19a)+CLI_BIN_NAME+_0x2f72dd(0x197));const _0x5094c5=resolveWriteScope({'explicitGlobal':_0x1145cb[_0x2f72dd(0x18d)](_0x2f72dd(0x1b9)),'policy':_0x2f72dd(0x1c6)}),_0x172a4c=toScopeFlags(_0x5094c5),_0x224cf3=readScopedConfig(_0x172a4c),_0x427873=parseAliasDeleteKey(_0x3a185a);if(_0x427873){if(!deleteLocalAppAlias(_0x224cf3,_0x427873))throw CliErrors[_0x2f72dd(0x18a)](_0x2f72dd(0x1be)+_0x3a185a);return console['log'](_0x2f72dd(0x19b)+_0x3a185a+'`'+(_0x5094c5===_0x2f72dd(0x1b9)?_0x2f72dd(0x192):'')),writeScopedConfig(_0x224cf3,_0x172a4c),{'ok':!![]};}if(_0x224cf3[_0x3a185a]===undefined)throw CliErrors['validation'](_0x2f72dd(0x1cf)+_0x3a185a+_0x2f72dd(0x1ab));return delete _0x224cf3[_0x3a185a],console[_0x2f72dd(0x1ac)](_0x2f72dd(0x19b)+_0x3a185a+'`'+(_0x5094c5===_0x2f72dd(0x1b9)?_0x2f72dd(0x192):'')),writeScopedConfig(_0x224cf3,_0x172a4c),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];function a18_0x53b3(){const _0x44c5ef=['alias','(none)','8NsVdLa','\x20\x20project:\x20','split','2HWRBvP','Write\x20to\x20global\x20config','Set\x20`','\x22\x20is\x20not\x20settable.','length','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Delete\x20a\x20config\x20value','Settable\x20keys:\x20','\x22\x20not\x20found\x20at\x20top\x20level.','log','`\x20=\x20\x22','Missing\x20key\x20or\x20value.','isArray','set','26395SrFfgl','4875285qQmeTZ','keys','raw','Top-level\x20key\x20\x22','trim','../../context.js','2532hKOKEY','global','Missing\x20key\x20argument.','config','delete','includes','Key\x20not\x20found:\x20','List\x20current\x20config','\x22.\x20Allowed:\x20','args','3956382sPQXbE','format','key','13024UqLOVU','project-or-global-explicit','value','read','pageSize','Set\x20a\x20config\x20value','113547jxeuZK','field','apps','list','Key\x20\x22','8708126ftcxOd','validation','Config\x20files:\x0a','appcode','bool','\x20config\x20get\x20<key>','\x20\x20global:\x20\x20','stringify','write','\x20(global)','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','get','40zBQtWE','64317xGWBOy','\x20config\x20delete\x20<key>\x20[--global]','object','boolean','Usage:\x20','Deleted\x20`','1290CkdJnb','\x20config\x20set\x20<key>\x20<value>\x20[--global]'];a18_0x53b3=function(){return _0x44c5ef;};return a18_0x53b3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3941e7,_0x25807b){var _0x27d177=a19_0x3994,_0x2ab825=_0x3941e7();while(!![]){try{var _0xea07a3=parseInt(_0x27d177(0x1c1))/0x1+-parseInt(_0x27d177(0x1c2))/0x2+parseInt(_0x27d177(0x1c5))/0x3+parseInt(_0x27d177(0x1bf))/0x4+-parseInt(_0x27d177(0x1c0))/0x5*(parseInt(_0x27d177(0x1c4))/0x6)+parseInt(_0x27d177(0x1c6))/0x7+-parseInt(_0x27d177(0x1c3))/0x8;if(_0xea07a3===_0x25807b)break;else _0x2ab825['push'](_0x2ab825['shift']());}catch(_0x8b643e){_0x2ab825['push'](_0x2ab825['shift']());}}}(a19_0x27ee,0xb5506));import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x27ee(){var _0x46f910=['350884JhhVil','2135128nzryoy','4369016BBlkQS','27354PWrxxu','1451571meAlvK','4231724ToyZrK','4343052XvuVQW','185BDUBFt'];a19_0x27ee=function(){return _0x46f910;};return a19_0x27ee();}export{CLI_BIN_NAME};function a19_0x3994(_0x20af63,_0x1f3e44){_0x20af63=_0x20af63-0x1bf;var _0x27eea8=a19_0x27ee();var _0x39948c=_0x27eea8[_0x20af63];return _0x39948c;}export{readScopedConfig,writeScopedConfig}from'../../context.js';export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a20_0x56ba(_0x3a20b3,_0x54dde1){_0x3a20b3=_0x3a20b3-0xef;const _0x3b441d=a20_0x3b44();let _0x56bab7=_0x3b441d[_0x3a20b3];return _0x56bab7;}const a20_0x4ee814=a20_0x56ba;(function(_0x4bb255,_0xa09890){const _0x21d76b=a20_0x56ba,_0x4a37ba=_0x4bb255();while(!![]){try{const _0x4a5dc1=-parseInt(_0x21d76b(0x122))/0x1+-parseInt(_0x21d76b(0x107))/0x2+parseInt(_0x21d76b(0x123))/0x3+parseInt(_0x21d76b(0x127))/0x4*(-parseInt(_0x21d76b(0xf3))/0x5)+-parseInt(_0x21d76b(0xf2))/0x6*(parseInt(_0x21d76b(0x126))/0x7)+parseInt(_0x21d76b(0x133))/0x8+parseInt(_0x21d76b(0x13b))/0x9;if(_0x4a5dc1===_0xa09890)break;else _0x4a37ba['push'](_0x4a37ba['shift']());}catch(_0x1031d6){_0x4a37ba['push'](_0x4a37ba['shift']());}}}(a20_0x3b44,0xcb618));import{executeData}from'../../core/sdk-client.js';function a20_0x3b44(){const _0x3d6f0c=['description','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','aggregate','\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}}','paramsHint','\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}}','/api/{appCode}/','now','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','12901168UXqbqU','Preview:\x20data\x20','map','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','command','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','12855654wMQCoT','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','Update\x20an\x20existing\x20record','risk','write','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','188196fptsMX','1309190QCTrip','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','params','build','batchCreate','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','code','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','create','\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\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20LOGICAL\x20COMBINATORS','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','body','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','372650ctDzub','filter','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','join','\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}}]}','Filter\x20dataset\x20records\x20with\x20query\x20conditions','str','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\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20AGGREGATE\x20TYPES','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','delete','operation','\x20\x20EXAMPLES','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','data\x20','\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\x20PAGINATION','\x20\x20PARAMS\x20STRUCTURE','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]','Get\x20a\x20single\x20record\x20by\x20ID','POST','856434BtsAYW','2751555CqgWwR','\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}}','getOne','231wevLKn','16oKnCOl','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)'];a20_0x3b44=function(){return _0x3d6f0c;};return a20_0x3b44();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a20_0x4ee814(0x108),'risk':a20_0x4ee814(0x11e),'paramsRequired':![],'description':a20_0x4ee814(0x10d),'paramsHint':a20_0x4ee814(0x114)+a20_0x4ee814(0xfb),'helpExtra':['\x20\x20WHERE\x20OPERATORS','\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}}',a20_0x4ee814(0x12f),a20_0x4ee814(0x124),'\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}',a20_0x4ee814(0x12d),a20_0x4ee814(0xfe),'\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}',a20_0x4ee814(0x110),'\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a20_0x4ee814(0x102),a20_0x4ee814(0x10c),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a20_0x4ee814(0x138),a20_0x4ee814(0x11f),a20_0x4ee814(0x11b),a20_0x4ee814(0x101),a20_0x4ee814(0x132),'',a20_0x4ee814(0x11c),a20_0x4ee814(0x119),'\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27',a20_0x4ee814(0x129)][a20_0x4ee814(0x10b)]('\x0a')},{'command':a20_0x4ee814(0x125),'operation':a20_0x4ee814(0x125),'risk':a20_0x4ee814(0x11e),'paramsRequired':!![],'description':a20_0x4ee814(0x120),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x4ee814(0xff),'operation':a20_0x4ee814(0xff),'risk':a20_0x4ee814(0xf0),'paramsRequired':!![],'description':a20_0x4ee814(0xf1),'paramsHint':a20_0x4ee814(0x136)},{'command':'batchCreate','operation':'batchCreate','risk':a20_0x4ee814(0xf0),'paramsRequired':!![],'description':a20_0x4ee814(0x112),'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':'update','risk':'write','paramsRequired':!![],'description':a20_0x4ee814(0x13d),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27'},{'command':a20_0x4ee814(0x115),'operation':a20_0x4ee814(0x115),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','paramsHint':a20_0x4ee814(0x13a)},{'command':a20_0x4ee814(0x12c),'operation':'aggregate','risk':a20_0x4ee814(0x11e),'paramsRequired':![],'description':a20_0x4ee814(0x104),'paramsHint':a20_0x4ee814(0x10f)+a20_0x4ee814(0xfa),'helpExtra':[a20_0x4ee814(0x113),a20_0x4ee814(0x13c),a20_0x4ee814(0x10a),a20_0x4ee814(0x128),a20_0x4ee814(0x137),a20_0x4ee814(0xf4),a20_0x4ee814(0x12b),a20_0x4ee814(0x109),'',a20_0x4ee814(0x11d),a20_0x4ee814(0x100),a20_0x4ee814(0xf6),a20_0x4ee814(0x103),a20_0x4ee814(0x106),a20_0x4ee814(0x118),a20_0x4ee814(0x111),'',a20_0x4ee814(0x117),a20_0x4ee814(0xfc),a20_0x4ee814(0xf5),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.'][a20_0x4ee814(0x10b)]('\x0a')}];function makeDataCommand(_0x5a213a){const _0x3de4f2=a20_0x4ee814,_0x25168c=_0x3de4f2(0x11a)+_0x5a213a['command'],_0x530fd9={'service':'data','command':_0x5a213a[_0x3de4f2(0x139)],'description':_0x5a213a[_0x3de4f2(0x12a)],'risk':_0x5a213a[_0x3de4f2(0xef)],'helpExtra':_0x5a213a['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5a213a[_0x3de4f2(0x12e)]}],'validate':async _0x3f93e7=>{const _0x33d57e=_0x3de4f2;_0x5a213a['paramsRequired']&&requireAnyOf(_0x3f93e7,[_0x33d57e(0xf7)],_0x25168c),_0x5a213a[_0x33d57e(0x116)]===_0x33d57e(0xf9)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3f93e7[_0x33d57e(0x10e)](_0x33d57e(0xf7))));},async 'execute'(_0x557354){const _0x442c59=_0x3de4f2,_0x29140c=_0x557354[_0x442c59(0x10e)](_0x442c59(0xfd)),_0x4aec96=_0x5a213a[_0x442c59(0x116)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x557354[_0x442c59(0x10e)](_0x442c59(0xf7)))):parseJsonParams(_0x557354[_0x442c59(0x10e)](_0x442c59(0xf7)))??{},_0x326ea6=Date[_0x442c59(0x131)](),_0x1959c3=await executeData(_0x29140c,_0x5a213a[_0x442c59(0x116)],_0x4aec96),_0x12fe7b=Date[_0x442c59(0x131)]()-_0x326ea6;return{'ok':!![],'data':{'result':_0x1959c3,'elapsed':_0x12fe7b},'message':_0x442c59(0x11a)+_0x5a213a[_0x442c59(0x139)]+'\x20completed\x20in\x20'+_0x12fe7b+'ms'};}};return _0x5a213a[_0x3de4f2(0xef)]!==_0x3de4f2(0x11e)&&(_0x530fd9['dryRun']=async _0x333ed5=>{const _0x56af5a=_0x3de4f2,_0x354024=_0x333ed5[_0x56af5a(0x10e)]('code'),_0x25c250=_0x5a213a[_0x56af5a(0x116)]===_0x56af5a(0xf9)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x333ed5[_0x56af5a(0x10e)](_0x56af5a(0xf7)))):parseJsonParams(_0x333ed5[_0x56af5a(0x10e)](_0x56af5a(0xf7)))??{};return dryRun(_0x56af5a(0x121),_0x56af5a(0x130)+_0x354024+'/'+_0x5a213a[_0x56af5a(0x116)])[_0x56af5a(0x105)](_0x25c250)[_0x56af5a(0x12a)](_0x56af5a(0x134)+_0x5a213a[_0x56af5a(0x139)]+'\x20on\x20dataset\x20'+_0x354024)[_0x56af5a(0xf8)]();}),_0x530fd9;}export const dataDefinitions=specs[a20_0x4ee814(0x135)](makeDataCommand);
|
|
1
|
+
const a20_0x8207c0=a20_0x54be;(function(_0x337e5b,_0x2cfc3b){const _0x2b88e3=a20_0x54be,_0x32029f=_0x337e5b();while(!![]){try{const _0x44d0ba=-parseInt(_0x2b88e3(0x105))/0x1+-parseInt(_0x2b88e3(0x134))/0x2+-parseInt(_0x2b88e3(0x15a))/0x3*(parseInt(_0x2b88e3(0x13f))/0x4)+-parseInt(_0x2b88e3(0x155))/0x5+-parseInt(_0x2b88e3(0x11c))/0x6*(-parseInt(_0x2b88e3(0x113))/0x7)+-parseInt(_0x2b88e3(0x124))/0x8+parseInt(_0x2b88e3(0x14f))/0x9;if(_0x44d0ba===_0x2cfc3b)break;else _0x32029f['push'](_0x32029f['shift']());}catch(_0x2acfe2){_0x32029f['push'](_0x32029f['shift']());}}}(a20_0x2b63,0xbf1ee));import{executeData}from'../../core/sdk-client.js';function a20_0x54be(_0x327ee8,_0x2e1797){_0x327ee8=_0x327ee8-0x105;const _0x2b632b=a20_0x2b63();let _0x54bed9=_0x2b632b[_0x327ee8];return _0x54bed9;}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a20_0x2b63(){const _0xf194db=['\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20Example:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27','\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}}','batchCreate','paramsRequired','1331346dHIImU','params','dryRun','build','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20on\x20dataset\x20','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','11648224HoMupZ','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}','write','\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]','Preview:\x20data\x20','\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}}','aggregate','read','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','filter','POST','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','body','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','\x20\x20LOGICAL\x20COMBINATORS','502600BdWAqo','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','code','\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}}','3708xbflJj','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','description','Update\x20an\x20existing\x20record','\x20\x20WHERE\x20OPERATORS','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20AGGREGATE\x20TYPES','\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}}','update','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','operation','data\x20','43194168EYSmlx','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','high-risk-write','map','/api/{appCode}/','delete','2136975hRsSKA','\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}}','join','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}}','2079hZHzAq','Get\x20a\x20single\x20record\x20by\x20ID','1461279eEpOTb','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','now','risk','\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\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','getOne','\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]}}','str','\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}}]}','create','data','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\x20\x20EXAMPLES','7tIHBjA','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)'];a20_0x2b63=function(){return _0xf194db;};return a20_0x2b63();}const specs=[{'command':a20_0x8207c0(0x12e),'operation':a20_0x8207c0(0x12e),'risk':a20_0x8207c0(0x12b),'paramsRequired':![],'description':a20_0x8207c0(0x135),'paramsHint':a20_0x8207c0(0x13a)+a20_0x8207c0(0x14c),'helpExtra':[a20_0x8207c0(0x143),a20_0x8207c0(0x122),a20_0x8207c0(0x119),a20_0x8207c0(0x156),a20_0x8207c0(0x13e),a20_0x8207c0(0x146),a20_0x8207c0(0x109),a20_0x8207c0(0x10c),a20_0x8207c0(0x144),a20_0x8207c0(0x159),a20_0x8207c0(0x129),'',a20_0x8207c0(0x133),a20_0x8207c0(0x10e),'\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}}]}','',a20_0x8207c0(0x140),a20_0x8207c0(0x148),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)',a20_0x8207c0(0x114),'','\x20\x20PAGINATION',a20_0x8207c0(0x116),a20_0x8207c0(0x14a),a20_0x8207c0(0x115)][a20_0x8207c0(0x157)]('\x0a')},{'command':a20_0x8207c0(0x10b),'operation':a20_0x8207c0(0x10b),'risk':'read','paramsRequired':!![],'description':a20_0x8207c0(0x15b),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':'create','operation':a20_0x8207c0(0x10f),'risk':'write','paramsRequired':!![],'description':'Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsHint':a20_0x8207c0(0x106)},{'command':a20_0x8207c0(0x11a),'operation':a20_0x8207c0(0x11a),'risk':a20_0x8207c0(0x126),'paramsRequired':!![],'description':a20_0x8207c0(0x111),'paramsHint':a20_0x8207c0(0x12c)},{'command':'update','operation':a20_0x8207c0(0x147),'risk':'write','paramsRequired':!![],'description':a20_0x8207c0(0x142),'paramsHint':a20_0x8207c0(0x118)},{'command':a20_0x8207c0(0x154),'operation':a20_0x8207c0(0x154),'risk':a20_0x8207c0(0x151),'paramsRequired':!![],'description':a20_0x8207c0(0x132),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a20_0x8207c0(0x12a),'operation':a20_0x8207c0(0x12a),'risk':'read','paramsRequired':![],'description':a20_0x8207c0(0x150),'paramsHint':a20_0x8207c0(0x149)+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a20_0x8207c0(0x145),a20_0x8207c0(0x14b),a20_0x8207c0(0x139),a20_0x8207c0(0x13c),a20_0x8207c0(0x125),a20_0x8207c0(0x10a),a20_0x8207c0(0x137),a20_0x8207c0(0x117),'',a20_0x8207c0(0x13b),a20_0x8207c0(0x127),a20_0x8207c0(0x130),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)',a20_0x8207c0(0x138),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Post-aggregation\x20filters,\x20e.g.\x20[{\x22columnName\x22:\x22total\x22,\x22condition\x22:{\x22$gt\x22:1000}}]',a20_0x8207c0(0x12d),'',a20_0x8207c0(0x112),'\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status',a20_0x8207c0(0x123),'',a20_0x8207c0(0x136),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','',a20_0x8207c0(0x120)][a20_0x8207c0(0x157)]('\x0a')}];function makeDataCommand(_0x55dedf){const _0x564d20=a20_0x8207c0,_0x5d9e81=_0x564d20(0x14e)+_0x55dedf[_0x564d20(0x158)],_0x23fedf={'service':_0x564d20(0x110),'command':_0x55dedf[_0x564d20(0x158)],'description':_0x55dedf[_0x564d20(0x141)],'risk':_0x55dedf[_0x564d20(0x108)],'helpExtra':_0x55dedf['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x55dedf['paramsHint']}],'validate':async _0x3df22f=>{const _0x138991=_0x564d20;_0x55dedf[_0x138991(0x11b)]&&requireAnyOf(_0x3df22f,['params'],_0x5d9e81),_0x55dedf[_0x138991(0x14d)]===_0x138991(0x11a)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3df22f[_0x138991(0x10d)](_0x138991(0x11d))));},async 'execute'(_0x246524){const _0x5671ed=_0x564d20,_0x50ea48=_0x246524[_0x5671ed(0x10d)](_0x5671ed(0x13d)),_0x1f2da6=_0x55dedf[_0x5671ed(0x14d)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x246524['str']('params'))):parseJsonParams(_0x246524['str']('params'))??{},_0x23929c=Date[_0x5671ed(0x107)](),_0x1e8deb=await executeData(_0x50ea48,_0x55dedf['operation'],_0x1f2da6),_0x1cb800=Date[_0x5671ed(0x107)]()-_0x23929c;return{'ok':!![],'data':{'result':_0x1e8deb,'elapsed':_0x1cb800},'message':_0x5671ed(0x14e)+_0x55dedf[_0x5671ed(0x158)]+'\x20completed\x20in\x20'+_0x1cb800+'ms'};}};return _0x55dedf[_0x564d20(0x108)]!==_0x564d20(0x12b)&&(_0x23fedf[_0x564d20(0x11e)]=async _0x1dc80e=>{const _0x1efd69=_0x564d20,_0x51ede9=_0x1dc80e[_0x1efd69(0x10d)](_0x1efd69(0x13d)),_0x3f9304=_0x55dedf[_0x1efd69(0x14d)]===_0x1efd69(0x11a)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1dc80e[_0x1efd69(0x10d)](_0x1efd69(0x11d)))):parseJsonParams(_0x1dc80e[_0x1efd69(0x10d)](_0x1efd69(0x11d)))??{};return dryRun(_0x1efd69(0x12f),_0x1efd69(0x153)+_0x51ede9+'/'+_0x55dedf['operation'])[_0x1efd69(0x131)](_0x3f9304)[_0x1efd69(0x141)](_0x1efd69(0x128)+_0x55dedf[_0x1efd69(0x158)]+_0x1efd69(0x121)+_0x51ede9)[_0x1efd69(0x11f)]();}),_0x23fedf;}export const dataDefinitions=specs[a20_0x8207c0(0x152)](makeDataCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x315cc6=a21_0x55ed;(function(_0x981b1d,_0x30a34d){const _0x372c95=a21_0x55ed,_0x43be00=_0x981b1d();while(!![]){try{const _0x439be6=parseInt(_0x372c95(0x1e2))/0x1*(parseInt(_0x372c95(0x1b8))/0x2)+parseInt(_0x372c95(0x1ac))/0x3*(-parseInt(_0x372c95(0x1aa))/0x4)+-parseInt(_0x372c95(0x1d0))/0x5+-parseInt(_0x372c95(0x1c5))/0x6+-parseInt(_0x372c95(0x1ae))/0x7*(-parseInt(_0x372c95(0x1d4))/0x8)+-parseInt(_0x372c95(0x1bc))/0x9+parseInt(_0x372c95(0x1c0))/0xa;if(_0x439be6===_0x30a34d)break;else _0x43be00['push'](_0x43be00['shift']());}catch(_0x3f1b7b){_0x43be00['push'](_0x43be00['shift']());}}}(a21_0x13f2,0x4acd8));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0xb6d88e){const _0x315867=a21_0x55ed;if(_0xb6d88e[_0x315867(0x1a2)])return null;const _0x535da4=Boolean(_0xb6d88e['displayName']!==undefined||_0xb6d88e['doType']!==undefined);let _0x1051c0={};if(!_0x535da4&&typeof _0xb6d88e[_0x315867(0x1c7)]===_0x315867(0x1cd))try{_0x1051c0=JSON[_0x315867(0x1d2)](_0xb6d88e['extend']);}catch{}const _0x2c5f89=_0x535da4?_0xb6d88e[_0x315867(0x1b9)]:_0xb6d88e[_0x315867(0x1b3)],_0x31bc82=_0x535da4?_0xb6d88e[_0x315867(0x1a5)]:_0xb6d88e[_0x315867(0x1b9)],_0x7fa045=_0x535da4?_0xb6d88e[_0x315867(0x1b2)]:_0xb6d88e[_0x315867(0x1da)]||_0xb6d88e['dataType'],_0x2931cc=_0x535da4?_0xb6d88e[_0x315867(0x1b7)]===!![]:_0x1051c0[_0x315867(0x1b7)]===!![],_0x7a5d56=_0x535da4?_0xb6d88e[_0x315867(0x1af)]===!![]:_0x1051c0[_0x315867(0x1af)]===!![],_0x1ef07c=_0x535da4?_0xb6d88e[_0x315867(0x1a3)]??null:_0x1051c0['options']??null,_0x207485={'name':_0x2c5f89,'displayName':_0x31bc82||_0x2c5f89,'type':_0x7fa045,'dbType':_0xb6d88e[_0x315867(0x1c6)],'pk':_0x2931cc,'required':_0x7a5d56,'description':_0xb6d88e[_0x315867(0x1ce)]||undefined};return Array[_0x315867(0x1a4)](_0x1ef07c)&&_0x1ef07c[_0x315867(0x1ca)]>0x0&&(_0x207485[_0x315867(0x1a3)]=_0x1ef07c),_0x207485;}function parseJsonMaybe(_0x10d5a0){const _0x3a08a5=a21_0x55ed;if(typeof _0x10d5a0!==_0x3a08a5(0x1cd))return _0x10d5a0;try{return JSON[_0x3a08a5(0x1d2)](_0x10d5a0);}catch{return _0x10d5a0;}}function normalizeOperationEntry(_0x49efa9,_0x3fdcbc){const _0x2645aa=a21_0x55ed;if(!_0x3fdcbc||typeof _0x3fdcbc!==_0x2645aa(0x1b1))return null;if(!_0x3fdcbc['method']||!_0x3fdcbc[_0x2645aa(0x1ad)])return null;const _0xc6b110={'name':_0x49efa9,'method':_0x3fdcbc[_0x2645aa(0x1df)],'path':_0x3fdcbc['path']};if(_0x3fdcbc[_0x2645aa(0x1e0)])_0xc6b110[_0x2645aa(0x1e0)]=_0x3fdcbc[_0x2645aa(0x1e0)];if(_0x3fdcbc['requestBody']!=null)_0xc6b110['requestBody']=parseJsonMaybe(_0x3fdcbc[_0x2645aa(0x1bb)]);if(_0x3fdcbc[_0x2645aa(0x1a9)]!=null)_0xc6b110[_0x2645aa(0x1a9)]=parseJsonMaybe(_0x3fdcbc[_0x2645aa(0x1a9)]);if(_0x3fdcbc[_0x2645aa(0x1c8)]!=null)_0xc6b110[_0x2645aa(0x1c8)]=_0x3fdcbc[_0x2645aa(0x1c8)];if(_0x3fdcbc[_0x2645aa(0x1d7)]!=null)_0xc6b110[_0x2645aa(0x1d7)]=_0x3fdcbc[_0x2645aa(0x1d7)];if(Array['isArray'](_0x3fdcbc[_0x2645aa(0x1de)]))_0xc6b110['requestFields']=_0x3fdcbc[_0x2645aa(0x1de)];if(Array['isArray'](_0x3fdcbc[_0x2645aa(0x1d9)]))_0xc6b110[_0x2645aa(0x1d9)]=_0x3fdcbc['responseFields'];return _0xc6b110;}function summarizeDbtable(_0x28e517){const _0x4ea1b6=a21_0x55ed,_0x30ec56={},_0x168afc=[_0x4ea1b6(0x1b6),_0x4ea1b6(0x1e4),_0x4ea1b6(0x1dc),_0x4ea1b6(0x1be),_0x4ea1b6(0x1b7),'allFields','logicField',_0x4ea1b6(0x1c1),_0x4ea1b6(0x1c9),'creatorIdField',_0x4ea1b6(0x1e1),'modifierIdField',_0x4ea1b6(0x1d5),'labelField',_0x4ea1b6(0x1b5)];for(const _0x12e64d of _0x168afc){if(_0x28e517[_0x12e64d]!==undefined)_0x30ec56[_0x12e64d]=_0x28e517[_0x12e64d];}return typeof _0x30ec56[_0x4ea1b6(0x1b0)]===_0x4ea1b6(0x1cd)&&_0x30ec56['allFields'][_0x4ea1b6(0x1ca)]>0x0&&(_0x30ec56['allFieldNames']=_0x30ec56[_0x4ea1b6(0x1b0)]['split'](',')[_0x4ea1b6(0x1c2)](_0x4e27a3=>_0x4e27a3[_0x4ea1b6(0x1bf)]())[_0x4ea1b6(0x1a6)](Boolean)),_0x30ec56;}function a21_0x13f2(){const _0x2eb3b2=['length','sourceType','find','string','description','dbtableConfig','58220gmMYTS','columnCodeListWithDeleted','parse','source','834488rXoLFn','modifierNameField','tableComment','afterScriptId','detail','responseFields','type','modelCode','tableName','indexes','requestFields','method','host','creatorNameField','16001zFwTVR','properties','dbName','dataset','push','modelId','relations','deleted','options','isArray','displayName','filter','read','entries','responseBody','1416268AiapnA','validateRules','3wdWngX','path','14BCWwAT','required','allFields','object','doType','code','str','dblinkInfoDTO','dbId','pkField','26TLPhPQ','name','formatRules','requestBody','957420Lsqwzu','Get\x20dataset\x20detail\x20including\x20fields,\x20relations,\x20and\x20operations','datasetKey','trim','6571870KHmLFm','createTimeField','map','doVersion','relatedPageInfoList','1772034sSlaof','dbType','extend','beforeScriptId','updateTimeField'];a21_0x13f2=function(){return _0x2eb3b2;};return a21_0x13f2();}function normalizeRelatedPages(_0x3a39aa){const _0x26cc1e=a21_0x55ed;if(!Array[_0x26cc1e(0x1a4)](_0x3a39aa))return[];return _0x3a39aa[_0x26cc1e(0x1a6)](_0x4d17bc=>_0x4d17bc&&typeof _0x4d17bc==='object')[_0x26cc1e(0x1c2)](_0x2a513a=>({'id':_0x2a513a['id'],'type':_0x2a513a['type'],'code':_0x2a513a['code'],'title':_0x2a513a['title'],'deleted':_0x2a513a['deleted']===!![]}));}function normalizeFallbackFieldName(_0x3c94fc,_0x535071){const _0x5d6cb7=a21_0x55ed,_0x4adf1a=_0x3c94fc[_0x5d6cb7(0x1bf)]();if(!_0x4adf1a)return null;return{'name':_0x4adf1a,'displayName':_0x4adf1a,'type':undefined,'dbType':undefined,'pk':_0x4adf1a===_0x535071,'required':![],'description':undefined};}function a21_0x55ed(_0x332fc0,_0x5ea519){_0x332fc0=_0x332fc0-0x19e;const _0x13f250=a21_0x13f2();let _0x55ed1f=_0x13f250[_0x332fc0];return _0x55ed1f;}async function loadListFieldFallback(_0x2b4cd0,_0x2b8ab8){const _0xbe1df9=a21_0x55ed;if(!_0x2b4cd0||!_0x2b8ab8)return[];try{const _0x1259b3=await listDatasets(_0x2b4cd0,{'code':_0x2b8ab8}),_0x4b01bd=_0x1259b3[_0xbe1df9(0x1cc)](_0x137129=>_0x137129[_0xbe1df9(0x1b3)]===_0x2b8ab8)??_0x1259b3[0x0],_0xd2c40b=_0x4b01bd?.[_0xbe1df9(0x1cf)]??{},_0xfd5808=typeof _0xd2c40b[_0xbe1df9(0x1b0)]==='string'?_0xd2c40b[_0xbe1df9(0x1b0)]['split'](','):[];return _0xfd5808['map'](_0x4a7221=>normalizeFallbackFieldName(_0x4a7221,_0xd2c40b['pkField']))[_0xbe1df9(0x1a6)](_0xa693e1=>_0xa693e1!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a21_0x315cc6(0x1d8),'description':a21_0x315cc6(0x1bd),'risk':a21_0x315cc6(0x1a7),'flags':[CODE_FLAG],async 'execute'(_0x4be604){const _0x460b7d=a21_0x315cc6,_0x35a5a3=await getDatasetDetail(_0x4be604[_0x460b7d(0x1b4)]('code')),_0x5d1c54=Array['isArray'](_0x35a5a3['fields'])?_0x35a5a3['fields']:Array[_0x460b7d(0x1a4)](_0x35a5a3['properties'])?_0x35a5a3[_0x460b7d(0x1e3)]:[];let _0x153742=_0x5d1c54[_0x460b7d(0x1c2)](_0x31ee86=>normalizeField(_0x31ee86))['filter'](_0x313e01=>_0x313e01!==null);_0x153742['length']===0x0&&(_0x153742=await loadListFieldFallback(_0x4be604['appCode'],_0x4be604[_0x460b7d(0x1b4)](_0x460b7d(0x1b3))));const _0x2e9945=_0x35a5a3['operations']??{},_0x5ca994=[];for(const [_0x4bf775,_0x54047a]of Object[_0x460b7d(0x1a8)](_0x2e9945)){const _0x59b8af=normalizeOperationEntry(_0x4bf775,_0x54047a);if(_0x59b8af)_0x5ca994[_0x460b7d(0x19f)](_0x59b8af);}const _0x4a5b44=_0x35a5a3[_0x460b7d(0x1cf)]??{},_0x1e1c42=_0x35a5a3[_0x460b7d(0x19e)]??{},_0x10f18c=_0x4a5b44[_0x460b7d(0x1b6)]!=null?{'id':_0x4a5b44[_0x460b7d(0x1b6)],'name':_0x4a5b44[_0x460b7d(0x1e4)]??null}:undefined;let _0x3a2d07;return typeof _0x35a5a3[_0x460b7d(0x1c7)]===_0x460b7d(0x1cd)&&(_0x3a2d07=parseJsonMaybe(_0x35a5a3[_0x460b7d(0x1c7)])),{'ok':!![],'data':{'id':_0x35a5a3[_0x460b7d(0x1a0)]??_0x35a5a3['id'],'name':_0x35a5a3[_0x460b7d(0x1b9)],'code':_0x35a5a3[_0x460b7d(0x1db)]||_0x35a5a3['code'],'doVersion':_0x35a5a3[_0x460b7d(0x1c3)],'description':_0x35a5a3['description']||_0x1e1c42[_0x460b7d(0x1d6)]||undefined,'source':_0x35a5a3[_0x460b7d(0x1d3)]||_0x1e1c42[_0x460b7d(0x1cb)],'table':_0x4a5b44[_0x460b7d(0x1dc)]||_0x1e1c42['tableName'],'datasetKey':_0x4a5b44[_0x460b7d(0x1be)],'pk':_0x4a5b44['pkField'],'db':_0x10f18c,'dbtable':summarizeDbtable(_0x4a5b44),'fields':_0x153742,'operations':_0x5ca994,'indexes':Array[_0x460b7d(0x1a4)](_0x1e1c42[_0x460b7d(0x1dd)])?_0x1e1c42['indexes']:[],'relations':_0x35a5a3[_0x460b7d(0x1a1)]??null,'relatedPages':normalizeRelatedPages(_0x35a5a3[_0x460b7d(0x1c4)]),...Array[_0x460b7d(0x1a4)](_0x35a5a3['columnCodeListWithDeleted'])?{'columnCodeListWithDeleted':_0x35a5a3[_0x460b7d(0x1d1)]}:{},'formatRules':Array[_0x460b7d(0x1a4)](_0x35a5a3[_0x460b7d(0x1ba)])?_0x35a5a3[_0x460b7d(0x1ba)]:[],'validateRules':Array[_0x460b7d(0x1a4)](_0x35a5a3[_0x460b7d(0x1ab)])?_0x35a5a3[_0x460b7d(0x1ab)]:[],..._0x3a2d07!==undefined?{'extend':_0x3a2d07}:{},'stats':{'fieldCount':_0x153742['length'],'operationCount':_0x5ca994[_0x460b7d(0x1ca)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x5a44(){const _0x1e203f=['322whUcdz','40226hKsZRL','864513SqnfYL','13593060zqdHUs','591455Mtfwck','3577374pAABYV','2678444AsyDMx','3Gzyhbt','110680PWQDQI','70psdXlb'];a22_0x5a44=function(){return _0x1e203f;};return a22_0x5a44();}(function(_0x7c1c2f,_0x30bd50){const _0x2c34b5=a22_0x15b2,_0xca736c=_0x7c1c2f();while(!![]){try{const _0x36a1a5=-parseInt(_0x2c34b5(0x1ec))/0x1*(-parseInt(_0x2c34b5(0x1ee))/0x2)+-parseInt(_0x2c34b5(0x1ea))/0x3*(-parseInt(_0x2c34b5(0x1f3))/0x4)+parseInt(_0x2c34b5(0x1f1))/0x5+parseInt(_0x2c34b5(0x1f2))/0x6+-parseInt(_0x2c34b5(0x1ed))/0x7*(parseInt(_0x2c34b5(0x1eb))/0x8)+parseInt(_0x2c34b5(0x1ef))/0x9+-parseInt(_0x2c34b5(0x1f0))/0xa;if(_0x36a1a5===_0x30bd50)break;else _0xca736c['push'](_0xca736c['shift']());}catch(_0x29d74f){_0xca736c['push'](_0xca736c['shift']());}}}(a22_0x5a44,0xd9dde));function a22_0x15b2(_0x808100,_0x420373){_0x808100=_0x808100-0x1ea;const _0x5a4411=a22_0x5a44();let _0x15b2e1=_0x5a4411[_0x808100];return _0x15b2e1;}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a23_0x55d8(_0x542f4c,_0x618526){_0x542f4c=_0x542f4c-0x8a;const _0x25d1bd=a23_0x25d1();let _0x55d843=_0x25d1bd[_0x542f4c];return _0x55d843;}const a23_0x893916=a23_0x55d8;(function(_0x26267f,_0x292651){const _0xf3a4cc=a23_0x55d8,_0x2f05e1=_0x26267f();while(!![]){try{const _0x7b065f=parseInt(_0xf3a4cc(0x8d))/0x1*(-parseInt(_0xf3a4cc(0xa0))/0x2)+parseInt(_0xf3a4cc(0x9a))/0x3+parseInt(_0xf3a4cc(0x9b))/0x4*(parseInt(_0xf3a4cc(0x93))/0x5)+parseInt(_0xf3a4cc(0x8f))/0x6*(-parseInt(_0xf3a4cc(0x9e))/0x7)+-parseInt(_0xf3a4cc(0x96))/0x8+parseInt(_0xf3a4cc(0x9f))/0x9*(-parseInt(_0xf3a4cc(0x97))/0xa)+parseInt(_0xf3a4cc(0x9c))/0xb*(parseInt(_0xf3a4cc(0x8e))/0xc);if(_0x7b065f===_0x292651)break;else _0x2f05e1['push'](_0x2f05e1['shift']());}catch(_0x2c548f){_0x2f05e1['push'](_0x2f05e1['shift']());}}}(a23_0x25d1,0x780ac));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a23_0x893916(0x91),'command':'list','description':a23_0x893916(0x98),'risk':'read','flags':[{'name':a23_0x893916(0x94),'type':a23_0x893916(0x8b),'description':'Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)'},{...CODE_FLAG,'required':![],'description':a23_0x893916(0xa5)}],async 'execute'(_0x382f4c){const _0xa55bce=a23_0x893916,_0xb08e37=_0x382f4c[_0xa55bce(0x8a)]('name'),_0xcee6be=_0x382f4c[_0xa55bce(0x8a)](_0xa55bce(0xa4)),_0x5310d5=await listDatasets(_0x382f4c['appCode'],{..._0xb08e37&&{'name':_0xb08e37},..._0xcee6be&&{'code':_0xcee6be}});return{'ok':!![],'data':{'total':_0x5310d5[_0xa55bce(0x99)],'datasets':_0x5310d5[_0xa55bce(0xa1)](_0x3a5fcb=>{const _0x2d2a89=_0xa55bce,_0x16a9d8=_0x3a5fcb[_0x2d2a89(0xa3)]??{};return{'id':_0x3a5fcb['id'],'code':_0x3a5fcb[_0x2d2a89(0xa4)],'name':_0x3a5fcb[_0x2d2a89(0x94)],'source':_0x3a5fcb[_0x2d2a89(0x9d)],'description':_0x3a5fcb['description'],'table':_0x16a9d8[_0x2d2a89(0x95)],'datasetKey':_0x16a9d8[_0x2d2a89(0x92)],'pk':_0x16a9d8[_0x2d2a89(0xa2)],'fields':_0x16a9d8[_0x2d2a89(0x8c)]?_0x16a9d8[_0x2d2a89(0x8c)]['split'](',')[_0x2d2a89(0xa1)](_0xbeda11=>_0xbeda11[_0x2d2a89(0x90)]()):[]};})}};}};function a23_0x25d1(){const _0x2fdd76=['10749852bzKSqc','52806sSMnEZ','trim','dataset','datasetKey','65TzmtmZ','name','tableName','5653240uZAnKh','2792570tNLIzo','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','length','2888109ERPXCq','102868vaOKpP','22CAAXWd','source','637fXcHyE','27dWStVD','503314ZTdqze','map','pkField','dbtableConfig','code','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','str','string','allFields','1fJKwjH'];a23_0x25d1=function(){return _0x2fdd76;};return a23_0x25d1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x4cb8(){const _0x43dd57=['18817780cGsiSB','57801KmvmIY','dataset','7567FvTcRx','str','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','code','4813140uUGuLD','5316JhCnrc','trim','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','string','1891255VeaOYo','11BsuBBA','143624WiqfQJ','sdk-doc','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','531bhKEiE','82gfYecU','34104JgnEEL','appCode'];a24_0x4cb8=function(){return _0x43dd57;};return a24_0x4cb8();}function a24_0x22f8(_0x1e48a2,_0x2f6f09){_0x1e48a2=_0x1e48a2-0x1a3;const _0x4cb8d7=a24_0x4cb8();let _0x22f85c=_0x4cb8d7[_0x1e48a2];return _0x22f85c;}const a24_0x582480=a24_0x22f8;(function(_0x21eb64,_0x3cc604){const _0x5ea5cc=a24_0x22f8,_0x4de7b9=_0x21eb64();while(!![]){try{const _0xde4f78=parseInt(_0x5ea5cc(0x1b5))/0x1+parseInt(_0x5ea5cc(0x1b4))/0x2*(parseInt(_0x5ea5cc(0x1a3))/0x3)+parseInt(_0x5ea5cc(0x1a9))/0x4+parseInt(_0x5ea5cc(0x1ae))/0x5+-parseInt(_0x5ea5cc(0x1aa))/0x6*(parseInt(_0x5ea5cc(0x1a5))/0x7)+parseInt(_0x5ea5cc(0x1b0))/0x8*(parseInt(_0x5ea5cc(0x1b3))/0x9)+parseInt(_0x5ea5cc(0x1b7))/0xa*(-parseInt(_0x5ea5cc(0x1af))/0xb);if(_0xde4f78===_0x3cc604)break;else _0x4de7b9['push'](_0x4de7b9['shift']());}catch(_0x328f6a){_0x4de7b9['push'](_0x4de7b9['shift']());}}}(a24_0x4cb8,0x98a76));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a24_0x582480(0x1b2);export function formatDatasetSdkMarkdown(_0xf1561c){const _0x411967=a24_0x582480,_0x24776a=typeof _0xf1561c===_0x411967(0x1ad)?_0xf1561c[_0x411967(0x1ab)]():'';return _0x24776a||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a24_0x582480(0x1a4),'command':a24_0x582480(0x1b1),'description':a24_0x582480(0x1ac),'risk':'read','flags':[{...CODE_FLAG,'description':a24_0x582480(0x1a7)}],async 'execute'(_0x2d62c9){const _0x25368b=a24_0x582480,_0x407ebd=_0x2d62c9[_0x25368b(0x1a6)](_0x25368b(0x1a8)),_0x386731=await getDatasetSdkUsageDoc(_0x407ebd,_0x2d62c9['appCode']);return{'ok':!![],'data':{'code':_0x407ebd,'appCode':_0x2d62c9[_0x25368b(0x1b6)],'markdown':formatDatasetSdkMarkdown(_0x386731)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x4595(_0xa5dfe0,_0x520e39){_0xa5dfe0=_0xa5dfe0-0xb0;const _0x4ba555=a25_0x4ba5();let _0x459559=_0x4ba555[_0xa5dfe0];return _0x459559;}const a25_0x32d250=a25_0x4595;(function(_0x40a370,_0x4f48a2){const _0x2f20e3=a25_0x4595,_0x24304f=_0x40a370();while(!![]){try{const _0x120214=-parseInt(_0x2f20e3(0xcb))/0x1+-parseInt(_0x2f20e3(0xba))/0x2+-parseInt(_0x2f20e3(0xd8))/0x3*(parseInt(_0x2f20e3(0xe3))/0x4)+-parseInt(_0x2f20e3(0xb5))/0x5*(parseInt(_0x2f20e3(0xd7))/0x6)+-parseInt(_0x2f20e3(0xc8))/0x7*(parseInt(_0x2f20e3(0xc2))/0x8)+parseInt(_0x2f20e3(0xf8))/0x9*(-parseInt(_0x2f20e3(0xf7))/0xa)+parseInt(_0x2f20e3(0xea))/0xb;if(_0x120214===_0x4f48a2)break;else _0x24304f['push'](_0x24304f['shift']());}catch(_0x4a9f6f){_0x24304f['push'](_0x24304f['shift']());}}}(a25_0x4ba5,0xf078b));import a25_0x19e9cb from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x2e1733){const _0x4ef492=a25_0x4595,_0x235425=getCliVersion(),_0x540235=buildConfigFromFlags({});await initGlobalEnvironment(_0x540235),console[_0x4ef492(0xf5)](),console['log'](a25_0x19e9cb[_0x4ef492(0xd3)](CLI_BIN_NAME+_0x4ef492(0xfc))),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd4)]('─'['repeat'](0x32))),console[_0x4ef492(0xf5)](_0x4ef492(0xc7)+_0x235425),console[_0x4ef492(0xf5)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process['version']),console[_0x4ef492(0xf5)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x4ef492(0xcd)]+'\x20'+process['arch']),console['log'](),console['log'](a25_0x19e9cb[_0x4ef492(0xd3)]('\x20\x20Config\x20Files')),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xe5)[_0x4ef492(0xf0)](0x1e)));const _0x3761a1=getGlobalConfigPath(),_0xbdd4eb=getProjectConfigPath();console[_0x4ef492(0xf5)](_0x4ef492(0xb2)+(_0x3761a1||a25_0x19e9cb[_0x4ef492(0xd4)]('(not\x20found)'))),console[_0x4ef492(0xf5)](_0x4ef492(0xff)+(_0xbdd4eb||a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xeb)))),console[_0x4ef492(0xf5)](),console['log'](a25_0x19e9cb[_0x4ef492(0xd3)](_0x4ef492(0xee))),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xe5)[_0x4ef492(0xf0)](0x1e)));const _0x50e7e5=(_0xdacdbe,_0x4eeef7)=>{const _0x44e305=_0x4ef492;if(!_0x4eeef7){console[_0x44e305(0xf5)]('\x20\x20'+_0xdacdbe[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb['gray'](_0x44e305(0xe4)));return;}const _0x5c927a=inspectCliConfigJsonFile(_0x4eeef7);if(_0x5c927a['status']==='ok')console[_0x44e305(0xf5)]('\x20\x20'+_0xdacdbe[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb[_0x44e305(0xf3)]('✓\x20Valid\x20JSON'));else{if(_0x5c927a[_0x44e305(0xfd)]===_0x44e305(0xf2))console[_0x44e305(0xf5)]('\x20\x20'+_0xdacdbe[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb['yellow']('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x5c927a[_0x44e305(0xfd)]===_0x44e305(0xd5)?console['log']('\x20\x20'+_0xdacdbe[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb['gray'](_0x44e305(0xcf))):(console[_0x44e305(0xf5)]('\x20\x20'+_0xdacdbe[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb[_0x44e305(0xc6)](_0x44e305(0xf4))),console['log']('\x20\x20'+''[_0x44e305(0xdc)](0x11)+'\x20'+a25_0x19e9cb[_0x44e305(0xc6)](_0x5c927a[_0x44e305(0xbf)])));}};_0x50e7e5(_0x4ef492(0xda),_0x3761a1),_0x50e7e5('Project',_0xbdd4eb),console['log'](),console[_0x4ef492(0xf5)](a25_0x19e9cb['bold']('\x20\x20Merged\x20Config')),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xe5)[_0x4ef492(0xf0)](0x1e))),console[_0x4ef492(0xf5)](_0x4ef492(0xed)+(_0x540235[_0x4ef492(0x100)]||a25_0x19e9cb[_0x4ef492(0xc6)](_0x4ef492(0x103)))),console[_0x4ef492(0xf5)](_0x4ef492(0xec)+_0x540235[_0x4ef492(0xc1)]);const _0x44c494=isLegacyCompatConfigKey('locale')?a25_0x19e9cb[_0x4ef492(0xd4)](_0x540235[_0x4ef492(0xdb)]+_0x4ef492(0xc3)):_0x540235[_0x4ef492(0xdb)];console[_0x4ef492(0xf5)](_0x4ef492(0xd6)+_0x44c494),console['log'](_0x4ef492(0xb9)+(_0x540235[_0x4ef492(0xfe)]||a25_0x19e9cb['gray'](_0x4ef492(0xd1)))),console[_0x4ef492(0xf5)](_0x4ef492(0xe2)+(_0x540235['currentApp']||a25_0x19e9cb[_0x4ef492(0xd4)]('(none)'))),console['log'](_0x4ef492(0xe7)+(_0x540235['format']||a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xfb)+DEFAULT_CONFIG_VALUES['format']+')'))),console['log'](_0x4ef492(0xd9)+(_0x540235[_0x4ef492(0x102)]??a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xef)))),console[_0x4ef492(0xf5)](_0x4ef492(0xca)+_0x540235[_0x4ef492(0xe6)]),console[_0x4ef492(0xf5)](_0x4ef492(0xe8)+_0x540235[_0x4ef492(0xce)]),console[_0x4ef492(0xf5)](_0x4ef492(0xc9)+AUTH_MODE[_0x4ef492(0xdd)]),console['log'](_0x4ef492(0xb4)+(_0x540235[_0x4ef492(0xb7)]?a25_0x19e9cb[_0x4ef492(0xf3)]('(set,\x20length='+_0x540235[_0x4ef492(0xb7)]['length']+')'):a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xd1)))),console[_0x4ef492(0xf5)](),console['log'](a25_0x19e9cb['bold']('\x20\x20API\x20Endpoints')),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xe5)['repeat'](0x1e))),console[_0x4ef492(0xf5)](_0x4ef492(0xdf)+getApiDomain()),console[_0x4ef492(0xf5)](_0x4ef492(0xbe)+getUserDomain()),console[_0x4ef492(0xf5)](_0x4ef492(0xb1)+getRuntimeDomain()),console[_0x4ef492(0xf5)](),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd3)](_0x4ef492(0xbb))),console['log'](a25_0x19e9cb[_0x4ef492(0xd4)]('\x20\x20─'[_0x4ef492(0xf0)](0x1e)));const _0x5e8690=inspectServiceRegistry();console['log']('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5e8690['registryPath']),console[_0x4ef492(0xf5)](_0x4ef492(0xbd)+formatServiceRegistryStatus(_0x5e8690)),console[_0x4ef492(0xf5)](_0x4ef492(0xf9)+_0x5e8690[_0x4ef492(0xc4)]),console['log'](_0x4ef492(0xb3)+_0x5e8690['commandCount']);for(const _0x4228fb of _0x5e8690[_0x4ef492(0xf1)]){console[_0x4ef492(0xf5)]('\x20\x20'+(_0x4228fb['serviceCode']+':')[_0x4ef492(0xdc)](0x11)+'\x20'+(_0x4228fb[_0x4ef492(0xd2)]||a25_0x19e9cb[_0x4ef492(0xd4)]('(unnamed)'))+'\x20('+_0x4228fb[_0x4ef492(0xf6)]+_0x4ef492(0xc5)),console[_0x4ef492(0xf5)]('\x20\x20'+''[_0x4ef492(0xdc)](0x11)+'\x20Imported\x20from:\x20'+_0x4228fb[_0x4ef492(0xb6)][_0x4ef492(0xde)]);}return console[_0x4ef492(0xf5)](),console[_0x4ef492(0xf5)](a25_0x19e9cb[_0x4ef492(0xd3)](_0x4ef492(0xc0))),console[_0x4ef492(0xf5)](a25_0x19e9cb['gray'](_0x4ef492(0xe5)[_0x4ef492(0xf0)](0x1e))),console[_0x4ef492(0xf5)](_0x4ef492(0xb0)+a25_0x19e9cb[_0x4ef492(0xf3)](AUTH_MODE[_0x4ef492(0xdd)]+_0x4ef492(0xe9))),console['log'](_0x4ef492(0xbc)+a25_0x19e9cb[_0x4ef492(0xd4)](_0x4ef492(0xd0))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0xadc9dd){const _0x4a3b69=a25_0x4595;if(_0xadc9dd[_0x4a3b69(0xfd)]==='ok')return a25_0x19e9cb['green'](_0x4a3b69(0xb8));if(_0xadc9dd[_0x4a3b69(0xfd)]===_0x4a3b69(0xd5))return a25_0x19e9cb['gray'](_0x4a3b69(0xeb));if(_0xadc9dd[_0x4a3b69(0xfd)]===_0x4a3b69(0xf2))return a25_0x19e9cb['yellow'](_0x4a3b69(0xfa));return a25_0x19e9cb[_0x4a3b69(0xc6)](_0x4a3b69(0xcc)+(_0xadc9dd[_0x4a3b69(0xbf)]?':\x20'+_0xadc9dd[_0x4a3b69(0xbf)]:''));}export const doctorDefinition={'service':a25_0x32d250(0x101),'command':a25_0x32d250(0xe1),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a25_0x32d250(0xe0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};function a25_0x4ba5(){const _0x58cf73=['\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','message','\x20\x20Auth','env','1888ZXnvJC','\x20(legacy/compat\x20only)','serviceCount','\x20commands)','red','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','15757bbBbhf','\x20\x20auth\x20(effective):\x20','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','1778142FstHbC','✗\x20Invalid','platform','verbose','(missing)','(removed\x20—\x20cookie\x20auth\x20disabled)','(none)','name','bold','gray','missing','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','6654GZnCBy','12hKOBpf','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Global','locale','padEnd','ClientAk','path','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','read','check','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','1571396JLnRhI','(no\x20file)','\x20\x20─','riskLevel','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','90387462ORTAJq','(not\x20found)','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','(default)','repeat','services','empty','green','✗\x20Invalid\x20JSON','log','commandCount','12473810eYwqfy','9GskohS','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty','(default:\x20','\x20doctor','status','defaultApp','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','appCode','doctor','pageSize','(not\x20set)','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','1160XZiVMz','source','accessKey','✓\x20Loaded','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','3693256PSqZOQ','\x20\x20Service\x20Tree'];a25_0x4ba5=function(){return _0x58cf73;};return a25_0x4ba5();}
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x52387f=a26_0xd43e;(function(_0x443ea3,_0x14c22c){const _0x32e276=a26_0xd43e,_0x4d8881=_0x443ea3();while(!![]){try{const _0x46a24c=parseInt(_0x32e276(0x19a))/0x1+-parseInt(_0x32e276(0x19d))/0x2*(parseInt(_0x32e276(0x1c3))/0x3)+-parseInt(_0x32e276(0x1de))/0x4*(parseInt(_0x32e276(0x1d4))/0x5)+-parseInt(_0x32e276(0x19f))/0x6*(parseInt(_0x32e276(0x1dd))/0x7)+parseInt(_0x32e276(0x198))/0x8+parseInt(_0x32e276(0x1cd))/0x9*(-parseInt(_0x32e276(0x1d5))/0xa)+parseInt(_0x32e276(0x1a1))/0xb;if(_0x46a24c===_0x14c22c)break;else _0x4d8881['push'](_0x4d8881['shift']());}catch(_0x16f16e){_0x4d8881['push'](_0x4d8881['shift']());}}}(a26_0x5233,0xa68e7));import{existsSync,readFileSync}from'node:fs';function a26_0x5233(){const _0x3ff866=['appcode','boolean','newConfigFileName','1014xwJAnr','Initialized\x20','flagMissing','\x20\x20appcode:\x20','\x22.\x20Allowed:\x20','Override\x20imported\x20default\x20env','utf8','\x20already\x20exists.\x20Overwrite?','Imported\x20from\x20','\x20\x20default:\x20','819zKNImn','Invalid\x20env\x20\x22','Write\x20to\x20global\x20(~/','SIGINT','Source\x20file\x20not\x20found:\x20','validation','Aborted.','20HXECCY','10IZASvi','removeListener','[y/N]','race','User\x20aborted\x20prompt','once','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','file','683823PNTjvz','733316kIoqUx','cancelled','yes','2614152MYAiWA','global','1128813WznCzI','entries','close','2932ZJBufA','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','72GzhVcY','defaultApp','17905976YgFZBV','trim','):\x20','apps','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','string','apiDir','env','stdin','\x20\x20env:\x20\x20\x20\x20\x20','AbortPrompt','app','riskLevel','Skip\x20confirmation\x20when\x20overwriting','File\x20','name','toLowerCase','join','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.',')\x20instead\x20of\x20project','includes','cwd','\x20\x20config:\x20\x20','App\x20code','message','project','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`.','log','question','Usage:\x20','App\x20code\x20cannot\x20be\x20empty.'];a26_0x5233=function(){return _0x3ff866;};return a26_0x5233();}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x52387f(0x1c0),'type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a26_0x52387f(0x1a8),'type':a26_0x52387f(0x1a6),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a26_0x52387f(0x1a8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x52387f(0x199),'type':'boolean','description':a26_0x52387f(0x1cf)+PRODUCT_CONFIG['newConfigFileName']+a26_0x52387f(0x1b4),'default':![]},{'name':a26_0x52387f(0x197),'type':a26_0x52387f(0x1c1),'description':a26_0x52387f(0x1ae),'default':![]}];export const initImportFlagDefs=[{'name':a26_0x52387f(0x1dc),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a26_0x52387f(0x1c0),'type':'string','description':'Override\x20imported\x20default\x20appcode'},{'name':a26_0x52387f(0x1a8),'type':'string','description':a26_0x52387f(0x1c8),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x52387f(0x1c1),'description':a26_0x52387f(0x1cf)+PRODUCT_CONFIG[a26_0x52387f(0x1c2)]+a26_0x52387f(0x1b4),'default':![]},{'name':'yes','type':a26_0x52387f(0x1c1),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3820ad){const _0x80331e=a26_0x52387f,_0x146d14=isNonInteractiveMode(_0x3820ad),_0xc43dc1=_0x3820ad[_0x80331e(0x199)]?_0x80331e(0x199):_0x80331e(0x1ba),_0x594a8b=resolveWriteConfigPath(_0xc43dc1);try{_0x146d14?await runNonInteractive(_0x3820ad,_0x594a8b):await runInteractive(_0x3820ad,_0x594a8b);}catch(_0x283e47){if(_0x283e47 instanceof AbortPrompt)throw CliErrors[_0x80331e(0x1df)]();throw _0x283e47;}}export async function runInitImport(_0x5dd445){const _0x56640=a26_0x52387f,_0x47babc=_0x5dd445[_0x56640(0x199)]?_0x56640(0x199):'project',_0x38bba2=resolveWriteConfigPath(_0x47babc);await runFromImport(_0x5dd445,_0x38bba2);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x52387f(0x1a7)]);async function runFromImport(_0x58e0d0,_0x4b715e){const _0x54a25a=a26_0x52387f,_0x57ad3f=resolveFilePath(_0x58e0d0[_0x54a25a(0x1dc)]);if(!existsSync(_0x57ad3f))throw CliErrors[_0x54a25a(0x1d2)](_0x54a25a(0x1d1)+_0x57ad3f);const _0x48227b=readSourceFile(_0x57ad3f),_0x564f14=convertToRuntimeConfig(_0x48227b);_0x58e0d0[_0x54a25a(0x1c0)]&&(_0x564f14['appcode']=String(_0x58e0d0[_0x54a25a(0x1c0)]));_0x58e0d0[_0x54a25a(0x1a8)]&&(_0x564f14[_0x54a25a(0x1a8)]=resolveInitEnv(_0x58e0d0));if(!_0x564f14[_0x54a25a(0x1c0)])throw CliErrors[_0x54a25a(0x1d2)](_0x54a25a(0x1db),_0x54a25a(0x1bb));await writeInitConfig(_0x4b715e,_0x564f14,_0x58e0d0),console['log'](_0x54a25a(0x1cb)+_0x57ad3f),console['log'](_0x54a25a(0x1b7)+_0x4b715e),console[_0x54a25a(0x1bc)](_0x54a25a(0x1c6)+_0x564f14[_0x54a25a(0x1c0)]);if(_0x564f14['defaultApp'])console[_0x54a25a(0x1bc)](_0x54a25a(0x1cc)+_0x564f14[_0x54a25a(0x1a0)]);}function convertToRuntimeConfig(_0x1eb013){const _0x354535=a26_0x52387f;if(_0x1eb013[_0x354535(0x1a4)]&&typeof _0x1eb013['apps']==='object')throw CliErrors[_0x354535(0x1d2)](_0x354535(0x19e),_0x354535(0x1b3));const _0x1a554b={};for(const _0x4b4034 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1eb013[_0x4b4034]!==undefined&&(_0x1a554b[_0x4b4034]=_0x1eb013[_0x4b4034]);}return!_0x1a554b['riskLevel']&&(_0x1a554b[_0x354535(0x1ad)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1a554b;}async function runNonInteractive(_0x5d7efc,_0x3a7749){const _0x4ea8b5=a26_0x52387f,_0x2f3442=_0x5d7efc['appcode'];if(!_0x2f3442)throw CliErrors[_0x4ea8b5(0x1c5)](_0x4ea8b5(0x1c0),_0x4ea8b5(0x1be)+CLI_BIN_NAME+_0x4ea8b5(0x1a5));const _0x347b85=resolveInitEnv(_0x5d7efc);await writeInitConfig(_0x3a7749,{'appcode':_0x2f3442,'env':_0x347b85},_0x5d7efc),console[_0x4ea8b5(0x1bc)](_0x4ea8b5(0x1c4)+_0x3a7749),console['log'](_0x4ea8b5(0x1c6)+_0x2f3442),console[_0x4ea8b5(0x1bc)](_0x4ea8b5(0x1aa)+_0x347b85);}function a26_0xd43e(_0x897a35,_0x370a2e){_0x897a35=_0x897a35-0x197;const _0x523348=a26_0x5233();let _0xd43e23=_0x523348[_0x897a35];return _0xd43e23;}async function runInteractive(_0x4fc80c,_0x1009ec){const _0x14569d=a26_0x52387f,_0x1941dc=loadExisting(_0x1009ec),_0x46ef23=typeof _0x1941dc?.[_0x14569d(0x1c0)]===_0x14569d(0x1a6)?_0x1941dc['appcode']:'',_0x4b0859=resolveInitEnv(_0x4fc80c);console[_0x14569d(0x1bc)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x1009ec)&&!_0x4fc80c[_0x14569d(0x197)]){const _0x4fcb31=await promptYesNo(_0x14569d(0x1af)+_0x1009ec+_0x14569d(0x1ca),![]);if(!_0x4fcb31){console['log'](_0x14569d(0x1d3));return;}}const _0x1a19f3=typeof _0x4fc80c[_0x14569d(0x1c0)]===_0x14569d(0x1a6)?_0x4fc80c[_0x14569d(0x1c0)]['trim']():'';let _0xaf0f5a=_0x1a19f3;!_0xaf0f5a&&(_0xaf0f5a=await promptInput(_0x14569d(0x1b8),_0x46ef23));if(!_0xaf0f5a['trim']())throw CliErrors['validation'](_0x14569d(0x1bf));await writeInitConfig(_0x1009ec,{'appcode':_0xaf0f5a[_0x14569d(0x1a2)](),'env':_0x4b0859},_0x4fc80c),console['log']('\x0aInitialized\x20'+_0x1009ec),console[_0x14569d(0x1bc)]('\x20\x20appcode:\x20'+_0xaf0f5a[_0x14569d(0x1a2)]()),console[_0x14569d(0x1bc)](_0x14569d(0x1aa)+_0x4b0859);}async function writeInitConfig(_0x187e82,_0x1920d3,_0x381710){const _0x203496=a26_0x52387f;let _0x58ee98={};existsSync(_0x187e82)&&!_0x381710[_0x203496(0x197)]&&(_0x58ee98=readConfigFile(_0x187e82));for(const [_0x1ea87f,_0x357089]of Object[_0x203496(0x19b)](_0x1920d3)){_0x357089!==undefined&&(_0x58ee98[_0x1ea87f]=_0x357089);}if(_0x58ee98[_0x203496(0x1ac)])delete _0x58ee98[_0x203496(0x1ac)];writeConfigFile(_0x187e82,_0x58ee98);}class AbortPrompt extends Error{constructor(){const _0x5bd5c8=a26_0x52387f;super(_0x5bd5c8(0x1d9)),this[_0x5bd5c8(0x1b0)]=_0x5bd5c8(0x1ab);}}function createSafeRl(){const _0x1ba67d=a26_0x52387f,_0x302cc0=createInterface({'input':process[_0x1ba67d(0x1a9)],'output':process['stdout']});let _0x5f548c;const _0x17e764=new Promise((_0xc9e851,_0x1f528d)=>{const _0x4373aa=_0x1ba67d;_0x5f548c=()=>{const _0x543572=a26_0xd43e;_0x5f548c&&(_0x302cc0[_0x543572(0x1d6)](_0x543572(0x1d0),_0x5f548c),_0x5f548c=undefined);try{_0x302cc0[_0x543572(0x19c)]();}catch{}_0x1f528d(new AbortPrompt());},_0x302cc0[_0x4373aa(0x1da)](_0x4373aa(0x1d0),_0x5f548c);}),_0xcd0687=()=>{const _0x5d0985=_0x1ba67d;_0x5f548c&&(_0x302cc0[_0x5d0985(0x1d6)](_0x5d0985(0x1d0),_0x5f548c),_0x5f548c=undefined);try{_0x302cc0[_0x5d0985(0x19c)]();}catch{}};return{'rl':_0x302cc0,'abortPromise':_0x17e764,'disposeSuccess':_0xcd0687};}async function promptInput(_0x31059d,_0x23a49a){const {rl:_0x2b8dc3,abortPromise:_0x44517e,disposeSuccess:_0x4e941f}=createSafeRl(),_0x511e59=new Promise(_0x4879ff=>{const _0x3bd396=a26_0xd43e,_0x513d39=_0x23a49a?'\x20\x20'+_0x31059d+'\x20('+_0x23a49a+_0x3bd396(0x1a3):'\x20\x20'+_0x31059d+':\x20';_0x2b8dc3[_0x3bd396(0x1bd)](_0x513d39,_0x2ade1e=>{_0x4e941f(),_0x4879ff(_0x2ade1e['trim']()||_0x23a49a);});});return Promise['race']([_0x511e59,_0x44517e]);}async function promptYesNo(_0x9f06b,_0x271ffc){const _0x5dd090=a26_0x52387f,{rl:_0x52a47c,abortPromise:_0x1aefa1,disposeSuccess:_0x1e735a}=createSafeRl(),_0x599e7d=new Promise(_0x3d26f8=>{const _0x523e1d=a26_0xd43e,_0x1db67d=_0x271ffc?'[Y/n]':_0x523e1d(0x1d7);_0x52a47c['question']('\x20\x20'+_0x9f06b+'\x20'+_0x1db67d+':\x20',_0xfdd26e=>{const _0xb119c8=_0x523e1d;_0x1e735a();const _0x37d190=_0xfdd26e[_0xb119c8(0x1a2)]()[_0xb119c8(0x1b1)]();if(_0x37d190==='y'||_0x37d190===_0xb119c8(0x197))_0x3d26f8(!![]);else{if(_0x37d190==='n'||_0x37d190==='no')_0x3d26f8(![]);else _0x3d26f8(_0x271ffc);}});});return Promise[_0x5dd090(0x1d8)]([_0x599e7d,_0x1aefa1]);}function loadExisting(_0x45b4a1){if(!existsSync(_0x45b4a1))return null;return readConfigFile(_0x45b4a1);}function resolveFilePath(_0x48fc34){const _0xf2f813=a26_0x52387f;return isAbsolute(_0x48fc34)?_0x48fc34:resolve(process[_0xf2f813(0x1b6)](),_0x48fc34);}function readSourceFile(_0x1cb35d){const _0x2a215b=a26_0x52387f;try{const _0x179d29=readFileSync(_0x1cb35d,{'encoding':_0x2a215b(0x1c9)});return JSON['parse'](_0x179d29);}catch(_0x39323e){throw CliErrors[_0x2a215b(0x1d2)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x39323e[_0x2a215b(0x1b9)]);}}function resolveInitEnv(_0x3aefca){const _0x533ef3=a26_0x52387f,_0x528e27=_0x3aefca[_0x533ef3(0x1a8)];if(_0x528e27===undefined||_0x528e27==='')return DEFAULT_CONFIG_VALUES[_0x533ef3(0x1a8)];if(!RUNTIME_ENV_VALUES[_0x533ef3(0x1b5)](_0x528e27))throw CliErrors['validation'](_0x533ef3(0x1ce)+_0x528e27+_0x533ef3(0x1c7)+RUNTIME_ENV_VALUES[_0x533ef3(0x1b2)](',\x20'));return _0x528e27;}
|
|
1
|
+
const a26_0x128358=a26_0x5b4e;(function(_0x149878,_0x5889ee){const _0x480998=a26_0x5b4e,_0x52b97d=_0x149878();while(!![]){try{const _0x17f878=parseInt(_0x480998(0x1fa))/0x1+parseInt(_0x480998(0x223))/0x2*(parseInt(_0x480998(0x1e4))/0x3)+parseInt(_0x480998(0x200))/0x4+-parseInt(_0x480998(0x207))/0x5+-parseInt(_0x480998(0x226))/0x6*(parseInt(_0x480998(0x1e0))/0x7)+parseInt(_0x480998(0x1ee))/0x8*(-parseInt(_0x480998(0x206))/0x9)+-parseInt(_0x480998(0x1f2))/0xa*(-parseInt(_0x480998(0x1ef))/0xb);if(_0x17f878===_0x5889ee)break;else _0x52b97d['push'](_0x52b97d['shift']());}catch(_0x4f17b7){_0x52b97d['push'](_0x52b97d['shift']());}}}(a26_0x1d14,0xf0f01));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';function a26_0x5b4e(_0x3020fc,_0x34b24c){_0x3020fc=_0x3020fc-0x1de;const _0x1d14b7=a26_0x1d14();let _0x5b4ece=_0x1d14b7[_0x3020fc];return _0x5b4ece;}import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a26_0x128358(0x1e6),'type':a26_0x128358(0x1fe),'description':a26_0x128358(0x201)},{'name':'env','type':a26_0x128358(0x1fe),'description':a26_0x128358(0x220)+DEFAULT_CONFIG_VALUES[a26_0x128358(0x1e8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a26_0x128358(0x20b),'type':a26_0x128358(0x1e9),'description':a26_0x128358(0x1f7)+PRODUCT_CONFIG[a26_0x128358(0x205)]+a26_0x128358(0x1ec),'default':![]},{'name':a26_0x128358(0x1f5),'type':a26_0x128358(0x1e9),'description':a26_0x128358(0x1f9),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a26_0x128358(0x1fe),'description':a26_0x128358(0x225),'required':!![]},{'name':a26_0x128358(0x1e6),'type':a26_0x128358(0x1fe),'description':a26_0x128358(0x1e2)},{'name':'env','type':'string','description':a26_0x128358(0x21a),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a26_0x128358(0x1e9),'description':a26_0x128358(0x1f7)+PRODUCT_CONFIG[a26_0x128358(0x205)]+')\x20instead\x20of\x20project','default':![]},{'name':a26_0x128358(0x1f5),'type':a26_0x128358(0x1e9),'description':a26_0x128358(0x1f9),'default':![]}];export async function runInit(_0xaf2dcc){const _0xa610af=a26_0x128358,_0x2be3cc=isNonInteractiveMode(_0xaf2dcc),_0x579ebc=_0xaf2dcc[_0xa610af(0x20b)]?'global':_0xa610af(0x221),_0x35d669=resolveWriteConfigPath(_0x579ebc);try{_0x2be3cc?await runNonInteractive(_0xaf2dcc,_0x35d669):await runInteractive(_0xaf2dcc,_0x35d669);}catch(_0x26477d){if(_0x26477d instanceof AbortPrompt)throw CliErrors[_0xa610af(0x20d)]();throw _0x26477d;}}function a26_0x1d14(){const _0x4fd0b0=['defaultApp','18550IvdBYg','removeListener','utf8','yes','Initialized\x20','Write\x20to\x20global\x20(~/','Failed\x20to\x20parse\x20source\x20file:\x20','Skip\x20confirmation\x20when\x20overwriting','587383XrTNcl','Source\x20file\x20not\x20found:\x20','object','log','string','\x20\x20config:\x20\x20','458400bfMyMU','App\x20code\x20for\x20the\x20project','\x20already\x20exists.\x20Overwrite?','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`.','message','newConfigFileName','90uxArJr','9248210EOQymJ','\x20\x20env:\x20\x20\x20\x20\x20','AbortPrompt','file','global','stdout','cancelled','User\x20aborted\x20prompt','toLowerCase','riskLevel','race','App\x20code','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20init\x20—\x20Create\x20','question','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','\x0aInitialized\x20','SIGINT','entries','Override\x20imported\x20default\x20env','close','[Y/n]','includes','trim','Imported\x20from\x20','Target\x20environment\x20(default\x20','project','stdin','98OeRbqg','flagMissing','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','839382rqbZNw','\x20\x20appcode:\x20','App\x20code\x20cannot\x20be\x20empty.','14WaoxUV','\x20\x20default:\x20','Override\x20imported\x20default\x20appcode','):\x20','71583opcMoi','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','appcode','app','env','boolean','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','once',')\x20instead\x20of\x20project','apiDir','774296EmARid','13123KieeZm','validation'];a26_0x1d14=function(){return _0x4fd0b0;};return a26_0x1d14();}export async function runInitImport(_0x185407){const _0x3b8e90=a26_0x128358,_0x962912=_0x185407[_0x3b8e90(0x20b)]?_0x3b8e90(0x20b):_0x3b8e90(0x221),_0x4cdafe=resolveWriteConfigPath(_0x962912);await runFromImport(_0x185407,_0x4cdafe);}const RUNTIME_IRRELEVANT_KEYS=new Set([a26_0x128358(0x1ed)]);async function runFromImport(_0x4864f9,_0x30802e){const _0xeb0fd1=a26_0x128358,_0x59cfcb=resolveFilePath(_0x4864f9[_0xeb0fd1(0x20a)]);if(!existsSync(_0x59cfcb))throw CliErrors[_0xeb0fd1(0x1f0)](_0xeb0fd1(0x1fb)+_0x59cfcb);const _0x52bcb8=readSourceFile(_0x59cfcb),_0x3f5e1d=convertToRuntimeConfig(_0x52bcb8);_0x4864f9[_0xeb0fd1(0x1e6)]&&(_0x3f5e1d[_0xeb0fd1(0x1e6)]=String(_0x4864f9['appcode']));_0x4864f9['env']&&(_0x3f5e1d['env']=resolveInitEnv(_0x4864f9));if(!_0x3f5e1d[_0xeb0fd1(0x1e6)])throw CliErrors[_0xeb0fd1(0x1f0)](_0xeb0fd1(0x216),_0xeb0fd1(0x203));await writeInitConfig(_0x30802e,_0x3f5e1d,_0x4864f9),console[_0xeb0fd1(0x1fd)](_0xeb0fd1(0x21f)+_0x59cfcb),console[_0xeb0fd1(0x1fd)](_0xeb0fd1(0x1ff)+_0x30802e),console[_0xeb0fd1(0x1fd)](_0xeb0fd1(0x1de)+_0x3f5e1d[_0xeb0fd1(0x1e6)]);if(_0x3f5e1d[_0xeb0fd1(0x1f1)])console[_0xeb0fd1(0x1fd)](_0xeb0fd1(0x1e1)+_0x3f5e1d[_0xeb0fd1(0x1f1)]);}function convertToRuntimeConfig(_0x5230ca){const _0x34fd78=a26_0x128358;if(_0x5230ca['apps']&&typeof _0x5230ca['apps']===_0x34fd78(0x1fc))throw CliErrors['validation'](_0x34fd78(0x1ea),_0x34fd78(0x213));const _0xf523d4={};for(const _0x3d9279 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5230ca[_0x3d9279]!==undefined&&(_0xf523d4[_0x3d9279]=_0x5230ca[_0x3d9279]);}return!_0xf523d4[_0x34fd78(0x210)]&&(_0xf523d4['riskLevel']=DEFAULT_CONFIG_VALUES[_0x34fd78(0x210)]),_0xf523d4;}async function runNonInteractive(_0x1c5034,_0x1c2e93){const _0x236a9c=a26_0x128358,_0x340c49=_0x1c5034[_0x236a9c(0x1e6)];if(!_0x340c49)throw CliErrors[_0x236a9c(0x224)](_0x236a9c(0x1e6),'Usage:\x20'+CLI_BIN_NAME+_0x236a9c(0x1e5));const _0x388d57=resolveInitEnv(_0x1c5034);await writeInitConfig(_0x1c2e93,{'appcode':_0x340c49,'env':_0x388d57},_0x1c5034),console[_0x236a9c(0x1fd)](_0x236a9c(0x1f6)+_0x1c2e93),console[_0x236a9c(0x1fd)]('\x20\x20appcode:\x20'+_0x340c49),console[_0x236a9c(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x388d57);}async function runInteractive(_0x1ae578,_0x26c853){const _0x442db3=a26_0x128358,_0x4a53ad=loadExisting(_0x26c853),_0xde42fa=typeof _0x4a53ad?.[_0x442db3(0x1e6)]===_0x442db3(0x1fe)?_0x4a53ad[_0x442db3(0x1e6)]:'',_0x19c067=resolveInitEnv(_0x1ae578);console['log'](CLI_BIN_NAME+_0x442db3(0x214)+PRODUCT_CONFIG[_0x442db3(0x205)]+'\x0a');if(existsSync(_0x26c853)&&!_0x1ae578[_0x442db3(0x1f5)]){const _0x38bd4a=await promptYesNo('File\x20'+_0x26c853+_0x442db3(0x202),![]);if(!_0x38bd4a){console['log']('Aborted.');return;}}const _0x12e3ee=typeof _0x1ae578[_0x442db3(0x1e6)]===_0x442db3(0x1fe)?_0x1ae578[_0x442db3(0x1e6)][_0x442db3(0x21e)]():'';let _0x329f97=_0x12e3ee;!_0x329f97&&(_0x329f97=await promptInput(_0x442db3(0x212),_0xde42fa));if(!_0x329f97['trim']())throw CliErrors[_0x442db3(0x1f0)](_0x442db3(0x1df));await writeInitConfig(_0x26c853,{'appcode':_0x329f97[_0x442db3(0x21e)](),'env':_0x19c067},_0x1ae578),console[_0x442db3(0x1fd)](_0x442db3(0x217)+_0x26c853),console[_0x442db3(0x1fd)](_0x442db3(0x1de)+_0x329f97['trim']()),console['log'](_0x442db3(0x208)+_0x19c067);}async function writeInitConfig(_0x418c96,_0x5b8859,_0x41efe3){const _0x402cbd=a26_0x128358;let _0x36675a={};existsSync(_0x418c96)&&!_0x41efe3[_0x402cbd(0x1f5)]&&(_0x36675a=readConfigFile(_0x418c96));for(const [_0x55ed15,_0x27ae44]of Object[_0x402cbd(0x219)](_0x5b8859)){_0x27ae44!==undefined&&(_0x36675a[_0x55ed15]=_0x27ae44);}if(_0x36675a['app'])delete _0x36675a[_0x402cbd(0x1e7)];writeConfigFile(_0x418c96,_0x36675a);}class AbortPrompt extends Error{constructor(){const _0x1cd268=a26_0x128358;super(_0x1cd268(0x20e)),this['name']=_0x1cd268(0x209);}}function createSafeRl(){const _0x29ad51=a26_0x128358,_0x2d142e=createInterface({'input':process[_0x29ad51(0x222)],'output':process[_0x29ad51(0x20c)]});let _0x57d20e;const _0x3a6ab6=new Promise((_0xabe972,_0x1de03e)=>{const _0x1db3f6=_0x29ad51;_0x57d20e=()=>{const _0x1d688b=a26_0x5b4e;_0x57d20e&&(_0x2d142e[_0x1d688b(0x1f3)]('SIGINT',_0x57d20e),_0x57d20e=undefined);try{_0x2d142e[_0x1d688b(0x21b)]();}catch{}_0x1de03e(new AbortPrompt());},_0x2d142e[_0x1db3f6(0x1eb)](_0x1db3f6(0x218),_0x57d20e);}),_0x194a8e=()=>{const _0x29553f=_0x29ad51;_0x57d20e&&(_0x2d142e[_0x29553f(0x1f3)](_0x29553f(0x218),_0x57d20e),_0x57d20e=undefined);try{_0x2d142e[_0x29553f(0x21b)]();}catch{}};return{'rl':_0x2d142e,'abortPromise':_0x3a6ab6,'disposeSuccess':_0x194a8e};}async function promptInput(_0x4ab2b1,_0x5754e3){const _0x40708e=a26_0x128358,{rl:_0x4e854d,abortPromise:_0x2e12ff,disposeSuccess:_0x2caefa}=createSafeRl(),_0x194375=new Promise(_0x3a3d96=>{const _0x32e025=a26_0x5b4e,_0x443158=_0x5754e3?'\x20\x20'+_0x4ab2b1+'\x20('+_0x5754e3+_0x32e025(0x1e3):'\x20\x20'+_0x4ab2b1+':\x20';_0x4e854d[_0x32e025(0x215)](_0x443158,_0x42b57f=>{const _0x261410=_0x32e025;_0x2caefa(),_0x3a3d96(_0x42b57f[_0x261410(0x21e)]()||_0x5754e3);});});return Promise[_0x40708e(0x211)]([_0x194375,_0x2e12ff]);}async function promptYesNo(_0x2bf7b1,_0x3cea9f){const _0xed7ef6=a26_0x128358,{rl:_0x2d0f3a,abortPromise:_0x3b1256,disposeSuccess:_0x385a4f}=createSafeRl(),_0x4c54a7=new Promise(_0x7f05a6=>{const _0x4729a3=a26_0x5b4e,_0x5e6d6a=_0x3cea9f?_0x4729a3(0x21c):'[y/N]';_0x2d0f3a[_0x4729a3(0x215)]('\x20\x20'+_0x2bf7b1+'\x20'+_0x5e6d6a+':\x20',_0x16ce80=>{const _0x5260d8=_0x4729a3;_0x385a4f();const _0x1445e4=_0x16ce80[_0x5260d8(0x21e)]()[_0x5260d8(0x20f)]();if(_0x1445e4==='y'||_0x1445e4===_0x5260d8(0x1f5))_0x7f05a6(!![]);else{if(_0x1445e4==='n'||_0x1445e4==='no')_0x7f05a6(![]);else _0x7f05a6(_0x3cea9f);}});});return Promise[_0xed7ef6(0x211)]([_0x4c54a7,_0x3b1256]);}function loadExisting(_0x10e2a2){if(!existsSync(_0x10e2a2))return null;return readConfigFile(_0x10e2a2);}function resolveFilePath(_0x46eca2){return isAbsolute(_0x46eca2)?_0x46eca2:resolve(process['cwd'](),_0x46eca2);}function readSourceFile(_0xcbdf3d){const _0x1c5685=a26_0x128358;try{const _0x11e3f2=readFileSync(_0xcbdf3d,{'encoding':_0x1c5685(0x1f4)});return JSON['parse'](_0x11e3f2);}catch(_0x41a335){throw CliErrors['validation'](_0x1c5685(0x1f8)+_0x41a335[_0x1c5685(0x204)]);}}function resolveInitEnv(_0x1241d4){const _0x1e3daa=a26_0x128358,_0x114876=_0x1241d4[_0x1e3daa(0x1e8)];if(_0x114876===undefined||_0x114876==='')return DEFAULT_CONFIG_VALUES[_0x1e3daa(0x1e8)];if(!RUNTIME_ENV_VALUES[_0x1e3daa(0x21d)](_0x114876))throw CliErrors['validation']('Invalid\x20env\x20\x22'+_0x114876+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x114876;}
|