@lovrabet/lovrabet-cli 2.1.9-beta.1 → 2.1.9-beta.3
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/NOTICE +5 -0
- package/README.md +156 -0
- 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/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/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/common/local-file.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/file/index.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/ocr/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/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.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/service-order.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 +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a11_0x5f49a8=a11_0x568d;(function(_0x2b4782,_0x5bddb4){const _0x419ab7=a11_0x568d,_0x5cbaae=_0x2b4782();while(!![]){try{const _0x1987fb=-parseInt(_0x419ab7(0x1fe))/0x1*(-parseInt(_0x419ab7(0x202))/0x2)+-parseInt(_0x419ab7(0x1f2))/0x3+-parseInt(_0x419ab7(0x213))/0x4+-parseInt(_0x419ab7(0x212))/0x5+parseInt(_0x419ab7(0x209))/0x6+parseInt(_0x419ab7(0x20e))/0x7+-parseInt(_0x419ab7(0x1e5))/0x8*(parseInt(_0x419ab7(0x223))/0x9);if(_0x1987fb===_0x5bddb4)break;else _0x5cbaae['push'](_0x5cbaae['shift']());}catch(_0x43f18f){_0x5cbaae['push'](_0x5cbaae['shift']());}}}(a11_0x13de,0xbf347));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE='react_module',ARTIFACT_SOURCE_AGENT=a11_0x5f49a8(0x1ed),ALLOWED_REACT_MODULE_IMPORTS=['react',a11_0x5f49a8(0x203),a11_0x5f49a8(0x1fd),a11_0x5f49a8(0x1eb),a11_0x5f49a8(0x211),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a11_0x5f49a8(0x21c),'type':a11_0x5f49a8(0x1e3),'required':!![],'description':a11_0x5f49a8(0x1ef)},ARTIFACT_NAME_FLAG={'name':'name','type':'string','description':a11_0x5f49a8(0x1e1)},METADATA_FLAG={'name':a11_0x5f49a8(0x1f7),'type':a11_0x5f49a8(0x1e3),'description':a11_0x5f49a8(0x1f3)};function isPlainObject(_0x2a591a){return typeof _0x2a591a==='object'&&_0x2a591a!==null&&!Array['isArray'](_0x2a591a);}function a11_0x13de(){const _0x3221e4=['lastIndex','string','Optional\x20favorite-state\x20filter','8qAukvk','/client/artifact/create','verbose','filter','artifact','/client/artifact/','dayjs','artifactType','AGENT','add','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','Invalid\x20JSON\x20for\x20--metadata:\x20','build','2266029TvbIJn','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','File\x20path\x20is\x20required.','parse','read','metadata','num','test','updateTime','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Preview:\x20update\x20react_module\x20Artifact\x20','lodash','1RimwbN','appCode','description','split','2404646bLhcbf','react-dom','Created\x20Artifact\x20','bool','length','isFile','List\x20current-app\x20react_module\x20Artifacts','7139736TXrKPp','POST','Preview:\x20create\x20react_module\x20Artifact','Artifact\x20ID','name','3673670GbmOGQ','flag','File\x20is\x20not\x20a\x20regular\x20file:\x20','antd','628780SvhaDU','100184zDsPhj','validation','utf8','deleted','trim','/update','content','react_module\x20imports\x20are\x20limited\x20to:\x20','createTime','file','list','File\x20not\x20found:\x20','includes','.\x20Unsupported:\x20','write','favorite','11049921OUaUea','compiledContent','map','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','boolean','source','Show\x20one\x20Artifact\x20by\x20id','str','exec','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Artifact\x20display\x20name'];a11_0x13de=function(){return _0x3221e4;};return a11_0x13de();}function readSourceFile(_0x2b5c90){const _0x5541de=a11_0x5f49a8;if(!_0x2b5c90)throw CliErrors[_0x5541de(0x214)](_0x5541de(0x1f4));if(!existsSync(_0x2b5c90))throw CliErrors[_0x5541de(0x214)](_0x5541de(0x21e)+_0x2b5c90);if(!statSync(_0x2b5c90)[_0x5541de(0x207)]())throw CliErrors['validation'](_0x5541de(0x210)+_0x2b5c90);const _0x5696de=readFileSync(_0x2b5c90,_0x5541de(0x215));return validateReactModuleSource(_0x5696de),_0x5696de;}function parseMetadata(_0x11e73b){const _0x244822=a11_0x5f49a8;if(!_0x11e73b)return undefined;let _0x2441eb;try{_0x2441eb=JSON[_0x244822(0x1f5)](_0x11e73b);}catch{throw CliErrors[_0x244822(0x214)](_0x244822(0x1f0)+_0x11e73b);}if(!isPlainObject(_0x2441eb))throw CliErrors[_0x244822(0x214)](_0x244822(0x1e0));const _0x30dc2c={..._0x2441eb};return delete _0x30dc2c[_0x244822(0x224)],_0x30dc2c;}function getPackageName(_0xc27196){const _0x4ac0bf=a11_0x5f49a8;if(_0xc27196['startsWith']('@')){const [_0x499829,_0xc827a5]=_0xc27196[_0x4ac0bf(0x201)]('/');return _0x499829&&_0xc827a5?_0x499829+'/'+_0xc827a5:_0xc27196;}return _0xc27196[_0x4ac0bf(0x201)]('/')[0x0]||_0xc27196;}function validateAllowedImports(_0x231171){const _0x466aa9=a11_0x5f49a8,_0x413e3e=new Set();for(const _0x473a08 of IMPORT_SOURCE_PATTERNS){_0x473a08[_0x466aa9(0x1e2)]=0x0;let _0x5de37f;while((_0x5de37f=_0x473a08[_0x466aa9(0x1df)](_0x231171))!==null){const _0x4e8081=_0x5de37f[0x1]?.[_0x466aa9(0x217)]();_0x4e8081&&_0x413e3e[_0x466aa9(0x1ee)](_0x4e8081);}}const _0x451fdc=[..._0x413e3e][_0x466aa9(0x225)](getPackageName)[_0x466aa9(0x1e8)](_0x455dce=>!ALLOWED_REACT_MODULE_IMPORTS[_0x466aa9(0x21f)](_0x455dce));if(_0x451fdc[_0x466aa9(0x206)]>0x0)throw CliErrors['validation'](_0x466aa9(0x21a)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x466aa9(0x220)+[...new Set(_0x451fdc)]['join'](',\x20'));}export function validateReactModuleSource(_0x2519a2){const _0x5a5be6=a11_0x5f49a8;if(!_0x2519a2[_0x5a5be6(0x217)]())throw CliErrors['validation']('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS['some'](_0x50aa5a=>_0x50aa5a[_0x5a5be6(0x1f9)](_0x2519a2)))throw CliErrors[_0x5a5be6(0x214)](_0x5a5be6(0x226));validateAllowedImports(_0x2519a2);}function buildArtifactInput(_0x362dfd){const _0x2003a4=a11_0x5f49a8,_0x55ef65=readSourceFile(_0x362dfd['str'](_0x2003a4(0x21c))),_0x4726fe=_0x362dfd['str'](_0x2003a4(0x20d))[_0x2003a4(0x217)](),_0x3d4823=parseMetadata(_0x362dfd[_0x2003a4(0x1de)](_0x2003a4(0x1f7)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4726fe?{'name':_0x4726fe}:{},'content':_0x55ef65,..._0x3d4823?{'metadata':_0x3d4823}:{},'source':ARTIFACT_SOURCE_AGENT};}function a11_0x568d(_0x229441,_0x5120c0){_0x229441=_0x229441-0x1dc;const _0x13de2a=a11_0x13de();let _0x568d21=_0x13de2a[_0x229441];return _0x568d21;}function summarizeArtifact(_0x4e8530){const _0x1b507a=a11_0x5f49a8;return{'id':_0x4e8530['id'],'name':_0x4e8530['name'],'artifactType':_0x4e8530[_0x1b507a(0x1ec)],'source':_0x4e8530['source'],'favorite':_0x4e8530[_0x1b507a(0x222)],'deleted':_0x4e8530[_0x1b507a(0x216)],'createTime':_0x4e8530[_0x1b507a(0x21b)],'updateTime':_0x4e8530[_0x1b507a(0x1fa)]};}function detailArtifact(_0x2cea88){const _0x45c470=a11_0x5f49a8;return{'id':_0x2cea88['id'],'appCode':_0x2cea88[_0x45c470(0x1ff)],'name':_0x2cea88['name'],'artifactType':_0x2cea88[_0x45c470(0x1ec)],'source':_0x2cea88['source'],'favorite':_0x2cea88[_0x45c470(0x222)],'deleted':_0x2cea88[_0x45c470(0x216)],'content':_0x2cea88[_0x45c470(0x219)]??'','compiledContent':_0x2cea88[_0x45c470(0x224)],'metadata':_0x2cea88['metadata']??{},'createTime':_0x2cea88['createTime'],'updateTime':_0x2cea88[_0x45c470(0x1fa)]};}function readFavoriteFlag(_0x48c8b7){const _0x324940=a11_0x5f49a8,_0x3c000a=_0x48c8b7[_0x324940(0x20f)]('favorite');return _0x3c000a===undefined||_0x3c000a===null||_0x3c000a===''?undefined:_0x48c8b7[_0x324940(0x205)]('favorite');}const artifactList={'service':a11_0x5f49a8(0x1e9),'command':a11_0x5f49a8(0x21d),'description':a11_0x5f49a8(0x208),'risk':a11_0x5f49a8(0x1f6),'flags':[{'name':a11_0x5f49a8(0x1dc),'type':'string','description':'Optional\x20source\x20filter,\x20for\x20example\x20AGENT'},{'name':a11_0x5f49a8(0x222),'type':a11_0x5f49a8(0x227),'description':a11_0x5f49a8(0x1e4)},VERBOSE_FLAG],async 'execute'(_0x35566f){const _0x101749=a11_0x5f49a8,_0x206d8a=await listRuntimeArtifacts(_0x35566f[_0x101749(0x1ff)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x35566f['str'](_0x101749(0x1dc))?{'source':_0x35566f['str'](_0x101749(0x1dc))}:{},...readFavoriteFlag(_0x35566f)!==undefined?{'favorite':readFavoriteFlag(_0x35566f)}:{}});return{'ok':!![],'data':{'total':_0x206d8a[_0x101749(0x206)],'items':_0x35566f['bool'](_0x101749(0x1e7))?_0x206d8a:_0x206d8a['map'](summarizeArtifact)}};}},artifactDetail={'service':a11_0x5f49a8(0x1e9),'command':'detail','description':a11_0x5f49a8(0x1dd),'risk':'read','flags':[{...ID_FLAG,'description':a11_0x5f49a8(0x20c)}],async 'execute'(_0x4a1291){const _0x485325=a11_0x5f49a8,_0x3e7ff3=await getRuntimeArtifact(_0x4a1291['num']('id'),_0x4a1291[_0x485325(0x1ff)]);return{'ok':!![],'data':detailArtifact(_0x3e7ff3)};}},artifactCreate={'service':a11_0x5f49a8(0x1e9),'command':'create','description':'Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x85e627){const _0x2b3b4f=a11_0x5f49a8,_0x1e5918=buildArtifactInput(_0x85e627),_0x510ef9=await createRuntimeArtifact(_0x85e627[_0x2b3b4f(0x1ff)],_0x1e5918);return{'ok':!![],'data':detailArtifact(_0x510ef9),'message':_0x2b3b4f(0x204)+_0x510ef9['id']+(_0x510ef9[_0x2b3b4f(0x20d)]?'\x20('+_0x510ef9[_0x2b3b4f(0x20d)]+')':'')};},async 'dryRun'(_0x20067d){const _0x3d7f3a=a11_0x5f49a8,_0x1e7ebf=buildArtifactInput(_0x20067d);return dryRun(_0x3d7f3a(0x20a),_0x3d7f3a(0x1e6))['body']({'appCode':_0x20067d[_0x3d7f3a(0x1ff)],..._0x1e7ebf})['description'](_0x3d7f3a(0x20b))[_0x3d7f3a(0x1f1)]();}},artifactUpdate={'service':a11_0x5f49a8(0x1e9),'command':'update','description':a11_0x5f49a8(0x1fb),'risk':a11_0x5f49a8(0x221),'flags':[{...ID_FLAG,'description':a11_0x5f49a8(0x20c)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1052e1){const _0x2d325c=a11_0x5f49a8,_0x2e2472=_0x1052e1['num']('id'),_0x1d8d58=buildArtifactInput(_0x1052e1),_0x37e07b=await updateRuntimeArtifact(_0x2e2472,_0x1052e1[_0x2d325c(0x1ff)],_0x1d8d58);return{'ok':!![],'data':detailArtifact(_0x37e07b),'message':'Updated\x20Artifact\x20'+_0x37e07b['id']+(_0x37e07b[_0x2d325c(0x20d)]?'\x20('+_0x37e07b['name']+')':'')};},async 'dryRun'(_0x872a89){const _0x3e85c7=a11_0x5f49a8,_0x2490ff=_0x872a89[_0x3e85c7(0x1f8)]('id'),_0x316239=buildArtifactInput(_0x872a89);return dryRun('POST',_0x3e85c7(0x1ea)+_0x2490ff+_0x3e85c7(0x218))['body']({'appCode':_0x872a89[_0x3e85c7(0x1ff)],..._0x316239})[_0x3e85c7(0x200)](_0x3e85c7(0x1fc)+_0x2490ff)[_0x3e85c7(0x1f1)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a11_0x31f0fd=a11_0x3c9d;(function(_0x2c15d9,_0xab4421){const _0x476b17=a11_0x3c9d,_0xa8ac10=_0x2c15d9();while(!![]){try{const _0x3bce45=parseInt(_0x476b17(0x1cc))/0x1+parseInt(_0x476b17(0x1d5))/0x2+-parseInt(_0x476b17(0x1e6))/0x3*(-parseInt(_0x476b17(0x1e0))/0x4)+-parseInt(_0x476b17(0x1d7))/0x5+parseInt(_0x476b17(0x1bf))/0x6+parseInt(_0x476b17(0x1d3))/0x7*(parseInt(_0x476b17(0x1ea))/0x8)+-parseInt(_0x476b17(0x1b5))/0x9*(parseInt(_0x476b17(0x1f6))/0xa);if(_0x3bce45===_0xab4421)break;else _0xa8ac10['push'](_0xa8ac10['shift']());}catch(_0x421f76){_0xa8ac10['push'](_0xa8ac10['shift']());}}}(a11_0x138a,0xc4c04));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE='react_module',ARTIFACT_SOURCE_AGENT=a11_0x31f0fd(0x1e8),ALLOWED_REACT_MODULE_IMPORTS=[a11_0x31f0fd(0x1c4),'react-dom',a11_0x31f0fd(0x1dc),a11_0x31f0fd(0x1f9),a11_0x31f0fd(0x1c2),a11_0x31f0fd(0x1ed)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a11_0x31f0fd(0x1d8)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a11_0x31f0fd(0x1ef),'type':a11_0x31f0fd(0x1e7),'required':!![],'description':a11_0x31f0fd(0x1fc)},ARTIFACT_NAME_FLAG={'name':'name','type':a11_0x31f0fd(0x1e7),'description':a11_0x31f0fd(0x1d1)},METADATA_FLAG={'name':'metadata','type':a11_0x31f0fd(0x1e7),'description':a11_0x31f0fd(0x1db)};function isPlainObject(_0x5c2063){const _0x3663dd=a11_0x31f0fd;return typeof _0x5c2063==='object'&&_0x5c2063!==null&&!Array[_0x3663dd(0x1e1)](_0x5c2063);}function readSourceFile(_0x5b9d2a){const _0x2d9a13=a11_0x31f0fd;if(!_0x5b9d2a)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x5b9d2a))throw CliErrors[_0x2d9a13(0x1f4)](_0x2d9a13(0x1b3)+_0x5b9d2a);if(!statSync(_0x5b9d2a)[_0x2d9a13(0x1e2)]())throw CliErrors[_0x2d9a13(0x1f4)](_0x2d9a13(0x1c3)+_0x5b9d2a);const _0x3799ca=readFileSync(_0x5b9d2a,_0x2d9a13(0x1f1));return validateReactModuleSource(_0x3799ca),_0x3799ca;}function parseMetadata(_0x58a741){const _0xd93456=a11_0x31f0fd;if(!_0x58a741)return undefined;let _0x485b44;try{_0x485b44=JSON['parse'](_0x58a741);}catch{throw CliErrors[_0xd93456(0x1f4)](_0xd93456(0x1fb)+_0x58a741);}if(!isPlainObject(_0x485b44))throw CliErrors[_0xd93456(0x1f4)](_0xd93456(0x1eb));const _0x1903b6={..._0x485b44};return delete _0x1903b6['compiledContent'],_0x1903b6;}function getPackageName(_0x27ea10){const _0x547aae=a11_0x31f0fd;if(_0x27ea10[_0x547aae(0x1dd)]('@')){const [_0x2d39c2,_0x282b44]=_0x27ea10[_0x547aae(0x1c5)]('/');return _0x2d39c2&&_0x282b44?_0x2d39c2+'/'+_0x282b44:_0x27ea10;}return _0x27ea10[_0x547aae(0x1c5)]('/')[0x0]||_0x27ea10;}function validateAllowedImports(_0x255d97){const _0x12c601=a11_0x31f0fd,_0x453ec0=new Set();for(const _0x504392 of IMPORT_SOURCE_PATTERNS){_0x504392['lastIndex']=0x0;let _0x39efb4;while((_0x39efb4=_0x504392[_0x12c601(0x1e4)](_0x255d97))!==null){const _0xe8e644=_0x39efb4[0x1]?.[_0x12c601(0x1c0)]();_0xe8e644&&_0x453ec0['add'](_0xe8e644);}}const _0x3432c9=[..._0x453ec0]['map'](getPackageName)['filter'](_0x14f424=>!ALLOWED_REACT_MODULE_IMPORTS[_0x12c601(0x1da)](_0x14f424));if(_0x3432c9[_0x12c601(0x1bd)]>0x0)throw CliErrors[_0x12c601(0x1f4)](_0x12c601(0x1c7)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x12c601(0x1ba)+[...new Set(_0x3432c9)][_0x12c601(0x1d8)](',\x20'));}export function validateReactModuleSource(_0x3ef4f0){const _0x426ac4=a11_0x31f0fd;if(!_0x3ef4f0[_0x426ac4(0x1c0)]())throw CliErrors[_0x426ac4(0x1f4)](_0x426ac4(0x1e5));if(PAGE_LEVEL_PATTERNS[_0x426ac4(0x1b6)](_0x216418=>_0x216418[_0x426ac4(0x1d2)](_0x3ef4f0)))throw CliErrors[_0x426ac4(0x1f4)](_0x426ac4(0x1f2));validateAllowedImports(_0x3ef4f0);}function buildArtifactInput(_0x5ccd8a){const _0x3d4a4e=a11_0x31f0fd,_0x40f8bd=readSourceFile(_0x5ccd8a['str'](_0x3d4a4e(0x1ef))),_0x467758=_0x5ccd8a[_0x3d4a4e(0x1de)](_0x3d4a4e(0x1b2))[_0x3d4a4e(0x1c0)](),_0x190986=parseMetadata(_0x5ccd8a['str'](_0x3d4a4e(0x1c9)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x467758?{'name':_0x467758}:{},'content':_0x40f8bd,..._0x190986?{'metadata':_0x190986}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x552d04){const _0x1412e9=a11_0x31f0fd;return{'id':_0x552d04['id'],'name':_0x552d04[_0x1412e9(0x1b2)],'artifactType':_0x552d04['artifactType'],'source':_0x552d04[_0x1412e9(0x1f0)],'favorite':_0x552d04[_0x1412e9(0x1f3)],'deleted':_0x552d04['deleted'],'createTime':_0x552d04['createTime'],'updateTime':_0x552d04[_0x1412e9(0x1f7)]};}function a11_0x138a(){const _0x561c8e=['27465foXRMr','string','AGENT','/client/artifact/create','522152FIXBSq','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Preview:\x20update\x20react_module\x20Artifact\x20','@ant-design/icons','boolean','file','source','utf8','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','favorite','validation','List\x20current-app\x20react_module\x20Artifacts','414860wNEboe','updateTime','appCode','dayjs','compiledContent','Invalid\x20JSON\x20for\x20--metadata:\x20','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','name','File\x20not\x20found:\x20','artifact','531OofYGJ','some','Optional\x20favorite-state\x20filter','flag','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','.\x20Unsupported:\x20','detail','Preview:\x20create\x20react_module\x20Artifact','length','bool','1979094FXJhmq','trim','Updated\x20Artifact\x20','antd','File\x20is\x20not\x20a\x20regular\x20file:\x20','react','split','read','react_module\x20imports\x20are\x20limited\x20to:\x20','build','metadata','POST','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','1039146KyWbsF','description','content','deleted','num','Artifact\x20display\x20name','test','161iYYkVE','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','900706hbJkOZ','Artifact\x20ID','2394720ZyHVhP','join','body','includes','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','lodash','startsWith','str','write','180bbCphM','isArray','isFile','create','exec','Artifact\x20source\x20file\x20is\x20blank.'];a11_0x138a=function(){return _0x561c8e;};return a11_0x138a();}function detailArtifact(_0x40bbfb){const _0x3650f2=a11_0x31f0fd;return{'id':_0x40bbfb['id'],'appCode':_0x40bbfb['appCode'],'name':_0x40bbfb[_0x3650f2(0x1b2)],'artifactType':_0x40bbfb['artifactType'],'source':_0x40bbfb[_0x3650f2(0x1f0)],'favorite':_0x40bbfb[_0x3650f2(0x1f3)],'deleted':_0x40bbfb[_0x3650f2(0x1cf)],'content':_0x40bbfb[_0x3650f2(0x1ce)]??'','compiledContent':_0x40bbfb[_0x3650f2(0x1fa)],'metadata':_0x40bbfb['metadata']??{},'createTime':_0x40bbfb['createTime'],'updateTime':_0x40bbfb[_0x3650f2(0x1f7)]};}function readFavoriteFlag(_0xeafcec){const _0x14b429=a11_0x31f0fd,_0x309559=_0xeafcec[_0x14b429(0x1b8)](_0x14b429(0x1f3));return _0x309559===undefined||_0x309559===null||_0x309559===''?undefined:_0xeafcec[_0x14b429(0x1be)](_0x14b429(0x1f3));}function a11_0x3c9d(_0x458ab9,_0x472430){_0x458ab9=_0x458ab9-0x1b2;const _0x138aa0=a11_0x138a();let _0x3c9da5=_0x138aa0[_0x458ab9];return _0x3c9da5;}const artifactList={'service':a11_0x31f0fd(0x1b4),'command':'list','description':a11_0x31f0fd(0x1f5),'risk':a11_0x31f0fd(0x1c6),'flags':[{'name':a11_0x31f0fd(0x1f0),'type':a11_0x31f0fd(0x1e7),'description':a11_0x31f0fd(0x1cb)},{'name':a11_0x31f0fd(0x1f3),'type':a11_0x31f0fd(0x1ee),'description':a11_0x31f0fd(0x1b7)},VERBOSE_FLAG],async 'execute'(_0x4d2a17){const _0x30c6b6=a11_0x31f0fd,_0x11a481=await listRuntimeArtifacts(_0x4d2a17['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4d2a17['str'](_0x30c6b6(0x1f0))?{'source':_0x4d2a17['str'](_0x30c6b6(0x1f0))}:{},...readFavoriteFlag(_0x4d2a17)!==undefined?{'favorite':readFavoriteFlag(_0x4d2a17)}:{}});return{'ok':!![],'data':{'total':_0x11a481['length'],'items':_0x4d2a17[_0x30c6b6(0x1be)]('verbose')?_0x11a481:_0x11a481['map'](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a11_0x31f0fd(0x1bb),'description':'Show\x20one\x20Artifact\x20by\x20id','risk':a11_0x31f0fd(0x1c6),'flags':[{...ID_FLAG,'description':a11_0x31f0fd(0x1d6)}],async 'execute'(_0x1e2ec3){const _0x21201d=await getRuntimeArtifact(_0x1e2ec3['num']('id'),_0x1e2ec3['appCode']);return{'ok':!![],'data':detailArtifact(_0x21201d)};}},artifactCreate={'service':a11_0x31f0fd(0x1b4),'command':a11_0x31f0fd(0x1e3),'description':a11_0x31f0fd(0x1d4),'risk':a11_0x31f0fd(0x1df),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x4fc9c8){const _0xf069a=a11_0x31f0fd,_0x27d249=buildArtifactInput(_0x4fc9c8),_0x7bffb3=await createRuntimeArtifact(_0x4fc9c8[_0xf069a(0x1f8)],_0x27d249);return{'ok':!![],'data':detailArtifact(_0x7bffb3),'message':'Created\x20Artifact\x20'+_0x7bffb3['id']+(_0x7bffb3['name']?'\x20('+_0x7bffb3['name']+')':'')};},async 'dryRun'(_0x223a04){const _0x51c4ce=a11_0x31f0fd,_0x513864=buildArtifactInput(_0x223a04);return dryRun(_0x51c4ce(0x1ca),_0x51c4ce(0x1e9))[_0x51c4ce(0x1d9)]({'appCode':_0x223a04['appCode'],..._0x513864})[_0x51c4ce(0x1cd)](_0x51c4ce(0x1bc))[_0x51c4ce(0x1c8)]();}},artifactUpdate={'service':a11_0x31f0fd(0x1b4),'command':'update','description':a11_0x31f0fd(0x1b9),'risk':a11_0x31f0fd(0x1df),'flags':[{...ID_FLAG,'description':a11_0x31f0fd(0x1d6)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2ed639){const _0x5c2e32=a11_0x31f0fd,_0x4a20ac=_0x2ed639[_0x5c2e32(0x1d0)]('id'),_0x454d31=buildArtifactInput(_0x2ed639),_0x365567=await updateRuntimeArtifact(_0x4a20ac,_0x2ed639[_0x5c2e32(0x1f8)],_0x454d31);return{'ok':!![],'data':detailArtifact(_0x365567),'message':_0x5c2e32(0x1c1)+_0x365567['id']+(_0x365567[_0x5c2e32(0x1b2)]?'\x20('+_0x365567['name']+')':'')};},async 'dryRun'(_0x321cb4){const _0x284602=a11_0x31f0fd,_0x4c9e6f=_0x321cb4[_0x284602(0x1d0)]('id'),_0x330b8e=buildArtifactInput(_0x321cb4);return dryRun(_0x284602(0x1ca),'/client/artifact/'+_0x4c9e6f+'/update')[_0x284602(0x1d9)]({'appCode':_0x321cb4[_0x284602(0x1f8)],..._0x330b8e})[_0x284602(0x1cd)](_0x284602(0x1ec)+_0x4c9e6f)[_0x284602(0x1c8)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a12_0x58f3e6=a12_0x4d6a;(function(_0x479296,_0x228f4d){const _0x34557b=a12_0x4d6a,_0x46bb67=_0x479296();while(!![]){try{const _0x1525e5=-parseInt(_0x34557b(0x1cc))/0x1+-parseInt(_0x34557b(0x190))/0x2*(parseInt(_0x34557b(0x1bb))/0x3)+-parseInt(_0x34557b(0x1ce))/0x4+parseInt(_0x34557b(0x194))/0x5+parseInt(_0x34557b(0x1b8))/0x6+-parseInt(_0x34557b(0x1c1))/0x7*(parseInt(_0x34557b(0x1bc))/0x8)+-parseInt(_0x34557b(0x1d2))/0x9*(-parseInt(_0x34557b(0x1ad))/0xa);if(_0x1525e5===_0x228f4d)break;else _0x46bb67['push'](_0x46bb67['shift']());}catch(_0x1db8f8){_0x46bb67['push'](_0x46bb67['shift']());}}}(a12_0x2b1e,0x4f572));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a12_0x2b1e(){const _0x55da49=['boolean','148673nizKEv','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','yes','production','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','accessKey','write','nonInteractive','Write\x20to\x20global\x20config\x20(default)','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','auth','290995umrAjR','status','37020yGXMZl','string','\x20env\x20var','test','3081807QMSfmk','project','Option\x20B:\x20apps\x20config\x20(','ACCESS_KEY','ClientAk','\x20doctor','Missing\x20accessKey.','global-default','\x20auth\x20status','join','\x20(via\x20','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','AccessKey\x20(ak_xxx...)','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','init','stdout','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','env','isTTY','Clear\x20from\x20global\x20config\x20(default)','242002llWhfs','=ak_xxx','validation','logout','2215025iVbzxn','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','bool','development','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','repeat','AccessKey\x20saved\x20to\x20','No\x20AccessKey\x20found\x20in\x20','info','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Tip:\x20you\x20can\x20also\x20run:','\x20config.','\x20config.\x20Nothing\x20to\x20clear.','Auth\x20config\x20reinitialized\x20in\x20','Invalid\x20accessKey\x20format:\x20\x22','access-key','str','Shorthand\x20for\x20--access-key','\x20Verify:\x20','stdin','AccessKey:\x20','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Read\x20from\x20global\x20config\x20(default)','global','10TWhLUT','\x20\x20export\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','newConfigFileName','push','envName','\x20Current\x20env:\x20','length','userCenterDisplayName','Option\x20A:\x20','AccessKey\x20cleared\x20from\x20','3804096MxPPTo','Use\x20`','read','6sUpXXK','208ukkJeY','trim','daily','Option\x20C:\x20environment\x20variable'];a12_0x2b1e=function(){return _0x55da49;};return a12_0x2b1e();}import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';function a12_0x4d6a(_0x1654bf,_0x4925e6){_0x1654bf=_0x1654bf-0x180;const _0x2b1e90=a12_0x2b1e();let _0x4d6a93=_0x2b1e90[_0x1654bf];return _0x4d6a93;}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x458d7a=a12_0x4d6a;writeCliSideChannelLine(_0x458d7a(0x1a9)+PRODUCT_CONFIG[_0x458d7a(0x1b5)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x458d7a(0x19e)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>');}function buildAccessKeySetupGuide(){const _0x54d8f1=a12_0x4d6a;return[_0x54d8f1(0x1a9)+PRODUCT_CONFIG[_0x54d8f1(0x1b5)]+':',USER_ACCESS_KEY_CREATE_URL,_0x54d8f1(0x1aa)+CLI_BIN_NAME+_0x54d8f1(0x1af)][_0x54d8f1(0x184)]('\x0a');}function canPromptForAccessKey(_0x788b95){const _0x284c2f=a12_0x4d6a;return!_0x788b95['nonInteractive']&&process[_0x284c2f(0x1a7)][_0x284c2f(0x18e)]!==![]&&process[_0x284c2f(0x18b)][_0x284c2f(0x18e)]!==![];}function resolveAuthScopeFlags(_0x3c3049){const _0x21bf96=a12_0x4d6a;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x3c3049[_0x21bf96(0x196)]('global'),'explicitProject':_0x3c3049[_0x21bf96(0x196)](_0x21bf96(0x1d3)),'policy':_0x21bf96(0x182)}));}async function resolveAuthWriteInput(_0x257665){const _0x4af708=a12_0x4d6a;let _0x1fbd06=(_0x257665[_0x4af708(0x1a4)](_0x4af708(0x1a3))||_0x257665['str']('ak')||'')[_0x4af708(0x1bd)]();const _0x31b7f2=(_0x257665['str'](_0x4af708(0x18d))||'')['trim']();if(!_0x1fbd06&&canPromptForAccessKey(_0x257665))try{showAccessKeyCreateHint(),_0x1fbd06=await promptAccessKey('');}catch(_0x4b1f4c){if(isAbortPrompt(_0x4b1f4c))throw CliErrors['cancelled']();throw _0x4b1f4c;}if(!_0x1fbd06)throw CliErrors['validation'](_0x4af708(0x181),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x4af708(0x1d1)](_0x1fbd06))throw CliErrors['validation'](_0x4af708(0x1a2)+_0x1fbd06+'\x22',_0x4af708(0x198));if(!_0x31b7f2)return{'accessKey':_0x1fbd06};const _0x3accb6=normalizeEnv(_0x31b7f2);return{'accessKey':_0x1fbd06,'env':isDaily(_0x3accb6)?_0x4af708(0x1be):isDev(_0x3accb6)?_0x4af708(0x197):_0x4af708(0x1c4)};}export const authDefinitions=[{'service':a12_0x58f3e6(0x1cb),'command':'login','description':a12_0x58f3e6(0x187),'risk':a12_0x58f3e6(0x1c7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x58f3e6(0x1a3),'type':a12_0x58f3e6(0x1cf),'description':a12_0x58f3e6(0x188)},{'name':'ak','type':'string','description':'Shorthand\x20for\x20--access-key'},{'name':'global','type':'boolean','description':a12_0x58f3e6(0x1c9),'default':!![]},{'name':a12_0x58f3e6(0x1d3),'type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x19d),'default':![]}],async 'execute'(_0x11cc24){const _0x10c88c=a12_0x58f3e6;if(_0x11cc24['bool'](_0x10c88c(0x1c3)))throw CliErrors[_0x10c88c(0x192)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x10c88c(0x1b9)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+_0x10c88c(0x1c5));const _0x5bacf5=(_0x11cc24[_0x10c88c(0x1a4)](_0x10c88c(0x1a3))||_0x11cc24[_0x10c88c(0x1a4)]('ak')||'')[_0x10c88c(0x1bd)]();if(!_0x5bacf5&&_0x11cc24[_0x10c88c(0x1c8)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0xf46600=await resolveAuthWriteInput(_0x11cc24),_0x35da76=resolveAuthScopeFlags(_0x11cc24),_0x26782f=readScopedConfig(_0x35da76);_0x26782f['accessKey']=_0xf46600[_0x10c88c(0x1c6)];_0xf46600[_0x10c88c(0x18d)]&&(_0x26782f[_0x10c88c(0x18d)]=_0xf46600[_0x10c88c(0x18d)]);writeScopedConfig(_0x26782f,_0x35da76);const _0x7ce472=_0x35da76[_0x10c88c(0x1ac)]?_0x10c88c(0x1ac):_0x10c88c(0x1d3),_0x3e8466=_0x26782f[_0x10c88c(0x18d)]?_0x10c88c(0x1b3)+_0x26782f[_0x10c88c(0x18d)]+'.':'';return{'ok':!![],'message':_0x10c88c(0x19a)+_0x7ce472+_0x10c88c(0x19f)+_0x3e8466+_0x10c88c(0x1a6)+CLI_BIN_NAME+_0x10c88c(0x183)};}},{'service':a12_0x58f3e6(0x1cb),'command':a12_0x58f3e6(0x18a),'description':'Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','risk':a12_0x58f3e6(0x1c7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a12_0x58f3e6(0x1cf),'description':a12_0x58f3e6(0x188)},{'name':'ak','type':a12_0x58f3e6(0x1cf),'description':a12_0x58f3e6(0x1a5)},{'name':'env','type':'string','description':a12_0x58f3e6(0x1c2)},{'name':a12_0x58f3e6(0x1ac),'type':'boolean','description':a12_0x58f3e6(0x1c9),'default':!![]},{'name':a12_0x58f3e6(0x1d3),'type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x19d),'default':![]}],async 'execute'(_0x1818c6){const _0x38a819=a12_0x58f3e6,_0x50cc3b=await resolveAuthWriteInput(_0x1818c6),_0x288bb9=resolveAuthScopeFlags(_0x1818c6),_0x2b60b4={'accessKey':_0x50cc3b[_0x38a819(0x1c6)]};_0x50cc3b['env']&&(_0x2b60b4[_0x38a819(0x18d)]=_0x50cc3b[_0x38a819(0x18d)]);writeScopedConfig(_0x2b60b4,_0x288bb9);const _0x5d5c85=_0x288bb9[_0x38a819(0x1ac)]?'global':_0x38a819(0x1d3),_0x3d428b=_0x2b60b4[_0x38a819(0x18d)]?_0x38a819(0x1b3)+_0x2b60b4[_0x38a819(0x18d)]+'.':'';return{'ok':!![],'message':_0x38a819(0x1a1)+_0x5d5c85+'\x20scope.'+_0x3d428b+_0x38a819(0x1a6)+CLI_BIN_NAME+_0x38a819(0x183)};}},{'service':'auth','command':a12_0x58f3e6(0x193),'description':'Clear\x20accessKey\x20from\x20config','risk':a12_0x58f3e6(0x1c7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x58f3e6(0x1ac),'type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x18f),'default':!![]},{'name':a12_0x58f3e6(0x1d3),'type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x189),'default':![]}],async 'execute'(_0xc7df5e){const _0xf66f=a12_0x58f3e6,_0x4919bc=resolveAuthScopeFlags(_0xc7df5e),_0x5e8e1f=readScopedConfig(_0x4919bc),_0x3f55f2=!!_0x5e8e1f[_0xf66f(0x1c6)];delete _0x5e8e1f['accessKey'],writeScopedConfig(_0x5e8e1f,_0x4919bc);const _0x52192c=_0x4919bc[_0xf66f(0x1ac)]?_0xf66f(0x1ac):_0xf66f(0x1d3);if(_0x3f55f2)return{'ok':!![],'message':_0xf66f(0x1b7)+_0x52192c+_0xf66f(0x19f)};return{'ok':!![],'message':_0xf66f(0x19b)+_0x52192c+_0xf66f(0x1a0)};}},{'service':a12_0x58f3e6(0x1cb),'command':a12_0x58f3e6(0x1cd),'description':'Show\x20current\x20authentication\x20status','risk':a12_0x58f3e6(0x1ba),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x58f3e6(0x1ac),'type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x1ab),'default':!![]},{'name':'project','type':a12_0x58f3e6(0x1c0),'description':a12_0x58f3e6(0x1ca),'default':![]}],async 'execute'(_0xdfc01d){const _0x432fa3=a12_0x58f3e6,_0x3c6e26=resolveAuthScopeFlags(_0xdfc01d),_0x303bda=readScopedConfig(_0x3c6e26),_0x37d6ff=productEnvName(_0x432fa3(0x1d5)),_0x126f9f=productEnv('ACCESS_KEY')||undefined,_0x2a14e0=_0x303bda['accessKey']||undefined,_0x11bcc8=_0x126f9f||_0x2a14e0,_0x3966f7=_0x126f9f?_0x37d6ff+_0x432fa3(0x1d0):_0x2a14e0?(_0x3c6e26[_0x432fa3(0x1ac)]?_0x432fa3(0x1ac):'project')+'\x20config':null,_0x697261=['Auth\x20mode:\x20'+AUTH_MODE[_0x432fa3(0x1d6)]];if(_0x11bcc8){const _0x221269=_0x11bcc8[_0x432fa3(0x1b4)]>0x8?''+_0x11bcc8['slice'](0x0,0x8)+'*'[_0x432fa3(0x199)](_0x11bcc8[_0x432fa3(0x1b4)]-0x8):_0x11bcc8;_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x1a8)+_0x221269+(_0x3966f7?_0x432fa3(0x185)+_0x3966f7+')':''));}return!_0x11bcc8&&(_0x697261['push'](''),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x18c)),_0x697261[_0x432fa3(0x1b1)](''),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x1b6)+CLI_BIN_NAME+_0x432fa3(0x195)),_0x697261[_0x432fa3(0x1b1)](''),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x1d4)+PRODUCT_CONFIG[_0x432fa3(0x1b0)]+')'),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x186)),_0x697261['push'](''),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x1bf)),_0x697261[_0x432fa3(0x1b1)](_0x432fa3(0x1ae)+_0x37d6ff+_0x432fa3(0x191)),_0x697261[_0x432fa3(0x1b1)](''),_0x697261[_0x432fa3(0x1b1)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x432fa3(0x183)),_0x697261[_0x432fa3(0x1b1)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+_0x432fa3(0x180))),{'ok':!![],'message':_0x697261[_0x432fa3(0x184)]('\x0a')};}},{'service':a12_0x58f3e6(0x1cb),'command':a12_0x58f3e6(0x19c),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a12_0x58f3e6(0x1ba),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x1c7c8){const _0x4b2ce5=a12_0x58f3e6,_0x1f40ca=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x1f40ca,'meta':{'env':_0x1c7c8[_0x4b2ce5(0x1b2)]??_0x4b2ce5(0x1c4)}}};}}];
|
|
1
|
+
const a12_0x1d924d=a12_0x30a6;function a12_0x30a6(_0x39f30b,_0x83ff22){_0x39f30b=_0x39f30b-0x1f2;const _0x4b583e=a12_0x4b58();let _0x30a6af=_0x4b583e[_0x39f30b];return _0x30a6af;}(function(_0x4b5da5,_0x19539c){const _0x5408b2=a12_0x30a6,_0x1a8a1a=_0x4b5da5();while(!![]){try{const _0x3c485a=parseInt(_0x5408b2(0x21c))/0x1+-parseInt(_0x5408b2(0x1f7))/0x2+parseInt(_0x5408b2(0x21a))/0x3*(parseInt(_0x5408b2(0x220))/0x4)+parseInt(_0x5408b2(0x240))/0x5*(parseInt(_0x5408b2(0x208))/0x6)+parseInt(_0x5408b2(0x200))/0x7*(-parseInt(_0x5408b2(0x1f8))/0x8)+-parseInt(_0x5408b2(0x230))/0x9+-parseInt(_0x5408b2(0x207))/0xa*(parseInt(_0x5408b2(0x216))/0xb);if(_0x3c485a===_0x19539c)break;else _0x1a8a1a['push'](_0x1a8a1a['shift']());}catch(_0x16f89c){_0x1a8a1a['push'](_0x1a8a1a['shift']());}}}(a12_0x4b58,0x632a2));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';function a12_0x4b58(){const _0x206321=['nonInteractive','Auth\x20config\x20reinitialized\x20in\x20','length','cancelled','15QJHTkD','\x20env\x20var','\x20Current\x20env:\x20','Option\x20A:\x20','Use\x20`','\x20auth\x20login\x20--access-key\x20<ak_xxx>','`auth\x20login`\x20does\x20not\x20support\x20--yes.','production','envName','auth','485106ITWKQf','751256aSXXPN','\x20(via\x20','Write\x20to\x20global\x20config\x20(default)','Auth\x20mode:\x20','AccessKey:\x20','No\x20AccessKey\x20found\x20in\x20','\x20\x20export\x20','AccessKey\x20cleared\x20from\x20','42jlPEZF','access-key','project','global','boolean','\x20scope.','yes','21900VpoOjx','227832xwlmVP','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','\x20Verify:\x20','development','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','push','\x20doctor','Then\x20verify\x20with:\x20','Missing\x20accessKey.','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','Read\x20from\x20global\x20config\x20(default)','trim','44xbEnpW','Clear\x20accessKey\x20from\x20config','\x20config.\x20Nothing\x20to\x20clear.','stdin','2202225PtNTCi','daily','808877lJZerD','AccessKey\x20saved\x20to\x20','accessKey','\x20auth\x20status','4JGBWdZ','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','status','login','str','env','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','Show\x20current\x20authentication\x20status','bool','Invalid\x20accessKey\x20format:\x20\x22','\x20config','Shorthand\x20for\x20--access-key','read','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','validation','global-default','3923415zhNgYa','write','isTTY','Option\x20C:\x20environment\x20variable','userCenterDisplayName','string','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Clear\x20from\x20global\x20config\x20(default)','test','ACCESS_KEY','\x20config.','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config'];a12_0x4b58=function(){return _0x206321;};return a12_0x4b58();}import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x512e20=a12_0x30a6;writeCliSideChannelLine(_0x512e20(0x209)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x512e20(0x1f2));}function buildAccessKeySetupGuide(){const _0x3b75bd=a12_0x30a6;return[_0x3b75bd(0x209)+PRODUCT_CONFIG[_0x3b75bd(0x234)]+':',USER_ACCESS_KEY_CREATE_URL,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]']['join']('\x0a');}function canPromptForAccessKey(_0x26e116){const _0x22c212=a12_0x30a6;return!_0x26e116[_0x22c212(0x23c)]&&process[_0x22c212(0x219)][_0x22c212(0x232)]!==![]&&process['stdout'][_0x22c212(0x232)]!==![];}function resolveAuthScopeFlags(_0x55caae){const _0x1750dd=a12_0x30a6;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x55caae[_0x1750dd(0x228)]('global'),'explicitProject':_0x55caae[_0x1750dd(0x228)](_0x1750dd(0x202)),'policy':_0x1750dd(0x22f)}));}async function resolveAuthWriteInput(_0x28f6d6){const _0xa64245=a12_0x30a6;let _0x1a46bb=(_0x28f6d6[_0xa64245(0x224)](_0xa64245(0x201))||_0x28f6d6[_0xa64245(0x224)]('ak')||'')[_0xa64245(0x215)]();const _0x250e4d=(_0x28f6d6[_0xa64245(0x224)](_0xa64245(0x225))||'')[_0xa64245(0x215)]();if(!_0x1a46bb&&canPromptForAccessKey(_0x28f6d6))try{showAccessKeyCreateHint(),_0x1a46bb=await promptAccessKey('');}catch(_0x49b0f0){if(isAbortPrompt(_0x49b0f0))throw CliErrors[_0xa64245(0x23f)]();throw _0x49b0f0;}if(!_0x1a46bb)throw CliErrors[_0xa64245(0x22e)](_0xa64245(0x212),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0xa64245(0x238)](_0x1a46bb))throw CliErrors[_0xa64245(0x22e)](_0xa64245(0x229)+_0x1a46bb+'\x22','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x250e4d)return{'accessKey':_0x1a46bb};const _0x282701=normalizeEnv(_0x250e4d);return{'accessKey':_0x1a46bb,'env':isDaily(_0x282701)?_0xa64245(0x21b):isDev(_0x282701)?_0xa64245(0x20c):_0xa64245(0x1f4)};}export const authDefinitions=[{'service':a12_0x1d924d(0x1f6),'command':a12_0x1d924d(0x223),'description':a12_0x1d924d(0x213),'risk':a12_0x1d924d(0x231),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x1d924d(0x201),'type':a12_0x1d924d(0x235),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a12_0x1d924d(0x235),'description':a12_0x1d924d(0x22b)},{'name':a12_0x1d924d(0x203),'type':a12_0x1d924d(0x204),'description':a12_0x1d924d(0x1fa),'default':!![]},{'name':'project','type':a12_0x1d924d(0x204),'description':a12_0x1d924d(0x22d),'default':![]}],async 'execute'(_0x330a1f){const _0x1bcad2=a12_0x1d924d;if(_0x330a1f[_0x1bcad2(0x228)](_0x1bcad2(0x206)))throw CliErrors['validation'](_0x1bcad2(0x1f3),_0x1bcad2(0x244)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x4af642=(_0x330a1f['str'](_0x1bcad2(0x201))||_0x330a1f[_0x1bcad2(0x224)]('ak')||'')[_0x1bcad2(0x215)]();if(!_0x4af642&&_0x330a1f[_0x1bcad2(0x23c)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x5cbc1d=await resolveAuthWriteInput(_0x330a1f),_0x101cea=resolveAuthScopeFlags(_0x330a1f),_0x3f7903=readScopedConfig(_0x101cea);_0x3f7903['accessKey']=_0x5cbc1d['accessKey'];_0x5cbc1d[_0x1bcad2(0x225)]&&(_0x3f7903[_0x1bcad2(0x225)]=_0x5cbc1d[_0x1bcad2(0x225)]);writeScopedConfig(_0x3f7903,_0x101cea);const _0x2b44cc=_0x101cea['global']?_0x1bcad2(0x203):_0x1bcad2(0x202),_0xd33371=_0x3f7903[_0x1bcad2(0x225)]?_0x1bcad2(0x242)+_0x3f7903['env']+'.':'';return{'ok':!![],'message':_0x1bcad2(0x21d)+_0x2b44cc+_0x1bcad2(0x23a)+_0xd33371+'\x20Verify:\x20'+CLI_BIN_NAME+_0x1bcad2(0x21f)};}},{'service':a12_0x1d924d(0x1f6),'command':'init','description':a12_0x1d924d(0x20a),'risk':a12_0x1d924d(0x231),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x1d924d(0x201),'type':'string','description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a12_0x1d924d(0x235),'description':'Shorthand\x20for\x20--access-key'},{'name':a12_0x1d924d(0x225),'type':a12_0x1d924d(0x235),'description':a12_0x1d924d(0x23b)},{'name':a12_0x1d924d(0x203),'type':'boolean','description':a12_0x1d924d(0x1fa),'default':!![]},{'name':'project','type':a12_0x1d924d(0x204),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x3581ab){const _0x2b9b6a=a12_0x1d924d,_0x25ccb5=await resolveAuthWriteInput(_0x3581ab),_0x2e694b=resolveAuthScopeFlags(_0x3581ab),_0x4bb07e={'accessKey':_0x25ccb5['accessKey']};_0x25ccb5[_0x2b9b6a(0x225)]&&(_0x4bb07e[_0x2b9b6a(0x225)]=_0x25ccb5[_0x2b9b6a(0x225)]);writeScopedConfig(_0x4bb07e,_0x2e694b);const _0x510f1b=_0x2e694b['global']?'global':_0x2b9b6a(0x202),_0x49db78=_0x4bb07e[_0x2b9b6a(0x225)]?_0x2b9b6a(0x242)+_0x4bb07e[_0x2b9b6a(0x225)]+'.':'';return{'ok':!![],'message':_0x2b9b6a(0x23d)+_0x510f1b+_0x2b9b6a(0x205)+_0x49db78+_0x2b9b6a(0x20b)+CLI_BIN_NAME+_0x2b9b6a(0x21f)};}},{'service':a12_0x1d924d(0x1f6),'command':'logout','description':a12_0x1d924d(0x217),'risk':a12_0x1d924d(0x231),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x1d924d(0x203),'type':a12_0x1d924d(0x204),'description':a12_0x1d924d(0x237),'default':!![]},{'name':a12_0x1d924d(0x202),'type':a12_0x1d924d(0x204),'description':a12_0x1d924d(0x236),'default':![]}],async 'execute'(_0x2b404e){const _0x160223=a12_0x1d924d,_0x146cc8=resolveAuthScopeFlags(_0x2b404e),_0x5a80a4=readScopedConfig(_0x146cc8),_0x661c32=!!_0x5a80a4[_0x160223(0x21e)];delete _0x5a80a4[_0x160223(0x21e)],writeScopedConfig(_0x5a80a4,_0x146cc8);const _0x15bd69=_0x146cc8['global']?'global':_0x160223(0x202);if(_0x661c32)return{'ok':!![],'message':_0x160223(0x1ff)+_0x15bd69+_0x160223(0x23a)};return{'ok':!![],'message':_0x160223(0x1fd)+_0x15bd69+_0x160223(0x218)};}},{'service':a12_0x1d924d(0x1f6),'command':a12_0x1d924d(0x222),'description':a12_0x1d924d(0x227),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a12_0x1d924d(0x203),'type':'boolean','description':a12_0x1d924d(0x214),'default':!![]},{'name':a12_0x1d924d(0x202),'type':a12_0x1d924d(0x204),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x4491cf){const _0xa72663=a12_0x1d924d,_0xe90c83=resolveAuthScopeFlags(_0x4491cf),_0xb913a7=readScopedConfig(_0xe90c83),_0x2be3bd=productEnvName('ACCESS_KEY'),_0x34c555=productEnv(_0xa72663(0x239))||undefined,_0x467d76=_0xb913a7[_0xa72663(0x21e)]||undefined,_0x3f3162=_0x34c555||_0x467d76,_0x503d1f=_0x34c555?_0x2be3bd+_0xa72663(0x241):_0x467d76?(_0xe90c83[_0xa72663(0x203)]?_0xa72663(0x203):_0xa72663(0x202))+_0xa72663(0x22a):null,_0x9ab92f=[_0xa72663(0x1fb)+AUTH_MODE['ClientAk']];if(_0x3f3162){const _0x5c26de=_0x3f3162[_0xa72663(0x23e)]>0x8?''+_0x3f3162['slice'](0x0,0x8)+'*'['repeat'](_0x3f3162[_0xa72663(0x23e)]-0x8):_0x3f3162;_0x9ab92f['push'](_0xa72663(0x1fc)+_0x5c26de+(_0x503d1f?_0xa72663(0x1f9)+_0x503d1f+')':''));}return!_0x3f3162&&(_0x9ab92f[_0xa72663(0x20f)](''),_0x9ab92f['push'](_0xa72663(0x20d)),_0x9ab92f[_0xa72663(0x20f)](''),_0x9ab92f[_0xa72663(0x20f)](_0xa72663(0x243)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x9ab92f[_0xa72663(0x20f)](''),_0x9ab92f['push']('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG['newConfigFileName']+')'),_0x9ab92f[_0xa72663(0x20f)](_0xa72663(0x221)),_0x9ab92f[_0xa72663(0x20f)](''),_0x9ab92f[_0xa72663(0x20f)](_0xa72663(0x233)),_0x9ab92f['push'](_0xa72663(0x1fe)+_0x2be3bd+'=ak_xxx'),_0x9ab92f['push'](''),_0x9ab92f[_0xa72663(0x20f)](_0xa72663(0x211)+CLI_BIN_NAME+'\x20auth\x20status'),_0x9ab92f['push'](_0xa72663(0x20e)+CLI_BIN_NAME+_0xa72663(0x210))),{'ok':!![],'message':_0x9ab92f['join']('\x0a')};}},{'service':a12_0x1d924d(0x1f6),'command':'info','description':a12_0x1d924d(0x226),'risk':a12_0x1d924d(0x22c),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x430b2b){const _0x1c5a0f=a12_0x1d924d,_0x48973c=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x48973c,'meta':{'env':_0x430b2b[_0x1c5a0f(0x1f5)]??_0x1c5a0f(0x1f4)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1afdbc,_0x5e99f8){const _0x1c1831=a13_0x5ceb,_0x4286cc=_0x1afdbc();while(!![]){try{const _0x4f482f=-parseInt(_0x1c1831(0x1fd))/0x1*(-parseInt(_0x1c1831(0x1f1))/0x2)+parseInt(_0x1c1831(0x1fa))/0x3*(-parseInt(_0x1c1831(0x1f7))/0x4)+-parseInt(_0x1c1831(0x1f3))/0x5*(parseInt(_0x1c1831(0x1ec))/0x6)+parseInt(_0x1c1831(0x1ed))/0x7+parseInt(_0x1c1831(0x1fe))/0x8*(parseInt(_0x1c1831(0x1fb))/0x9)+parseInt(_0x1c1831(0x1e8))/0xa*(parseInt(_0x1c1831(0x1f6))/0xb)+parseInt(_0x1c1831(0x1f8))/0xc;if(_0x4f482f===_0x5e99f8)break;else _0x4286cc['push'](_0x4286cc['shift']());}catch(_0xcaa5f4){_0x4286cc['push'](_0x4286cc['shift']());}}}(a13_0x2b89,0x4218c));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x5ec1b5=a13_0x5ceb;super(_0x5ec1b5(0x1f5)),this[_0x5ec1b5(0x1ef)]=_0x5ec1b5(0x1e9);}}function createSafeRl(){const _0x3fa30a=a13_0x5ceb,_0x108377=createInterface({'input':process['stdin'],'output':process[_0x3fa30a(0x1fc)]});let _0x3c505d;const _0x120807=new Promise((_0x647b8f,_0x134e9d)=>{const _0x2ea44c=_0x3fa30a;_0x3c505d=()=>{const _0x57f17f=a13_0x5ceb;_0x3c505d&&(_0x108377[_0x57f17f(0x1eb)]('SIGINT',_0x3c505d),_0x3c505d=undefined);try{_0x108377[_0x57f17f(0x1ea)]();}catch{}_0x134e9d(new AbortPrompt());},_0x108377[_0x2ea44c(0x1e7)](_0x2ea44c(0x1f4),_0x3c505d);}),_0x4a018e=()=>{const _0x58494f=_0x3fa30a;_0x3c505d&&(_0x108377['removeListener']('SIGINT',_0x3c505d),_0x3c505d=undefined);try{_0x108377[_0x58494f(0x1ea)]();}catch{}};return{'rl':_0x108377,'abortPromise':_0x120807,'disposeSuccess':_0x4a018e};}function a13_0x2b89(){const _0xc6e1e8=['trim','964690HVqDcb','SIGINT','User\x20aborted\x20prompt','1848lOnwJO','6212oahYxr','1086348CYLvvx','AccessKey\x20(paste\x20ak_...):\x20','795qXHtLh','22311vjTNib','stdout','6571xBcbjI','400iiJBEu','once','6880TMygwj','AbortPrompt','close','removeListener','12DiHTaM','2636795qwYYYZ','race','name','question','110yuIEPV'];a13_0x2b89=function(){return _0xc6e1e8;};return a13_0x2b89();}export async function promptAccessKey(_0x236dc2=''){const _0x1b80b5=a13_0x5ceb,{rl:_0x39dd77,abortPromise:_0x4ac809,disposeSuccess:_0x1eb35f}=createSafeRl(),_0xc5d679=new Promise(_0x4c5cca=>{const _0x13f07d=a13_0x5ceb,_0x10c322=_0x236dc2?'AccessKey\x20('+_0x236dc2+'):\x20':_0x13f07d(0x1f9);_0x39dd77[_0x13f07d(0x1f0)](_0x10c322,_0x1396e2=>{const _0x1b4dff=_0x13f07d;_0x1eb35f(),_0x4c5cca(_0x1396e2[_0x1b4dff(0x1f2)]()||_0x236dc2);});});return Promise[_0x1b80b5(0x1ee)]([_0xc5d679,_0x4ac809]);}function a13_0x5ceb(_0x1c11e1,_0x119a4a){_0x1c11e1=_0x1c11e1-0x1e7;const _0x2b89ff=a13_0x2b89();let _0x5ceb34=_0x2b89ff[_0x1c11e1];return _0x5ceb34;}export function isAbortPrompt(_0x3aae97){const _0x572eea=a13_0x5ceb;return _0x3aae97 instanceof Error&&_0x3aae97['name']===_0x572eea(0x1e9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x19af2b=a14_0x58ec;function a14_0x58ec(_0x6eb4b3,_0x44caff){_0x6eb4b3=_0x6eb4b3-0x13f;const _0x392bc3=a14_0x392b();let _0x58ec73=_0x392bc3[_0x6eb4b3];return _0x58ec73;}function a14_0x392b(){const _0x4d0aa9=['verbose','read','createdTime','694695PjWYpw','Get\x20BFF\x20script\x20details\x20by\x20ID','95dLqCMH','functionName','num','1503EYtNqs','bool','Script\x20ID','(none)','18tGTpvr','6024XikSia','4435770RtUolh','563885ECuyVM','20776CXpGqR','1207960Dsdshx','detail','201440RpHDum'];a14_0x392b=function(){return _0x4d0aa9;};return a14_0x392b();}(function(_0x41c3de,_0x561c0e){const _0x47ae61=a14_0x58ec,_0x2e7d63=_0x41c3de();while(!![]){try{const _0x17d604=parseInt(_0x47ae61(0x14c))/0x1*(parseInt(_0x47ae61(0x140))/0x2)+-parseInt(_0x47ae61(0x14a))/0x3+parseInt(_0x47ae61(0x144))/0x4+-parseInt(_0x47ae61(0x146))/0x5*(parseInt(_0x47ae61(0x13f))/0x6)+parseInt(_0x47ae61(0x142))/0x7+-parseInt(_0x47ae61(0x143))/0x8*(-parseInt(_0x47ae61(0x14f))/0x9)+-parseInt(_0x47ae61(0x141))/0xa;if(_0x17d604===_0x561c0e)break;else _0x2e7d63['push'](_0x2e7d63['shift']());}catch(_0x4f2473){_0x2e7d63['push'](_0x2e7d63['shift']());}}}(a14_0x392b,0x4acca));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':'bff','command':a14_0x19af2b(0x145),'description':a14_0x19af2b(0x14b),'risk':a14_0x19af2b(0x148),'flags':[{...ID_FLAG,'description':a14_0x19af2b(0x151)},VERBOSE_FLAG],async 'execute'(_0x5dcd94){const _0x4599ac=a14_0x19af2b,_0x40cbd4=await getBffScriptInfo(_0x5dcd94[_0x4599ac(0x14e)]('id')),_0x375718=_0x5dcd94[_0x4599ac(0x150)](_0x4599ac(0x147));if(_0x375718)return{'ok':!![],'data':_0x40cbd4};return{'ok':!![],'data':{'id':_0x40cbd4['id'],'appCode':_0x40cbd4['appCode'],'functionName':_0x40cbd4[_0x4599ac(0x14d)]??'','scriptType':_0x40cbd4['scriptType'],'description':_0x40cbd4['description']||_0x4599ac(0x152),'createdTime':_0x40cbd4[_0x4599ac(0x149)]??'','updatedTime':_0x40cbd4['updatedTime']??''}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a15_0x32c1(){const _0x4443d8=['8872JdmWKT','BFF\x20executed\x20in\x20','275648MyHnGC','1405KJfrMP','str','16930ETGExJ','5286lDJxHt','271019WmWMpe','2922018YKKyqK','2dWSIaV','1666LEIqgM','945KhADdN','BFF\x20function\x20name\x20to\x20execute','now','name','770745aDyuQA'];a15_0x32c1=function(){return _0x4443d8;};return a15_0x32c1();}const a15_0x2702f8=a15_0x5f54;(function(_0x9619b8,_0x21da3e){const _0x55f7a8=a15_0x5f54,_0x1dbe30=_0x9619b8();while(!![]){try{const _0x702870=parseInt(_0x55f7a8(0xb2))/0x1+parseInt(_0x55f7a8(0xb4))/0x2*(parseInt(_0x55f7a8(0xaa))/0x3)+parseInt(_0x55f7a8(0xad))/0x4+-parseInt(_0x55f7a8(0xae))/0x5*(parseInt(_0x55f7a8(0xb1))/0x6)+-parseInt(_0x55f7a8(0xb5))/0x7*(parseInt(_0x55f7a8(0xab))/0x8)+parseInt(_0x55f7a8(0xb6))/0x9*(-parseInt(_0x55f7a8(0xb0))/0xa)+parseInt(_0x55f7a8(0xb3))/0xb;if(_0x702870===_0x21da3e)break;else _0x1dbe30['push'](_0x1dbe30['shift']());}catch(_0x5ebde3){_0x1dbe30['push'](_0x1dbe30['shift']());}}}(a15_0x32c1,0x2a4a0));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a15_0x5f54(_0x5dc945,_0x48b384){_0x5dc945=_0x5dc945-0xa7;const _0x32c16e=a15_0x32c1();let _0x5f54d4=_0x32c16e[_0x5dc945];return _0x5f54d4;}export const bffExec={'service':'bff','command':'exec','description':'Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','risk':'read','flags':[{...NAME_FLAG,'required':!![],'description':a15_0x2702f8(0xa7)},PARAMS_FLAG],async 'execute'(_0x225fc0){const _0xbf2c4d=a15_0x2702f8,_0x5c6ef0=parseJsonParams(_0x225fc0[_0xbf2c4d(0xaf)]('params')),_0x2e6a48=Date[_0xbf2c4d(0xa8)](),_0x45134f=await executeSdkBff(_0x225fc0[_0xbf2c4d(0xaf)](_0xbf2c4d(0xa9)),_0x5c6ef0),_0x3fdec6=Date[_0xbf2c4d(0xa8)]()-_0x2e6a48;return{'ok':!![],'data':{'result':_0x45134f,'elapsed':_0x3fdec6},'message':_0xbf2c4d(0xac)+_0x3fdec6+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4412ee,_0x753d48){const _0x5bff11=a16_0x156d,_0x324812=_0x4412ee();while(!![]){try{const _0x24bdcb=-parseInt(_0x5bff11(0x135))/0x1*(parseInt(_0x5bff11(0x130))/0x2)+-parseInt(_0x5bff11(0x133))/0x3+parseInt(_0x5bff11(0x137))/0x4*(-parseInt(_0x5bff11(0x134))/0x5)+-parseInt(_0x5bff11(0x139))/0x6+-parseInt(_0x5bff11(0x132))/0x7*(parseInt(_0x5bff11(0x136))/0x8)+-parseInt(_0x5bff11(0x138))/0x9+parseInt(_0x5bff11(0x131))/0xa;if(_0x24bdcb===_0x753d48)break;else _0x324812['push'](_0x324812['shift']());}catch(_0x9f2ed1){_0x324812['push'](_0x324812['shift']());}}}(a16_0x1c34,0xddd27));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a16_0x156d(_0x212ff3,_0x55efa2){_0x212ff3=_0x212ff3-0x130;const _0x1c34f=a16_0x1c34();let _0x156dcc=_0x1c34f[_0x212ff3];return _0x156dcc;}function a16_0x1c34(){const _0x4b462e=['28OTLKop','404120JwFnix','156IXiiik','11229876CpMlUr','7280472CyCPKQ','62500WzEfhq','75485260mFqWYe','161ZjsJdZ','2324565PSpqpA','175265NbZHCK'];a16_0x1c34=function(){return _0x4b462e;};return a16_0x1c34();}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a17_0x1b5f(){const _0x110035=['5354605olsvOs','log','pipe','14868310RMYXpK','write','error','inherit','Install\x20the\x20CLI\x20Built-in\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','apiError','\x20-g\x20-y','nonInteractive','4GuDSEK','setLogPath','56IThZbM','90215VdgJBn','npx\x20skills\x20add\x20failed:\x20','=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','cli-skill','info','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','37959QXekNL','104DZXIKt','56134012toQDKd','CLI\x20Built-in\x20Skill\x20installed','unknown','cwd','5011167uDbDvm','1525401tHvmyt','install','6suTUwD'];a17_0x1b5f=function(){return _0x110035;};return a17_0x1b5f();}function a17_0x5dfe(_0x393576,_0x17bdb4){_0x393576=_0x393576-0x114;const _0x1b5f21=a17_0x1b5f();let _0x5dfe8d=_0x1b5f21[_0x393576];return _0x5dfe8d;}const a17_0x5e1d08=a17_0x5dfe;(function(_0x39e1e4,_0x4ee1af){const _0x40bce1=a17_0x5dfe,_0x2315dd=_0x39e1e4();while(!![]){try{const _0xc762a9=-parseInt(_0x40bce1(0x131))/0x1*(parseInt(_0x40bce1(0x12e))/0x2)+-parseInt(_0x40bce1(0x119))/0x3*(-parseInt(_0x40bce1(0x11a))/0x4)+-parseInt(_0x40bce1(0x123))/0x5*(parseInt(_0x40bce1(0x122))/0x6)+-parseInt(_0x40bce1(0x11f))/0x7+-parseInt(_0x40bce1(0x130))/0x8*(parseInt(_0x40bce1(0x120))/0x9)+-parseInt(_0x40bce1(0x126))/0xa+parseInt(_0x40bce1(0x11b))/0xb;if(_0xc762a9===_0x4ee1af)break;else _0x2315dd['push'](_0x2315dd['shift']());}catch(_0x25b0b6){_0x2315dd['push'](_0x2315dd['shift']());}}}(a17_0x1b5f,0xc1420));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a17_0x5e1d08(0x116),'command':a17_0x5e1d08(0x121),'description':a17_0x5e1d08(0x12a),'risk':a17_0x5e1d08(0x127),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x42a26a){const _0x228dea=a17_0x5e1d08;logger[_0x228dea(0x12f)](process['cwd']()),logger[_0x228dea(0x117)]('cli-skill-install','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.');const {LOVRABET_SKILL_SOURCE:_0x2c70f8,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x5bde8c,runNpxSkillsAddGlobal:_0x35bde9}=await import('../../skills/npx-skills-add.js'),_0x3810e9=_0x42a26a[_0x228dea(0x12d)]?_0x228dea(0x125):_0x228dea(0x129);console[_0x228dea(0x124)](_0x228dea(0x118)+_0x2c70f8+'\x20-g\x20-y)...');const _0x587b0f=_0x35bde9(process[_0x228dea(0x11e)](),_0x2c70f8,{'stdio':_0x3810e9});if(_0x587b0f['skipped'])console['log']('Skipped\x20npx\x20('+_0x5bde8c+_0x228dea(0x115));else{if(_0x587b0f['ok'])console[_0x228dea(0x124)](_0x228dea(0x11c));else throw CliErrors[_0x228dea(0x12b)](_0x228dea(0x114)+(_0x587b0f[_0x228dea(0x128)]||_0x228dea(0x11d)),'Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20npx\x20skills\x20add\x20'+_0x2c70f8+_0x228dea(0x12c));}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10b343,_0x2f3a9b){const _0x30d3b3=a18_0xaebb,_0x40c11=_0x10b343();while(!![]){try{const _0x3f569b=-parseInt(_0x30d3b3(0x16b))/0x1*(parseInt(_0x30d3b3(0x17b))/0x2)+-parseInt(_0x30d3b3(0x169))/0x3+parseInt(_0x30d3b3(0x176))/0x4+parseInt(_0x30d3b3(0x179))/0x5+-parseInt(_0x30d3b3(0x16f))/0x6+parseInt(_0x30d3b3(0x17a))/0x7+parseInt(_0x30d3b3(0x168))/0x8;if(_0x3f569b===_0x2f3a9b)break;else _0x40c11['push'](_0x40c11['shift']());}catch(_0x417f20){_0x40c11['push'](_0x40c11['shift']());}}}(a18_0x1af9,0x86ad9));import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';function a18_0xaebb(_0x37e340,_0x1b51ae){_0x37e340=_0x37e340-0x168;const _0x1af9d2=a18_0x1af9();let _0xaebb9e=_0x1af9d2[_0x37e340];return _0xaebb9e;}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';function a18_0x1af9(){const _0x4dbfb3=['global','project-default','2314180eLQKmn','\x20found).','global-default','1883260oAhvpH','6115039xwHKhO','3574TRmgNY','726312axOxaa','1479654rigast','project','37dQtayi','newConfigFileName','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',',\x20or\x20run\x20`','4851510NlxUxg','inProject','Not\x20inside\x20a\x20project\x20(no\x20','validation','\x20(global)'];a18_0x1af9=function(){return _0x4dbfb3;};return a18_0x1af9();}import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x161cbd){const _0x1022cf=a18_0xaebb,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x10c505}=_0x161cbd;if(explicitGlobal&&explicitProject)throw CliErrors[_0x1022cf(0x172)](_0x1022cf(0x16d),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return'global';if(explicitProject)return'project';switch(_0x10c505){case _0x1022cf(0x178):return'global';case _0x1022cf(0x175):return _0x161cbd[_0x1022cf(0x170)]??isInProject()?_0x1022cf(0x16a):_0x1022cf(0x174);case'project-or-global-explicit':if(!(_0x161cbd[_0x1022cf(0x170)]??isInProject()))throw CliErrors[_0x1022cf(0x172)](_0x1022cf(0x171)+PRODUCT_CONFIG['newConfigFileName']+_0x1022cf(0x177),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x1022cf(0x16c)]+_0x1022cf(0x16e)+CLI_BIN_NAME+'\x20init`\x20first.');return _0x1022cf(0x16a);}}export function toScopeFlags(_0x2c1953){const _0x41345a=a18_0xaebb;return{'global':_0x2c1953===_0x41345a(0x174)};}export function formatScopeLabel(_0x5694f5){const _0x201fcb=a18_0xaebb;return _0x5694f5==='global'?_0x201fcb(0x173):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x62927a,_0x3e1029){const _0x57ed1d=a19_0x258a,_0x4a91ef=_0x62927a();while(!![]){try{const _0x177f4a=-parseInt(_0x57ed1d(0x10d))/0x1+-parseInt(_0x57ed1d(0x106))/0x2*(-parseInt(_0x57ed1d(0x110))/0x3)+-parseInt(_0x57ed1d(0xf4))/0x4*(-parseInt(_0x57ed1d(0xf6))/0x5)+-parseInt(_0x57ed1d(0xfc))/0x6+-parseInt(_0x57ed1d(0x10b))/0x7*(-parseInt(_0x57ed1d(0xfe))/0x8)+-parseInt(_0x57ed1d(0x10c))/0x9+parseInt(_0x57ed1d(0xfb))/0xa;if(_0x177f4a===_0x3e1029)break;else _0x4a91ef['push'](_0x4a91ef['shift']());}catch(_0x52f202){_0x4a91ef['push'](_0x4a91ef['shift']());}}}(a19_0x44c4,0x2327e));function a19_0x258a(_0x52424a,_0x2b6a9e){_0x52424a=_0x52424a-0xf3;const _0x44c472=a19_0x44c4();let _0x258a1b=_0x44c472[_0x52424a];return _0x258a1b;}import{CliErrors}from'../../errors.js';function isSet(_0x472047,_0x3fdbbc){const _0x5dcb13=a19_0x258a,_0x1a3610=_0x472047[_0x5dcb13(0x109)](_0x3fdbbc);return _0x1a3610!==undefined&&_0x1a3610!==''&&_0x1a3610!==![]&&_0x1a3610!==0x0;}function fmtNames(_0x37d8d8){const _0x409d3e=a19_0x258a;return _0x37d8d8[_0x409d3e(0xf5)](_0x4f0332=>'--'+_0x4f0332)[_0x409d3e(0xfa)](',\x20');}export function requireOneOf(_0x176afa,_0x4b87d1,_0x4d6926){const _0x731a37=a19_0x258a,_0x1a2395=_0x4b87d1[_0x731a37(0x10e)](_0x12c88e=>isSet(_0x176afa,_0x12c88e));if(_0x1a2395[_0x731a37(0x10f)]!==0x1)throw CliErrors[_0x731a37(0x107)](_0x1a2395[_0x731a37(0x10f)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x4b87d1)+_0x731a37(0xf9)+_0x4d6926+'`.':_0x731a37(0xf7)+fmtNames(_0x4b87d1)+_0x731a37(0x10a)+fmtNames(_0x1a2395)+'.',_0x1a2395[_0x731a37(0x10f)]===0x0?_0x731a37(0x105)+fmtNames(_0x4b87d1):_0x731a37(0x103));}export function requireAnyOf(_0x2241bc,_0x475032,_0x4dd7f1){const _0x1e05e1=a19_0x258a;if(!_0x475032['some'](_0x17a0a2=>isSet(_0x2241bc,_0x17a0a2)))throw CliErrors[_0x1e05e1(0x107)](_0x1e05e1(0x104)+fmtNames(_0x475032)+_0x1e05e1(0xf9)+_0x4dd7f1+'`.',_0x1e05e1(0x105)+fmtNames(_0x475032));}function a19_0x44c4(){const _0x34543e=['48iufQKo','Invalid\x20--','test','Flags\x20','\x20are\x20mutually\x20exclusive\x20for\x20`','Remove\x20all\x20but\x20one.','At\x20least\x20one\x20of\x20','Provide\x20one\x20of:\x20','28762XtOrhS','validation','str','flag','\x20is\x20allowed,\x20found:\x20','79401WSiMdR','985212vbWFTs','19501VXuvNa','filter','length','6wuaNcx',',\x20got\x20\x22','7516bRMXdh','map','725NqvAAN','Only\x20one\x20of\x20','Use\x20only\x20one\x20of:\x20','\x20is\x20required\x20for\x20`','join','1688130hHnZCq','1590726JLdwPE',':\x20expected\x20'];a19_0x44c4=function(){return _0x34543e;};return a19_0x44c4();}export function mutuallyExclusive(_0x373c13,_0x2bdd67,_0xa99ab6){const _0x240f04=a19_0x258a,_0xed63ae=_0x2bdd67[_0x240f04(0x10e)](_0x10f875=>isSet(_0x373c13,_0x10f875));if(_0xed63ae[_0x240f04(0x10f)]>0x1)throw CliErrors['validation'](_0x240f04(0x101)+fmtNames(_0xed63ae)+_0x240f04(0x102)+_0xa99ab6+'`.',_0x240f04(0xf8)+fmtNames(_0x2bdd67));}export function validatePattern(_0xe31ec5,_0x277ee6,_0x4bca8c,_0x3e09e4){const _0x288bd9=a19_0x258a,_0xe4ed11=_0xe31ec5[_0x288bd9(0x108)](_0x277ee6);if(_0xe4ed11&&!_0x4bca8c[_0x288bd9(0x100)](_0xe4ed11))throw CliErrors[_0x288bd9(0x107)](_0x288bd9(0xff)+_0x277ee6+_0x288bd9(0xfd)+_0x3e09e4+_0x288bd9(0xf3)+_0xe4ed11+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a20_0x45fcaa=a20_0xb259;(function(_0x57fce6,_0x345530){const _0x2a1356=a20_0xb259,_0x5a23d6=_0x57fce6();while(!![]){try{const _0xa59789=-parseInt(_0x2a1356(0x1c4))/0x1*(parseInt(_0x2a1356(0x1ce))/0x2)+-parseInt(_0x2a1356(0x1c2))/0x3*(-parseInt(_0x2a1356(0x1c3))/0x4)+parseInt(_0x2a1356(0x1d1))/0x5*(parseInt(_0x2a1356(0x1cd))/0x6)+parseInt(_0x2a1356(0x1d3))/0x7+parseInt(_0x2a1356(0x1c7))/0x8+parseInt(_0x2a1356(0x1c0))/0x9+-parseInt(_0x2a1356(0x1c5))/0xa*(parseInt(_0x2a1356(0x1be))/0xb);if(_0xa59789===_0x345530)break;else _0x5a23d6['push'](_0x5a23d6['shift']());}catch(_0x453965){_0x5a23d6['push'](_0x5a23d6['shift']());}}}(a20_0x4d38,0x9b155));function a20_0xb259(_0x29f623,_0x1f877d){_0x29f623=_0x29f623-0x1be;const _0x4d386c=a20_0x4d38();let _0xb25993=_0x4d386c[_0x29f623];return _0xb25993;}export const CODE_FLAG={'name':a20_0x45fcaa(0x1cb),'type':a20_0x45fcaa(0x1cf),'required':!![],'description':a20_0x45fcaa(0x1c1),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a20_0x45fcaa(0x1c9)}};export const SQLCODE_FLAG={'name':a20_0x45fcaa(0x1cc),'type':a20_0x45fcaa(0x1cf),'required':!![],'description':a20_0x45fcaa(0x1d6),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a20_0x45fcaa(0x1ca)}};export const VERBOSE_FLAG={'name':a20_0x45fcaa(0x1d0),'type':a20_0x45fcaa(0x1d4),'description':a20_0x45fcaa(0x1d5)};export const PARAMS_FLAG={'name':'params','type':a20_0x45fcaa(0x1cf),'description':a20_0x45fcaa(0x1d2)};function a20_0x4d38(){const _0x10b1da=['2069419WoNUwQ','Resource\x20ID','5350320UsUekC','Dataset\x20code\x20(32-char\x20hex\x20UUID)','3603EEeTnd','2260jeSKWM','472mkuHkD','90JjJLjR','Resource\x20name\x20for\x20lookup','4687184fTaeyz','number','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','code','sqlcode','12atHyNM','3590lkQMKg','string','verbose','1539085lOKYQZ','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','4907315ZWlUnR','boolean','Return\x20full\x20raw\x20response\x20object','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)'];a20_0x4d38=function(){return _0x10b1da;};return a20_0x4d38();}export const NAME_FLAG={'name':'name','type':a20_0x45fcaa(0x1cf),'description':a20_0x45fcaa(0x1c6)};export const ID_FLAG={'name':'id','type':a20_0x45fcaa(0x1c8),'required':!![],'description':a20_0x45fcaa(0x1bf)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1acd65,_0x4f5079){const _0x3305fd=a21_0x27a8,_0x353316=_0x1acd65();while(!![]){try{const _0x17b7d0=parseInt(_0x3305fd(0x18c))/0x1*(-parseInt(_0x3305fd(0x17c))/0x2)+parseInt(_0x3305fd(0x18a))/0x3*(-parseInt(_0x3305fd(0x189))/0x4)+parseInt(_0x3305fd(0x184))/0x5+-parseInt(_0x3305fd(0x180))/0x6+-parseInt(_0x3305fd(0x186))/0x7+-parseInt(_0x3305fd(0x187))/0x8*(-parseInt(_0x3305fd(0x182))/0x9)+parseInt(_0x3305fd(0x185))/0xa;if(_0x17b7d0===_0x4f5079)break;else _0x353316['push'](_0x353316['shift']());}catch(_0x457ea7){_0x353316['push'](_0x353316['shift']());}}}(a21_0x9db1,0x2cd52));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;function a21_0x9db1(){const _0x380d9f=['10286OMJQlI','toFixed','\x20path\x20is\x20required.','File\x20is\x20not\x20a\x20regular\x20file:\x20','30JHGTYf','File\x20not\x20found:\x20','isFile','validation','330228wVByYs','File\x20exceeds\x20the\x20runtime\x20upload\x20limit\x20of\x2050\x20MB:\x20','967257vaaZGS','size','1074310iWJsHr','4323000kWadUw','1354024WioilT','8OOedUP','ceil','672964gjavVN','3uItyPC','\x20MB'];a21_0x9db1=function(){return _0x380d9f;};return a21_0x9db1();}function a21_0x27a8(_0x384258,_0x371e4a){_0x384258=_0x384258-0x17a;const _0x9db155=a21_0x9db1();let _0x27a84e=_0x9db155[_0x384258];return _0x27a84e;}export const RUNTIME_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x448773){const _0x3ae40a=a21_0x27a8;if(_0x448773>=BYTES_PER_MB){const _0x4fe3ac=Math[_0x3ae40a(0x188)](_0x448773/BYTES_PER_MB*0x64)/0x64;return _0x4fe3ac[_0x3ae40a(0x18d)](0x2)+_0x3ae40a(0x18b);}return _0x448773+'\x20B';}export function requireRuntimeUploadFile(_0x232d0c,_0x47fa9e){const _0x34f7ab=a21_0x27a8,_0x23b630=_0x232d0c['trim']();if(!_0x23b630)throw CliErrors[_0x34f7ab(0x17f)](_0x47fa9e+_0x34f7ab(0x17a));if(!existsSync(_0x23b630))throw CliErrors[_0x34f7ab(0x17f)](_0x34f7ab(0x17d)+_0x23b630);const _0xe282f9=statSync(_0x23b630);if(!_0xe282f9[_0x34f7ab(0x17e)]())throw CliErrors[_0x34f7ab(0x17f)](_0x34f7ab(0x17b)+_0x23b630);if(_0xe282f9[_0x34f7ab(0x183)]>RUNTIME_UPLOAD_MAX_BYTES)throw CliErrors['validation'](_0x34f7ab(0x181)+_0x23b630+'\x20('+formatBytes(_0xe282f9[_0x34f7ab(0x183)])+')');return{'path':_0x23b630,'size':_0xe282f9[_0x34f7ab(0x183)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x1cdff1=a22_0x4a54;function a22_0x5205(){const _0x1a785e=['pretty','stringify','2876650Qswjuj','590490ZfMYnu','\x20(global)','(none)','format','validation','`\x20=\x20\x22','Key\x20not\x20found:\x20','708ZenzUK','Write\x20to\x20global\x20config','value','7913646pmGJVF','object','Missing\x20key\x20or\x20value.','bool','trim','write','263417ukDfQb','riskLevel','Set\x20`','Usage:\x20','\x22\x20is\x20not\x20settable.','\x20config\x20delete\x20<key>\x20[--global]','16PcxSdQ',';\x20apps.<alias>.appcode','Missing\x20key\x20argument.','919353ccuzQa','../../context.js','\x20\x20project:\x20','log','raw','Invalid\x20value\x20for\x20\x22','alias','length','list','appcode','Key\x20\x22','project-or-global-explicit','pageSize','key','\x20config\x20set\x20<key>\x20<value>\x20[--global]','args','join','Top-level\x20key\x20\x22','config','Set\x20a\x20config\x20value','apps','global','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','get','4214495QirPVa','List\x20current\x20config','split','Delete\x20a\x20config\x20value','isArray','Get\x20a\x20config\x20value','\x22\x20not\x20found\x20at\x20top\x20level.','4461NreqYc','boolean','field','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Settable\x20keys:\x20','includes','\x20config\x20get\x20<key>'];a22_0x5205=function(){return _0x1a785e;};return a22_0x5205();}(function(_0x44379c,_0x12970b){const _0x337183=a22_0x4a54,_0x4cfb12=_0x44379c();while(!![]){try{const _0x2e84e5=parseInt(_0x337183(0xe2))/0x1+parseInt(_0x337183(0x10a))/0x2+-parseInt(_0x337183(0x101))/0x3*(-parseInt(_0x337183(0x112))/0x4)+-parseInt(_0x337183(0xfa))/0x5+-parseInt(_0x337183(0x10b))/0x6+-parseInt(_0x337183(0xd9))/0x7*(parseInt(_0x337183(0xdf))/0x8)+-parseInt(_0x337183(0xd3))/0x9;if(_0x2e84e5===_0x12970b)break;else _0x4cfb12['push'](_0x4cfb12['shift']());}catch(_0x4eacbc){_0x4cfb12['push'](_0x4cfb12['shift']());}}}(a22_0x5205,0xb100f));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':a22_0x1cdff1(0xf7),'type':a22_0x1cdff1(0x102),'description':a22_0x1cdff1(0x113),'default':![]};function parseAliasAppcodeSetKey(_0x46e9e0){const _0x3394a9=a22_0x1cdff1,_0x47f7c0=_0x46e9e0[_0x3394a9(0xfc)]('.');if(_0x47f7c0[_0x3394a9(0xe9)]!==0x3||_0x47f7c0[0x0]!=='apps'||_0x47f7c0[0x2]!==_0x3394a9(0xeb))return undefined;const _0x23dc4b=_0x47f7c0[0x1]?.[_0x3394a9(0xd7)]();return _0x23dc4b?_0x23dc4b:undefined;}function parseAliasDeleteKey(_0x5b51f7){const _0x1bd191=a22_0x1cdff1,_0x5001d4=_0x5b51f7['split']('.');if(_0x5001d4[_0x1bd191(0xe9)]===0x2&&_0x5001d4[0x0]===_0x1bd191(0xf6)){const _0x13bbc7=_0x5001d4[0x1]?.[_0x1bd191(0xd7)]();return _0x13bbc7?{'alias':_0x13bbc7}:undefined;}if(_0x5001d4['length']===0x3&&_0x5001d4[0x0]==='apps'&&_0x5001d4[0x2]===_0x1bd191(0xeb)){const _0x436bf3=_0x5001d4[0x1]?.['trim']();return _0x436bf3?{'alias':_0x436bf3,'field':_0x1bd191(0xeb)}:undefined;}return undefined;}function setLocalAppAlias(_0x57df55,_0x266bce,_0x3a6a8c){const _0x4fb9c0=a22_0x1cdff1,_0x33cab6=_0x57df55[_0x4fb9c0(0xf6)]&&typeof _0x57df55[_0x4fb9c0(0xf6)]==='object'&&!Array[_0x4fb9c0(0xfe)](_0x57df55[_0x4fb9c0(0xf6)])?_0x57df55[_0x4fb9c0(0xf6)]:{},_0x3bd2be=_0x33cab6[_0x266bce]&&typeof _0x33cab6[_0x266bce]===_0x4fb9c0(0xd4)&&!Array[_0x4fb9c0(0xfe)](_0x33cab6[_0x266bce])?_0x33cab6[_0x266bce]:{};_0x3bd2be['appcode']=_0x3a6a8c,_0x33cab6[_0x266bce]=_0x3bd2be,_0x57df55[_0x4fb9c0(0xf6)]=_0x33cab6;}function a22_0x4a54(_0x41c62b,_0x2aaf10){_0x41c62b=_0x41c62b-0xd3;const _0x5205ee=a22_0x5205();let _0x4a54aa=_0x5205ee[_0x41c62b];return _0x4a54aa;}function deleteLocalAppAlias(_0x3b995,_0x35ff28){const _0x10ad51=a22_0x1cdff1;if(!_0x3b995[_0x10ad51(0xf6)]||typeof _0x3b995[_0x10ad51(0xf6)]!=='object'||Array[_0x10ad51(0xfe)](_0x3b995[_0x10ad51(0xf6)]))return![];const _0x44d96f=_0x3b995[_0x10ad51(0xf6)],_0x496d29=_0x44d96f[_0x35ff28[_0x10ad51(0xe8)]];if(!_0x496d29||typeof _0x496d29!==_0x10ad51(0xd4)||Array['isArray'](_0x496d29))return![];if(!_0x35ff28['field'])return delete _0x44d96f[_0x35ff28[_0x10ad51(0xe8)]],!![];if(!(_0x35ff28[_0x10ad51(0x103)]in _0x496d29))return![];return delete _0x496d29[_0x35ff28[_0x10ad51(0x103)]],Object['keys'](_0x496d29)[_0x10ad51(0xe9)]===0x0&&delete _0x44d96f[_0x35ff28['alias']],!![];}const listDef={'service':a22_0x1cdff1(0xf4),'command':a22_0x1cdff1(0xea),'description':a22_0x1cdff1(0xfb),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x107afb){const _0x21b5ab=a22_0x1cdff1,{buildConfigFromFlags:_0x443d65}=await import(_0x21b5ab(0xe3)),_0x278eb=_0x443d65({}),_0x59e251=getProjectConfigPath(),_0x536ab9=resolveWriteConfigPath(_0x21b5ab(0xf7));if(_0x107afb[_0x21b5ab(0x10e)]===_0x21b5ab(0x108))return{'ok':!![],'message':_0x21b5ab(0xf8)+(JSON[_0x21b5ab(0x109)](_0x278eb[_0x21b5ab(0xe6)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x21b5ab(0xe4)+(_0x59e251??_0x21b5ab(0x10d))+'\x0a')+('\x20\x20global:\x20\x20'+_0x536ab9)};return{'ok':!![],'data':{'effective':_0x278eb['raw'],'configFiles':{'project':_0x59e251??null,'global':_0x536ab9}}};}},getDef={'service':'config','command':a22_0x1cdff1(0xf9),'description':a22_0x1cdff1(0xff),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x1cdff1(0xef),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x2a855e){const _0x1d250e=a22_0x1cdff1,_0x268809=_0x2a855e[_0x1d250e(0xf1)][0x0];if(!_0x268809)throw CliErrors[_0x1d250e(0x10f)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x1d250e(0x107));const {buildConfigFromFlags:_0x490d81}=await import(_0x1d250e(0xe3)),{raw:_0x5b4924}=_0x490d81({});if(_0x268809['includes']('.')){const _0xb2a07e=_0x268809[_0x1d250e(0xfc)]('.');let _0x50edbb=_0x5b4924;for(const _0x2c5713 of _0xb2a07e){if(_0x50edbb==null||typeof _0x50edbb!==_0x1d250e(0xd4))throw CliErrors[_0x1d250e(0x10f)](_0x1d250e(0x111)+_0x268809);_0x50edbb=_0x50edbb[_0x2c5713];}if(_0x50edbb===undefined)throw CliErrors[_0x1d250e(0x10f)](_0x1d250e(0x111)+_0x268809);return console[_0x1d250e(0xe5)](typeof _0x50edbb===_0x1d250e(0xd4)?JSON[_0x1d250e(0x109)](_0x50edbb,null,0x2):String(_0x50edbb)),{'ok':!![]};}const _0x57f19b=_0x5b4924[_0x268809];if(_0x57f19b===undefined)throw CliErrors[_0x1d250e(0x10f)](_0x1d250e(0x111)+_0x268809);return console[_0x1d250e(0xe5)](typeof _0x57f19b===_0x1d250e(0xd4)?JSON[_0x1d250e(0x109)](_0x57f19b,null,0x2):String(_0x57f19b)),{'ok':!![]};}},setDef={'service':a22_0x1cdff1(0xf4),'command':'set','description':a22_0x1cdff1(0xf5),'risk':a22_0x1cdff1(0xd8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a22_0x1cdff1(0xef),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a22_0x1cdff1(0x114),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x16ba0c){const _0x58bd04=a22_0x1cdff1,_0x2dd5bf=_0x16ba0c['args'][0x0],_0x247a19=_0x16ba0c[_0x58bd04(0xf1)][0x1];if(!_0x2dd5bf||_0x247a19===undefined)throw CliErrors[_0x58bd04(0x10f)](_0x58bd04(0xd5),_0x58bd04(0xdc)+CLI_BIN_NAME+_0x58bd04(0xf0));if(ENUM_KEYS[_0x2dd5bf]&&!ENUM_KEYS[_0x2dd5bf][_0x58bd04(0x106)](_0x247a19))throw CliErrors[_0x58bd04(0x10f)](_0x58bd04(0xe7)+_0x2dd5bf+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0x2dd5bf][_0x58bd04(0xf2)](',\x20'));if(_0x2dd5bf===_0x58bd04(0xda))throw CliErrors['validation'](_0x58bd04(0x104));if(_0x2dd5bf===_0x58bd04(0xee)){const _0xccabd5=Number(_0x247a19);if(isNaN(_0xccabd5)||_0xccabd5<=0x0)throw CliErrors[_0x58bd04(0x10f)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x37b204=resolveWriteScope({'explicitGlobal':_0x16ba0c[_0x58bd04(0xd6)](_0x58bd04(0xf7)),'policy':_0x58bd04(0xed)}),_0xe44412=toScopeFlags(_0x37b204),_0x3e4cb8=readScopedConfig(_0xe44412),_0x40df44=parseAliasAppcodeSetKey(_0x2dd5bf);if(!_0x40df44&&!isTopLevelConfigKey(_0x2dd5bf))throw CliErrors[_0x58bd04(0x10f)](_0x58bd04(0xf3)+_0x2dd5bf+_0x58bd04(0xdd),_0x58bd04(0x105)+getTopLevelConfigKeySummary()+_0x58bd04(0xe0));return _0x40df44?setLocalAppAlias(_0x3e4cb8,_0x40df44,_0x247a19):_0x3e4cb8[_0x2dd5bf]=_0x2dd5bf==='pageSize'?Number(_0x247a19):_0x247a19,console[_0x58bd04(0xe5)](_0x58bd04(0xdb)+_0x2dd5bf+_0x58bd04(0x110)+_0x247a19+'\x22'+(_0x37b204===_0x58bd04(0xf7)?_0x58bd04(0x10c):'')),writeScopedConfig(_0x3e4cb8,_0xe44412),{'ok':!![]};}},deleteDef={'service':a22_0x1cdff1(0xf4),'command':'delete','description':a22_0x1cdff1(0xfd),'risk':a22_0x1cdff1(0xd8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x5746e1){const _0x20b8ce=a22_0x1cdff1,_0x5b55d1=_0x5746e1[_0x20b8ce(0xf1)][0x0];if(!_0x5b55d1)throw CliErrors['validation'](_0x20b8ce(0xe1),_0x20b8ce(0xdc)+CLI_BIN_NAME+_0x20b8ce(0xde));const _0x125d43=resolveWriteScope({'explicitGlobal':_0x5746e1[_0x20b8ce(0xd6)](_0x20b8ce(0xf7)),'policy':_0x20b8ce(0xed)}),_0x58020b=toScopeFlags(_0x125d43),_0x4a4c8f=readScopedConfig(_0x58020b),_0x29080f=parseAliasDeleteKey(_0x5b55d1);if(_0x29080f){if(!deleteLocalAppAlias(_0x4a4c8f,_0x29080f))throw CliErrors['validation'](_0x20b8ce(0x111)+_0x5b55d1);return console[_0x20b8ce(0xe5)]('Deleted\x20`'+_0x5b55d1+'`'+(_0x125d43===_0x20b8ce(0xf7)?_0x20b8ce(0x10c):'')),writeScopedConfig(_0x4a4c8f,_0x58020b),{'ok':!![]};}if(_0x4a4c8f[_0x5b55d1]===undefined)throw CliErrors[_0x20b8ce(0x10f)](_0x20b8ce(0xec)+_0x5b55d1+_0x20b8ce(0x100));return delete _0x4a4c8f[_0x5b55d1],console['log']('Deleted\x20`'+_0x5b55d1+'`'+(_0x125d43==='global'?'\x20(global)':'')),writeScopedConfig(_0x4a4c8f,_0x58020b),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a23_0x19d4(_0x3acb01,_0x662b7b){_0x3acb01=_0x3acb01-0x161;var _0x439c2f=a23_0x439c();var _0x19d4e3=_0x439c2f[_0x3acb01];return _0x19d4e3;}(function(_0x3673cc,_0x461a89){var _0x940c5f=a23_0x19d4,_0x92a1fc=_0x3673cc();while(!![]){try{var _0x2fb241=parseInt(_0x940c5f(0x164))/0x1*(parseInt(_0x940c5f(0x161))/0x2)+parseInt(_0x940c5f(0x16a))/0x3+parseInt(_0x940c5f(0x169))/0x4+parseInt(_0x940c5f(0x163))/0x5*(parseInt(_0x940c5f(0x162))/0x6)+-parseInt(_0x940c5f(0x165))/0x7+parseInt(_0x940c5f(0x167))/0x8*(-parseInt(_0x940c5f(0x168))/0x9)+-parseInt(_0x940c5f(0x166))/0xa;if(_0x2fb241===_0x461a89)break;else _0x92a1fc['push'](_0x92a1fc['shift']());}catch(_0x61f415){_0x92a1fc['push'](_0x92a1fc['shift']());}}}(a23_0x439c,0xde6d6));import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};function a23_0x439c(){var _0xfa3fba=['651205KwyEpk','4NGWqAf','8585087vtEsjK','10884230bDwEXC','56tuxgZN','1260999pbUqxN','6042852zVevfT','4133595ECmHSP','593942DxgYHQ','6DiRtPk'];a23_0x439c=function(){return _0xfa3fba;};return a23_0x439c();}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
|
-
const a24_0x21b592=a24_0x11a1;(function(_0x11f044,_0x2f50f2){const _0x5f36fe=a24_0x11a1,_0x26ccee=_0x11f044();while(!![]){try{const _0x4ac224=parseInt(_0x5f36fe(0xfb))/0x1*(parseInt(_0x5f36fe(0x102))/0x2)+parseInt(_0x5f36fe(0x132))/0x3*(-parseInt(_0x5f36fe(0x147))/0x4)+parseInt(_0x5f36fe(0xf9))/0x5+-parseInt(_0x5f36fe(0x124))/0x6+parseInt(_0x5f36fe(0x105))/0x7+parseInt(_0x5f36fe(0x14a))/0x8*(-parseInt(_0x5f36fe(0xf8))/0x9)+-parseInt(_0x5f36fe(0x13d))/0xa;if(_0x4ac224===_0x2f50f2)break;else _0x26ccee['push'](_0x26ccee['shift']());}catch(_0x1975c6){_0x26ccee['push'](_0x26ccee['shift']());}}}(a24_0x129f,0x71a99));function a24_0x129f(){const _0x2f096b=['\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\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','str','721264FiCMra','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','1416uoNTaR','description','map','now','POST','\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)','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','write','\x20on\x20dataset\x20','32058qSChuJ','3372825WEpVmz','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','109379pczlcY','\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','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','high-risk-write','data','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20$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}}]}','14CFaTBP','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','join','4401376yFdyYI','Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27','\x20\x20EXAMPLES','\x20\x20AGGREGATE\x20TYPES','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','paramsRequired','delete','\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\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\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','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}}','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','aggregate','\x20\x20PAGINATION','operation','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','batchCreate','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','getOne','\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}}]}','Preview:\x20data\x20','update','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','risk','\x20\x20WHERE\x20OPERATORS','params','\x20\x20PARAMS\x20STRUCTURE','1984230BbqtAX','\x20completed\x20in\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','\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}','filter','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','length','code','6MJBdIW','\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}}','body','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','\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]}}','batch','/api/{appCode}/','build','\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','read','2816140CPwhJf','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','create','\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\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','command','Update\x20an\x20existing\x20record'];a24_0x129f=function(){return _0x2f096b;};return a24_0x129f();}import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';function a24_0x11a1(_0x5a0536,_0x452236){_0x5a0536=_0x5a0536-0xf3;const _0x129f41=a24_0x129f();let _0x11a1bf=_0x129f41[_0x5a0536];return _0x11a1bf;}import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':'filter','operation':a24_0x21b592(0x12e),'risk':a24_0x21b592(0x13c),'paramsRequired':![],'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsHint':a24_0x21b592(0xf4)+a24_0x21b592(0x149),'helpExtra':[a24_0x21b592(0x121),a24_0x21b592(0x133),a24_0x21b592(0x112),a24_0x21b592(0x10f),a24_0x21b592(0x135),a24_0x21b592(0x136),a24_0x21b592(0x129),a24_0x21b592(0x137),a24_0x21b592(0x110),a24_0x21b592(0x10c),a24_0x21b592(0x148),'',a24_0x21b592(0x14f),a24_0x21b592(0x101),a24_0x21b592(0x11c),'','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)',a24_0x21b592(0x12a),a24_0x21b592(0x144),'\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}]',a24_0x21b592(0x103),a24_0x21b592(0x12f),'',a24_0x21b592(0x115),a24_0x21b592(0xf5),a24_0x21b592(0x128),a24_0x21b592(0x11f)][a24_0x21b592(0x104)]('\x0a')},{'command':a24_0x21b592(0x11b),'operation':'getOne','risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a24_0x21b592(0x141)},{'command':a24_0x21b592(0x13f),'operation':a24_0x21b592(0x13f),'risk':a24_0x21b592(0xf6),'paramsRequired':!![],'description':a24_0x21b592(0x109),'paramsHint':a24_0x21b592(0xfd)},{'command':a24_0x21b592(0x119),'operation':a24_0x21b592(0x119),'risk':a24_0x21b592(0xf6),'paramsRequired':!![],'description':a24_0x21b592(0x12c),'paramsHint':a24_0x21b592(0x100)},{'command':a24_0x21b592(0x11e),'operation':'update','risk':a24_0x21b592(0xf6),'paramsRequired':!![],'description':a24_0x21b592(0x143),'paramsHint':a24_0x21b592(0x127)+a24_0x21b592(0x106)},{'command':a24_0x21b592(0x10b),'operation':a24_0x21b592(0x10b),'risk':a24_0x21b592(0xfe),'paramsRequired':!![],'description':a24_0x21b592(0x11a),'paramsHint':a24_0x21b592(0x141)},{'command':a24_0x21b592(0x114),'operation':'aggregate','risk':'read','paramsRequired':![],'description':a24_0x21b592(0x113),'paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a24_0x21b592(0x108),a24_0x21b592(0x10e),a24_0x21b592(0x12b),'\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\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}',a24_0x21b592(0x12d),'\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}',a24_0x21b592(0x140),'',a24_0x21b592(0x123),a24_0x21b592(0x118),a24_0x21b592(0x126),a24_0x21b592(0xf3),a24_0x21b592(0xfa),a24_0x21b592(0x10d),a24_0x21b592(0x117),'',a24_0x21b592(0x107),a24_0x21b592(0x145),a24_0x21b592(0x13b),'','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a24_0x21b592(0xfc),'',a24_0x21b592(0x13e)][a24_0x21b592(0x104)]('\x0a')}];function makeDataCommand(_0x280f33){const _0x55d2a7=a24_0x21b592,_0x1a8fbe='data\x20'+_0x280f33[_0x55d2a7(0x142)],_0x265e9e={'service':_0x55d2a7(0xff),'command':_0x280f33[_0x55d2a7(0x142)],'description':_0x280f33[_0x55d2a7(0x14b)],'risk':_0x280f33['risk'],'helpExtra':_0x280f33['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x280f33[_0x55d2a7(0x111)]}],'validate':async _0x4d75b8=>{const _0xe78064=_0x55d2a7;_0x280f33[_0xe78064(0x10a)]&&requireAnyOf(_0x4d75b8,[_0xe78064(0x122)],_0x1a8fbe),_0x280f33[_0xe78064(0x116)]==='batchCreate'&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4d75b8['str'](_0xe78064(0x122)))),_0x280f33[_0xe78064(0x116)]==='update'&&parseUpdateIdsFromParams(parseJsonParams(_0x4d75b8[_0xe78064(0x146)](_0xe78064(0x122)))??{});},async 'execute'(_0x382a14){const _0x3a6e26=_0x55d2a7,_0x110584=_0x382a14['str'](_0x3a6e26(0x131)),_0x101cc6=_0x280f33[_0x3a6e26(0x116)]===_0x3a6e26(0x119)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x382a14[_0x3a6e26(0x146)](_0x3a6e26(0x122)))):parseJsonParams(_0x382a14[_0x3a6e26(0x146)](_0x3a6e26(0x122)))??{},_0x41f061=_0x280f33['operation']===_0x3a6e26(0x11e)?parseUpdateIdsFromParams(_0x101cc6):undefined,_0xddc462=_0x41f061?normalizeUpdateParamsForRuntime(_0x101cc6,_0x41f061):_0x101cc6,_0x49028e=Date[_0x3a6e26(0x14d)](),_0x246d1f=await executeData(_0x110584,_0x280f33[_0x3a6e26(0x116)],_0xddc462),_0x37ec19=Date[_0x3a6e26(0x14d)]()-_0x49028e,_0xd4ecaf=_0x41f061&&_0x41f061['length']>0x1?buildBatchUpdateResult(_0x41f061,_0x246d1f):_0x246d1f;return{'ok':!![],'data':{'result':_0xd4ecaf,'elapsed':_0x37ec19},'message':'data\x20'+_0x280f33[_0x3a6e26(0x142)]+_0x3a6e26(0x125)+_0x37ec19+'ms'};}};return _0x280f33[_0x55d2a7(0x120)]!=='read'&&(_0x265e9e['dryRun']=async _0xf550ea=>{const _0x11c768=_0x55d2a7,_0x4cbfbf=_0xf550ea[_0x11c768(0x146)](_0x11c768(0x131)),_0x3086fa=_0x280f33['operation']==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0xf550ea[_0x11c768(0x146)](_0x11c768(0x122)))):parseJsonParams(_0xf550ea[_0x11c768(0x146)](_0x11c768(0x122)))??{};let _0x2bc408=_0x3086fa;if(_0x280f33['operation']==='update'){const _0x252212=parseUpdateIdsFromParams(_0x3086fa);_0x2bc408=normalizeUpdateParamsForRuntime(_0x3086fa,_0x252212);}return dryRun(_0x11c768(0x14e),_0x11c768(0x139)+_0x4cbfbf+'/'+_0x280f33[_0x11c768(0x116)])[_0x11c768(0x134)](_0x2bc408)[_0x11c768(0x14b)](_0x11c768(0x11d)+_0x280f33[_0x11c768(0x142)]+_0x11c768(0xf7)+_0x4cbfbf)[_0x11c768(0x13a)]();}),_0x265e9e;}export const dataDefinitions=specs[a24_0x21b592(0x14c)](makeDataCommand);function buildBatchUpdateResult(_0x5bd7bf,_0x3a4895){const _0x59bc36=a24_0x21b592;return{'operation':_0x59bc36(0x11e),'mode':_0x59bc36(0x138),'ids':_0x5bd7bf,'total':_0x5bd7bf[_0x59bc36(0x130)],'result':_0x3a4895};}
|
|
1
|
+
const a24_0x2ca395=a24_0x1d58;(function(_0x2338f2,_0x4528a3){const _0x32d4f1=a24_0x1d58,_0x426e90=_0x2338f2();while(!![]){try{const _0x253ee3=parseInt(_0x32d4f1(0x210))/0x1*(parseInt(_0x32d4f1(0x1ca))/0x2)+-parseInt(_0x32d4f1(0x20e))/0x3+-parseInt(_0x32d4f1(0x220))/0x4*(-parseInt(_0x32d4f1(0x1cc))/0x5)+-parseInt(_0x32d4f1(0x219))/0x6*(parseInt(_0x32d4f1(0x207))/0x7)+-parseInt(_0x32d4f1(0x1d2))/0x8*(parseInt(_0x32d4f1(0x1e5))/0x9)+-parseInt(_0x32d4f1(0x1da))/0xa+-parseInt(_0x32d4f1(0x223))/0xb*(-parseInt(_0x32d4f1(0x1fa))/0xc);if(_0x253ee3===_0x4528a3)break;else _0x426e90['push'](_0x426e90['shift']());}catch(_0x105354){_0x426e90['push'](_0x426e90['shift']());}}}(a24_0xbf6b,0x3b492));import{executeData}from'../../core/sdk-client.js';import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';function a24_0xbf6b(){const _0x1ad7ed=['batchCreate','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20Pagination\x20is\x20controlled\x20via\x20JSON\x20in\x20--params.\x20Do\x20NOT\x20use\x20--page-size\x20as\x20a\x20CLI\x20flag.','455FuDNbE','now','write','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','delete','read','\x20on\x20dataset\x20','1012899dhtxio','\x20\x20PARAMS\x20STRUCTURE','16RvOtOe','\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]','data\x20','str','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\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','JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27','\x20\x20PAGINATION','36858OoLTau','\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\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}','Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27','batch','Create\x20a\x20new\x20record\x20in\x20a\x20dataset','Delete\x20a\x20record\x20(requires\x20--yes\x20in\x20non-interactive)','166024AkbrHF','dryRun','\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}}','11352308EdAdTR','\x20\x20WHERE\x20OPERATORS','description','helpExtra','length','\x20completed\x20in\x20','35562pVtnBG','\x20\x20LOGICAL\x20COMBINATORS','10vgQSoz','/api/{appCode}/','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','risk','join','\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}}]}','449256hQLJGZ','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','getOne','build','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20\x20\x20$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}}','params','\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}}','266750szKmRu','aggregate','filter','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','create','code','Filter\x20dataset\x20records\x20with\x20query\x20conditions','update','map','Create\x20multiple\x20records\x20in\x20one\x20request\x20(SDK\x20batchCreate)','63ELMjRy','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','command','Update\x20an\x20existing\x20record','\x20\x20\x20\x20Correct:\x20\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:10}\x27','Preview:\x20data\x20','\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\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20AGGREGATE\x20TYPES','\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}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','\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}','\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}}','data','\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','Get\x20a\x20single\x20record\x20by\x20ID','\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}}','operation','POST','12XtgshD','paramsHint','body','high-risk-write','\x20\x20\x20\x20Wrong:\x20\x20\x20\x20--page-size\x2010\x20\x20(this\x20is\x20not\x20a\x20valid\x20flag)','\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$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\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\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20\x20\x20$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]}}'];a24_0xbf6b=function(){return _0x1ad7ed;};return a24_0xbf6b();}import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';function a24_0x1d58(_0x2d0281,_0x28e3a7){_0x2d0281=_0x2d0281-0x1c6;const _0xbf6bcb=a24_0xbf6b();let _0x1d5809=_0xbf6bcb[_0x2d0281];return _0x1d5809;}const specs=[{'command':a24_0x2ca395(0x1dc),'operation':a24_0x2ca395(0x1dc),'risk':a24_0x2ca395(0x20c),'paramsRequired':![],'description':a24_0x2ca395(0x1e1),'paramsHint':'JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20'+a24_0x2ca395(0x215),'helpExtra':[a24_0x2ca395(0x224),a24_0x2ca395(0x200),'\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}}',a24_0x2ca395(0x202),a24_0x2ca395(0x1d9),a24_0x2ca395(0x1d7),a24_0x2ca395(0x1f7),a24_0x2ca395(0x203),a24_0x2ca395(0x1f3),'\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}}',a24_0x2ca395(0x222),'',a24_0x2ca395(0x1cb),a24_0x2ca395(0x205),a24_0x2ca395(0x1d1),'',a24_0x2ca395(0x20a),a24_0x2ca395(0x1dd),a24_0x2ca395(0x1eb),a24_0x2ca395(0x1d6),a24_0x2ca395(0x1ee),a24_0x2ca395(0x1d3),'',a24_0x2ca395(0x218),a24_0x2ca395(0x206),a24_0x2ca395(0x1e9),a24_0x2ca395(0x1fe)]['join']('\x0a')},{'command':a24_0x2ca395(0x1d4),'operation':a24_0x2ca395(0x1d4),'risk':a24_0x2ca395(0x20c),'paramsRequired':!![],'description':a24_0x2ca395(0x1f6),'paramsHint':a24_0x2ca395(0x1f1)},{'command':a24_0x2ca395(0x1df),'operation':a24_0x2ca395(0x1df),'risk':a24_0x2ca395(0x209),'paramsRequired':!![],'description':a24_0x2ca395(0x21e),'paramsHint':a24_0x2ca395(0x217)},{'command':a24_0x2ca395(0x204),'operation':a24_0x2ca395(0x204),'risk':'write','paramsRequired':!![],'description':a24_0x2ca395(0x1e4),'paramsHint':a24_0x2ca395(0x214)},{'command':a24_0x2ca395(0x1e2),'operation':a24_0x2ca395(0x1e2),'risk':a24_0x2ca395(0x209),'paramsRequired':!![],'description':a24_0x2ca395(0x1e8),'paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20'+a24_0x2ca395(0x21c)},{'command':'delete','operation':a24_0x2ca395(0x20b),'risk':a24_0x2ca395(0x1fd),'paramsRequired':!![],'description':a24_0x2ca395(0x21f),'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'},{'command':a24_0x2ca395(0x1db),'operation':a24_0x2ca395(0x1db),'risk':a24_0x2ca395(0x20c),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':'JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20'+'Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','helpExtra':[a24_0x2ca395(0x1ef),a24_0x2ca395(0x1f0),a24_0x2ca395(0x1f2),'\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\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}',a24_0x2ca395(0x1ff),a24_0x2ca395(0x21b),'\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}','',a24_0x2ca395(0x20f),a24_0x2ca395(0x211),a24_0x2ca395(0x1ec),a24_0x2ca395(0x1e6),a24_0x2ca395(0x21a),a24_0x2ca395(0x201),a24_0x2ca395(0x1ce),'','\x20\x20EXAMPLES',a24_0x2ca395(0x216),a24_0x2ca395(0x1f5),'',a24_0x2ca395(0x1ed),'\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','',a24_0x2ca395(0x1de)][a24_0x2ca395(0x1d0)]('\x0a')}];function makeDataCommand(_0x5e98fc){const _0x32bf53=a24_0x2ca395,_0x53fc08=_0x32bf53(0x212)+_0x5e98fc[_0x32bf53(0x1e7)],_0x392c47={'service':_0x32bf53(0x1f4),'command':_0x5e98fc[_0x32bf53(0x1e7)],'description':_0x5e98fc[_0x32bf53(0x1c6)],'risk':_0x5e98fc[_0x32bf53(0x1cf)],'helpExtra':_0x5e98fc[_0x32bf53(0x1c7)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x5e98fc[_0x32bf53(0x1fb)]}],'validate':async _0x3bfcdb=>{const _0x93fce9=_0x32bf53;_0x5e98fc['paramsRequired']&&requireAnyOf(_0x3bfcdb,[_0x93fce9(0x1d8)],_0x53fc08),_0x5e98fc[_0x93fce9(0x1f8)]===_0x93fce9(0x204)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3bfcdb['str'](_0x93fce9(0x1d8)))),_0x5e98fc[_0x93fce9(0x1f8)]===_0x93fce9(0x1e2)&&parseUpdateIdsFromParams(parseJsonParams(_0x3bfcdb[_0x93fce9(0x213)](_0x93fce9(0x1d8)))??{});},async 'execute'(_0x46be07){const _0x51ffdc=_0x32bf53,_0x10cda9=_0x46be07[_0x51ffdc(0x213)](_0x51ffdc(0x1e0)),_0x303e79=_0x5e98fc[_0x51ffdc(0x1f8)]==='batchCreate'?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x46be07[_0x51ffdc(0x213)]('params'))):parseJsonParams(_0x46be07[_0x51ffdc(0x213)](_0x51ffdc(0x1d8)))??{},_0x205465=_0x5e98fc[_0x51ffdc(0x1f8)]===_0x51ffdc(0x1e2)?parseUpdateIdsFromParams(_0x303e79):undefined,_0x308e6c=_0x205465?normalizeUpdateParamsForRuntime(_0x303e79,_0x205465):_0x303e79,_0x2a43ab=Date[_0x51ffdc(0x208)](),_0x50546a=await executeData(_0x10cda9,_0x5e98fc[_0x51ffdc(0x1f8)],_0x308e6c),_0x391254=Date[_0x51ffdc(0x208)]()-_0x2a43ab,_0x5b2cd9=_0x205465&&_0x205465[_0x51ffdc(0x1c8)]>0x1?buildBatchUpdateResult(_0x205465,_0x50546a):_0x50546a;return{'ok':!![],'data':{'result':_0x5b2cd9,'elapsed':_0x391254},'message':'data\x20'+_0x5e98fc[_0x51ffdc(0x1e7)]+_0x51ffdc(0x1c9)+_0x391254+'ms'};}};return _0x5e98fc['risk']!==_0x32bf53(0x20c)&&(_0x392c47[_0x32bf53(0x221)]=async _0x51cc24=>{const _0x20df7b=_0x32bf53,_0x40c715=_0x51cc24[_0x20df7b(0x213)](_0x20df7b(0x1e0)),_0x5a35dd=_0x5e98fc[_0x20df7b(0x1f8)]===_0x20df7b(0x204)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x51cc24[_0x20df7b(0x213)]('params'))):parseJsonParams(_0x51cc24[_0x20df7b(0x213)](_0x20df7b(0x1d8)))??{};let _0x54d135=_0x5a35dd;if(_0x5e98fc[_0x20df7b(0x1f8)]===_0x20df7b(0x1e2)){const _0x989560=parseUpdateIdsFromParams(_0x5a35dd);_0x54d135=normalizeUpdateParamsForRuntime(_0x5a35dd,_0x989560);}return dryRun(_0x20df7b(0x1f9),_0x20df7b(0x1cd)+_0x40c715+'/'+_0x5e98fc['operation'])[_0x20df7b(0x1fc)](_0x54d135)[_0x20df7b(0x1c6)](_0x20df7b(0x1ea)+_0x5e98fc[_0x20df7b(0x1e7)]+_0x20df7b(0x20d)+_0x40c715)[_0x20df7b(0x1d5)]();}),_0x392c47;}export const dataDefinitions=specs[a24_0x2ca395(0x1e3)](makeDataCommand);function buildBatchUpdateResult(_0xdca4b7,_0x29388e){const _0x5c0559=a24_0x2ca395;return{'operation':'update','mode':_0x5c0559(0x21d),'ids':_0xdca4b7,'total':_0xdca4b7['length'],'result':_0x29388e};}
|