@lovrabet/rabetbase-cli 2.0.2-beta.1 → 2.0.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -0
- package/lib/commands/api/index.js +1 -0
- package/lib/commands/api/list.js +1 -0
- package/lib/commands/api/pull.js +1 -0
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/cli-update.js +1 -0
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/flags.js +1 -0
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -0
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/menu/index.js +1 -0
- package/lib/commands/menu/shared/compare-table.js +1 -0
- package/lib/commands/menu/shared/index.js +1 -0
- package/lib/commands/menu/shared/inquirer.js +1 -0
- package/lib/commands/menu/shared/local-pages.js +1 -0
- package/lib/commands/menu/shared/logic.js +1 -0
- package/lib/commands/menu/shared/service.js +1 -0
- package/lib/commands/menu/shared/sync-core.js +1 -0
- package/lib/commands/menu/shared/update-core.js +1 -0
- package/lib/commands/menu/shared/valid-url.js +1 -0
- package/lib/commands/menu/sync.js +1 -0
- package/lib/commands/menu/update.js +1 -0
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.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/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.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/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -0
- package/lib/telemetry/ensure-cli-otel-config.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- package/lib/telemetry/send-cli-trace-log.js +1 -0
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -0
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +7 -4
- package/templates/generate-api/api.ts.tpl +4 -4
- package/templates/generate-api/client.ts.tpl +2 -2
- package/lib/ai-setup/config.js +0 -1
- package/lib/api/api-doc-ui.js +0 -1
- package/lib/api/api-pull-ui.js +0 -1
- package/lib/api/main.js +0 -1
- package/lib/api/pull-silent.js +0 -1
- package/lib/app-menu/app-menu-sync-ui.js +0 -1
- package/lib/app-menu/create-menu.js +0 -1
- package/lib/app-menu/get-local-pages.js +0 -1
- package/lib/app-menu/get-online-menu-list.js +0 -1
- package/lib/app-menu/types.js +0 -1
- package/lib/app-menu/use-get-online-menu-list.js +0 -1
- package/lib/app-menu/utils.js +0 -1
- package/lib/app-menu/valid-url.js +0 -1
- package/lib/app-menu-update-cdn/current-content.js +0 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +0 -1
- package/lib/app-menu-update-cdn/main.js +0 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
- package/lib/commands/api.js +0 -1
- package/lib/commands/mcp.js +0 -1
- package/lib/commands/menu.js +0 -1
- package/lib/mcp/McpInstallUI.js +0 -1
- package/lib/mcp/claude.js +0 -1
- package/lib/mcp/cursor.js +0 -1
- package/lib/mcp/main.js +0 -1
- package/lib/mcp/mcp-install-non-interactive.js +0 -1
- package/lib/mcp/mcp-installer.js +0 -1
- package/lib/ui/IDESelector.js +0 -1
- package/lib/ui/useIDESelection.js +0 -1
- /package/lib/{app-menu-update-cdn → commands/menu/shared}/types.js +0 -0
package/lib/commands/bff/new.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x25f630=a36_0x255b;(function(_0x5edb5d,_0x359b55){const _0x446f93=a36_0x255b,_0x233641=_0x5edb5d();while(!![]){try{const _0x64ceba=-parseInt(_0x446f93(0x16d))/0x1+parseInt(_0x446f93(0x194))/0x2*(-parseInt(_0x446f93(0x19b))/0x3)+-parseInt(_0x446f93(0x1a9))/0x4*(-parseInt(_0x446f93(0x1a6))/0x5)+parseInt(_0x446f93(0x18d))/0x6*(parseInt(_0x446f93(0x153))/0x7)+parseInt(_0x446f93(0x16f))/0x8*(parseInt(_0x446f93(0x1ab))/0x9)+parseInt(_0x446f93(0x188))/0xa*(-parseInt(_0x446f93(0x15e))/0xb)+parseInt(_0x446f93(0x164))/0xc*(parseInt(_0x446f93(0x1a5))/0xd);if(_0x64ceba===_0x359b55)break;else _0x233641['push'](_0x233641['shift']());}catch(_0x5205ed){_0x233641['push'](_0x233641['shift']());}}}(a36_0x2ef0,0x5d397));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a36_0x255b(_0x46d7c5,_0x4ff972){_0x46d7c5=_0x46d7c5-0x153;const _0x2ef051=a36_0x2ef0();let _0x255bff=_0x2ef051[_0x46d7c5];return _0x255bff;}import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a36_0x2ef0(){const _0x1ee94b=['isInteger','316584Xxzekc','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','TODO:\x20add\x20script\x20description','close','function-node','HOOK\x20requires\x20alias/operation/node\x20options.','str','before','tableName','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','after','trim','find','validation','functionNode','No\x20datasets\x20found\x20for\x20this\x20app.','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','scriptsRootDir','Invalid\x20dataset\x20selection.','operationType','Available:\x20','nonInteractive','3260NmryAW','datasetCode','File\x20already\x20exists:\x20','apiDir','question','2958342lFtMMV','\x20function:\x20','No\x20api.ts\x20found.\x20Run\x20`','Dataset\x20not\x20found\x20for\x20code\x20\x22','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22\x20not\x20found.\x20','84122haNVAy','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','description','Script\x20type','map','Script\x20description','3sAzoKp','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20api\x20pull`\x20to\x20refresh.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','new','Operation\x20type\x20\x22','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Available\x20aliases:\x20','HOOK','13LbrQhB','5BBGLzf','\x22\x20not\x20found\x20for\x20dataset\x20','alias','1043492xXdTNX','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','117KmaBQR','appCode','name','Select\x20trigger\x20node:','operation-type','7cQDuEn','Invalid\x20function\x20name\x20\x22','Select\x20dataset:','datasetcode','COMMON','Select\x20operation\x20type:','join','string','\x0a\x20*\x20[触发节点]\x20','length','write','23045uuwAcP','ENDPOINT','keys','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22.\x20','type','5200716QaRNwK','stderr','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','includes','.js','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Trigger\x20node\x20(HOOK\x20only)','594894DTnSjK'];a36_0x2ef0=function(){return _0x1ee94b;};return a36_0x2ef0();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':'bff','command':a36_0x25f630(0x19f),'description':a36_0x25f630(0x17b),'risk':a36_0x25f630(0x15d),'flags':[{'name':a36_0x25f630(0x163),'type':a36_0x25f630(0x15a),'required':!![],'enum':[a36_0x25f630(0x157),a36_0x25f630(0x15f),a36_0x25f630(0x1a4)],'description':a36_0x25f630(0x198)},{'name':a36_0x25f630(0x1ad),'type':a36_0x25f630(0x15a),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':'string','description':a36_0x25f630(0x19a)},{'name':a36_0x25f630(0x1a8),'type':a36_0x25f630(0x15a),'description':a36_0x25f630(0x1a1)},{'name':'datasetcode','type':a36_0x25f630(0x15a),'description':a36_0x25f630(0x17a)},{'name':a36_0x25f630(0x1af),'type':a36_0x25f630(0x15a),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a36_0x25f630(0x174),'type':'string','description':a36_0x25f630(0x16c),'enum':['before',a36_0x25f630(0x17c)]}],async 'validate'(_0x4989ca){const _0x339cf4=a36_0x25f630,_0x7b2b56=_0x4989ca['str']('name');if(!isValidBffFunctionName(_0x7b2b56))throw CliErrors[_0x339cf4(0x17f)](_0x339cf4(0x154)+_0x7b2b56+_0x339cf4(0x19e));},async 'execute'(_0x122bbf){const _0x20642b=a36_0x25f630,_0x236823=loadBffProjectConfig(_0x122bbf['appCode']),_0x18e08c=_0x122bbf['str'](_0x20642b(0x163)),_0x11c816=_0x122bbf[_0x20642b(0x176)]('name'),_0x393695=_0x122bbf[_0x20642b(0x176)]('description')||undefined,_0x144b32=_0x18e08c===_0x20642b(0x1a4)?await resolveHookOptions(_0x236823,_0x122bbf):undefined,_0x214388=buildFilePath(_0x236823,_0x18e08c,_0x11c816,_0x144b32);if(await fileExists(_0x214388))throw CliErrors['validation'](_0x20642b(0x18a)+_0x214388);await mkdir(dirname(_0x214388),{'recursive':!![]});const _0x30bc37=generateTemplate(_0x18e08c,_0x11c816,_0x236823,_0x393695,_0x144b32);await writeFile(_0x214388,_0x30bc37,_0x20642b(0x171));const _0xe4e5c5={'type':_0x18e08c,'name':_0x11c816,'path':_0x214388};if(_0x393695)_0xe4e5c5[_0x20642b(0x197)]=_0x393695;if(_0x144b32){if(_0x144b32[_0x20642b(0x1a8)])_0xe4e5c5[_0x20642b(0x1a8)]=_0x144b32['alias'];_0xe4e5c5[_0x20642b(0x189)]=_0x144b32['datasetCode'],_0xe4e5c5[_0x20642b(0x185)]=_0x144b32[_0x20642b(0x185)],_0xe4e5c5[_0x20642b(0x180)]=_0x144b32[_0x20642b(0x180)];}return{'ok':!![],'data':_0xe4e5c5,'message':'Created\x20'+_0x18e08c+_0x20642b(0x18e)+_0x11c816};}};async function resolveHookOptions(_0x52e69b,_0x3a1618){const _0xe0ff70=a36_0x25f630,_0x1969cf=loadAliasMap(_0x3a1618[_0xe0ff70(0x18b)]),_0x4eb93f=_0x1969cf['length']>0x0;let _0x101ca7,_0x56e044,_0x13247b;const _0x2f3020=_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x1a8)),_0x53578f=_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x156));if(_0x2f3020){const _0x3f8482=resolveAlias(_0x3a1618[_0xe0ff70(0x18b)],_0x2f3020);if(!_0x3f8482){const _0x15a0ad=_0x4eb93f?_0xe0ff70(0x1a3)+_0x1969cf['map'](_0x39c454=>_0x39c454[_0xe0ff70(0x1a8)])[_0xe0ff70(0x159)](',\x20'):_0xe0ff70(0x18f)+CLI_BIN_NAME+_0xe0ff70(0x167);throw CliErrors[_0xe0ff70(0x17f)]('Alias\x20\x22'+_0x2f3020+_0xe0ff70(0x193)+_0x15a0ad);}_0x101ca7=_0x2f3020,_0x56e044=_0x3f8482;}else{if(_0x53578f){_0x56e044=_0x53578f;const _0x2f2c5f=_0x1969cf[_0xe0ff70(0x17e)](_0x132605=>_0x132605[_0xe0ff70(0x189)]===_0x53578f);_0x101ca7=_0x2f2c5f?.[_0xe0ff70(0x1a8)];}else{if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x170));else{if(_0x4eb93f){const _0x1f7d89=_0x1969cf[_0xe0ff70(0x199)](_0x54ddf3=>_0x54ddf3[_0xe0ff70(0x1a8)]+'\x20('+_0x54ddf3[_0xe0ff70(0x178)]+')'),_0x209e24=await promptSelect(_0xe0ff70(0x155),_0x1f7d89),_0xf722a3=_0x1969cf[_0x209e24];if(!_0xf722a3)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x101ca7=_0xf722a3['alias'],_0x56e044=_0xf722a3[_0xe0ff70(0x189)];}else{const _0x30f5ce=await listDatasets(_0x52e69b[_0xe0ff70(0x1ac)]);if(_0x30f5ce[_0xe0ff70(0x15c)]===0x0)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x181));const _0x4a5667=_0x30f5ce[_0xe0ff70(0x199)](_0x5c7cf1=>_0x5c7cf1['name']+'\x20('+_0x5c7cf1['code']+')'),_0x23b889=await promptSelect(_0xe0ff70(0x155),_0x4a5667),_0x54c549=_0x30f5ce[_0x23b889];if(!_0x54c549)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x184));_0x56e044=_0x54c549['code'],_0x101ca7=undefined;}}}}const _0x260d32=await listDatasets(_0x52e69b[_0xe0ff70(0x1ac)]),_0x2289ea=_0x260d32[_0xe0ff70(0x17e)](_0x57d654=>_0x57d654['code']===_0x56e044);if(!_0x2289ea)throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x190)+_0x56e044+_0xe0ff70(0x162)+(_0x101ca7?_0xe0ff70(0x1a2)+CLI_BIN_NAME+_0xe0ff70(0x19d):''));_0x13247b=_0x2289ea['id'];const _0x4cfb32=_0x101ca7??_0x56e044,_0x3bbdbe=await listBffDatasetOperations(_0x52e69b['appCode'],_0x13247b),_0x1f6834=_0x3bbdbe?Object[_0xe0ff70(0x160)](_0x3bbdbe):[];if(_0x1f6834[_0xe0ff70(0x15c)]===0x0)throw CliErrors[_0xe0ff70(0x17f)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x4cfb32+'.');let _0x89bcd7;const _0x309922=_0x3a1618['str'](_0xe0ff70(0x1af));if(_0x309922){if(!_0x1f6834[_0xe0ff70(0x169)](_0x309922))throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x1a0)+_0x309922+_0xe0ff70(0x1a7)+_0x4cfb32+'.\x20'+(_0xe0ff70(0x186)+_0x1f6834[_0xe0ff70(0x159)](',\x20')));_0x89bcd7=_0x309922;}else{if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x168));const _0x589ce5=await promptSelect(_0xe0ff70(0x158),_0x1f6834);_0x89bcd7=_0x1f6834[_0x589ce5]??_0x1f6834[0x0];}let _0x443a3c=normalizeHookFunctionNode(_0x3a1618[_0xe0ff70(0x176)]('function-node'));if(!_0x443a3c){if(_0x3a1618[_0xe0ff70(0x176)](_0xe0ff70(0x174)))throw CliErrors[_0xe0ff70(0x17f)](_0xe0ff70(0x1aa));if(_0x3a1618[_0xe0ff70(0x187)])throw CliErrors['validation'](_0xe0ff70(0x166));const _0x27c385=await promptSelect(_0xe0ff70(0x1ae),[_0xe0ff70(0x177),_0xe0ff70(0x17c)]);_0x443a3c=[_0xe0ff70(0x177),'after'][_0x27c385]??_0xe0ff70(0x177);}return{'alias':_0x101ca7,'datasetCode':_0x56e044,'datasetId':_0x13247b,'operationType':_0x89bcd7,'functionNode':_0x443a3c};}async function promptSelect(_0x3ddace,_0x4b55fa){const _0x1e6e60=a36_0x25f630;if(_0x4b55fa['length']===0x1)return 0x0;for(const [_0x1326c5,_0x338c63]of _0x4b55fa['entries']()){process['stderr'][_0x1e6e60(0x15d)]('\x20\x20'+(_0x1326c5+0x1)+'.\x20'+_0x338c63+'\x0a');}const _0x485d0a=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x56ce27=await new Promise(_0x32d706=>{const _0x48f8f5=_0x1e6e60;_0x485d0a[_0x48f8f5(0x18c)](_0x3ddace+'\x20',_0x32d706);}),_0xb7f284=Number['parseInt'](_0x56ce27[_0x1e6e60(0x17d)](),0xa);if(Number[_0x1e6e60(0x16e)](_0xb7f284)&&_0xb7f284>=0x1&&_0xb7f284<=_0x4b55fa[_0x1e6e60(0x15c)])return _0x485d0a[_0x1e6e60(0x173)](),_0xb7f284-0x1;process[_0x1e6e60(0x165)]['write'](_0x1e6e60(0x195)+_0x4b55fa[_0x1e6e60(0x15c)]+'.\x0a');}}function buildFilePath(_0x14ea0f,_0x13d5db,_0x1b1b86,_0x457dee){const _0x724238=a36_0x25f630;if(_0x13d5db===_0x724238(0x1a4)){if(!_0x457dee)throw CliErrors['validation'](_0x724238(0x175));const _0x409544=_0x457dee[_0x724238(0x1a8)]??_0x457dee[_0x724238(0x189)];return join(_0x14ea0f[_0x724238(0x183)],_0x724238(0x1a4),_0x409544,_0x457dee[_0x724238(0x185)],_0x457dee[_0x724238(0x180)],_0x1b1b86+_0x724238(0x16a));}return join(_0x14ea0f['scriptsRootDir'],_0x13d5db,_0x1b1b86+_0x724238(0x16a));}function generateTemplate(_0x3b2c9b,_0x4ff647,_0x514dce,_0x58030f,_0x4f6749){const _0x324ece=a36_0x25f630,_0x469670=_0x58030f?.[_0x324ece(0x17d)]()||_0x324ece(0x172);if(_0x3b2c9b==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x469670+'\x0a\x20*\x20[脚本名称]\x20'+_0x4ff647+_0x324ece(0x179)+_0x4ff647+'.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4ff647+_0x324ece(0x191);if(_0x3b2c9b==='ENDPOINT')return _0x324ece(0x182)+_0x469670+_0x324ece(0x16b)+_0x514dce[_0x324ece(0x1ac)]+'/endpoint/'+_0x4ff647+_0x324ece(0x192)+_0x4ff647+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x4f6749)throw CliErrors[_0x324ece(0x17f)](_0x324ece(0x196));return _0x324ece(0x19c)+_0x469670+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x514dce[_0x324ece(0x1ac)]+'/'+_0x4f6749[_0x324ece(0x189)]+'/'+_0x4f6749[_0x324ece(0x185)]+_0x324ece(0x15b)+_0x4f6749['functionNode']+_0x324ece(0x161)+_0x4ff647+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
const a22_0xe3c323=a22_0x284a;(function(_0x5e5957,_0x3f2527){const _0x2c7323=a22_0x284a,_0x4bb196=_0x5e5957();while(!![]){try{const _0x14a10c=-parseInt(_0x2c7323(0x1cb))/0x1*(parseInt(_0x2c7323(0x1a9))/0x2)+parseInt(_0x2c7323(0x1a0))/0x3*(parseInt(_0x2c7323(0x1b2))/0x4)+-parseInt(_0x2c7323(0x186))/0x5*(-parseInt(_0x2c7323(0x1b5))/0x6)+-parseInt(_0x2c7323(0x1a5))/0x7+-parseInt(_0x2c7323(0x1c7))/0x8*(parseInt(_0x2c7323(0x195))/0x9)+parseInt(_0x2c7323(0x1b9))/0xa*(-parseInt(_0x2c7323(0x1cd))/0xb)+parseInt(_0x2c7323(0x197))/0xc;if(_0x14a10c===_0x3f2527)break;else _0x4bb196['push'](_0x4bb196['shift']());}catch(_0xdfe894){_0x4bb196['push'](_0x4bb196['shift']());}}}(a22_0x1525,0x29171));import{createInterface}from'node:readline';function a22_0x1525(){const _0x1f81bd=['ENDPOINT','trim','before','write','name','operationType','question','82422CpeEzE','No\x20operation\x20types\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Function\x20name\x20(valid\x20JS\x20identifier)','Invalid\x20function\x20name\x20\x22','1886836XZxvJS','length','Script\x20type','\x0a\x20*\x20[触发节点]\x20','2914pJCdSN','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','Alias\x20\x22','string','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Script\x20description','.js','Select\x20dataset:','44fjkNBW','function-node','str','18ZtoHgw','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','apiDir','\x22\x20not\x20found.\x20','27980rOealj','HOOK\x20requires\x20alias/operation/node\x20options.','nonInteractive','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','validation','Available:\x20','appCode','type','File\x20already\x20exists:\x20','description','HOOK','datasetCode','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Select\x20trigger\x20node:','636648fmnlWh','keys','datasetcode','Operation\x20type\x20(HOOK\x20only)','182UHgwYc','\x20api\x20pull`\x20to\x20refresh.','649qrRImN','Select\x20operation\x20type:','scriptsRootDir','map','TODO:\x20add\x20script\x20description','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','alias','\x22\x20not\x20found\x20for\x20dataset\x20','tableName','bff','Dataset\x20not\x20found\x20for\x20code\x20\x22','operation-type','parseInt','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','stdin','Invalid\x20dataset\x20selection.','Operation\x20type\x20\x22','444615AUguyY','find','\x20function:\x20','stderr','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','join','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Trigger\x20node\x20(HOOK\x20only)','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','COMMON','/endpoint/','\x0a\x20*\x20[脚本名称]\x20','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','includes','after','27MqUuwb','Available\x20aliases:\x20','6454428pvUTDc','No\x20api.ts\x20found.\x20Run\x20`'];a22_0x1525=function(){return _0x1f81bd;};return a22_0x1525();}import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a22_0xe3c323(0x17e),'command':'new','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a22_0xe3c323(0x19c),'flags':[{'name':a22_0xe3c323(0x1c0),'type':a22_0xe3c323(0x1ad),'required':!![],'enum':[a22_0xe3c323(0x18f),a22_0xe3c323(0x199),a22_0xe3c323(0x1c3)],'description':a22_0xe3c323(0x1a7)},{'name':a22_0xe3c323(0x19d),'type':a22_0xe3c323(0x1ad),'required':!![],'description':a22_0xe3c323(0x1a3)},{'name':'description','type':a22_0xe3c323(0x1ad),'description':a22_0xe3c323(0x1af)},{'name':a22_0xe3c323(0x1d4),'type':a22_0xe3c323(0x1ad),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a22_0xe3c323(0x1ad),'description':a22_0xe3c323(0x1bc)},{'name':'operation-type','type':a22_0xe3c323(0x1ad),'description':a22_0xe3c323(0x1ca)},{'name':a22_0xe3c323(0x1b3),'type':a22_0xe3c323(0x1ad),'description':a22_0xe3c323(0x18d),'enum':[a22_0xe3c323(0x19b),a22_0xe3c323(0x194)]}],async 'validate'(_0x27fb28){const _0x5db2f3=a22_0xe3c323,_0x39081b=_0x27fb28[_0x5db2f3(0x1b4)]('name');if(!isValidBffFunctionName(_0x39081b))throw CliErrors['validation'](_0x5db2f3(0x1a4)+_0x39081b+_0x5db2f3(0x1aa));},async 'execute'(_0x4356fe){const _0x43af40=a22_0xe3c323,_0x284f1e=loadBffProjectConfig(_0x4356fe['appCode']),_0x1525d=_0x4356fe['str'](_0x43af40(0x1c0)),_0x5b122e=_0x4356fe[_0x43af40(0x1b4)](_0x43af40(0x19d)),_0x5573ac=_0x4356fe[_0x43af40(0x1b4)](_0x43af40(0x1c2))||undefined,_0x15c1b8=_0x1525d===_0x43af40(0x1c3)?await resolveHookOptions(_0x284f1e,_0x4356fe):undefined,_0x12985e=buildFilePath(_0x284f1e,_0x1525d,_0x5b122e,_0x15c1b8);if(await fileExists(_0x12985e))throw CliErrors[_0x43af40(0x1bd)](_0x43af40(0x1c1)+_0x12985e);await mkdir(dirname(_0x12985e),{'recursive':!![]});const _0x4d3133=generateTemplate(_0x1525d,_0x5b122e,_0x284f1e,_0x5573ac,_0x15c1b8);await writeFile(_0x12985e,_0x4d3133,'utf8');const _0x436763={'type':_0x1525d,'name':_0x5b122e,'path':_0x12985e};if(_0x5573ac)_0x436763[_0x43af40(0x1c2)]=_0x5573ac;if(_0x15c1b8){if(_0x15c1b8['alias'])_0x436763[_0x43af40(0x1d4)]=_0x15c1b8[_0x43af40(0x1d4)];_0x436763[_0x43af40(0x1c4)]=_0x15c1b8['datasetCode'],_0x436763['operationType']=_0x15c1b8[_0x43af40(0x19e)],_0x436763['functionNode']=_0x15c1b8['functionNode'];}return{'ok':!![],'data':_0x436763,'message':'Created\x20'+_0x1525d+_0x43af40(0x188)+_0x5b122e};}};function a22_0x284a(_0x254f10,_0x2f5215){_0x254f10=_0x254f10-0x17e;const _0x15256a=a22_0x1525();let _0x284af6=_0x15256a[_0x254f10];return _0x284af6;}async function resolveHookOptions(_0xf7a8c0,_0x33d5b7){const _0x36a905=a22_0xe3c323,_0x121656=loadAliasMap(_0x33d5b7[_0x36a905(0x1b7)]),_0x4704b7=_0x121656['length']>0x0;let _0x5a2075,_0x46f15f,_0x1bf7db;const _0x1dee20=_0x33d5b7[_0x36a905(0x1b4)](_0x36a905(0x1d4)),_0x568fb0=_0x33d5b7[_0x36a905(0x1b4)](_0x36a905(0x1c9));if(_0x1dee20){const _0x376d2a=resolveAlias(_0x33d5b7[_0x36a905(0x1b7)],_0x1dee20);if(!_0x376d2a){const _0x1ad561=_0x4704b7?_0x36a905(0x196)+_0x121656[_0x36a905(0x1d0)](_0x5f259f=>_0x5f259f['alias'])[_0x36a905(0x18b)](',\x20'):_0x36a905(0x198)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x1ac)+_0x1dee20+_0x36a905(0x1b8)+_0x1ad561);}_0x5a2075=_0x1dee20,_0x46f15f=_0x376d2a;}else{if(_0x568fb0){_0x46f15f=_0x568fb0;const _0x3c0cb1=_0x121656[_0x36a905(0x187)](_0x2e4211=>_0x2e4211['datasetCode']===_0x568fb0);_0x5a2075=_0x3c0cb1?.['alias'];}else{if(_0x33d5b7[_0x36a905(0x1bb)])throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x182));else{if(_0x4704b7){const _0x5d0e81=_0x121656[_0x36a905(0x1d0)](_0x50a3f6=>_0x50a3f6[_0x36a905(0x1d4)]+'\x20('+_0x50a3f6[_0x36a905(0x1d6)]+')'),_0x426d56=await promptSelect(_0x36a905(0x1b1),_0x5d0e81),_0x3ac37b=_0x121656[_0x426d56];if(!_0x3ac37b)throw CliErrors[_0x36a905(0x1bd)]('Invalid\x20dataset\x20selection.');_0x5a2075=_0x3ac37b[_0x36a905(0x1d4)],_0x46f15f=_0x3ac37b[_0x36a905(0x1c4)];}else{const _0x49d96b=await listDatasets(_0xf7a8c0[_0x36a905(0x1bf)]);if(_0x49d96b[_0x36a905(0x1a6)]===0x0)throw CliErrors[_0x36a905(0x1bd)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x54fe90=_0x49d96b[_0x36a905(0x1d0)](_0xac301=>_0xac301[_0x36a905(0x19d)]+'\x20('+_0xac301[_0x36a905(0x1ab)]+')'),_0x35a571=await promptSelect('Select\x20dataset:',_0x54fe90),_0x126ca7=_0x49d96b[_0x35a571];if(!_0x126ca7)throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x184));_0x46f15f=_0x126ca7[_0x36a905(0x1ab)],_0x5a2075=undefined;}}}}const _0x5b6bad=await listDatasets(_0xf7a8c0['appCode']),_0x21a3a3=_0x5b6bad['find'](_0x3650ba=>_0x3650ba[_0x36a905(0x1ab)]===_0x46f15f);if(!_0x21a3a3)throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x17f)+_0x46f15f+'\x22.\x20'+(_0x5a2075?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x36a905(0x1cc):''));_0x1bf7db=_0x21a3a3['id'];const _0x3247f8=_0x5a2075??_0x46f15f,_0x32805b=await listBffDatasetOperations(_0xf7a8c0[_0x36a905(0x1bf)],_0x1bf7db),_0x2fec2f=_0x32805b?Object[_0x36a905(0x1c8)](_0x32805b):[];if(_0x2fec2f['length']===0x0)throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x1a1)+_0x3247f8+'.');let _0xb8690b;const _0x3394f2=_0x33d5b7[_0x36a905(0x1b4)](_0x36a905(0x180));if(_0x3394f2){if(!_0x2fec2f[_0x36a905(0x193)](_0x3394f2))throw CliErrors[_0x36a905(0x1bd)](_0x36a905(0x185)+_0x3394f2+_0x36a905(0x1d5)+_0x3247f8+'.\x20'+(_0x36a905(0x1be)+_0x2fec2f['join'](',\x20')));_0xb8690b=_0x3394f2;}else{if(_0x33d5b7['nonInteractive'])throw CliErrors[_0x36a905(0x1bd)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x214087=await promptSelect(_0x36a905(0x1ce),_0x2fec2f);_0xb8690b=_0x2fec2f[_0x214087]??_0x2fec2f[0x0];}let _0x45088a=normalizeHookFunctionNode(_0x33d5b7['str'](_0x36a905(0x1b3)));if(!_0x45088a){if(_0x33d5b7[_0x36a905(0x1b4)](_0x36a905(0x1b3)))throw CliErrors[_0x36a905(0x1bd)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x33d5b7[_0x36a905(0x1bb)])throw CliErrors[_0x36a905(0x1bd)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xa0f289=await promptSelect(_0x36a905(0x1c6),[_0x36a905(0x19b),_0x36a905(0x194)]);_0x45088a=['before',_0x36a905(0x194)][_0xa0f289]??'before';}return{'alias':_0x5a2075,'datasetCode':_0x46f15f,'datasetId':_0x1bf7db,'operationType':_0xb8690b,'functionNode':_0x45088a};}async function promptSelect(_0x186268,_0xcae14e){const _0x4eb0b9=a22_0xe3c323;if(_0xcae14e[_0x4eb0b9(0x1a6)]===0x1)return 0x0;for(const [_0x3c4cb0,_0x1d3380]of _0xcae14e['entries']()){process[_0x4eb0b9(0x189)]['write']('\x20\x20'+(_0x3c4cb0+0x1)+'.\x20'+_0x1d3380+'\x0a');}const _0x3ab095=createInterface({'input':process[_0x4eb0b9(0x183)],'output':process['stderr']});while(!![]){const _0x4e4f59=await new Promise(_0x5bffb0=>{const _0xc33754=_0x4eb0b9;_0x3ab095[_0xc33754(0x19f)](_0x186268+'\x20',_0x5bffb0);}),_0x5bfd1f=Number[_0x4eb0b9(0x181)](_0x4e4f59[_0x4eb0b9(0x19a)](),0xa);if(Number['isInteger'](_0x5bfd1f)&&_0x5bfd1f>=0x1&&_0x5bfd1f<=_0xcae14e[_0x4eb0b9(0x1a6)])return _0x3ab095['close'](),_0x5bfd1f-0x1;process[_0x4eb0b9(0x189)][_0x4eb0b9(0x19c)](_0x4eb0b9(0x1c5)+_0xcae14e[_0x4eb0b9(0x1a6)]+'.\x0a');}}function buildFilePath(_0x4c9fca,_0x157373,_0x3f9ae6,_0x1fb523){const _0x11277a=a22_0xe3c323;if(_0x157373===_0x11277a(0x1c3)){if(!_0x1fb523)throw CliErrors[_0x11277a(0x1bd)](_0x11277a(0x1ba));const _0x5baaeb=_0x1fb523[_0x11277a(0x1d4)]??_0x1fb523[_0x11277a(0x1c4)];return join(_0x4c9fca[_0x11277a(0x1cf)],_0x11277a(0x1c3),_0x5baaeb,_0x1fb523[_0x11277a(0x19e)],_0x1fb523['functionNode'],_0x3f9ae6+_0x11277a(0x1b0));}return join(_0x4c9fca[_0x11277a(0x1cf)],_0x157373,_0x3f9ae6+_0x11277a(0x1b0));}function generateTemplate(_0x2d7915,_0x61d29a,_0x55d5e2,_0x3db836,_0x3a1242){const _0x1f08c0=a22_0xe3c323,_0x1f1664=_0x3db836?.[_0x1f08c0(0x19a)]()||_0x1f08c0(0x1d1);if(_0x2d7915==='COMMON')return _0x1f08c0(0x1ae)+_0x1f1664+_0x1f08c0(0x191)+_0x61d29a+_0x1f08c0(0x1d3)+_0x61d29a+'.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x61d29a+_0x1f08c0(0x18e);if(_0x2d7915===_0x1f08c0(0x199))return _0x1f08c0(0x1a2)+_0x1f1664+_0x1f08c0(0x1d2)+_0x55d5e2[_0x1f08c0(0x1bf)]+_0x1f08c0(0x190)+_0x61d29a+_0x1f08c0(0x192)+_0x61d29a+_0x1f08c0(0x18e);if(!_0x3a1242)throw CliErrors['validation'](_0x1f08c0(0x18a));return _0x1f08c0(0x1b6)+_0x1f1664+_0x1f08c0(0x1d2)+_0x55d5e2[_0x1f08c0(0x1bf)]+'/'+_0x3a1242[_0x1f08c0(0x1c4)]+'/'+_0x3a1242[_0x1f08c0(0x19e)]+_0x1f08c0(0x1a8)+_0x3a1242['functionNode']+_0x1f08c0(0x18c)+_0x61d29a+_0x1f08c0(0x18e);}
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x322a(_0x537cd7,_0x1628d6){_0x537cd7=_0x537cd7-0x18c;const _0x5f5418=a23_0x5f54();let _0x322a87=_0x5f5418[_0x537cd7];return _0x322a87;}const a23_0x214850=a23_0x322a;(function(_0x43df88,_0x392e7f){const _0x4458f7=a23_0x322a,_0x5d98a0=_0x43df88();while(!![]){try{const _0x432524=-parseInt(_0x4458f7(0x1c7))/0x1*(-parseInt(_0x4458f7(0x19c))/0x2)+parseInt(_0x4458f7(0x1bb))/0x3+-parseInt(_0x4458f7(0x1a3))/0x4*(-parseInt(_0x4458f7(0x1b4))/0x5)+parseInt(_0x4458f7(0x1ba))/0x6+-parseInt(_0x4458f7(0x1cd))/0x7+parseInt(_0x4458f7(0x1b6))/0x8*(-parseInt(_0x4458f7(0x1ce))/0x9)+-parseInt(_0x4458f7(0x1b2))/0xa;if(_0x432524===_0x392e7f)break;else _0x5d98a0['push'](_0x5d98a0['shift']());}catch(_0x4465b7){_0x5d98a0['push'](_0x5d98a0['shift']());}}}(a23_0x5f54,0x988d3));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a23_0x214850(0x1a7),'command':a23_0x214850(0x1bc),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a23_0x214850(0x19d),'flags':[{'name':a23_0x214850(0x1b9),'type':a23_0x214850(0x19b),'description':a23_0x214850(0x1c2),'enum':[a23_0x214850(0x1b5),a23_0x214850(0x1c8),a23_0x214850(0x19e)]},{'name':a23_0x214850(0x1ca),'type':a23_0x214850(0x1a2),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x5b16f2){const _0x5595f7=a23_0x214850,_0x550ab5=loadBffProjectConfig(_0x5b16f2['appCode']),_0x2da29d=await readBffLockFile(_0x550ab5[_0x5595f7(0x195)]),{appLock:_0x57c091}=ensureLockScope(_0x2da29d??createEmptyBffLock(),_0x550ab5['appCode'],_0x550ab5['scriptsRoot'],'pull',_0x550ab5[_0x5595f7(0x197)],_0x550ab5[_0x5595f7(0x1a0)]+'/'+_0x550ab5[_0x5595f7(0x197)]),_0x4b7e78=buildDatasetCodeToAliasMap(_0x5b16f2[_0x5595f7(0x1b8)]),_0x171a16=normalizeBffType(_0x5b16f2['str']('type'))??undefined,[_0x86ad00,_0x2d37a1]=await Promise[_0x5595f7(0x18c)]([listBffScripts(_0x5b16f2[_0x5595f7(0x197)],_0x171a16),getBffScriptStatistics(_0x5b16f2[_0x5595f7(0x197)])]),_0x36912b=createHookLocationMap(_0x2d37a1),_0x49f675=[];for(const _0x489661 of _0x86ad00){const _0xfc7b01=resolveRemoteScriptTarget(_0x550ab5,_0x489661,_0x36912b,_0x57c091[_0x5595f7(0x191)],_0x4b7e78);if(_0xfc7b01)_0x49f675[_0x5595f7(0x1c3)](_0xfc7b01['lockKey']);}return{'method':_0x5595f7(0x1c1),'url':_0x5595f7(0x19f),'body':{'scripts':_0x49f675,'appCode':_0x5b16f2[_0x5595f7(0x197)]},'description':'Would\x20pull\x20'+_0x49f675[_0x5595f7(0x1af)]+_0x5595f7(0x1c0)};},async 'execute'(_0x6c7cc4){const _0x38acdf=a23_0x214850,_0x2a9b92=loadBffProjectConfig(_0x6c7cc4[_0x38acdf(0x197)]),_0x3f7653=await readBffLockFile(_0x2a9b92[_0x38acdf(0x195)]),{lockData:_0x3c85b2,appLock:_0x1b4580}=ensureLockScope(_0x3f7653??createEmptyBffLock(),_0x2a9b92[_0x38acdf(0x197)],_0x2a9b92[_0x38acdf(0x1a5)],_0x38acdf(0x1bc),_0x2a9b92[_0x38acdf(0x197)],_0x2a9b92[_0x38acdf(0x1a0)]+'/'+_0x2a9b92[_0x38acdf(0x197)]),_0x15b7d1=normalizeBffType(_0x6c7cc4[_0x38acdf(0x199)](_0x38acdf(0x1b9)))??undefined;if(_0x6c7cc4[_0x38acdf(0x199)]('type')&&!_0x15b7d1)throw CliErrors[_0x38acdf(0x190)](_0x38acdf(0x1ae));const [_0x4315cd,_0x43549c]=await Promise[_0x38acdf(0x18c)]([listBffScripts(_0x6c7cc4[_0x38acdf(0x197)],_0x15b7d1),getBffScriptStatistics(_0x6c7cc4['appCode'])]);if(_0x4315cd[_0x38acdf(0x1af)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x38acdf(0x1cb)};const _0x578f14=_0x6c7cc4[_0x38acdf(0x1bf)]('force');if(_0x578f14&&!_0x6c7cc4[_0x38acdf(0x1aa)]){const _0x13c1dd=await confirmForce();if(!_0x13c1dd)throw CliErrors[_0x38acdf(0x1ac)]('Force\x20pull\x20cancelled.');}if(_0x578f14&&_0x6c7cc4[_0x38acdf(0x1aa)]){}const _0x134ad9=buildDatasetCodeToAliasMap(_0x6c7cc4[_0x38acdf(0x1b8)]),_0x51b798=createHookLocationMap(_0x43549c),_0x358c70=cloneLockData(_0x3c85b2),_0x3f1c6b=_0x358c70['apps'][_0x2a9b92['appCode']],_0x565e6c=[],_0x29e6c1=[],_0xf40cf6=[];for(const _0x382ade of _0x4315cd){const _0x494327=resolveRemoteScriptTarget(_0x2a9b92,_0x382ade,_0x51b798,_0x1b4580['functions'],_0x134ad9);if(!_0x494327){_0x29e6c1[_0x38acdf(0x1c3)]({'lockKey':_0x382ade['scriptType']+'/'+_0x382ade[_0x38acdf(0x1b1)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x26cca1=_0x1b4580['functions'][_0x494327[_0x38acdf(0x1c5)]];try{if(!_0x578f14){const _0x46d0ef=await hasUnsyncedLocalChanges(_0x494327[_0x38acdf(0x1c4)],_0x26cca1);if(_0x46d0ef){_0x29e6c1[_0x38acdf(0x1c3)]({'lockKey':_0x494327[_0x38acdf(0x1c5)],'reason':_0x38acdf(0x18f)});continue;}}if(!_0x382ade['id'])throw new Error(_0x38acdf(0x18e));if(_0x382ade[_0x38acdf(0x1a1)]==null)throw new Error(_0x38acdf(0x1a8));const _0x2ed3f8=_0x382ade[_0x38acdf(0x1a1)];await ensureParentDirectory(_0x494327['filePath']),await writeFile(_0x494327[_0x38acdf(0x1c4)],_0x2ed3f8,'utf8');const _0x2ca994={'hash':computeContentHash(_0x2ed3f8),'remoteId':_0x382ade['id'],'version':_0x382ade[_0x38acdf(0x1c6)]};_0x494327[_0x38acdf(0x1b9)]===_0x38acdf(0x19e)&&_0x494327[_0x38acdf(0x1b3)]&&(_0x2ca994[_0x38acdf(0x1bd)]=_0x494327[_0x38acdf(0x1b3)][_0x38acdf(0x1bd)],_0x2ca994[_0x38acdf(0x1a9)]=_0x494327['hookLocation'][_0x38acdf(0x1a9)],_0x2ca994['operationType']=_0x494327[_0x38acdf(0x1b3)][_0x38acdf(0x1b0)],_0x2ca994[_0x38acdf(0x194)]=_0x494327['hookLocation'][_0x38acdf(0x194)]),_0x3f1c6b[_0x38acdf(0x191)][_0x494327[_0x38acdf(0x1c5)]]=_0x2ca994,_0x565e6c[_0x38acdf(0x1c3)]({'lockKey':_0x494327[_0x38acdf(0x1c5)],'remoteId':_0x382ade['id']});}catch(_0x3f9765){_0xf40cf6[_0x38acdf(0x1c3)]({'lockKey':_0x494327[_0x38acdf(0x1c5)],'error':_0x3f9765 instanceof Error?_0x3f9765[_0x38acdf(0x198)]:String(_0x3f9765)});}}return _0x3f1c6b[_0x38acdf(0x1be)]=new Date()['toISOString'](),await writeBffLockFile(_0x2a9b92[_0x38acdf(0x195)],_0x358c70),{'ok':_0xf40cf6[_0x38acdf(0x1af)]===0x0,'data':{'pulled':_0x565e6c,'skipped':_0x29e6c1,'failed':_0xf40cf6},'message':_0x38acdf(0x1ab)+_0x565e6c['length']+_0x38acdf(0x18d)+_0x29e6c1[_0x38acdf(0x1af)]+_0x38acdf(0x1ad)+_0xf40cf6['length']+_0x38acdf(0x1b7)};}};async function hasUnsyncedLocalChanges(_0x5484f7,_0xce1d59){if(!await fileExists(_0x5484f7))return![];const _0x2a3e30=await computeFileHash(_0x5484f7);if(!_0xce1d59)return!![];return _0x2a3e30!==_0xce1d59['hash'];}function a23_0x5f54(){const _0x45d5c6=['Pull\x20complete:\x20','cancelled','\x20skipped,\x20','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','length','operationType','functionName','4641000QJrcet','hookLocation','5oQkDFj','COMMON','821032rTBRVf','\x20failed','apiDir','type','1284438HpzDfk','1841121rYWCCF','pull','alias','lastSync','bool','\x20file(s)','GET','Pull\x20only\x20this\x20script\x20type','push','filePath','lockKey','version','1104206HcOPcK','ENDPOINT','aliases','force','No\x20remote\x20BFF\x20scripts\x20found.','trim','6647830ZiewPh','36PTqdwj','all','\x20pulled,\x20','Remote\x20script\x20missing\x20id.','local\x20unsynced\x20changes','validation','functions','stdin','map','functionNode','lockFilePath','toLowerCase','appCode','message','str','includes','string','2ChcfTM','write','HOOK','/api/management/library/scripts/list','scriptsWorkspaceRoot','scriptContent','boolean','2068684ymZQtu','apps','scriptsRoot','entries','bff','Remote\x20script\x20missing\x20content.','datasetCode','nonInteractive'];a23_0x5f54=function(){return _0x45d5c6;};return a23_0x5f54();}function cloneLockData(_0xab9d4c){const _0x2ece9e=a23_0x214850;return{'aliases':{..._0xab9d4c[_0x2ece9e(0x1c9)]},'apps':Object['fromEntries'](Object[_0x2ece9e(0x1a6)](_0xab9d4c[_0x2ece9e(0x1a4)])[_0x2ece9e(0x193)](([_0x501140,_0x1dfcfb])=>[_0x501140,{'scriptsRoot':_0x1dfcfb[_0x2ece9e(0x1a5)],'lastSync':_0x1dfcfb['lastSync'],'functions':{..._0x1dfcfb['functions']}}]))};}function buildDatasetCodeToAliasMap(_0x1208af){const _0x12298f=a23_0x214850,_0x36a942=loadAliasMap(_0x1208af);return new Map(_0x36a942[_0x12298f(0x193)](_0x4f78ed=>[_0x4f78ed[_0x12298f(0x1a9)],_0x4f78ed[_0x12298f(0x1bd)]]));}async function confirmForce(){const _0x36a959=a23_0x214850,_0x49d1b5=createInterface({'input':process[_0x36a959(0x192)],'output':process['stderr']}),_0x2e62a1=await new Promise(_0x29db73=>{_0x49d1b5['question']('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x29db73);});return _0x49d1b5['close'](),['y','yes'][_0x36a959(0x19a)](_0x2e62a1[_0x36a959(0x1cc)]()[_0x36a959(0x196)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x27c9df=a38_0x2a74;(function(_0x12929b,_0x4c8043){const _0x3e5672=a38_0x2a74,_0x140293=_0x12929b();while(!![]){try{const _0x39c160=parseInt(_0x3e5672(0x18e))/0x1*(-parseInt(_0x3e5672(0x1af))/0x2)+parseInt(_0x3e5672(0x196))/0x3*(-parseInt(_0x3e5672(0x18f))/0x4)+-parseInt(_0x3e5672(0x190))/0x5*(-parseInt(_0x3e5672(0x19e))/0x6)+-parseInt(_0x3e5672(0x187))/0x7+parseInt(_0x3e5672(0x1b5))/0x8*(parseInt(_0x3e5672(0x188))/0x9)+parseInt(_0x3e5672(0x18a))/0xa*(-parseInt(_0x3e5672(0x1c2))/0xb)+parseInt(_0x3e5672(0x1c1))/0xc;if(_0x39c160===_0x4c8043)break;else _0x140293['push'](_0x140293['shift']());}catch(_0x5253d6){_0x140293['push'](_0x140293['shift']());}}}(a38_0x55b9,0x9a010));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a38_0x2a74(_0x545922,_0x2d8890){_0x545922=_0x545922-0x185;const _0x55b9aa=a38_0x55b9();let _0x2a745f=_0x55b9aa[_0x545922];return _0x2a745f;}import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a38_0x55b9(){const _0x493343=['high-risk-write','boolean','alias','str','some','17539668qjUXMx','44KZLpru','version','string','functions','map','datasetCodeToId','has','Local\x20function\x20not\x20found:\x20','scriptsWorkspaceRoot','\x20uploaded,\x20','3142944BJgCSI','3897DeDVeB','No\x20local\x20BFF\x20functions\x20found.','799380LyUaGG','Run\x20`','Push\x20complete:\x20','HOOK','127VbSNNL','4ZWZhNI','19925kePTuE','length','functionNode','remoteId','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','filePath','618984JGHHLm','toISOString','\x20file(s)','code','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','ENDPOINT','bool','operationType','618gvDNpn','aliasToDatasetCode','hash',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','lockKey','appCode','name','COMMON','force','lastSync','get','Force\x20push\x20ignoring\x20hash\x20protection','push','lockFilePath','scriptsRoot','unchanged','\x20failed','7486dwiBim','/api/management/library/scripts/save','datasetCode','Would\x20push\x20','type','\x22.\x20','3864XaCMdU','apiDir','validation','set','datasetId','\x20skipped,\x20','Incomplete\x20HOOK\x20path:\x20'];a38_0x55b9=function(){return _0x493343;};return a38_0x55b9();}export const bffPush={'service':'bff','command':a38_0x27c9df(0x1aa),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a38_0x27c9df(0x1bc),'flags':[{'name':a38_0x27c9df(0x1b3),'type':a38_0x27c9df(0x1c4),'description':'Push\x20only\x20this\x20script\x20type','enum':[a38_0x27c9df(0x1a5),a38_0x27c9df(0x19b),a38_0x27c9df(0x18d)]},{'name':a38_0x27c9df(0x1a4),'type':a38_0x27c9df(0x1c4),'description':a38_0x27c9df(0x194)},{'name':a38_0x27c9df(0x1a6),'type':a38_0x27c9df(0x1bd),'description':a38_0x27c9df(0x1a9)}],async 'dryRun'(_0x5c3c86){const _0x1e8962=a38_0x27c9df,_0x3bfa6c=loadBffProjectConfig(_0x5c3c86[_0x1e8962(0x1a3)]),_0x32ad37=await readBffLockFile(_0x3bfa6c[_0x1e8962(0x1ab)]),{appLock:_0x515f59}=ensureLockScope(_0x32ad37??createEmptyBffLock(),_0x3bfa6c[_0x1e8962(0x1a3)],_0x3bfa6c[_0x1e8962(0x1ac)],_0x1e8962(0x1aa),_0x3bfa6c['appCode'],_0x3bfa6c[_0x1e8962(0x185)]+'/'+_0x3bfa6c[_0x1e8962(0x1a3)]),_0x56d793=await getTargetFunctions(_0x3bfa6c,_0x5c3c86),_0x5f0a04=_0x5c3c86[_0x1e8962(0x19c)](_0x1e8962(0x1a6)),_0x29b5dd=[];for(const _0x2337fd of _0x56d793){const _0x2d5eb4=await computeFileHash(_0x2337fd[_0x1e8962(0x195)]),_0x4eb1ec=_0x515f59[_0x1e8962(0x1c5)][_0x2337fd[_0x1e8962(0x1a2)]];if(!_0x5f0a04&&_0x4eb1ec&&_0x4eb1ec[_0x1e8962(0x1a0)]===_0x2d5eb4)continue;_0x29b5dd[_0x1e8962(0x1aa)](_0x2337fd[_0x1e8962(0x1a2)]);}return{'method':'POST','url':_0x1e8962(0x1b0),'body':{'files':_0x29b5dd,'appCode':_0x5c3c86[_0x1e8962(0x1a3)]},'description':_0x1e8962(0x1b2)+_0x29b5dd['length']+_0x1e8962(0x198)};},async 'execute'(_0x3d21b6){const _0xb3bb64=a38_0x27c9df,_0x81cafc=loadBffProjectConfig(_0x3d21b6[_0xb3bb64(0x1a3)]),_0x2db0f4=await readBffLockFile(_0x81cafc[_0xb3bb64(0x1ab)]),{lockData:_0x305225,appLock:_0x2ce3c2}=ensureLockScope(_0x2db0f4??createEmptyBffLock(),_0x81cafc[_0xb3bb64(0x1a3)],_0x81cafc['scriptsRoot'],_0xb3bb64(0x1aa),_0x81cafc[_0xb3bb64(0x1a3)],_0x81cafc[_0xb3bb64(0x185)]+'/'+_0x81cafc[_0xb3bb64(0x1a3)]),_0x575b7a=await getTargetFunctions(_0x81cafc,_0x3d21b6);if(_0x575b7a[_0xb3bb64(0x191)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xb3bb64(0x189)};const _0x548e55=_0x3d21b6[_0xb3bb64(0x19c)](_0xb3bb64(0x1a6)),_0x57d70b=await buildHookMaps(_0x81cafc[_0xb3bb64(0x1a3)],_0x3d21b6[_0xb3bb64(0x1b6)],_0x575b7a,_0x2ce3c2),_0x415449=[],_0x4d45b8=[],_0x696533=[];for(const _0x28509f of _0x575b7a){const _0x21dd85=await computeFileHash(_0x28509f[_0xb3bb64(0x195)]),_0x3a719a=_0x2ce3c2['functions'][_0x28509f[_0xb3bb64(0x1a2)]];if(!_0x548e55&&_0x3a719a&&_0x3a719a[_0xb3bb64(0x1a0)]===_0x21dd85){_0x4d45b8['push']({'lockKey':_0x28509f[_0xb3bb64(0x1a2)],'reason':_0xb3bb64(0x1ad)});continue;}try{await uploadSingleFunction(_0x81cafc['appCode'],_0x28509f,_0x2ce3c2,_0x57d70b);const _0x248e12=_0x2ce3c2[_0xb3bb64(0x1c5)][_0x28509f[_0xb3bb64(0x1a2)]];_0x415449[_0xb3bb64(0x1aa)]({'lockKey':_0x28509f['lockKey'],'remoteId':_0x248e12?.[_0xb3bb64(0x193)]??0x0});}catch(_0x552906){_0x696533[_0xb3bb64(0x1aa)]({'lockKey':_0x28509f['lockKey'],'error':_0x552906 instanceof Error?_0x552906['message']:String(_0x552906)});}}return _0x2ce3c2[_0xb3bb64(0x1a7)]=new Date()[_0xb3bb64(0x197)](),await writeBffLockFile(_0x81cafc[_0xb3bb64(0x1ab)],_0x305225),{'ok':_0x696533['length']===0x0,'data':{'uploaded':_0x415449,'skipped':_0x4d45b8,'failed':_0x696533},'message':_0xb3bb64(0x18c)+_0x415449['length']+_0xb3bb64(0x186)+_0x4d45b8['length']+_0xb3bb64(0x1ba)+_0x696533[_0xb3bb64(0x191)]+_0xb3bb64(0x1ae)};}};async function getTargetFunctions(_0x4283af,_0x4d6d25){const _0x2254df=a38_0x27c9df,_0x15f94f=_0x4d6d25[_0x2254df(0x1bf)](_0x2254df(0x1b3)),_0xeb1ff2=_0x4d6d25['str']('name'),_0x3af663=normalizeBffType(_0x15f94f)??undefined;if(_0xeb1ff2&&!_0x3af663)throw CliErrors[_0x2254df(0x1b7)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x38a910=await scanLocalBffFunctions(_0x4283af,_0x3af663);if(_0xeb1ff2){const _0xf8d201=_0x38a910['filter'](_0x27abf5=>_0x27abf5[_0x2254df(0x1a4)]===_0xeb1ff2);if(_0xf8d201[_0x2254df(0x191)]===0x0)throw CliErrors[_0x2254df(0x1b7)](_0x2254df(0x1c9)+_0x3af663+'/'+_0xeb1ff2);return _0xf8d201;}return _0x38a910;}async function buildHookMaps(_0x5e6c19,_0x9d450b,_0x4e6d02,_0xe2c91d){const _0x136b5d=a38_0x27c9df,_0x511972=_0x4e6d02[_0x136b5d(0x1c0)](_0x3ae761=>_0x3ae761[_0x136b5d(0x1b3)]===_0x136b5d(0x18d));if(!_0x511972)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x32871c=loadAliasMap(_0x9d450b),_0x510f42=new Map(_0x32871c[_0x136b5d(0x1c6)](_0x3e0090=>[_0x3e0090[_0x136b5d(0x1be)],_0x3e0090['datasetCode']]));for(const _0x57af61 of Object['values'](_0xe2c91d[_0x136b5d(0x1c5)])){_0x57af61[_0x136b5d(0x1be)]&&_0x57af61[_0x136b5d(0x1b1)]&&!_0x510f42[_0x136b5d(0x1c8)](_0x57af61['alias'])&&_0x510f42[_0x136b5d(0x1b8)](_0x57af61[_0x136b5d(0x1be)],_0x57af61[_0x136b5d(0x1b1)]);}const _0x397451=await listDatasets(_0x5e6c19),_0xdf59e2=new Map(_0x397451['map'](_0x8e64ca=>[_0x8e64ca[_0x136b5d(0x199)],_0x8e64ca['id']]));return{'aliasToDatasetCode':_0x510f42,'datasetCodeToId':_0xdf59e2};}async function uploadSingleFunction(_0x506989,_0x4e7661,_0x1020e8,_0x51e570){const _0x10282c=a38_0x27c9df,_0x36a6af=await readFile(_0x4e7661[_0x10282c(0x195)],'utf8'),_0x5a2fb4=await computeFileHash(_0x4e7661['filePath']),_0x14262a=_0x1020e8['functions'][_0x4e7661['lockKey']];if(_0x14262a?.['remoteId']&&_0x14262a[_0x10282c(0x1c3)]==null)throw CliErrors[_0x10282c(0x1b7)](_0x4e7661[_0x10282c(0x1a2)]+_0x10282c(0x1a1));let _0x3b0ceb=extractScriptDescription(_0x36a6af);if(!_0x3b0ceb&&_0x14262a?.[_0x10282c(0x193)]){const _0x2e520d=await getBffScriptInfo(_0x14262a['remoteId']);_0x3b0ceb=_0x2e520d['description']||undefined;}const _0x49b4e2={'appCode':_0x506989,'functionName':_0x4e7661[_0x10282c(0x1a4)],'scriptType':_0x4e7661['type'],'scriptContent':_0x36a6af};if(_0x14262a?.['remoteId'])_0x49b4e2['id']=_0x14262a['remoteId'];if(_0x14262a?.[_0x10282c(0x1c3)]!=null)_0x49b4e2[_0x10282c(0x1c3)]=_0x14262a['version'];if(_0x3b0ceb)_0x49b4e2['description']=_0x3b0ceb;if(_0x4e7661[_0x10282c(0x1b3)]===_0x10282c(0x18d)){const _0x5b3602=_0x4e7661[_0x10282c(0x1be)];if(!_0x5b3602||!_0x4e7661[_0x10282c(0x19d)]||!_0x4e7661['functionNode'])throw CliErrors['validation'](_0x10282c(0x1bb)+_0x4e7661[_0x10282c(0x1a2)]);const _0x1a7d4d=_0x51e570['aliasToDatasetCode'][_0x10282c(0x1a8)](_0x5b3602)??_0x14262a?.[_0x10282c(0x1b1)]??_0x5b3602,_0x4b66d6=_0x51e570[_0x10282c(0x1c7)][_0x10282c(0x1a8)](_0x1a7d4d);if(!_0x4b66d6)throw CliErrors[_0x10282c(0x1b7)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x5b3602+_0x10282c(0x1b4)+(_0x10282c(0x18b)+CLI_BIN_NAME+_0x10282c(0x19a)));_0x49b4e2[_0x10282c(0x1b9)]=_0x4b66d6,_0x49b4e2[_0x10282c(0x19d)]=_0x4e7661['operationType'],_0x49b4e2['functionNode']=_0x4e7661[_0x10282c(0x192)];}const _0x4aa250=await saveBffScript(_0x49b4e2),_0x4d2564=await getBffScriptInfo(_0x4aa250),_0x2662b6={'hash':_0x5a2fb4,'remoteId':_0x4aa250,'version':_0x4d2564[_0x10282c(0x1c3)]};if(_0x4e7661[_0x10282c(0x1b3)]==='HOOK'){const _0x465d0e=_0x4e7661[_0x10282c(0x1be)],_0x4076d0=_0x51e570[_0x10282c(0x19f)][_0x10282c(0x1a8)](_0x465d0e)??_0x14262a?.[_0x10282c(0x1b1)]??_0x465d0e;_0x51e570[_0x10282c(0x19f)][_0x10282c(0x1c8)](_0x465d0e)?_0x2662b6[_0x10282c(0x1be)]=_0x465d0e:_0x2662b6['alias']=_0x14262a?.[_0x10282c(0x1be)],_0x2662b6['datasetCode']=_0x4076d0,_0x2662b6[_0x10282c(0x19d)]=_0x4e7661['operationType'],_0x2662b6[_0x10282c(0x192)]=_0x4e7661['functionNode'];}_0x1020e8['functions'][_0x4e7661[_0x10282c(0x1a2)]]=_0x2662b6;}
|
|
1
|
+
const a24_0x57d3b1=a24_0x2c7f;(function(_0xc912d6,_0x4eabf3){const _0x4980c8=a24_0x2c7f,_0x3d9512=_0xc912d6();while(!![]){try{const _0x4267e5=-parseInt(_0x4980c8(0x11c))/0x1*(-parseInt(_0x4980c8(0x14a))/0x2)+parseInt(_0x4980c8(0x148))/0x3*(parseInt(_0x4980c8(0x134))/0x4)+-parseInt(_0x4980c8(0x153))/0x5+-parseInt(_0x4980c8(0x15a))/0x6+parseInt(_0x4980c8(0x124))/0x7*(parseInt(_0x4980c8(0x159))/0x8)+parseInt(_0x4980c8(0x15c))/0x9+parseInt(_0x4980c8(0x142))/0xa*(-parseInt(_0x4980c8(0x11a))/0xb);if(_0x4267e5===_0x4eabf3)break;else _0x3d9512['push'](_0x3d9512['shift']());}catch(_0x421a5b){_0x3d9512['push'](_0x3d9512['shift']());}}}(a24_0x1790,0xe2d2d));function a24_0x1790(){const _0x4574c9=['\x20file(s)','appCode','code','map','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','datasetId','aliasToDatasetCode','No\x20local\x20BFF\x20functions\x20found.','string','HOOK','ENDPOINT','bool','Cannot\x20resolve\x20dataset\x20for\x20\x22','length','lockFilePath','285068bingvY','Incomplete\x20HOOK\x20path:\x20','version','values','COMMON','apiDir','get','description','set','lockKey','force','unchanged','datasetCodeToId','type','1284970aKKYhU','has','high-risk-write','filter','Would\x20push\x20','Push\x20complete:\x20','24RbSYMr','\x20failed','28LGcpIW','datasetCode','scriptsWorkspaceRoot','functionNode','remoteId','\x20skipped,\x20','\x22.\x20','operationType','alias','353360wBndwv','bff','utf8','name','scriptsRoot','Local\x20function\x20not\x20found:\x20','24ArkHPH','4284120UAtqDB','str','7289604PLGKTN','functions','validation','hash','88IGTpDU','Force\x20push\x20ignoring\x20hash\x20protection','26023lGAxup','POST','Push\x20only\x20this\x20script\x20type','push','lastSync','filePath','message',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','2327087KgSbnM'];a24_0x1790=function(){return _0x4574c9;};return a24_0x1790();}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a24_0x2c7f(_0x277d35,_0x4d0720){_0x277d35=_0x277d35-0x119;const _0x179049=a24_0x1790();let _0x2c7fc1=_0x179049[_0x277d35];return _0x2c7fc1;}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a24_0x57d3b1(0x154),'command':a24_0x57d3b1(0x11f),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a24_0x57d3b1(0x144),'flags':[{'name':a24_0x57d3b1(0x141),'type':'string','description':a24_0x57d3b1(0x11e),'enum':[a24_0x57d3b1(0x138),a24_0x57d3b1(0x12f),a24_0x57d3b1(0x12e)]},{'name':a24_0x57d3b1(0x156),'type':a24_0x57d3b1(0x12d),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a24_0x57d3b1(0x13e),'type':'boolean','description':a24_0x57d3b1(0x11b)}],async 'dryRun'(_0x5bfacd){const _0x177a3a=a24_0x57d3b1,_0x99bdb6=loadBffProjectConfig(_0x5bfacd['appCode']),_0x3cf03d=await readBffLockFile(_0x99bdb6[_0x177a3a(0x133)]),{appLock:_0x412ae8}=ensureLockScope(_0x3cf03d??createEmptyBffLock(),_0x99bdb6[_0x177a3a(0x126)],_0x99bdb6['scriptsRoot'],_0x177a3a(0x11f),_0x99bdb6['appCode'],_0x99bdb6[_0x177a3a(0x14c)]+'/'+_0x99bdb6[_0x177a3a(0x126)]),_0x49bb16=await getTargetFunctions(_0x99bdb6,_0x5bfacd),_0x47f858=_0x5bfacd[_0x177a3a(0x130)](_0x177a3a(0x13e)),_0x419d30=[];for(const _0x3e4828 of _0x49bb16){const _0x5c2282=await computeFileHash(_0x3e4828[_0x177a3a(0x121)]),_0x3dd6eb=_0x412ae8[_0x177a3a(0x15d)][_0x3e4828[_0x177a3a(0x13d)]];if(!_0x47f858&&_0x3dd6eb&&_0x3dd6eb[_0x177a3a(0x119)]===_0x5c2282)continue;_0x419d30[_0x177a3a(0x11f)](_0x3e4828[_0x177a3a(0x13d)]);}return{'method':_0x177a3a(0x11d),'url':'/api/management/library/scripts/save','body':{'files':_0x419d30,'appCode':_0x5bfacd['appCode']},'description':_0x177a3a(0x146)+_0x419d30[_0x177a3a(0x132)]+_0x177a3a(0x125)};},async 'execute'(_0x296e2c){const _0x8b9bf0=a24_0x57d3b1,_0x796781=loadBffProjectConfig(_0x296e2c[_0x8b9bf0(0x126)]),_0x5ef722=await readBffLockFile(_0x796781['lockFilePath']),{lockData:_0x44c64f,appLock:_0x114f2b}=ensureLockScope(_0x5ef722??createEmptyBffLock(),_0x796781['appCode'],_0x796781[_0x8b9bf0(0x157)],_0x8b9bf0(0x11f),_0x796781[_0x8b9bf0(0x126)],_0x796781[_0x8b9bf0(0x14c)]+'/'+_0x796781[_0x8b9bf0(0x126)]),_0x429783=await getTargetFunctions(_0x796781,_0x296e2c);if(_0x429783[_0x8b9bf0(0x132)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x8b9bf0(0x12c)};const _0x43f11b=_0x296e2c[_0x8b9bf0(0x130)](_0x8b9bf0(0x13e)),_0x3005c1=await buildHookMaps(_0x796781[_0x8b9bf0(0x126)],_0x296e2c[_0x8b9bf0(0x139)],_0x429783,_0x114f2b),_0x538294=[],_0x338846=[],_0x1c8d3c=[];for(const _0x232bb4 of _0x429783){const _0x51ba00=await computeFileHash(_0x232bb4[_0x8b9bf0(0x121)]),_0x5a52bf=_0x114f2b['functions'][_0x232bb4['lockKey']];if(!_0x43f11b&&_0x5a52bf&&_0x5a52bf[_0x8b9bf0(0x119)]===_0x51ba00){_0x338846[_0x8b9bf0(0x11f)]({'lockKey':_0x232bb4[_0x8b9bf0(0x13d)],'reason':_0x8b9bf0(0x13f)});continue;}try{await uploadSingleFunction(_0x796781['appCode'],_0x232bb4,_0x114f2b,_0x3005c1);const _0x391d87=_0x114f2b[_0x8b9bf0(0x15d)][_0x232bb4[_0x8b9bf0(0x13d)]];_0x538294[_0x8b9bf0(0x11f)]({'lockKey':_0x232bb4['lockKey'],'remoteId':_0x391d87?.[_0x8b9bf0(0x14e)]??0x0});}catch(_0x2698bc){_0x1c8d3c[_0x8b9bf0(0x11f)]({'lockKey':_0x232bb4['lockKey'],'error':_0x2698bc instanceof Error?_0x2698bc[_0x8b9bf0(0x122)]:String(_0x2698bc)});}}return _0x114f2b[_0x8b9bf0(0x120)]=new Date()['toISOString'](),await writeBffLockFile(_0x796781['lockFilePath'],_0x44c64f),{'ok':_0x1c8d3c[_0x8b9bf0(0x132)]===0x0,'data':{'uploaded':_0x538294,'skipped':_0x338846,'failed':_0x1c8d3c},'message':_0x8b9bf0(0x147)+_0x538294[_0x8b9bf0(0x132)]+'\x20uploaded,\x20'+_0x338846[_0x8b9bf0(0x132)]+_0x8b9bf0(0x14f)+_0x1c8d3c[_0x8b9bf0(0x132)]+_0x8b9bf0(0x149)};}};async function getTargetFunctions(_0x29b153,_0x2fff10){const _0xa3fbfd=a24_0x57d3b1,_0x645654=_0x2fff10['str'](_0xa3fbfd(0x141)),_0x42e895=_0x2fff10[_0xa3fbfd(0x15b)](_0xa3fbfd(0x156)),_0x2aef5e=normalizeBffType(_0x645654)??undefined;if(_0x42e895&&!_0x2aef5e)throw CliErrors[_0xa3fbfd(0x15e)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4109b5=await scanLocalBffFunctions(_0x29b153,_0x2aef5e);if(_0x42e895){const _0x4a347c=_0x4109b5[_0xa3fbfd(0x145)](_0x286eaa=>_0x286eaa[_0xa3fbfd(0x156)]===_0x42e895);if(_0x4a347c['length']===0x0)throw CliErrors[_0xa3fbfd(0x15e)](_0xa3fbfd(0x158)+_0x2aef5e+'/'+_0x42e895);return _0x4a347c;}return _0x4109b5;}async function buildHookMaps(_0x58280c,_0xedecb3,_0x4a1495,_0x3d541d){const _0x618160=a24_0x57d3b1,_0x102d91=_0x4a1495['some'](_0x494944=>_0x494944[_0x618160(0x141)]===_0x618160(0x12e));if(!_0x102d91)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0xe21c9f=loadAliasMap(_0xedecb3),_0x3843af=new Map(_0xe21c9f['map'](_0x288eff=>[_0x288eff['alias'],_0x288eff[_0x618160(0x14b)]]));for(const _0x32c4d2 of Object[_0x618160(0x137)](_0x3d541d[_0x618160(0x15d)])){_0x32c4d2['alias']&&_0x32c4d2[_0x618160(0x14b)]&&!_0x3843af[_0x618160(0x143)](_0x32c4d2[_0x618160(0x152)])&&_0x3843af[_0x618160(0x13c)](_0x32c4d2[_0x618160(0x152)],_0x32c4d2[_0x618160(0x14b)]);}const _0xbd3ac=await listDatasets(_0x58280c),_0x169973=new Map(_0xbd3ac[_0x618160(0x128)](_0x590260=>[_0x590260[_0x618160(0x127)],_0x590260['id']]));return{'aliasToDatasetCode':_0x3843af,'datasetCodeToId':_0x169973};}async function uploadSingleFunction(_0x40de87,_0x566e92,_0x576458,_0x40a31e){const _0x2da946=a24_0x57d3b1,_0x38262b=await readFile(_0x566e92[_0x2da946(0x121)],_0x2da946(0x155)),_0x50dd8d=await computeFileHash(_0x566e92[_0x2da946(0x121)]),_0x41df31=_0x576458['functions'][_0x566e92[_0x2da946(0x13d)]];if(_0x41df31?.[_0x2da946(0x14e)]&&_0x41df31[_0x2da946(0x136)]==null)throw CliErrors[_0x2da946(0x15e)](_0x566e92[_0x2da946(0x13d)]+_0x2da946(0x123));let _0x5f08fc=extractScriptDescription(_0x38262b);if(!_0x5f08fc&&_0x41df31?.[_0x2da946(0x14e)]){const _0x162318=await getBffScriptInfo(_0x41df31[_0x2da946(0x14e)]);_0x5f08fc=_0x162318[_0x2da946(0x13b)]||undefined;}const _0x9f4959={'appCode':_0x40de87,'functionName':_0x566e92[_0x2da946(0x156)],'scriptType':_0x566e92[_0x2da946(0x141)],'scriptContent':_0x38262b};if(_0x41df31?.['remoteId'])_0x9f4959['id']=_0x41df31[_0x2da946(0x14e)];if(_0x41df31?.[_0x2da946(0x136)]!=null)_0x9f4959[_0x2da946(0x136)]=_0x41df31[_0x2da946(0x136)];if(_0x5f08fc)_0x9f4959[_0x2da946(0x13b)]=_0x5f08fc;if(_0x566e92[_0x2da946(0x141)]===_0x2da946(0x12e)){const _0x31c009=_0x566e92['alias'];if(!_0x31c009||!_0x566e92[_0x2da946(0x151)]||!_0x566e92['functionNode'])throw CliErrors['validation'](_0x2da946(0x135)+_0x566e92[_0x2da946(0x13d)]);const _0x12766a=_0x40a31e['aliasToDatasetCode'][_0x2da946(0x13a)](_0x31c009)??_0x41df31?.['datasetCode']??_0x31c009,_0x505b5b=_0x40a31e[_0x2da946(0x140)]['get'](_0x12766a);if(!_0x505b5b)throw CliErrors[_0x2da946(0x15e)](_0x2da946(0x131)+_0x31c009+_0x2da946(0x150)+('Run\x20`'+CLI_BIN_NAME+_0x2da946(0x129)));_0x9f4959[_0x2da946(0x12a)]=_0x505b5b,_0x9f4959['operationType']=_0x566e92[_0x2da946(0x151)],_0x9f4959['functionNode']=_0x566e92[_0x2da946(0x14d)];}const _0x9d4213=await saveBffScript(_0x9f4959),_0x24e612=await getBffScriptInfo(_0x9d4213),_0x934d73={'hash':_0x50dd8d,'remoteId':_0x9d4213,'version':_0x24e612['version']};if(_0x566e92[_0x2da946(0x141)]===_0x2da946(0x12e)){const _0x373b11=_0x566e92['alias'],_0x4a9b3f=_0x40a31e['aliasToDatasetCode']['get'](_0x373b11)??_0x41df31?.[_0x2da946(0x14b)]??_0x373b11;_0x40a31e[_0x2da946(0x12b)][_0x2da946(0x143)](_0x373b11)?_0x934d73['alias']=_0x373b11:_0x934d73[_0x2da946(0x152)]=_0x41df31?.[_0x2da946(0x152)],_0x934d73[_0x2da946(0x14b)]=_0x4a9b3f,_0x934d73[_0x2da946(0x151)]=_0x566e92[_0x2da946(0x151)],_0x934d73['functionNode']=_0x566e92['functionNode'];}_0x576458[_0x2da946(0x15d)][_0x566e92['lockKey']]=_0x934d73;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x57ad(_0x1a8793,_0x510603){_0x1a8793=_0x1a8793-0xc8;const _0x530207=a25_0x5302();let _0x57adb8=_0x530207[_0x1a8793];return _0x57adb8;}const a25_0xc37c34=a25_0x57ad;(function(_0xaec7f3,_0x2ab2a0){const _0x358ba6=a25_0x57ad,_0x4d06e3=_0xaec7f3();while(!![]){try{const _0x3c4367=parseInt(_0x358ba6(0xde))/0x1+parseInt(_0x358ba6(0xe2))/0x2*(-parseInt(_0x358ba6(0xe9))/0x3)+parseInt(_0x358ba6(0xcd))/0x4+-parseInt(_0x358ba6(0xdb))/0x5*(-parseInt(_0x358ba6(0xc8))/0x6)+parseInt(_0x358ba6(0xd1))/0x7*(parseInt(_0x358ba6(0xe4))/0x8)+-parseInt(_0x358ba6(0xe5))/0x9+-parseInt(_0x358ba6(0xd3))/0xa*(parseInt(_0x358ba6(0xe8))/0xb);if(_0x3c4367===_0x2ab2a0)break;else _0x4d06e3['push'](_0x4d06e3['shift']());}catch(_0x21a6d6){_0x4d06e3['push'](_0x4d06e3['shift']());}}}(a25_0x5302,0x5962b));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a25_0xc37c34(0xd5),'command':a25_0xc37c34(0xe7),'description':a25_0xc37c34(0xc9),'risk':a25_0xc37c34(0xd8),'flags':[{'name':a25_0xc37c34(0xcb),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x52a384){const _0x30940b=a25_0xc37c34,_0x3eaf06=loadBffProjectConfig(_0x52a384[_0x30940b(0xce)]),_0x31775=await readBffLockFile(_0x3eaf06[_0x30940b(0xe1)]),{appLock:_0x3e66e9}=ensureLockScope(_0x31775??createEmptyBffLock(),_0x3eaf06[_0x30940b(0xce)],_0x3eaf06['scriptsRoot'],_0x30940b(0xe7),_0x3eaf06['appCode'],_0x3eaf06[_0x30940b(0xcf)]+'/'+_0x3eaf06[_0x30940b(0xce)]),_0xbf95fb=await scanLocalBffFunctions(_0x3eaf06),_0x48e9a4=[],_0x34c4ed=[],_0x3df929=[];for(const _0x16b5a6 of _0xbf95fb){const _0xd6e320=await computeFileHash(_0x16b5a6[_0x30940b(0xd6)]),_0x4175fd=_0x3e66e9[_0x30940b(0xdf)][_0x16b5a6['lockKey']];if(!_0x4175fd)_0x48e9a4[_0x30940b(0xd7)](_0x16b5a6[_0x30940b(0xdc)]);else _0x4175fd[_0x30940b(0xe0)]!==_0xd6e320?_0x34c4ed[_0x30940b(0xd7)](_0x16b5a6['lockKey']):_0x3df929[_0x30940b(0xd7)](_0x16b5a6[_0x30940b(0xdc)]);}const _0x463cc8=[];if(_0x52a384['bool'](_0x30940b(0xcb))){const _0x52ae64=loadAliasMap(_0x52a384[_0x30940b(0xdd)]),_0x56074d=new Map(_0x52ae64[_0x30940b(0xe6)](_0xddb3cd=>[_0xddb3cd[_0x30940b(0xda)],_0xddb3cd[_0x30940b(0xd2)]])),[_0xeec50e,_0x552286]=await Promise[_0x30940b(0xcc)]([listBffScripts(_0x52a384[_0x30940b(0xce)]),getBffScriptStatistics(_0x52a384[_0x30940b(0xce)])]),_0x265b5e=createHookLocationMap(_0x552286),_0x5b9581=new Set(_0xbf95fb[_0x30940b(0xe6)](_0x53a9b7=>_0x53a9b7['lockKey']));for(const _0x4e565a of _0xeec50e){const _0x824ed6=resolveRemoteScriptTarget(_0x3eaf06,_0x4e565a,_0x265b5e,_0x3e66e9[_0x30940b(0xdf)],_0x56074d);_0x824ed6&&!_0x5b9581[_0x30940b(0xd0)](_0x824ed6[_0x30940b(0xdc)])&&_0x463cc8[_0x30940b(0xd7)](_0x824ed6[_0x30940b(0xdc)]);}}const _0x47b7da=_0x48e9a4[_0x30940b(0xd9)]===0x0&&_0x34c4ed['length']===0x0&&_0x463cc8['length']===0x0;return{'ok':!![],'data':{'added':_0x48e9a4,'modified':_0x34c4ed,'unchanged':_0x3df929,'remoteOnly':_0x463cc8},'message':_0x47b7da?_0x30940b(0xd4):_0x48e9a4[_0x30940b(0xd9)]+_0x30940b(0xe3)+_0x34c4ed[_0x30940b(0xd9)]+_0x30940b(0xca)+_0x3df929['length']+'\x20unchanged'+(_0x463cc8[_0x30940b(0xd9)]>0x0?',\x20'+_0x463cc8[_0x30940b(0xd9)]+'\x20remote-only':'')};}};function a25_0x5302(){const _0x22d956=['8UZMZJW','362898cNgjIw','map','status','506JHWNtm','924999LronfJ','5196FqGWgB','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','\x20modified,\x20','remote','all','697492FFFmYx','appCode','scriptsWorkspaceRoot','has','2836561rWvnri','alias','96810FxIVoV','All\x20BFF\x20scripts\x20are\x20in\x20sync.','bff','filePath','push','read','length','datasetCode','330ejXGJD','lockKey','apiDir','523352bYTmVB','functions','hash','lockFilePath','2FrQpfM','\x20added,\x20'];a25_0x5302=function(){return _0x22d956;};return a25_0x5302();}
|
package/lib/commands/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x57e6eb=a26_0x8171;(function(_0x1b688a,_0x2b5693){const _0x31213d=a26_0x8171,_0x426b68=_0x1b688a();while(!![]){try{const _0x113e1c=parseInt(_0x31213d(0x1a8))/0x1+parseInt(_0x31213d(0x19e))/0x2*(-parseInt(_0x31213d(0x19f))/0x3)+-parseInt(_0x31213d(0x1b4))/0x4+parseInt(_0x31213d(0x1a3))/0x5+parseInt(_0x31213d(0x1b2))/0x6*(-parseInt(_0x31213d(0x1b0))/0x7)+parseInt(_0x31213d(0x1a7))/0x8+parseInt(_0x31213d(0x1ba))/0x9;if(_0x113e1c===_0x2b5693)break;else _0x426b68['push'](_0x426b68['shift']());}catch(_0x37f6e4){_0x426b68['push'](_0x426b68['shift']());}}}(a26_0x3fd0,0xb82f0));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runBuild(_0x4b3e89){return new Promise((_0x47b3e7,_0x3a42df)=>{const _0x3866a6=a26_0x8171,_0x4393a7=Date[_0x3866a6(0x1ae)]();_0x4b3e89['logger']['info'](_0x3866a6(0x1b6),'开始构建项目',{'command':_0x3866a6(0x1b3)});let _0x38e180='';const _0x2665cf=spawn(_0x3866a6(0x1a5),[_0x3866a6(0x1aa),_0x3866a6(0x1b6)],{'stdio':[_0x3866a6(0x1ab),_0x3866a6(0x1ab),_0x3866a6(0x1a9)],'shell':!![],'env':{...process[_0x3866a6(0x1a4)],'PATH':''+join(process['cwd'](),_0x3866a6(0x1ad),'.bin')+delimiter+process[_0x3866a6(0x1a4)][_0x3866a6(0x19d)]}});_0x2665cf['stderr']?.['on']('data',_0x5f6d8=>{_0x38e180+=_0x5f6d8['toString']();}),_0x2665cf['on'](_0x3866a6(0x1a2),_0x210008=>{const _0x4a0779=_0x3866a6,_0x149264=Date[_0x4a0779(0x1ae)]()-_0x4393a7;if(_0x210008===0x0||_0x210008===null)_0x4b3e89['logger'][_0x4a0779(0x1b7)](_0x4a0779(0x1b6),_0x4a0779(0x1a6),_0x149264),_0x47b3e7();else{const _0x5c260f={'exitCode':_0x210008,'duration':_0x149264,'command':'npm\x20run\x20build','cwd':process[_0x4a0779(0x1af)]()};_0x38e180[_0x4a0779(0x1b9)]()&&(_0x5c260f[_0x4a0779(0x1ac)]=_0x38e180[_0x4a0779(0x1b9)]()),_0x4b3e89[_0x4a0779(0x1a0)]['error'](_0x4a0779(0x1b6),_0x4a0779(0x1b8),_0x5c260f),_0x3a42df(new Error(_0x4a0779(0x1b1)+_0x210008));}}),_0x2665cf['on']('error',_0x1ab8e2=>{const _0x26de8b=_0x3866a6,_0x489eb8=Date['now']()-_0x4393a7;_0x4b3e89[_0x26de8b(0x1a0)][_0x26de8b(0x1b5)]('build',_0x26de8b(0x1a1),{'error':_0x1ab8e2['message'],'duration':_0x489eb8,'stderr':_0x38e180[_0x26de8b(0x1b9)]()||undefined}),_0x3a42df(_0x1ab8e2);});});}export const buildCommand={'name':a26_0x57e6eb(0x1b6),'description':'Build\x20project',async 'run'(_0x44ea7b,_0x24b9f4,_0x1828be){await runBuild(_0x44ea7b);}};function a26_0x8171(_0x3f17dd,_0x591a37){_0x3f17dd=_0x3f17dd-0x19d;const _0x3fd00f=a26_0x3fd0();let _0x81713=_0x3fd00f[_0x3f17dd];return _0x81713;}function a26_0x3fd0(){const _0x269acd=['npm\x20run\x20build','5836472UfTsvI','error','build','success','项目构建失败','trim','1887246sUWjYU','PATH','82038VWYZiB','21IDXbXO','logger','项目构建出错','close','5458790DOtfBB','env','npm','项目构建成功','7088456SEoNHI','610803MAFMkk','pipe','run','inherit','stderr','node_modules','now','cwd','7taVwYl','npm\x20run\x20build\x20exited\x20with\x20code\x20','1785870hXLnfP'];a26_0x3fd0=function(){return _0x269acd;};return a26_0x3fd0();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a27_0x581a25=a27_0x57dd;(function(_0x1684b1,_0x2cd8cc){const _0x1f9917=a27_0x57dd,_0x4b2c43=_0x1684b1();while(!![]){try{const _0x4d0da6=-parseInt(_0x1f9917(0x19f))/0x1+parseInt(_0x1f9917(0x1b5))/0x2+parseInt(_0x1f9917(0x1af))/0x3*(parseInt(_0x1f9917(0x1a2))/0x4)+-parseInt(_0x1f9917(0x195))/0x5*(-parseInt(_0x1f9917(0x1ab))/0x6)+parseInt(_0x1f9917(0x19e))/0x7+parseInt(_0x1f9917(0x192))/0x8+-parseInt(_0x1f9917(0x18b))/0x9;if(_0x4d0da6===_0x2cd8cc)break;else _0x4b2c43['push'](_0x4b2c43['shift']());}catch(_0x368af2){_0x4b2c43['push'](_0x4b2c43['shift']());}}}(a27_0x3166,0x884cf));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a27_0x5521a1 from'chalk';import a27_0x57e50f from'ora';function a27_0x3166(){const _0x32895e=['Version\x20comparison\x20failed','yellow','update','pipe','npm','execPath','Updating\x20via\x20','@latest','5565588xtDBvA','438559CZkWdB','red','https://registry.npmjs.org/','2464604fNYtkn','gray','bun','stableVersion','message','utf-8','includes','start','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','6302214zUGAAH','json','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Updated\x20to\x20v','3QDuthT','...','fail','coerce','install','\x20install\x20-g\x20','228594qPOqQO','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Try\x20manually:\x20','version','timeout','info','23219667WogIdx','\x20→\x20','succeed','0.0.0','Current\x20version:\x20','log','Checking\x20for\x20updates...','8007264eGaGvQ','Update\x20available:\x20','package.json','5IipQzP'];a27_0x3166=function(){return _0x32895e;};return a27_0x3166();}import a27_0x424db9 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';import{resolveNpmBin}from'../utils/platform.js';function a27_0x57dd(_0x5249af,_0x34bf7c){_0x5249af=_0x5249af-0x189;const _0x3166fa=a27_0x3166();let _0x57dd28=_0x3166fa[_0x5249af];return _0x57dd28;}function getCurrentVersion(){const _0x49f4da=a27_0x57dd;try{const _0x1e9790=resolve(dirname(fileURLToPath(import.meta.url)),'../..'),_0x51e3ba=JSON['parse'](readFileSync(resolve(_0x1e9790,_0x49f4da(0x194)),_0x49f4da(0x1a7))),_0x5d0238=_0x51e3ba[_0x49f4da(0x1b8)]||_0x49f4da(0x18e);return BUILD_NUMBER?_0x5d0238+'+'+BUILD_NUMBER:_0x5d0238;}catch{return _0x49f4da(0x18e);}}function detectPackageManager(){const _0xb0234=a27_0x57dd,_0x3660b4=process[_0xb0234(0x19b)]['toLowerCase']();if(_0x3660b4[_0xb0234(0x1a8)](_0xb0234(0x1a4)))return _0xb0234(0x1a4);return _0xb0234(0x19a);}async function fetchLatestNpmVersion(){const _0x83a483=a27_0x57dd;try{const _0x187389=await fetch(_0x83a483(0x1a1)+NPM_PACKAGE_NAME+'/latest',{'signal':AbortSignal[_0x83a483(0x189)](0x2710)});if(!_0x187389['ok'])return null;const _0x1ed1d3=await _0x187389[_0x83a483(0x1ac)]();return _0x1ed1d3[_0x83a483(0x1b8)]??null;}catch{return null;}}async function fetchLatestVersion(){const _0x6f796f=a27_0x57dd,_0x50b589=await fetchLatestNpmVersion();if(_0x50b589)return _0x50b589;const _0x5572dd=await getCdnConfig();return _0x5572dd?.['cli']?.[_0x6f796f(0x1a5)]??null;}async function runSelfUpdate(_0x356bc0,_0x38286f,_0x4a9334){const _0x59e589=a27_0x57dd,_0x2e32ec=getCurrentVersion();console[_0x59e589(0x190)](_0x59e589(0x18f)+_0x2e32ec);const _0xe0113e=a27_0x57e50f(_0x59e589(0x191))['start'](),_0x391536=await fetchLatestVersion();if(!_0x391536){_0xe0113e[_0x59e589(0x1b1)](_0x59e589(0x1b6)),console[_0x59e589(0x190)](a27_0x5521a1['gray'](_0x59e589(0x1ad)+NPM_PACKAGE_NAME+'@latest'));return;}const _0x4d88f9=a27_0x424db9[_0x59e589(0x1b2)](_0x2e32ec),_0x330009=a27_0x424db9[_0x59e589(0x1b2)](_0x391536);if(!_0x4d88f9||!_0x330009){_0xe0113e[_0x59e589(0x1b1)](_0x59e589(0x196));return;}if(!a27_0x424db9['lt'](_0x4d88f9,_0x330009)){_0xe0113e[_0x59e589(0x18d)]('Already\x20up\x20to\x20date\x20(v'+_0x391536+')');return;}_0xe0113e[_0x59e589(0x18a)](_0x59e589(0x193)+a27_0x5521a1[_0x59e589(0x197)](_0x2e32ec)+_0x59e589(0x18c)+a27_0x5521a1['green'](_0x391536));const _0x51eaeb=detectPackageManager(),_0x349072=_0x51eaeb===_0x59e589(0x19a)?resolveNpmBin(_0x59e589(0x19a)):_0x51eaeb,_0x120301=a27_0x57e50f(_0x59e589(0x19c)+_0x51eaeb+_0x59e589(0x1b0))[_0x59e589(0x1a9)]();try{await execa(_0x349072,[_0x59e589(0x1b3),'-g',NPM_PACKAGE_NAME+_0x59e589(0x19d)],{'stdio':_0x59e589(0x199)}),_0x120301['succeed'](_0x59e589(0x1ae)+_0x391536),console[_0x59e589(0x190)](a27_0x5521a1[_0x59e589(0x1a3)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x2cbbae){_0x120301[_0x59e589(0x1b1)]('Update\x20failed'),console['error'](a27_0x5521a1[_0x59e589(0x1a0)]('\x20\x20'+_0x2cbbae[_0x59e589(0x1a6)])),console['log'](a27_0x5521a1['gray'](_0x59e589(0x1b7)+_0x51eaeb+_0x59e589(0x1b4)+NPM_PACKAGE_NAME+_0x59e589(0x19d)));}}export const updateCommand={'name':a27_0x581a25(0x198),'description':a27_0x581a25(0x1aa),async 'run'(_0x4bc5b1,_0xd3563e,_0x545874){await runSelfUpdate(_0x4bc5b1,_0xd3563e,_0x545874);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a28_0x446c(){const _0x69558c=['6262662bHaLSw','8hpIZrn','1882500WGZWEd','1524096SizBWi','13mdkCmo','511930OGPEdN','558892EYQKem','34616cHoRVb','63oBmiWR','12MIxMib','9GhMrOB','12114509IxQIZF'];a28_0x446c=function(){return _0x69558c;};return a28_0x446c();}(function(_0xaf065a,_0x279630){const _0x43314a=a28_0x15ef,_0x7649e1=_0xaf065a();while(!![]){try{const _0x5b174a=parseInt(_0x43314a(0xa6))/0x1*(parseInt(_0x43314a(0x9d))/0x2)+-parseInt(_0x43314a(0xa0))/0x3*(parseInt(_0x43314a(0x9c))/0x4)+parseInt(_0x43314a(0xa4))/0x5+parseInt(_0x43314a(0xa5))/0x6+parseInt(_0x43314a(0xa2))/0x7*(parseInt(_0x43314a(0xa3))/0x8)+-parseInt(_0x43314a(0x9e))/0x9*(-parseInt(_0x43314a(0xa7))/0xa)+parseInt(_0x43314a(0xa1))/0xb*(-parseInt(_0x43314a(0x9f))/0xc);if(_0x5b174a===_0x279630)break;else _0x7649e1['push'](_0x7649e1['shift']());}catch(_0x560c9b){_0x7649e1['push'](_0x7649e1['shift']());}}}(a28_0x446c,0x8f911));import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';function a28_0x15ef(_0x27f633,_0x6d17f2){_0x27f633=_0x27f633-0x9c;const _0x446c16=a28_0x446c();let _0x15efe3=_0x446c16[_0x27f633];return _0x15efe3;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x4f58(){const _0x273b48=['240468pcwiNr','60TMlSWv','1160OyGxVJ','271614FcrlTp','codegen','2315709JAObTY','boolean','operation','3140328wvyYKc','5riTOxP','4360xjhCLQ','appCode','string','13075UQaMJX','Omit\x20import\x20statements\x20from\x20generated\x20code','sdk','1044pXKDYk','code','name','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','str','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','tableName','read','3038607gWezeO','skip-imports'];a29_0x4f58=function(){return _0x273b48;};return a29_0x4f58();}const a29_0x36788f=a29_0x12c5;function a29_0x12c5(_0x372be1,_0x409555){_0x372be1=_0x372be1-0x14b;const _0x4f58e9=a29_0x4f58();let _0x12c5ca=_0x4f58e9[_0x372be1];return _0x12c5ca;}(function(_0x345b6e,_0x7fc8d7){const _0x58b106=a29_0x12c5,_0x37585e=_0x345b6e();while(!![]){try{const _0x1ce623=parseInt(_0x58b106(0x159))/0x1*(-parseInt(_0x58b106(0x150))/0x2)+-parseInt(_0x58b106(0x155))/0x3+-parseInt(_0x58b106(0x152))/0x4*(-parseInt(_0x58b106(0x15d))/0x5)+-parseInt(_0x58b106(0x158))/0x6+-parseInt(_0x58b106(0x153))/0x7+parseInt(_0x58b106(0x15a))/0x8*(-parseInt(_0x58b106(0x160))/0x9)+-parseInt(_0x58b106(0x151))/0xa*(-parseInt(_0x58b106(0x14e))/0xb);if(_0x1ce623===_0x7fc8d7)break;else _0x37585e['push'](_0x37585e['shift']());}catch(_0x3def08){_0x37585e['push'](_0x37585e['shift']());}}}(a29_0x4f58,0x65e09));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':a29_0x36788f(0x154),'command':a29_0x36788f(0x15f),'description':a29_0x36788f(0x163),'risk':a29_0x36788f(0x14d),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a29_0x36788f(0x15c),'description':a29_0x36788f(0x14b)},{'name':a29_0x36788f(0x157),'type':a29_0x36788f(0x15c),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a29_0x36788f(0x14f),'type':a29_0x36788f(0x156),'description':a29_0x36788f(0x15e)}],async 'execute'(_0x2ef5e7){const _0x6258e5=a29_0x36788f,{dataset:_0x44ec0a,operation:_0x4cde33}=await getOperationDetail(_0x2ef5e7[_0x6258e5(0x15b)],_0x2ef5e7[_0x6258e5(0x164)](_0x6258e5(0x161)),_0x2ef5e7[_0x6258e5(0x164)](_0x6258e5(0x157))),_0x4f05=generateSdkCode(_0x44ec0a,_0x4cde33,{'includeImports':!_0x2ef5e7['bool'](_0x6258e5(0x14f))});return{'ok':!![],'data':{'dataset':{'name':_0x44ec0a[_0x6258e5(0x162)],'code':_0x44ec0a['code'],'tableName':_0x44ec0a[_0x6258e5(0x14c)]},'operation':_0x2ef5e7['str'](_0x6258e5(0x157)),'code':_0x4f05}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x5b2af7=a30_0x555e;(function(_0x211b54,_0x213931){const _0x3a06e0=a30_0x555e,_0x1137cc=_0x211b54();while(!![]){try{const _0x565ea5=-parseInt(_0x3a06e0(0x96))/0x1+parseInt(_0x3a06e0(0x98))/0x2*(-parseInt(_0x3a06e0(0x8e))/0x3)+-parseInt(_0x3a06e0(0x93))/0x4*(parseInt(_0x3a06e0(0x97))/0x5)+-parseInt(_0x3a06e0(0x9e))/0x6+parseInt(_0x3a06e0(0x9b))/0x7+-parseInt(_0x3a06e0(0xa1))/0x8*(-parseInt(_0x3a06e0(0x8f))/0x9)+parseInt(_0x3a06e0(0xa0))/0xa;if(_0x565ea5===_0x213931)break;else _0x1137cc['push'](_0x1137cc['shift']());}catch(_0x37b24b){_0x1137cc['push'](_0x1137cc['shift']());}}}(a30_0x42e3,0x4584a));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../common/flags.js';export const codegenSql={'service':a30_0x5b2af7(0x90),'command':a30_0x5b2af7(0x92),'description':a30_0x5b2af7(0x94),'risk':a30_0x5b2af7(0x95),'flags':[SQLCODE_FLAG,{'name':a30_0x5b2af7(0x8b),'type':a30_0x5b2af7(0x8a),'description':a30_0x5b2af7(0x8c),'default':'sdk','enum':[a30_0x5b2af7(0x9c),'bff']},{'name':a30_0x5b2af7(0x91),'type':a30_0x5b2af7(0x9a),'description':a30_0x5b2af7(0x8d)}],async 'execute'(_0x30cfac){const _0x89bbb7=a30_0x5b2af7,_0x2c301d=await getSqlQueryInfo(_0x30cfac[_0x89bbb7(0x9f)],_0x30cfac[_0x89bbb7(0x89)]('sqlcode')),_0x4f3d12=_0x30cfac['str']('target')||_0x89bbb7(0x9c),_0x5ee2c4=generateSqlCodeTemplate(_0x2c301d,{'target':_0x4f3d12,'includeImports':!_0x30cfac['bool'](_0x89bbb7(0x91))});return{'ok':!![],'data':{'sqlCode':_0x2c301d[_0x89bbb7(0x9d)],'sqlName':_0x2c301d[_0x89bbb7(0x99)],'target':_0x4f3d12,'code':_0x5ee2c4}};}};function a30_0x555e(_0x16e417,_0x405a79){_0x16e417=_0x16e417-0x89;const _0x42e30e=a30_0x42e3();let _0x555edb=_0x42e30e[_0x16e417];return _0x555edb;}function a30_0x42e3(){const _0xa58099=['boolean','2376395jfsaYP','sdk','sqlCode','577920sMXLlr','appCode','2247860unXPgy','944npQKiy','str','string','target','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','Omit\x20import\x20statements\x20from\x20generated\x20code','22476nCqAyu','27828QsYyVZ','codegen','no-imports','sql','12XGSSZF','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','read','218131XqZEjW','412530xPoSqZ','22YyxVJK','sqlName'];a30_0x42e3=function(){return _0xa58099;};return a30_0x42e3();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a31_0x2f77(_0x23bcff,_0x3381d5){_0x23bcff=_0x23bcff-0x109;const _0x4d1e1a=a31_0x4d1e();let _0x2f77ef=_0x4d1e1a[_0x23bcff];return _0x2f77ef;}const a31_0x10fa41=a31_0x2f77;(function(_0x2a5df2,_0x5497bf){const _0x2a2026=a31_0x2f77,_0x38cc4c=_0x2a5df2();while(!![]){try{const _0x51041a=parseInt(_0x2a2026(0x10d))/0x1+-parseInt(_0x2a2026(0x10c))/0x2*(parseInt(_0x2a2026(0x114))/0x3)+-parseInt(_0x2a2026(0x116))/0x4*(-parseInt(_0x2a2026(0x117))/0x5)+parseInt(_0x2a2026(0x112))/0x6+parseInt(_0x2a2026(0x10b))/0x7*(-parseInt(_0x2a2026(0x10a))/0x8)+parseInt(_0x2a2026(0x119))/0x9*(-parseInt(_0x2a2026(0x110))/0xa)+-parseInt(_0x2a2026(0x115))/0xb;if(_0x51041a===_0x5497bf)break;else _0x38cc4c['push'](_0x38cc4c['shift']());}catch(_0x507538){_0x38cc4c['push'](_0x38cc4c['shift']());}}}(a31_0x4d1e,0xefd33));export const CODE_FLAG={'name':'code','type':a31_0x10fa41(0x109),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a31_0x10fa41(0x10f)}};export const CODE_FLAG_OPTIONAL={'name':a31_0x10fa41(0x113),'type':a31_0x10fa41(0x109),'required':![],'description':a31_0x10fa41(0x10e),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};export const SQLCODE_FLAG={'name':a31_0x10fa41(0x111),'type':a31_0x10fa41(0x109),'required':!![],'description':a31_0x10fa41(0x11a),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a31_0x10fa41(0x118)}};export const SQLCODE_FLAG_OPTIONAL={'name':'sqlcode','type':a31_0x10fa41(0x109),'required':![],'description':a31_0x10fa41(0x11a),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a31_0x10fa41(0x118)}};function a31_0x4d1e(){const _0x3adce2=['SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','71127ekLuvi','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','string','415928hAvPmu','7gxCXcT','59630idbqqp','1555334mLWBPF','Dataset\x20code\x20(32-char\x20hex\x20UUID)','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','140HnYfLk','sqlcode','711492sdozpQ','code','117ldpmQN','11547822Rjnpzi','41316DGccLC','815vxYzgc'];a31_0x4d1e=function(){return _0x3adce2;};return a31_0x4d1e();}
|
package/lib/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x3016db=a32_0x6aee;(function(_0x10716,_0x10e5b6){const _0x436dc0=a32_0x6aee,_0x23d2b4=_0x10716();while(!![]){try{const _0x382756=-parseInt(_0x436dc0(0x157))/0x1*(parseInt(_0x436dc0(0x150))/0x2)+parseInt(_0x436dc0(0x153))/0x3*(parseInt(_0x436dc0(0x151))/0x4)+-parseInt(_0x436dc0(0x152))/0x5+parseInt(_0x436dc0(0x154))/0x6+parseInt(_0x436dc0(0x155))/0x7+-parseInt(_0x436dc0(0x14f))/0x8+-parseInt(_0x436dc0(0x156))/0x9;if(_0x382756===_0x10e5b6)break;else _0x23d2b4['push'](_0x23d2b4['shift']());}catch(_0x5cab98){_0x23d2b4['push'](_0x23d2b4['shift']());}}}(a32_0x1a8b,0x4554a));import{jsx as a32_0x3d4471}from'react/jsx-runtime';import{render}from'ink';import{Config}from'../config/main.js';function a32_0x1a8b(){const _0x3b1887=['570808lyvuyo','307630ZTbPIW','72Prgnnh','633445iGbiJA','76473sHNZQe','2589564gSIOBo','3067736ESZMmA','6235623EygpCX','1qkBTOh','Manage\x20project\x20configuration'];a32_0x1a8b=function(){return _0x3b1887;};return a32_0x1a8b();}function a32_0x6aee(_0x1b9996,_0x14835c){_0x1b9996=_0x1b9996-0x14f;const _0x1a8ba9=a32_0x1a8b();let _0x6aee3b=_0x1a8ba9[_0x1b9996];return _0x6aee3b;}export const configCommand={'name':'config','description':a32_0x3016db(0x158),async 'run'(_0x40a355,_0x4163e3,_0x290abe){const _0x93749e={'input':['config',..._0x4163e3],'flags':_0x290abe,'pkg':{},'help':'','updateNotifier':undefined,'showHelp':()=>{},'showVersion':()=>{}};render(a32_0x3d4471(Config,{'cli':_0x93749e}));}};
|
package/lib/commands/create.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x151c(_0x4d3533,_0x363eeb){_0x4d3533=_0x4d3533-0x9c;const _0x4ce58d=a33_0x4ce5();let _0x151ced=_0x4ce58d[_0x4d3533];return _0x151ced;}const a33_0x1a2772=a33_0x151c;function a33_0x4ce5(){const _0x7da33c=['validation','54KiyCol','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','auth','1049965knpcNd','Usage:\x20rabetbase\x20create\x20<project-name>\x20--ci','11830016tCrWxm','49236XzHHuK','28HqqXii','create','trim','72448fYEXjR','Create\x20a\x20new\x20project','nonInteractive','25855VcBkWj','logger','712fUSxrW','9235602ZnlmXT','非交互模式创建项目:\x20','4343940MAWbig','1440SMlAgR'];a33_0x4ce5=function(){return _0x7da33c;};return a33_0x4ce5();}(function(_0x2e6f23,_0x50c2f0){const _0x49c0bb=a33_0x151c,_0x57251d=_0x2e6f23();while(!![]){try{const _0x4331ea=parseInt(_0x49c0bb(0xa0))/0x1*(-parseInt(_0x49c0bb(0x9d))/0x2)+-parseInt(_0x49c0bb(0xa8))/0x3+parseInt(_0x49c0bb(0xa5))/0x4*(parseInt(_0x49c0bb(0xa3))/0x5)+-parseInt(_0x49c0bb(0xab))/0x6*(-parseInt(_0x49c0bb(0xae))/0x7)+parseInt(_0x49c0bb(0xb0))/0x8+-parseInt(_0x49c0bb(0xa6))/0x9+parseInt(_0x49c0bb(0xa9))/0xa*(parseInt(_0x49c0bb(0x9c))/0xb);if(_0x4331ea===_0x50c2f0)break;else _0x57251d['push'](_0x57251d['shift']());}catch(_0x384c69){_0x57251d['push'](_0x57251d['shift']());}}}(a33_0x4ce5,0xdd02b));import{jsx as a33_0x109e30}from'react/jsx-runtime';import{render}from'ink';import{CreateApp}from'../create-app/main.js';import{CliErrors}from'../errors.js';export const createCommand={'name':a33_0x1a2772(0x9e),'description':a33_0x1a2772(0xa1),async 'run'(_0x3743b0,_0x2641e7,_0x10b62a){const _0x3924b6=a33_0x1a2772,_0x586519=_0x2641e7[0x0]?.[_0x3924b6(0x9f)](),_0x85efc5=_0x10b62a['env'];if(_0x3743b0[_0x3924b6(0xa2)]&&_0x586519){_0x3743b0[_0x3924b6(0xa4)]['info'](_0x3924b6(0x9e),_0x3924b6(0xa7)+_0x586519);const {createProjectNonInteractive:_0x2d4300}=await import('../create-app/non-interactive.js');await _0x2d4300(_0x586519,_0x85efc5);}else{if(_0x3743b0[_0x3924b6(0xa2)]&&!_0x586519)throw CliErrors[_0x3924b6(0xaa)](_0x3924b6(0xac),_0x3924b6(0xaf));else render(a33_0x109e30(CreateApp,{'projectCode':_0x586519,'env':_0x85efc5,'cookie':_0x3743b0[_0x3924b6(0xad)]['cookie']}));}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x30a433=a34_0x32f9;function a34_0x32f9(_0x34b071,_0x4cefe5){_0x34b071=_0x34b071-0x169;const _0x28d614=a34_0x28d6();let _0x32f955=_0x28d614[_0x34b071];return _0x32f955;}(function(_0x56b85d,_0x40de5c){const _0x3de526=a34_0x32f9,_0xad185a=_0x56b85d();while(!![]){try{const _0x28cdcd=-parseInt(_0x3de526(0x188))/0x1+parseInt(_0x3de526(0x171))/0x2+-parseInt(_0x3de526(0x19c))/0x3+-parseInt(_0x3de526(0x18f))/0x4+parseInt(_0x3de526(0x177))/0x5*(-parseInt(_0x3de526(0x179))/0x6)+parseInt(_0x3de526(0x16c))/0x7*(parseInt(_0x3de526(0x185))/0x8)+-parseInt(_0x3de526(0x194))/0x9*(-parseInt(_0x3de526(0x19f))/0xa);if(_0x28cdcd===_0x40de5c)break;else _0xad185a['push'](_0xad185a['shift']());}catch(_0xcc6ab8){_0xad185a['push'](_0xad185a['shift']());}}}(a34_0x28d6,0x34d83));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG}from'../common/flags.js';function a34_0x28d6(){const _0x5eede0=['461478UxWCvu','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','required','sourceType','tableName','toFieldLabel','5eCsaVg','str','2018634kQpZyN','Return\x20full\x20raw\x20detail\x20object','length','displayName','dataset','verbose','operations','string','pkField','object','isArray','toTableName','8qSsIDs','indexes','type','138179SvaGtN','alias','dbtableConfig','code','doType','properties','read','668788DMmJyf','entries','parse','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','extend','58725Yojzax','method','detail','description','fields','modelId','relations','path','920790trUjqU','name','boolean','1150KvWRAN','map','toDatasetName','dbType','toDatasetCode','tableComment','dataType','filter','1288574eTsXDT','options','source','deleted','datasetKey'];a34_0x28d6=function(){return _0x5eede0;};return a34_0x28d6();}function normalizeField(_0x409095){const _0x2556e4=a34_0x32f9;if(_0x409095[_0x2556e4(0x16f)])return null;const _0x52d159=Boolean(_0x409095['displayName']!==undefined||_0x409095[_0x2556e4(0x18c)]!==undefined);let _0x34b697={};if(!_0x52d159&&typeof _0x409095[_0x2556e4(0x193)]===_0x2556e4(0x180))try{_0x34b697=JSON[_0x2556e4(0x191)](_0x409095[_0x2556e4(0x193)]);}catch{}const _0x431c2f=_0x52d159?_0x409095[_0x2556e4(0x19d)]:_0x409095[_0x2556e4(0x18b)],_0x10c72e=_0x52d159?_0x409095[_0x2556e4(0x17c)]:_0x409095['name'],_0x31acb3=_0x52d159?_0x409095[_0x2556e4(0x18c)]:_0x409095[_0x2556e4(0x187)]||_0x409095[_0x2556e4(0x16a)],_0x153ea2=_0x52d159?_0x409095[_0x2556e4(0x181)]===!![]:_0x34b697[_0x2556e4(0x181)]===!![],_0x20c1ab=_0x52d159?_0x409095[_0x2556e4(0x173)]===!![]:_0x34b697[_0x2556e4(0x173)]===!![],_0x4c7594=_0x52d159?_0x409095[_0x2556e4(0x16d)]??null:_0x34b697[_0x2556e4(0x16d)]??null,_0x5326b1={'name':_0x431c2f,'displayName':_0x10c72e||_0x431c2f,'type':_0x31acb3,'dbType':_0x409095[_0x2556e4(0x1a2)],'pk':_0x153ea2,'required':_0x20c1ab,'description':_0x409095[_0x2556e4(0x197)]||undefined};return Array[_0x2556e4(0x183)](_0x4c7594)&&_0x4c7594[_0x2556e4(0x17b)]>0x0&&(_0x5326b1[_0x2556e4(0x16d)]=_0x4c7594),_0x5326b1;}export const datasetDetail={'service':a34_0x30a433(0x17d),'command':a34_0x30a433(0x196),'description':a34_0x30a433(0x172),'risk':a34_0x30a433(0x18e),'flags':[CODE_FLAG,{'name':a34_0x30a433(0x189),'type':'string','description':a34_0x30a433(0x192)},{'name':'verbose','type':a34_0x30a433(0x19e),'description':a34_0x30a433(0x17a)}],async 'execute'(_0x41cfc4){const _0x1caf88=a34_0x30a433,_0x38bd1e=await getDatasetDetail(_0x41cfc4[_0x1caf88(0x178)](_0x1caf88(0x18b))),_0x4f2b95=_0x41cfc4['bool'](_0x1caf88(0x17e));if(_0x4f2b95)return{'ok':!![],'data':_0x38bd1e};const _0x23fc63=Array[_0x1caf88(0x183)](_0x38bd1e[_0x1caf88(0x198)])?_0x38bd1e['fields']:Array[_0x1caf88(0x183)](_0x38bd1e['properties'])?_0x38bd1e[_0x1caf88(0x18d)]:[],_0xd1ecea=_0x23fc63[_0x1caf88(0x1a0)](_0x18a8a8=>normalizeField(_0x18a8a8))[_0x1caf88(0x16b)](_0x89f5e4=>_0x89f5e4!==null),_0x5c0c10=_0x38bd1e[_0x1caf88(0x17f)]??{},_0x528e4d=[];for(const [_0x56b6b2,_0x465968]of Object[_0x1caf88(0x190)](_0x5c0c10)){if(_0x465968&&typeof _0x465968===_0x1caf88(0x182)){const _0x171ceb=_0x465968;_0x171ceb[_0x1caf88(0x195)]&&_0x171ceb[_0x1caf88(0x19b)]&&_0x528e4d['push']({'name':_0x56b6b2,'method':_0x171ceb['method'],'path':_0x171ceb[_0x1caf88(0x19b)]});}}const _0x5d7378=_0x38bd1e[_0x1caf88(0x18a)]??{},_0x209d09=_0x38bd1e[_0x1caf88(0x17d)]??{};return{'ok':!![],'data':{'id':_0x38bd1e[_0x1caf88(0x199)]??_0x38bd1e['id'],'name':_0x38bd1e[_0x1caf88(0x19d)],'code':_0x38bd1e['modelCode']||_0x38bd1e[_0x1caf88(0x18b)],'description':_0x38bd1e['description']||_0x209d09[_0x1caf88(0x169)]||undefined,'source':_0x38bd1e[_0x1caf88(0x16e)]||_0x209d09[_0x1caf88(0x174)],'table':_0x5d7378[_0x1caf88(0x175)]||_0x209d09[_0x1caf88(0x175)],'datasetKey':_0x5d7378[_0x1caf88(0x170)],'pk':_0x5d7378[_0x1caf88(0x181)],'fields':_0xd1ecea,'operations':_0x528e4d,'indexes':Array[_0x1caf88(0x183)](_0x209d09['indexes'])?_0x209d09[_0x1caf88(0x186)]:[],'relations':Array[_0x1caf88(0x183)](_0x38bd1e[_0x1caf88(0x19a)])?_0x38bd1e[_0x1caf88(0x19a)]['map'](_0xb8e673=>({'fromField':_0xb8e673['fromField'],'toDataset':_0xb8e673[_0x1caf88(0x1a1)],'toCode':_0xb8e673[_0x1caf88(0x1a3)],'toTable':_0xb8e673[_0x1caf88(0x184)],'toField':_0xb8e673['toField'],'labelField':_0xb8e673[_0x1caf88(0x176)]||undefined})):[],'stats':{'fieldCount':_0xd1ecea[_0x1caf88(0x17b)],'operationCount':_0x528e4d['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a1122,_0x1fb006){const _0x2341a3=a35_0x859f,_0x375aa7=_0x3a1122();while(!![]){try{const _0x24470d=-parseInt(_0x2341a3(0xc8))/0x1+-parseInt(_0x2341a3(0xcd))/0x2+parseInt(_0x2341a3(0xce))/0x3+parseInt(_0x2341a3(0xcb))/0x4+-parseInt(_0x2341a3(0xc9))/0x5+-parseInt(_0x2341a3(0xcf))/0x6+-parseInt(_0x2341a3(0xca))/0x7*(-parseInt(_0x2341a3(0xcc))/0x8);if(_0x24470d===_0x1fb006)break;else _0x375aa7['push'](_0x375aa7['shift']());}catch(_0x406071){_0x375aa7['push'](_0x375aa7['shift']());}}}(a35_0x64c2,0x4cea5));import{datasetList}from'./list.js';function a35_0x859f(_0x4b3fce,_0xaaac7b){_0x4b3fce=_0x4b3fce-0xc8;const _0x64c295=a35_0x64c2();let _0x859f95=_0x64c295[_0x4b3fce];return _0x859f95;}function a35_0x64c2(){const _0xbcc5b1=['97923vTZnHu','535920jdSMZE','584NZaWux','1052606HDjDxs','811347NbiACK','942984uyFCXg','323262uhSqmI','519260mMvEaB'];a35_0x64c2=function(){return _0xbcc5b1;};return a35_0x64c2();}import{datasetDetail}from'./detail.js';import{datasetOperations}from'./operations.js';import{datasetLinks}from'./links.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetOperations,datasetLinks];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x4177d1=a36_0x475b;function a36_0xbeb5(){const _0x51f6c8=['string','6864180mCpYjW','isForeignKey','isPrimaryKey','meta','\x20database(s),\x20','Ideal\x20for\x20AI\x20to\x20understand\x20the\x20full\x20data\x20model\x20in\x20a\x20single\x20call\x20before\x20writing\x20queries\x20or\x20BFF\x20scripts.','reduce','\x20dataset(s),\x20','stats','relationCount','dbId','verbose','Returns\x20all\x20datasets\x20with\x20their\x20fields\x20(PK/FK\x20flags)\x20and\x20cross-dataset\x20JOIN\x20relationships.\x20','9pdriXH','toField','\x20relation(s)','2382279KnEyvc','Fetched\x20link\x20graph\x20for\x20','name','Defaults\x20to\x20auto-detect\x20all\x20linked\x20databases.','3993876szyJwW','dbName','4oxBDcb','displayName','appCode','length','filter','relations','7VOEUQv','12yNgSlE','\x20database(s)','22921921jNwSWM','Link\x20graph:\x20','read','links','datasets','fields','Get\x20the\x20link\x20graph\x20(entity-relationship)\x20for\x20the\x20app\x27s\x20datasets.\x20','2766OzGelJ','331VxPJBX','map','datasetId','tableName','datasetCount','2101200oKszdH','fromField','dbType','bool','4314384ntvFJS','toDatasetName','str','dataset','datasetName'];a36_0xbeb5=function(){return _0x51f6c8;};return a36_0xbeb5();}(function(_0x1ab6b5,_0x33a5cf){const _0x1fffb9=a36_0x475b,_0x3ea468=_0x1ab6b5();while(!![]){try{const _0x40266c=parseInt(_0x1fffb9(0x112))/0x1*(parseInt(_0x1fffb9(0x111))/0x2)+parseInt(_0x1fffb9(0xfb))/0x3*(parseInt(_0x1fffb9(0x101))/0x4)+parseInt(_0x1fffb9(0x117))/0x5+-parseInt(_0x1fffb9(0xff))/0x6*(-parseInt(_0x1fffb9(0x107))/0x7)+parseInt(_0x1fffb9(0xe5))/0x8*(-parseInt(_0x1fffb9(0xf8))/0x9)+parseInt(_0x1fffb9(0xeb))/0xa+parseInt(_0x1fffb9(0x10a))/0xb*(-parseInt(_0x1fffb9(0x108))/0xc);if(_0x40266c===_0x33a5cf)break;else _0x3ea468['push'](_0x3ea468['shift']());}catch(_0x3f1624){_0x3ea468['push'](_0x3ea468['shift']());}}}(a36_0xbeb5,0x61ea5));import{getErConfig}from'../../core/api-client.js';function a36_0x475b(_0x321dbd,_0x514bee){_0x321dbd=_0x321dbd-0xe3;const _0xbeb553=a36_0xbeb5();let _0x475b9b=_0xbeb553[_0x321dbd];return _0x475b9b;}import{resolveDb}from'../../core/db-resolver.js';export const datasetLinks={'service':a36_0x4177d1(0xe8),'command':a36_0x4177d1(0x10d),'description':a36_0x4177d1(0x110)+a36_0x4177d1(0xf7)+a36_0x4177d1(0xf0),'risk':a36_0x4177d1(0x10c),'flags':[{'name':'db','type':a36_0x4177d1(0xea),'description':'Filter\x20by\x20database\x20—\x20accepts\x20a\x20numeric\x20dblink\x20ID\x20or\x20a\x20database\x20name\x20(e.g.\x20ecommerce_db).\x20'+a36_0x4177d1(0xfe)},{'name':a36_0x4177d1(0xf6),'type':'boolean','description':'Return\x20full\x20raw\x20ER\x20response\x20from\x20API'}],async 'execute'(_0x3c06c5){const _0x36e37d=a36_0x4177d1,_0xca8380=_0x3c06c5[_0x36e37d(0xe4)](_0x36e37d(0xf6)),{resolved:_0x590e7a,error:_0x8e0f92}=await resolveDb(_0x3c06c5[_0x36e37d(0x103)],_0x3c06c5[_0x36e37d(0xe7)]('db')||undefined);if(_0x8e0f92)return{'ok':![],'message':_0x8e0f92};const _0x10d64d=_0x590e7a[_0x36e37d(0x113)](_0x593c1e=>_0x593c1e[_0x36e37d(0xf5)]),_0x397a84=await Promise['all'](_0x10d64d['map'](_0x5ed0b1=>getErConfig(_0x3c06c5[_0x36e37d(0x103)],_0x5ed0b1)));if(_0xca8380)return{'ok':!![],'data':_0x397a84[_0x36e37d(0x104)]===0x1?_0x397a84[0x0]:_0x397a84,'message':_0x36e37d(0xfc)+_0x10d64d[_0x36e37d(0x104)]+_0x36e37d(0x109)};const _0x419aef=_0x397a84[_0x36e37d(0x113)](_0x4f5989=>{const _0x22918b=_0x36e37d,_0x162e48=(_0x4f5989[_0x22918b(0x10e)]??[])[_0x22918b(0x113)](_0x4ac457=>{const _0x9bb6b5=_0x22918b,_0x445566=_0x4ac457[_0x9bb6b5(0x10f)]?.[_0x9bb6b5(0x105)](_0x27ee84=>_0x27ee84[_0x9bb6b5(0xed)])[_0x9bb6b5(0x113)](_0x47d756=>_0x47d756[_0x9bb6b5(0xfd)])??[],_0x4da9d4=_0x4ac457[_0x9bb6b5(0x10f)]?.[_0x9bb6b5(0x105)](_0x2c140c=>_0x2c140c[_0x9bb6b5(0xec)])[_0x9bb6b5(0x113)](_0x58ebc5=>_0x58ebc5['name'])??[];return{'id':_0x4ac457[_0x9bb6b5(0x114)],'name':_0x4ac457[_0x9bb6b5(0xe9)],'code':_0x4ac457['datasetCode'],'table':_0x4ac457[_0x9bb6b5(0x115)],'comment':_0x4ac457['tableComment']||undefined,'fields':(_0x4ac457[_0x9bb6b5(0x10f)]??[])[_0x9bb6b5(0x113)](_0x4432e4=>({'name':_0x4432e4[_0x9bb6b5(0xfd)],'displayName':_0x4432e4[_0x9bb6b5(0x102)],'type':_0x4432e4[_0x9bb6b5(0xe3)],'pk':_0x4432e4[_0x9bb6b5(0xed)],'fk':_0x4432e4[_0x9bb6b5(0xec)]})),'relations':(_0x4ac457[_0x9bb6b5(0x106)]??[])[_0x9bb6b5(0x105)](_0x50f593=>_0x50f593['fromField']&&_0x50f593['toDataset'])[_0x9bb6b5(0x113)](_0x1454aa=>({'from':_0x1454aa[_0x9bb6b5(0x118)],'toDataset':_0x1454aa[_0x9bb6b5(0xe6)],'toCode':_0x1454aa['toDataset'],'toField':_0x1454aa[_0x9bb6b5(0xf9)],'joinType':_0x1454aa['joinType']||'LEFT'})),'stats':{'fieldCount':_0x4ac457[_0x9bb6b5(0x10f)]?.[_0x9bb6b5(0x104)]??0x0,'pkCount':_0x445566[_0x9bb6b5(0x104)],'fkCount':_0x4da9d4[_0x9bb6b5(0x104)],'relationCount':_0x4ac457[_0x9bb6b5(0x106)]?.[_0x9bb6b5(0x104)]??0x0}};}),_0x170a41=_0x162e48[_0x22918b(0x105)](_0x2c742=>_0x2c742[_0x22918b(0xf3)][_0x22918b(0xf4)]>0x0)[_0x22918b(0x113)](_0x44dbf9=>_0x44dbf9[_0x22918b(0xfd)]);return{'db':_0x4f5989[_0x22918b(0xee)]?.[_0x22918b(0x100)],'dbId':_0x4f5989[_0x22918b(0xee)]?.['dbId'],'appCode':_0x4f5989[_0x22918b(0xee)]?.['appCode'],'datasetCount':_0x162e48[_0x22918b(0x104)],'connectedDatasets':_0x170a41,'datasets':_0x162e48};}),_0x334538=_0x419aef[_0x36e37d(0xf1)]((_0x4a6b08,_0x12b3d4)=>_0x4a6b08+_0x12b3d4[_0x36e37d(0x116)],0x0),_0x39c886=_0x419aef[_0x36e37d(0xf1)]((_0x14d75d,_0x1cb97e)=>_0x14d75d+_0x1cb97e[_0x36e37d(0x10e)][_0x36e37d(0xf1)]((_0x4bbcfd,_0x1035d8)=>_0x4bbcfd+_0x1035d8[_0x36e37d(0xf3)]['relationCount'],0x0),0x0);return{'ok':!![],'data':_0x419aef[_0x36e37d(0x104)]===0x1?_0x419aef[0x0]:{'databases':_0x419aef},'message':_0x36e37d(0x10b)+_0x419aef['length']+_0x36e37d(0xef)+_0x334538+_0x36e37d(0xf2)+_0x39c886+_0x36e37d(0xfa)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x3b325d=a37_0x316b;function a37_0x2bd4(){const _0x5bffa5=['64464BafDIb','\x20dataset(s)','appCode','5420pXsUBh','code','trim','2XIbxHK','3814896wxdENs','Found\x20','name','read','168qFxmCg','20826fBRDQv','split','allFields','dataset','str','13317172UxdoOb','verbose','string','list','731710UZSHzZ','36OHpjee','length','bool','map','30XSnhtI','boolean','779617ErYNKd','source','2778235orBUzX','List\x20all\x20datasets\x20with\x20metadata','tableName'];a37_0x2bd4=function(){return _0x5bffa5;};return a37_0x2bd4();}function a37_0x316b(_0x50dafe,_0x3172f0){_0x50dafe=_0x50dafe-0x15f;const _0x2bd427=a37_0x2bd4();let _0x316b57=_0x2bd427[_0x50dafe];return _0x316b57;}(function(_0x3c8e30,_0x3cd2a0){const _0xf3ae25=a37_0x316b,_0x2507e6=_0x3c8e30();while(!![]){try{const _0x1e9a17=-parseInt(_0xf3ae25(0x16e))/0x1*(-parseInt(_0xf3ae25(0x179))/0x2)+parseInt(_0xf3ae25(0x17e))/0x3*(-parseInt(_0xf3ae25(0x173))/0x4)+-parseInt(_0xf3ae25(0x170))/0x5+-parseInt(_0xf3ae25(0x16c))/0x6*(parseInt(_0xf3ae25(0x167))/0x7)+-parseInt(_0xf3ae25(0x17a))/0x8+-parseInt(_0xf3ae25(0x17f))/0x9*(parseInt(_0xf3ae25(0x176))/0xa)+-parseInt(_0xf3ae25(0x163))/0xb*(-parseInt(_0xf3ae25(0x168))/0xc);if(_0x1e9a17===_0x3cd2a0)break;else _0x2507e6['push'](_0x2507e6['shift']());}catch(_0x156ad9){_0x2507e6['push'](_0x2507e6['shift']());}}}(a37_0x2bd4,0xaad52));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const datasetList={'service':a37_0x3b325d(0x161),'command':a37_0x3b325d(0x166),'description':a37_0x3b325d(0x171),'risk':a37_0x3b325d(0x17d),'flags':[{'name':'name','type':a37_0x3b325d(0x165),'description':'Filter\x20datasets\x20by\x20name\x20(server-side\x20fuzzy\x20match)'},CODE_FLAG_OPTIONAL,{'name':a37_0x3b325d(0x164),'type':a37_0x3b325d(0x16d),'description':'Return\x20full\x20dataset\x20objects\x20including\x20columns,\x20operations\x20and\x20relations'}],async 'execute'(_0x2199ed){const _0x23308a=a37_0x3b325d,_0x230e59=_0x2199ed['str'](_0x23308a(0x17c)),_0x4a4809=_0x2199ed[_0x23308a(0x162)](_0x23308a(0x177)),_0x75e64b=_0x2199ed[_0x23308a(0x16a)](_0x23308a(0x164)),_0x5bec1e=await listDatasets(_0x2199ed[_0x23308a(0x175)],{..._0x230e59&&{'name':_0x230e59},..._0x4a4809&&{'code':_0x4a4809}}),_0xc36b9d=_0x75e64b?_0x5bec1e:_0x5bec1e[_0x23308a(0x16b)](_0xf67a7f=>{const _0x45f818=_0x23308a,_0x235528=_0xf67a7f['dbtableConfig']??{};return{'id':_0xf67a7f['id'],'name':_0xf67a7f[_0x45f818(0x17c)],'code':_0xf67a7f['code'],'description':_0xf67a7f['description'],'source':_0xf67a7f[_0x45f818(0x16f)],'db':_0x235528['dbName'],'table':_0x235528[_0x45f818(0x172)],'datasetKey':_0x235528['datasetKey'],'pk':_0x235528['pkField'],'fields':_0x235528[_0x45f818(0x160)]?_0x235528[_0x45f818(0x160)][_0x45f818(0x15f)](',')['map'](_0x82358a=>_0x82358a[_0x45f818(0x178)]()):[]};});return{'ok':!![],'data':{'total':_0xc36b9d[_0x23308a(0x169)],'datasets':_0xc36b9d},'message':_0x23308a(0x17b)+_0xc36b9d[_0x23308a(0x169)]+_0x23308a(0x174)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x43a2cf=a38_0x5b10;(function(_0x1c9862,_0x412413){const _0x5161cf=a38_0x5b10,_0x1b2e93=_0x1c9862();while(!![]){try{const _0x1d9c60=-parseInt(_0x5161cf(0x1d4))/0x1*(parseInt(_0x5161cf(0x1c8))/0x2)+parseInt(_0x5161cf(0x1bf))/0x3*(-parseInt(_0x5161cf(0x1c9))/0x4)+parseInt(_0x5161cf(0x1bc))/0x5*(-parseInt(_0x5161cf(0x1be))/0x6)+parseInt(_0x5161cf(0x1d7))/0x7+parseInt(_0x5161cf(0x1ce))/0x8+parseInt(_0x5161cf(0x1d5))/0x9*(parseInt(_0x5161cf(0x1d0))/0xa)+-parseInt(_0x5161cf(0x1cb))/0xb;if(_0x1d9c60===_0x412413)break;else _0x1b2e93['push'](_0x1b2e93['shift']());}catch(_0x14adf6){_0x1b2e93['push'](_0x1b2e93['shift']());}}}(a38_0x5b4f,0x760a7));function a38_0x5b10(_0x53d99a,_0x1d995d){_0x53d99a=_0x53d99a-0x1bc;const _0x5b4f23=a38_0x5b4f();let _0x5b101c=_0x5b4f23[_0x53d99a];return _0x5b101c;}function a38_0x5b4f(){const _0x48d977=['string','map','operation','3388hwskMh','4UoYShn','operations','6795525cBKXht','alias','Operation\x20name\x20to\x20get\x20full\x20detail\x20(e.g.\x20filter,\x20getOne,\x20create)','4924008RKQAlM','Return\x20full\x20operation\x20objects\x20including\x20requestFields\x20and\x20responseFields','10MerivQ','Get\x20operations\x20for\x20a\x20dataset,\x20optionally\x20with\x20full\x20detail\x20for\x20one\x20operation','name','bool','131gLtLKM','5911533rkQwRV','length','4840864YUGchP','displayName','265LrNCGl','enabled','72366doveTJ','4419EtHiSZ','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','dataset','method','type','str'];a38_0x5b4f=function(){return _0x48d977;};return a38_0x5b4f();}import{getDatasetOperations,getOperationDetail}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const datasetOperations={'service':a38_0x43a2cf(0x1c1),'command':a38_0x43a2cf(0x1ca),'description':a38_0x43a2cf(0x1d1),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a38_0x43a2cf(0x1cc),'type':a38_0x43a2cf(0x1c5),'description':a38_0x43a2cf(0x1c0)},{'name':a38_0x43a2cf(0x1c7),'type':a38_0x43a2cf(0x1c5),'description':a38_0x43a2cf(0x1cd)},{'name':'verbose','type':'boolean','description':a38_0x43a2cf(0x1cf)}],async 'execute'(_0x5ce257){const _0x2c7f11=a38_0x43a2cf,_0x3ca62d=_0x5ce257[_0x2c7f11(0x1c4)]('code'),_0x49fb94=_0x5ce257[_0x2c7f11(0x1c4)](_0x2c7f11(0x1c7)),_0x577b8c=_0x5ce257[_0x2c7f11(0x1d3)]('verbose');if(_0x49fb94){const {dataset:_0x75b662,operation:_0x15cf9f}=await getOperationDetail(_0x5ce257['appCode'],_0x3ca62d,_0x49fb94);return{'ok':!![],'data':{'dataset':_0x75b662,'operation':_0x15cf9f}};}const {dataset:_0x2e4d32,operations:_0xf862c8}=await getDatasetOperations(_0x3ca62d);return{'ok':!![],'data':{'dataset':_0x2e4d32,'total':_0xf862c8[_0x2c7f11(0x1d6)],'operations':_0x577b8c?_0xf862c8:_0xf862c8[_0x2c7f11(0x1c6)](_0x4782fb=>({'name':_0x4782fb[_0x2c7f11(0x1d2)],'displayName':_0x4782fb[_0x2c7f11(0x1d8)],'type':_0x4782fb[_0x2c7f11(0x1c3)],'method':_0x4782fb[_0x2c7f11(0x1c2)],'enabled':_0x4782fb[_0x2c7f11(0x1bd)]}))}};}};
|