@lovrabet/rabetbase-cli 2.1.13 → 2.1.14-beta.0
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 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.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/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.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/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- 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/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.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/dataset/rename.js +1 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.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/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.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/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.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-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.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/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.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/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a144_0x20b352=a144_0x4492;(function(_0x5e5e1b,_0x2a3fe9){const _0x5742ed=a144_0x4492,_0x5914b0=_0x5e5e1b();while(!![]){try{const _0x38e413=-parseInt(_0x5742ed(0xab))/0x1*(-parseInt(_0x5742ed(0xc2))/0x2)+-parseInt(_0x5742ed(0xb0))/0x3+-parseInt(_0x5742ed(0xa2))/0x4*(-parseInt(_0x5742ed(0xb7))/0x5)+parseInt(_0x5742ed(0xa7))/0x6+-parseInt(_0x5742ed(0xb4))/0x7*(parseInt(_0x5742ed(0x9f))/0x8)+parseInt(_0x5742ed(0xa8))/0x9+parseInt(_0x5742ed(0xa4))/0xa*(-parseInt(_0x5742ed(0xa3))/0xb);if(_0x38e413===_0x2a3fe9)break;else _0x5914b0['push'](_0x5914b0['shift']());}catch(_0xbefadb){_0x5914b0['push'](_0x5914b0['shift']());}}}(a144_0x5b6c,0x2b259));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';function a144_0x5b6c(){const _0x6b94bc=['set','all','6tImfPS','beforeScriptId','name','after','operationType','HOOK','1176jLqhsf','F_OK','ENOENT','539996Gtifbr','6079381sOgGKP','10ljmsVI','functionNode','split','1919472clFfXA','2583576WanOlW','get','.js','77513PHlqoS','isDirectory','HOOK/','endsWith','code','398418WZMWTt','afterScriptId','functionName','isFile','5348OTTWsb','push','ENDPOINT','5YhJgio','scriptType','trim','map','alias','scriptsRootDir','COMMON','replace','datasetCode'];a144_0x5b6c=function(){return _0x6b94bc;};return a144_0x5b6c();}import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';function a144_0x4492(_0x13d46a,_0x81a8e1){_0x13d46a=_0x13d46a-0x9e;const _0x5b6c7b=a144_0x5b6c();let _0x4492f7=_0x5b6c7b[_0x13d46a];return _0x4492f7;}export const SUPPORTED_BFF_TYPES=[a144_0x20b352(0xbd),a144_0x20b352(0xb6),'HOOK'];export function normalizeBffType(_0x48742c){const _0x4289f7=a144_0x20b352;if(!_0x48742c)return undefined;const _0x215ed8=_0x48742c[_0x4289f7(0xb9)]()['toUpperCase']();return SUPPORTED_BFF_TYPES['includes'](_0x215ed8)?_0x215ed8:undefined;}async function scanJsFilesRecursively(_0x7e218a,_0x13c9e1){const _0x41e10b=a144_0x20b352,_0x4d9315=[];try{const _0xa14025=await readdir(_0x7e218a,{'withFileTypes':!![]});for(const _0x459855 of _0xa14025){const _0x45a695=join(_0x7e218a,_0x459855[_0x41e10b(0xc4)]);if(_0x459855['isDirectory']())_0x4d9315[_0x41e10b(0xb5)](...await scanJsFilesRecursively(_0x45a695,_0x13c9e1+'/'+_0x459855[_0x41e10b(0xc4)]));else _0x459855[_0x41e10b(0xb3)]()&&_0x459855[_0x41e10b(0xc4)][_0x41e10b(0xae)](_0x41e10b(0xaa))&&_0x4d9315[_0x41e10b(0xb5)]({'lockKey':_0x13c9e1+'/'+_0x459855[_0x41e10b(0xc4)]['replace'](/\.js$/,''),'filePath':_0x45a695});}}catch(_0x4bf53c){if(_0x4bf53c[_0x41e10b(0xaf)]!==_0x41e10b(0xa1))throw _0x4bf53c;}return _0x4d9315;}async function scanFlatFunctions(_0x575a40,_0x13a85a){const _0x4a85f0=a144_0x20b352,_0x3cae78=join(_0x575a40[_0x4a85f0(0xbc)],_0x13a85a),_0x2be348=await scanJsFilesRecursively(_0x3cae78,_0x13a85a);return _0x2be348[_0x4a85f0(0xba)](({lockKey:_0x503fee,filePath:_0x1fd635})=>({'type':_0x13a85a,'name':_0x503fee[_0x4a85f0(0xa6)]('/')['at'](-0x1)??'','filePath':_0x1fd635,'lockKey':_0x503fee}));}async function scanHookFunctions(_0x3c7acd){const _0x246c14=a144_0x20b352,_0x52816d=join(_0x3c7acd[_0x246c14(0xbc)],_0x246c14(0x9e)),_0x546c31=[];try{const _0x21e04b=await readdir(_0x52816d,{'withFileTypes':!![]});for(const _0x224053 of _0x21e04b){if(!_0x224053[_0x246c14(0xac)]())continue;const _0x2730b8=_0x224053[_0x246c14(0xc4)],_0x31cc5f=join(_0x52816d,_0x2730b8),_0x5e4dc1=await readdir(_0x31cc5f,{'withFileTypes':!![]});for(const _0x477996 of _0x5e4dc1){if(!_0x477996[_0x246c14(0xac)]())continue;const _0x493af6=_0x477996['name'],_0x106a6b=join(_0x31cc5f,_0x493af6),_0x3fae8a=await readdir(_0x106a6b,{'withFileTypes':!![]});for(const _0x2cb94b of _0x3fae8a){if(!_0x2cb94b[_0x246c14(0xac)]())continue;const _0x24ae7c=_0x2cb94b[_0x246c14(0xc4)],_0x3d577a=join(_0x106a6b,_0x24ae7c),_0x35c164=await readdir(_0x3d577a,{'withFileTypes':!![]});for(const _0x47c34b of _0x35c164){if(!_0x47c34b[_0x246c14(0xb3)]()||!_0x47c34b[_0x246c14(0xc4)][_0x246c14(0xae)]('.js'))continue;const _0x5c2683=_0x47c34b['name'][_0x246c14(0xbe)](/\.js$/,'');_0x546c31[_0x246c14(0xb5)]({'type':'HOOK','name':_0x5c2683,'filePath':join(_0x3d577a,_0x47c34b[_0x246c14(0xc4)]),'lockKey':'HOOK/'+_0x2730b8+'/'+_0x493af6+'/'+_0x24ae7c+'/'+_0x5c2683,'alias':_0x2730b8,'operationType':_0x493af6,'functionNode':_0x24ae7c});}}}}}catch(_0x4d76c4){if(_0x4d76c4[_0x246c14(0xaf)]!=='ENOENT')throw _0x4d76c4;}return _0x546c31;}export async function scanLocalBffFunctions(_0x98e320,_0x349aa9){const _0x8b7811=a144_0x20b352;if(_0x349aa9===_0x8b7811(0xbd)||_0x349aa9==='ENDPOINT')return scanFlatFunctions(_0x98e320,_0x349aa9);if(_0x349aa9===_0x8b7811(0x9e))return scanHookFunctions(_0x98e320);const [_0x3dbaa7,_0x9d2ec2,_0x4d69fe]=await Promise[_0x8b7811(0xc1)]([scanFlatFunctions(_0x98e320,_0x8b7811(0xbd)),scanFlatFunctions(_0x98e320,_0x8b7811(0xb6)),scanHookFunctions(_0x98e320)]);return[..._0x3dbaa7,..._0x9d2ec2,..._0x4d69fe];}export function resolveLocalFilePathFromLockKey(_0x5c13de,_0x54a37d){const _0x5bfd6f=a144_0x20b352;return join(_0x5c13de[_0x5bfd6f(0xbc)],..._0x54a37d[_0x5bfd6f(0xa6)]('/'))+_0x5bfd6f(0xaa);}export function createHookLocationMap(_0x214397){const _0x16bc88=a144_0x20b352,_0x1bafff=new Map();for(const _0x54fb36 of _0x214397){_0x54fb36['beforeScriptId']&&_0x1bafff['set'](_0x54fb36[_0x16bc88(0xc3)],{'datasetCode':_0x54fb36[_0x16bc88(0xbf)],'operationType':snakeToCamel(_0x54fb36['operationType']),'functionNode':'before'}),_0x54fb36[_0x16bc88(0xb1)]&&_0x1bafff[_0x16bc88(0xc0)](_0x54fb36[_0x16bc88(0xb1)],{'datasetCode':_0x54fb36[_0x16bc88(0xbf)],'operationType':snakeToCamel(_0x54fb36[_0x16bc88(0xc6)]),'functionNode':_0x16bc88(0xc5)});}return _0x1bafff;}export function resolveRemoteScriptTarget(_0x248577,_0x3846da,_0x2e1e1c,_0x1f0254,_0x30bf82){const _0x441f88=a144_0x20b352,_0x295672=normalizeBffType(_0x3846da[_0x441f88(0xb8)]);if(!_0x295672||!_0x3846da[_0x441f88(0xb2)])return null;if(_0x295672==='HOOK'){const _0x5c19d8=(_0x3846da['id']?_0x2e1e1c[_0x441f88(0xa9)](_0x3846da['id']):undefined)??findHookLocationByRemoteId(_0x1f0254,_0x3846da['id']);if(!_0x5c19d8)return null;const _0x39a6fe=_0x5c19d8[_0x441f88(0xbb)]||_0x30bf82[_0x441f88(0xa9)](_0x5c19d8[_0x441f88(0xbf)]),_0x4e21de=_0x39a6fe??_0x5c19d8[_0x441f88(0xbf)],_0x1b1ccd={..._0x5c19d8,'alias':_0x39a6fe},_0x736e4b=_0x441f88(0xad)+_0x4e21de+'/'+_0x1b1ccd[_0x441f88(0xc6)]+'/'+_0x1b1ccd[_0x441f88(0xa5)]+'/'+_0x3846da['functionName'];return{'lockKey':_0x736e4b,'filePath':resolveLocalFilePathFromLockKey(_0x248577,_0x736e4b),'type':_0x441f88(0x9e),'hookLocation':_0x1b1ccd};}const _0x6c8c38=_0x295672+'/'+_0x3846da[_0x441f88(0xb2)];return{'lockKey':_0x6c8c38,'filePath':resolveLocalFilePathFromLockKey(_0x248577,_0x6c8c38),'type':_0x295672};}export async function ensureParentDirectory(_0x1a5348){await mkdir(dirname(_0x1a5348),{'recursive':!![]});}export async function fileExists(_0x1fc933){const _0x197d6b=a144_0x20b352;try{return await access(_0x1fc933,constants[_0x197d6b(0xa0)]),!![];}catch{return![];}}export async function directoryExists(_0x2d6250){try{const _0x4cd28c=await stat(_0x2d6250);return _0x4cd28c['isDirectory']();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c5744,_0x9e7ddd){const _0x2ef127=a145_0x4834,_0x21c372=_0x1c5744();while(!![]){try{const _0x186690=parseInt(_0x2ef127(0x1f6))/0x1*(parseInt(_0x2ef127(0x1f0))/0x2)+parseInt(_0x2ef127(0x1ea))/0x3+parseInt(_0x2ef127(0x1f3))/0x4+parseInt(_0x2ef127(0x1ee))/0x5+parseInt(_0x2ef127(0x1eb))/0x6+-parseInt(_0x2ef127(0x1f1))/0x7*(-parseInt(_0x2ef127(0x1f4))/0x8)+-parseInt(_0x2ef127(0x1f2))/0x9;if(_0x186690===_0x9e7ddd)break;else _0x21c372['push'](_0x21c372['shift']());}catch(_0xbd3488){_0x21c372['push'](_0x21c372['shift']());}}}(a145_0x13ec,0x7466f));function a145_0x13ec(){const _0x466a4b=['24806061CCAWjJ','2509036KkHSnI','15896YWJOwE','digest','21202aaUvYy','2072913NKOLKw','2028438fCgjwJ','md5','createHash','268410hjRUUw','update','88CgOqGo','2079rIcPzR'];a145_0x13ec=function(){return _0x466a4b;};return a145_0x13ec();}import{readFile}from'node:fs/promises';import a145_0x11d052 from'node:crypto';export function computeContentHash(_0x2d9abd){const _0x492c7c=a145_0x4834;return a145_0x11d052[_0x492c7c(0x1ed)](_0x492c7c(0x1ec))[_0x492c7c(0x1ef)](_0x2d9abd)[_0x492c7c(0x1f5)]('hex');}function a145_0x4834(_0x47f756,_0x16b70b){_0x47f756=_0x47f756-0x1ea;const _0x13ecae=a145_0x13ec();let _0x483494=_0x13ecae[_0x47f756];return _0x483494;}export async function computeFileHash(_0x183662){const _0x271557=await readFile(_0x183662,'utf8');return computeContentHash(_0x271557);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a8f1f,_0x507e71){const _0xc3ddff=a146_0x5523,_0x5598da=_0x3a8f1f();while(!![]){try{const _0x1e7583=parseInt(_0xc3ddff(0xbc))/0x1*(-parseInt(_0xc3ddff(0xad))/0x2)+parseInt(_0xc3ddff(0xb5))/0x3*(parseInt(_0xc3ddff(0xb1))/0x4)+parseInt(_0xc3ddff(0xbe))/0x5+parseInt(_0xc3ddff(0xc0))/0x6*(parseInt(_0xc3ddff(0xb0))/0x7)+-parseInt(_0xc3ddff(0xb3))/0x8+parseInt(_0xc3ddff(0xc2))/0x9*(parseInt(_0xc3ddff(0xba))/0xa)+-parseInt(_0xc3ddff(0xb2))/0xb;if(_0x1e7583===_0x507e71)break;else _0x5598da['push'](_0x5598da['shift']());}catch(_0x18a1a0){_0x5598da['push'](_0x5598da['shift']());}}}(a146_0x3c49,0xbb5da));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a146_0x5523(_0x2b5ee0,_0xcf6c83){_0x2b5ee0=_0x2b5ee0-0xab;const _0x3c49ea=a146_0x3c49();let _0x552350=_0x3c49ea[_0x2b5ee0];return _0x552350;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x45143f,_0x31a8aa,_0x1c51f0,_0x1c00a2){const _0x1e471b=a146_0x5523,_0x5385d2={'apps':_0x45143f[_0x1e471b(0xb6)]&&typeof _0x45143f[_0x1e471b(0xb6)]===_0x1e471b(0xae)?_0x45143f[_0x1e471b(0xb6)]:{}};let _0x329b87=_0x5385d2['apps'][_0x31a8aa];if(!_0x329b87)return _0x329b87={'scriptsRoot':_0x1c51f0,'lastSync':'','functions':{}},_0x5385d2[_0x1e471b(0xb6)][_0x31a8aa]=_0x329b87,{'lockData':_0x5385d2,'appLock':_0x329b87};if(!_0x329b87['scriptsRoot'])_0x329b87[_0x1e471b(0xbd)]=_0x1c51f0;else{if(_0x329b87[_0x1e471b(0xbd)]!==_0x1c51f0)throw new Error(_0x1c00a2+_0x1e471b(0xaf)+('current\x20\x22'+_0x1c51f0+_0x1e471b(0xbb)+_0x329b87[_0x1e471b(0xbd)]+_0x1e471b(0xbf))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x329b87[_0x1e471b(0xb8)]&&(_0x329b87[_0x1e471b(0xb8)]={}),!_0x329b87[_0x1e471b(0xac)]&&(_0x329b87[_0x1e471b(0xac)]=''),{'lockData':_0x5385d2,'appLock':_0x329b87};}export async function readBffLockFile(_0x550b74){const _0x28be8e=a146_0x5523;try{const _0x37d11e=await readFile(_0x550b74,_0x28be8e(0xb7)),_0x348581=JSON[_0x28be8e(0xb9)](_0x37d11e);return{'apps':_0x348581['apps']&&typeof _0x348581[_0x28be8e(0xb6)]==='object'?_0x348581[_0x28be8e(0xb6)]:{}};}catch(_0x1da3ac){if(_0x1da3ac[_0x28be8e(0xb4)]===_0x28be8e(0xab))return null;throw new Error(_0x28be8e(0xc1)+String(_0x1da3ac));}}function a146_0x3c49(){const _0x5ede5b=['functions','parse','10ZpXtDz','\x22\x20vs\x20lock\x20\x22','15fXjAGM','scriptsRoot','7667045xCMULU','\x22.\x20','910254FAmUUR','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','13667067HryQta','ENOENT','lastSync','201352SvbKlO','object',':\x20scriptsRoot\x20mismatch\x20—\x20','7PnPNDH','5813476WwuqhJ','21738761bllzgI','3225672WmDMiZ','code','3sdIEhF','apps','utf8'];a146_0x3c49=function(){return _0x5ede5b;};return a146_0x3c49();}export async function writeBffLockFile(_0x2816c5,_0x4b107d){const _0xa40a70=a146_0x5523;await mkdir(dirname(_0x2816c5),{'recursive':!![]}),await writeFile(_0x2816c5,JSON['stringify'](_0x4b107d,null,0x2),_0xa40a70(0xb7));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x160503,_0x8b6e0){const _0x112a8a=a148_0x5ee0,_0x9bf3b2=_0x160503();while(!![]){try{const _0x53cc19=parseInt(_0x112a8a(0x1b4))/0x1*(parseInt(_0x112a8a(0x19e))/0x2)+-parseInt(_0x112a8a(0x1ac))/0x3*(parseInt(_0x112a8a(0x1ae))/0x4)+-parseInt(_0x112a8a(0x1b1))/0x5*(parseInt(_0x112a8a(0x1a5))/0x6)+parseInt(_0x112a8a(0x1a0))/0x7+-parseInt(_0x112a8a(0x19f))/0x8*(parseInt(_0x112a8a(0x1a1))/0x9)+-parseInt(_0x112a8a(0x1ab))/0xa*(-parseInt(_0x112a8a(0x1a9))/0xb)+parseInt(_0x112a8a(0x1a4))/0xc;if(_0x53cc19===_0x8b6e0)break;else _0x9bf3b2['push'](_0x9bf3b2['shift']());}catch(_0x51a65e){_0x9bf3b2['push'](_0x9bf3b2['shift']());}}}(a148_0x2f09,0x30c19));export function snakeToCamel(_0x14a335){const _0x439aa6=a148_0x5ee0;return _0x14a335[_0x439aa6(0x1a6)]()['replace'](/_([a-z])/g,(_0x54a4c5,_0x2840ab)=>_0x2840ab[_0x439aa6(0x1a7)]());}export function findHookLocationByRemoteId(_0x2fa636,_0x3db550){const _0x277e8b=a148_0x5ee0;if(!_0x3db550)return undefined;for(const _0x45afa2 of Object[_0x277e8b(0x1b0)](_0x2fa636)){if(_0x45afa2[_0x277e8b(0x1aa)]===_0x3db550&&_0x45afa2[_0x277e8b(0x1b2)]&&_0x45afa2[_0x277e8b(0x1af)]&&_0x45afa2[_0x277e8b(0x1a2)])return{'datasetCode':_0x45afa2['datasetCode'],'operationType':_0x45afa2['operationType'],'functionNode':_0x45afa2['functionNode']};}return undefined;}export function extractScriptDescription(_0x394e9f){const _0x60677b=a148_0x5ee0,_0x5dcce5=_0x394e9f[_0x60677b(0x1a8)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x5dcce5?.[0x1]?.[_0x60677b(0x19d)]()||undefined;}function a148_0x5ee0(_0xcfc3c8,_0x2020e4){_0xcfc3c8=_0xcfc3c8-0x19d;const _0x2f098b=a148_0x2f09();let _0x5ee069=_0x2f098b[_0xcfc3c8];return _0x5ee069;}export function isValidBffFunctionName(_0x3b163f){const _0x3868c0=a148_0x5ee0;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x3868c0(0x1ad)](_0x3b163f);}export function normalizeHookFunctionNode(_0x24be83){const _0x4e9bd5=a148_0x5ee0;if(!_0x24be83)return undefined;const _0x267eaa=_0x24be83['trim']()[_0x4e9bd5(0x1a6)]();if(_0x267eaa===_0x4e9bd5(0x1a3)||_0x267eaa===_0x4e9bd5(0x1b3))return _0x267eaa;return undefined;}function a148_0x2f09(){const _0x56f0ae=['74ZAwsyo','968SDMTga','392476idVzKQ','26856NEhjNx','functionNode','before','3784968cOZvUV','618sPFAAp','toLowerCase','toUpperCase','match','11iUfpJS','remoteId','5970vEOqqy','3IUFnqx','test','37068rgHBOF','operationType','values','4930MymXyJ','datasetCode','after','8095ulkqXy','trim'];a148_0x2f09=function(){return _0x56f0ae;};return a148_0x2f09();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x246b4f,_0x4f9a5f){const _0x15c2be=a149_0x5cd7,_0x2d6d7f=_0x246b4f();while(!![]){try{const _0x236ebb=-parseInt(_0x15c2be(0x117))/0x1+parseInt(_0x15c2be(0x119))/0x2*(-parseInt(_0x15c2be(0x11f))/0x3)+parseInt(_0x15c2be(0x120))/0x4+-parseInt(_0x15c2be(0x11d))/0x5+parseInt(_0x15c2be(0x121))/0x6+-parseInt(_0x15c2be(0x132))/0x7*(parseInt(_0x15c2be(0x116))/0x8)+parseInt(_0x15c2be(0x12b))/0x9*(parseInt(_0x15c2be(0x131))/0xa);if(_0x236ebb===_0x4f9a5f)break;else _0x2d6d7f['push'](_0x2d6d7f['shift']());}catch(_0x2dc0a4){_0x2d6d7f['push'](_0x2d6d7f['shift']());}}}(a149_0x4274,0xbb9ce));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x8c4cf4){const _0x43aba8=a149_0x5cd7;if(cache[_0x43aba8(0x125)](_0x8c4cf4))return cache[_0x43aba8(0x115)](_0x8c4cf4);const _0x546704=await listDatasets(_0x8c4cf4),_0x15f473=new Map();for(const _0x477164 of _0x546704){const _0x193261=_0x477164[_0x43aba8(0x12d)];_0x193261?.[_0x43aba8(0x12a)]!=null&&_0x15f473[_0x43aba8(0x122)](_0x193261['dbId'],_0x193261[_0x43aba8(0x133)]??'db-'+_0x193261[_0x43aba8(0x12a)]);}const _0x4a1a91=[..._0x15f473[_0x43aba8(0x11c)]()][_0x43aba8(0x12e)](([_0x5136db,_0x1059be])=>({'dbId':_0x5136db,'dbName':_0x1059be}));return cache[_0x43aba8(0x122)](_0x8c4cf4,_0x4a1a91),_0x4a1a91;}export async function resolveDb(_0x4560d1,_0x234a80){const _0x5c106a=a149_0x5cd7,_0x8fd670=await listDatabases(_0x4560d1);if(_0x8fd670['length']===0x0)return{'resolved':[],'error':_0x5c106a(0x127)+_0x4560d1+_0x5c106a(0x129)};if(!_0x234a80)return{'resolved':_0x8fd670};const _0x4f1991=Number(_0x234a80);if(!Number[_0x5c106a(0x124)](_0x4f1991)){const _0x19e47f=_0x8fd670[_0x5c106a(0x126)](_0x3a8957=>_0x3a8957['dbId']===_0x4f1991);if(_0x19e47f)return{'resolved':[_0x19e47f]};}const _0x5e38ab=_0x234a80[_0x5c106a(0x118)](),_0x4d928d=_0x8fd670[_0x5c106a(0x11a)](_0x585564=>_0x585564['dbName'][_0x5c106a(0x118)]()[_0x5c106a(0x11b)](_0x5e38ab));if(_0x4d928d[_0x5c106a(0x12f)]>0x0)return{'resolved':_0x4d928d};const _0x5a79ec=_0x8fd670[_0x5c106a(0x12e)](_0x3828e7=>_0x3828e7[_0x5c106a(0x133)]+'\x20('+_0x3828e7[_0x5c106a(0x12a)]+')')[_0x5c106a(0x130)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x234a80+_0x5c106a(0x12c)+_0x4560d1+_0x5c106a(0x123)+_0x5a79ec+'.\x20If\x20this\x20db\x20belongs\x20to\x20another\x20app,\x20rerun\x20with\x20--appcode\x20<appCode>.'};}function a149_0x4274(){const _0x335a8a=['\x22\x20matches\x20multiple\x20databases:\x20','17772fIaFpK','1431752pppPHL','7598346wFnJeA','set','\x22.\x20Available:\x20','isNaN','has','find','No\x20linked\x20databases\x20found\x20under\x20app\x20\x22','.\x20Be\x20more\x20specific.','\x22.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','dbId','140463qgLDCK','\x22\x20under\x20app\x20\x22','dbtableConfig','map','length','join','1370fLZOSi','819FFzERj','dbName','get','82568vTThaR','1511169acFIjO','toLowerCase','10VbFltl','filter','includes','entries','1228400htXIyR'];a149_0x4274=function(){return _0x335a8a;};return a149_0x4274();}function a149_0x5cd7(_0x16ece1,_0x18c211){_0x16ece1=_0x16ece1-0x115;const _0x4274ad=a149_0x4274();let _0x5cd7dd=_0x4274ad[_0x16ece1];return _0x5cd7dd;}export async function resolveOneDb(_0x1317c5,_0x435ab7){const _0x5e164a=a149_0x5cd7,{resolved:_0x28a739,error:_0xd1c50}=await resolveDb(_0x1317c5,_0x435ab7);if(_0xd1c50)return{'db':null,'error':_0xd1c50};if(_0x28a739[_0x5e164a(0x12f)]===0x1)return{'db':_0x28a739[0x0]};if(!_0x435ab7){const _0x535de1=_0x28a739[_0x5e164a(0x12e)](_0x38b220=>_0x38b220['dbName']+'\x20('+_0x38b220[_0x5e164a(0x12a)]+')')[_0x5e164a(0x130)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x535de1};}const _0x403e3b=_0x28a739[_0x5e164a(0x12e)](_0x347eeb=>_0x347eeb[_0x5e164a(0x133)]+'\x20('+_0x347eeb[_0x5e164a(0x12a)]+')')[_0x5e164a(0x130)](',\x20');return{'db':null,'error':'\x22'+_0x435ab7+_0x5e164a(0x11e)+_0x403e3b+_0x5e164a(0x128)};}export async function getDbName(_0x27db79,_0x1aacbf){const _0x421747=a149_0x5cd7,_0x2e4a1e=await listDatabases(_0x27db79);return _0x2e4a1e[_0x421747(0x126)](_0x22bd1c=>_0x22bd1c[_0x421747(0x12a)]===_0x1aacbf)?.['dbName'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a150_0x2fdca4=a150_0x5789;(function(_0x1df6ec,_0x82c48f){const _0x30041e=a150_0x5789,_0x5b5047=_0x1df6ec();while(!![]){try{const _0x3b8e1e=-parseInt(_0x30041e(0x191))/0x1+-parseInt(_0x30041e(0x194))/0x2*(-parseInt(_0x30041e(0x186))/0x3)+-parseInt(_0x30041e(0x187))/0x4*(parseInt(_0x30041e(0x188))/0x5)+parseInt(_0x30041e(0x195))/0x6+parseInt(_0x30041e(0x192))/0x7*(parseInt(_0x30041e(0x189))/0x8)+parseInt(_0x30041e(0x18a))/0x9+-parseInt(_0x30041e(0x190))/0xa*(parseInt(_0x30041e(0x18d))/0xb);if(_0x3b8e1e===_0x82c48f)break;else _0x5b5047['push'](_0x5b5047['shift']());}catch(_0x9067c5){_0x5b5047['push'](_0x5b5047['shift']());}}}(a150_0x49a7,0x7bce6));import{constants}from'node:fs';import{access,mkdir}from'node:fs/promises';import{dirname,join,resolve}from'node:path';export function loadPageProjectConfig(_0x1f68ea,_0x17e626=process[a150_0x2fdca4(0x18e)]()){const _0x51c5e6=a150_0x2fdca4,_0x3888fe=resolve(_0x17e626),_0x4c2bfe=join(_0x3888fe,'.rabetbase',_0x51c5e6(0x18c));return{'projectRoot':_0x3888fe,'pagesBaseDir':_0x4c2bfe,'appPagesDir':join(_0x4c2bfe,_0x1f68ea),'lockFilePath':join(_0x3888fe,_0x51c5e6(0x196),'page.lock.json')};}export function buildPageFileName(_0xdd7a6e,_0x398161){const _0x357933=a150_0x2fdca4;return _0xdd7a6e+'-'+String(_0x398161)[_0x357933(0x193)]()+_0x357933(0x18f);}function a150_0x5789(_0x27d89e,_0x331f13){_0x27d89e=_0x27d89e-0x186;const _0x49a78a=a150_0x49a7();let _0x578984=_0x49a78a[_0x27d89e];return _0x578984;}export function resolvePageFilePath(_0x20f4ef,_0x5e0dc4,_0x558a17){const _0x558eba=a150_0x2fdca4;return join(_0x20f4ef[_0x558eba(0x18b)],buildPageFileName(_0x5e0dc4,_0x558a17));}export async function ensureParentDirectory(_0x445cc6){await mkdir(dirname(_0x445cc6),{'recursive':!![]});}export async function fileExists(_0x235630){try{return await access(_0x235630,constants['F_OK']),!![];}catch{return![];}}function a150_0x49a7(){const _0x2a371d=['page','6719273AQDYKm','cwd','.json','10nhBDcU','945808BHyyQQ','291340iPpYap','toUpperCase','98198WMgTHg','5511882DzDRKr','.rabetbase','39qnyMZt','932276xgCcaA','10SXGWKj','56lNJEYB','6134625AQeAre','appPagesDir'];a150_0x49a7=function(){return _0x2a371d;};return a150_0x49a7();}
|
package/lib/core/page/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x57798a,_0x235672){const _0x32b91a=a151_0x1dfe,_0x422ce7=_0x57798a();while(!![]){try{const _0x4c2da3=parseInt(_0x32b91a(0x1f9))/0x1+parseInt(_0x32b91a(0x1f1))/0x2+parseInt(_0x32b91a(0x1f3))/0x3*(parseInt(_0x32b91a(0x1f2))/0x4)+-parseInt(_0x32b91a(0x1f4))/0x5*(-parseInt(_0x32b91a(0x1f7))/0x6)+-parseInt(_0x32b91a(0x1fc))/0x7+-parseInt(_0x32b91a(0x1ee))/0x8+parseInt(_0x32b91a(0x1f8))/0x9*(-parseInt(_0x32b91a(0x1fd))/0xa);if(_0x4c2da3===_0x235672)break;else _0x422ce7['push'](_0x422ce7['shift']());}catch(_0x32e5c9){_0x422ce7['push'](_0x422ce7['shift']());}}}(a151_0x1a2e,0xdb629));import a151_0x1e47cf from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x2003ac){const _0x5e2ebb=a151_0x1dfe;return JSON[_0x5e2ebb(0x1fe)](JSON[_0x5e2ebb(0x1f0)](_0x2003ac),null,0x2)+'\x0a';}export function computePageContentHash(_0x1d5078){const _0x458290=a151_0x1dfe;return a151_0x1e47cf[_0x458290(0x1ef)](_0x458290(0x1fa))[_0x458290(0x1f6)](_0x1d5078)[_0x458290(0x1ed)](_0x458290(0x1fb));}export function computeSerializedSchemaHash(_0x1c0e36){return computePageContentHash(serializePageSchemaForFile(_0x1c0e36));}export async function computePageFileHash(_0x11f423){const _0x1d9448=a151_0x1dfe,_0x26685b=await readFile(_0x11f423,_0x1d9448(0x1f5));return computePageContentHash(_0x26685b);}function a151_0x1dfe(_0x1855c9,_0xe5ea97){_0x1855c9=_0x1855c9-0x1ed;const _0x1a2e07=a151_0x1a2e();let _0x1dfec9=_0x1a2e07[_0x1855c9];return _0x1dfec9;}function a151_0x1a2e(){const _0x1e88d1=['createHash','parse','2504278uvXEqY','32824IHqcjI','237BqjxdG','5248540CFnjCt','utf8','update','6paTAtF','9KhHTop','182357OioyzE','md5','hex','5990684CCVHfN','10411610vZVccL','stringify','digest','2695232gKCldt'];a151_0x1a2e=function(){return _0x1e88d1;};return a151_0x1a2e();}
|
package/lib/core/page/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x583bea,_0x4604d7){const _0x269fb9=a152_0x5ace,_0x334d27=_0x583bea();while(!![]){try{const _0x5be97b=-parseInt(_0x269fb9(0x1b1))/0x1*(parseInt(_0x269fb9(0x1b3))/0x2)+-parseInt(_0x269fb9(0x1b4))/0x3*(-parseInt(_0x269fb9(0x1a3))/0x4)+-parseInt(_0x269fb9(0x1ad))/0x5+-parseInt(_0x269fb9(0x1ae))/0x6+parseInt(_0x269fb9(0x1b5))/0x7*(-parseInt(_0x269fb9(0x1a6))/0x8)+-parseInt(_0x269fb9(0x1ab))/0x9+parseInt(_0x269fb9(0x1a7))/0xa;if(_0x5be97b===_0x4604d7)break;else _0x334d27['push'](_0x334d27['shift']());}catch(_0xdf7b02){_0x334d27['push'](_0x334d27['shift']());}}}(a152_0x19f5,0x71aca));function a152_0x5ace(_0x300ed5,_0x18b3fb){_0x300ed5=_0x300ed5-0x1a3;const _0x19f5fa=a152_0x19f5();let _0x5ace92=_0x19f5fa[_0x300ed5];return _0x5ace92;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}function a152_0x19f5(){const _0x55dc43=['23918750mVWSgf','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','object','code','6857388JaODug','pages','2567430enERon','1478310DmuYkH','stringify','utf8','9NBRFxa','lastSync','172118lULQHe','12VkeLep','333557hCPKEF','417720VopCfp','apps','parse','8cdJxDR'];a152_0x19f5=function(){return _0x55dc43;};return a152_0x19f5();}export function ensurePageLockScope(_0x5566f0,_0x460959){const _0x374349=a152_0x5ace,_0x4d4635={'apps':_0x5566f0[_0x374349(0x1a4)]&&typeof _0x5566f0[_0x374349(0x1a4)]===_0x374349(0x1a9)?_0x5566f0['apps']:{}};let _0x94187d=_0x4d4635[_0x374349(0x1a4)][_0x460959];if(!_0x94187d)return _0x94187d={'lastSync':'','pages':{}},_0x4d4635[_0x374349(0x1a4)][_0x460959]=_0x94187d,{'lockData':_0x4d4635,'appLock':_0x94187d};return!_0x94187d[_0x374349(0x1b2)]&&(_0x94187d[_0x374349(0x1b2)]=''),(!_0x94187d[_0x374349(0x1ac)]||typeof _0x94187d[_0x374349(0x1ac)]!=='object')&&(_0x94187d[_0x374349(0x1ac)]={}),{'lockData':_0x4d4635,'appLock':_0x94187d};}export async function readPageLockFile(_0x32a6a5){const _0x29c58e=a152_0x5ace;try{const _0x156b8e=await readFile(_0x32a6a5,_0x29c58e(0x1b0)),_0xf0f344=JSON[_0x29c58e(0x1a5)](_0x156b8e);return{'apps':_0xf0f344[_0x29c58e(0x1a4)]&&typeof _0xf0f344[_0x29c58e(0x1a4)]===_0x29c58e(0x1a9)?_0xf0f344['apps']:{}};}catch(_0x52e9bc){if(_0x52e9bc[_0x29c58e(0x1aa)]==='ENOENT')return null;throw new Error(_0x29c58e(0x1a8)+String(_0x52e9bc));}}export async function writePageLockFile(_0x3c6129,_0x300804){const _0x210ff3=a152_0x5ace;await mkdir(dirname(_0x3c6129),{'recursive':!![]}),await writeFile(_0x3c6129,JSON[_0x210ff3(0x1af)](_0x300804,null,0x2),_0x210ff3(0x1b0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a154_0xf4c859=a154_0x4574;(function(_0x335429,_0x707a3c){const _0x516752=a154_0x4574,_0x8babf9=_0x335429();while(!![]){try{const _0x59a031=parseInt(_0x516752(0x18c))/0x1+-parseInt(_0x516752(0x18a))/0x2*(-parseInt(_0x516752(0x186))/0x3)+-parseInt(_0x516752(0x187))/0x4*(parseInt(_0x516752(0x185))/0x5)+parseInt(_0x516752(0x18e))/0x6+parseInt(_0x516752(0x182))/0x7*(parseInt(_0x516752(0x184))/0x8)+-parseInt(_0x516752(0x181))/0x9+-parseInt(_0x516752(0x188))/0xa*(-parseInt(_0x516752(0x183))/0xb);if(_0x59a031===_0x707a3c)break;else _0x8babf9['push'](_0x8babf9['shift']());}catch(_0x5f147d){_0x8babf9['push'](_0x8babf9['shift']());}}}(a154_0x209b,0x5448a));function a154_0x209b(){const _0x929501=['/sql','2lhbaXA','sql.lock.json','583620clKzCW','.rabetbase','1710042DqKKOz','4140927FdYwLT','931uaoYLm','22088TExwlq','7496WUsQMG','2762390reVgLq','690069KfGLIF','4TCWUkz','670vhGvUD'];a154_0x209b=function(){return _0x929501;};return a154_0x209b();}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a154_0xf4c859(0x18d),LOCK_FILE_NAME=a154_0xf4c859(0x18b),TRASH_DIR_NAME='sql-trash';function a154_0x4574(_0x206789,_0x225ccd){_0x206789=_0x206789-0x181;const _0x209bd5=a154_0x209b();let _0x4574ca=_0x209bd5[_0x206789];return _0x4574ca;}export function loadSqlProjectConfig(_0x42e425,_0x2915c7){const _0x37cdfa=a154_0xf4c859,_0x453785=resolve(_0x2915c7??findProjectRootDirectory()),_0x5a74a5=DOT_DIR+_0x37cdfa(0x189),_0x5bb96c=_0x5a74a5+'/'+_0x42e425;return{'projectRoot':_0x453785,'appCode':_0x42e425,'sqlWorkspaceRoot':_0x5a74a5,'sqlRoot':_0x5bb96c,'sqlRootDir':resolve(_0x453785,DOT_DIR,'sql',_0x42e425),'lockFilePath':resolve(_0x453785,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x453785,DOT_DIR,TRASH_DIR_NAME)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1554bc,_0x304e06){const _0x182382=a155_0x3b41,_0x219bb6=_0x1554bc();while(!![]){try{const _0x13506c=-parseInt(_0x182382(0x17f))/0x1+-parseInt(_0x182382(0x177))/0x2*(parseInt(_0x182382(0x17e))/0x3)+-parseInt(_0x182382(0x175))/0x4*(-parseInt(_0x182382(0x181))/0x5)+parseInt(_0x182382(0x185))/0x6*(parseInt(_0x182382(0x176))/0x7)+parseInt(_0x182382(0x16d))/0x8*(-parseInt(_0x182382(0x16e))/0x9)+parseInt(_0x182382(0x17c))/0xa+-parseInt(_0x182382(0x186))/0xb*(parseInt(_0x182382(0x16f))/0xc);if(_0x13506c===_0x304e06)break;else _0x219bb6['push'](_0x219bb6['shift']());}catch(_0x3798c3){_0x219bb6['push'](_0x219bb6['shift']());}}}(a155_0xb081,0xb347f));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';function a155_0xb081(){const _0x4ea37b=['6YlxgEN','length','filter','.sql','dbName','5750230SnkaQN','ENOENT','562014QcXXTP','109552JGkLyF','sqlCode','25Thogfx','split','.xml','dbId','12gDbxlW','22gxpEYy','code','slice','name','isDirectory','sqlRootDir','isFile','544664QDfJXL','99GSVEoY','4646220CpvYyv','mybatisXml','sql','toLowerCase','sqlName','mode','1122916uqriTv','3326806CMugtb'];a155_0xb081=function(){return _0x4ea37b;};return a155_0xb081();}import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x2e2c02){const _0x2b3140=a155_0x3b41;if(_0x2e2c02===_0x2b3140(0x17a))return _0x2b3140(0x171);if(_0x2e2c02===_0x2b3140(0x183))return _0x2b3140(0x170);return undefined;}async function scanSqlFilesRecursively(_0x321e71,_0x49bbb9){const _0x2447ba=a155_0x3b41,_0x1ccb1b=[];try{const _0x167cf8=await readdir(_0x321e71,{'withFileTypes':!![]});for(const _0x2f344a of _0x167cf8){const _0x3c34d3=join(_0x321e71,_0x2f344a[_0x2447ba(0x189)]);if(_0x2f344a[_0x2447ba(0x18a)]()){_0x1ccb1b['push'](...await scanSqlFilesRecursively(_0x3c34d3,_0x49bbb9));continue;}if(!_0x2f344a[_0x2447ba(0x16c)]())continue;const _0x5ae166=extname(_0x2f344a[_0x2447ba(0x189)])[_0x2447ba(0x172)](),_0x3fd02b=extensionToMode(_0x5ae166);if(!_0x3fd02b)continue;const _0x786cb4=relative(_0x49bbb9,_0x3c34d3)['replace'](/\\/g,'/'),_0x6121e4=_0x786cb4[_0x2447ba(0x182)]('/')[_0x2447ba(0x179)](Boolean),_0x72f966=parseSqlPath(_0x6121e4,_0x2f344a['name'],_0x5ae166);if(!_0x72f966)continue;_0x1ccb1b['push']({'sqlCode':_0x72f966[_0x2447ba(0x180)],'sqlName':_0x72f966[_0x2447ba(0x173)],'dbDirectory':_0x6121e4[0x0],'filePath':_0x3c34d3,'relativePath':_0x786cb4,'lockKey':_0x72f966[_0x2447ba(0x180)],'mode':_0x3fd02b});}}catch(_0x1b9812){if(_0x1b9812[_0x2447ba(0x187)]!==_0x2447ba(0x17d))throw _0x1b9812;}return _0x1ccb1b;}export async function scanLocalSqlQueries(_0x5243f2){const _0x115285=a155_0x3b41;return scanSqlFilesRecursively(_0x5243f2[_0x115285(0x18b)],_0x5243f2[_0x115285(0x18b)]);}function a155_0x3b41(_0xef6533,_0x554479){_0xef6533=_0xef6533-0x16c;const _0xb081d6=a155_0xb081();let _0x3b41fd=_0xb081d6[_0xef6533];return _0x3b41fd;}export function resolveLocalSqlFilePath(_0x2794a8,_0x146dd6,_0x465f0c){const _0x25a379=a155_0x3b41,_0x391eea=_0x465f0c?.['path']||(_0x465f0c?.['sqlName']||_0x465f0c?.[_0x25a379(0x17b)]?buildSqlRelativePath(_0x146dd6,_0x465f0c?.[_0x25a379(0x173)],_0x465f0c?.[_0x25a379(0x17b)],_0x465f0c?.[_0x25a379(0x174)]||'sql',_0x465f0c?.[_0x25a379(0x184)]):buildDefaultSqlFileName(_0x146dd6,_0x465f0c?.['mode']||_0x25a379(0x171)));return join(_0x2794a8[_0x25a379(0x18b)],_0x391eea);}export async function directoryExists(_0x50eedb){try{const _0xa56f92=await stat(_0x50eedb);return _0xa56f92['isDirectory']();}catch{return![];}}function parseSqlPath(_0x335138,_0x1e930b,_0x1713f5){const _0x2d0736=a155_0x3b41,_0x2bb6d4=_0x1e930b[_0x2d0736(0x188)](0x0,-_0x1713f5['length']);if(_0x335138[_0x2d0736(0x178)]<0x2)return null;const _0x2b38b3=_0x2bb6d4['indexOf']('_');if(_0x2b38b3<=0x0||_0x2b38b3>=_0x2bb6d4[_0x2d0736(0x178)]-0x1)return null;const _0x156900=_0x2bb6d4[_0x2d0736(0x188)](0x0,_0x2b38b3);if(!isLikelySqlCode(_0x156900))return null;return{'sqlCode':_0x156900,'sqlName':_0x2bb6d4[_0x2d0736(0x188)](_0x2b38b3+0x1)};}function isLikelySqlCode(_0x2f25e9){return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/['test'](_0x2f25e9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf431eb,_0x31b36c){const _0x51ef63=a156_0x2b39,_0x41c9fa=_0xf431eb();while(!![]){try{const _0x7c2e36=parseInt(_0x51ef63(0xa0))/0x1*(-parseInt(_0x51ef63(0x9f))/0x2)+parseInt(_0x51ef63(0x98))/0x3+parseInt(_0x51ef63(0x9e))/0x4+parseInt(_0x51ef63(0x96))/0x5+parseInt(_0x51ef63(0x9b))/0x6+parseInt(_0x51ef63(0x99))/0x7*(-parseInt(_0x51ef63(0x9a))/0x8)+-parseInt(_0x51ef63(0x9c))/0x9;if(_0x7c2e36===_0x31b36c)break;else _0x41c9fa['push'](_0x41c9fa['shift']());}catch(_0x836183){_0x41c9fa['push'](_0x41c9fa['shift']());}}}(a156_0x3fbf,0xd6140));import{readFile}from'node:fs/promises';import a156_0x3a2e9a from'node:crypto';function a156_0x2b39(_0x39e3f4,_0x179501){_0x39e3f4=_0x39e3f4-0x94;const _0x3fbfcc=a156_0x3fbf();let _0x2b3942=_0x3fbfcc[_0x39e3f4];return _0x2b3942;}function a156_0x3fbf(){const _0x1923a3=['createHash','4503189uBodlN','3031sdsbkj','19424gFoKqD','2656692lURyof','8736291RxlIyn','update','1960248NLydXk','34lByHWC','46015pfdJGF','digest','hex','6236175xzODYj'];a156_0x3fbf=function(){return _0x1923a3;};return a156_0x3fbf();}export function computeSqlContentHash(_0x3021cb){const _0x28f710=a156_0x2b39;return a156_0x3a2e9a[_0x28f710(0x97)]('md5')[_0x28f710(0x9d)](_0x3021cb)[_0x28f710(0x94)](_0x28f710(0x95));}export async function computeSqlFileHash(_0x2cdde1){const _0x55b330=await readFile(_0x2cdde1,'utf8');return computeSqlContentHash(_0x55b330);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x537536,_0x4e014e){const _0x1d721b=a157_0x276e,_0x2f6e03=_0x537536();while(!![]){try{const _0x4c3de8=parseInt(_0x1d721b(0xff))/0x1*(parseInt(_0x1d721b(0x109))/0x2)+-parseInt(_0x1d721b(0xfb))/0x3+parseInt(_0x1d721b(0x101))/0x4*(parseInt(_0x1d721b(0x10a))/0x5)+-parseInt(_0x1d721b(0x104))/0x6+-parseInt(_0x1d721b(0x108))/0x7+-parseInt(_0x1d721b(0xfc))/0x8+parseInt(_0x1d721b(0x10b))/0x9;if(_0x4c3de8===_0x4e014e)break;else _0x2f6e03['push'](_0x2f6e03['shift']());}catch(_0x36194d){_0x2f6e03['push'](_0x2f6e03['shift']());}}}(a157_0x548e,0x957a8));function a157_0x276e(_0x558124,_0x5e9119){_0x558124=_0x558124-0xf9;const _0x548eb8=a157_0x548e();let _0x276e07=_0x548eb8[_0x558124];return _0x276e07;}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a157_0x548e(){const _0x4eafb4=['7013856gDkMvX','code','lastSync','\x22.\x20','5247032isEbFh','2qunwpM','3318755DcfMJB','29751012etnuqV','parse','sqlRoot','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','sqls','2549355Tupqid','6104432HdPyWP','stringify','apps','174236noweEf','utf8','4DgutuX','\x22\x20vs\x20lock\x20\x22','ENOENT'];a157_0x548e=function(){return _0x4eafb4;};return a157_0x548e();}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x369d4b,_0x2e7c64,_0x103f6a,_0xb950ea){const _0x30d5a9=a157_0x276e,_0x34deb8=_0x369d4b??createEmptySqlLock();let _0x2f52af=_0x34deb8[_0x30d5a9(0xfe)][_0x2e7c64];if(!_0x2f52af)return _0x2f52af={'sqlRoot':_0x103f6a,'lastSync':'','sqls':{}},_0x34deb8['apps'][_0x2e7c64]=_0x2f52af,{'lockData':_0x34deb8,'appLock':_0x2f52af};if(!_0x2f52af[_0x30d5a9(0x10d)])_0x2f52af[_0x30d5a9(0x10d)]=_0x103f6a;else{if(_0x2f52af[_0x30d5a9(0x10d)]!==_0x103f6a)throw new Error(_0xb950ea+':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'+_0x103f6a+_0x30d5a9(0x102)+_0x2f52af['sqlRoot']+_0x30d5a9(0x107)+_0x30d5a9(0xf9));}return!_0x2f52af[_0x30d5a9(0xfa)]&&(_0x2f52af['sqls']={}),!_0x2f52af[_0x30d5a9(0x106)]&&(_0x2f52af[_0x30d5a9(0x106)]=''),{'lockData':_0x34deb8,'appLock':_0x2f52af};}export async function readSqlLockFile(_0x489cad){const _0x22809a=a157_0x276e;try{const _0x5f47c8=await readFile(_0x489cad,_0x22809a(0x100));return JSON[_0x22809a(0x10c)](_0x5f47c8);}catch(_0x136bef){if(_0x136bef[_0x22809a(0x105)]===_0x22809a(0x103))return null;throw new Error('Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'+String(_0x136bef));}}export async function writeSqlLockFile(_0x3d8271,_0x2e991e){const _0x2d7663=a157_0x276e;await mkdir(dirname(_0x3d8271),{'recursive':!![]}),await writeFile(_0x3d8271,JSON[_0x2d7663(0xfd)](_0x2e991e,null,0x2),_0x2d7663(0x100));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x57bddc,_0xf92508){const _0x41e50d=a159_0x2dca,_0x356234=_0x57bddc();while(!![]){try{const _0x41b4e3=-parseInt(_0x41e50d(0x1e1))/0x1*(parseInt(_0x41e50d(0x1dc))/0x2)+-parseInt(_0x41e50d(0x1e4))/0x3+-parseInt(_0x41e50d(0x1de))/0x4*(parseInt(_0x41e50d(0x1dd))/0x5)+-parseInt(_0x41e50d(0x1eb))/0x6*(-parseInt(_0x41e50d(0x1e0))/0x7)+-parseInt(_0x41e50d(0x1da))/0x8*(-parseInt(_0x41e50d(0x1ee))/0x9)+parseInt(_0x41e50d(0x1e8))/0xa*(parseInt(_0x41e50d(0x1e5))/0xb)+parseInt(_0x41e50d(0x1e2))/0xc;if(_0x41b4e3===_0xf92508)break;else _0x356234['push'](_0x356234['shift']());}catch(_0x5527ac){_0x356234['push'](_0x356234['shift']());}}}(a159_0x10f0,0x3584b));export function detectSqlMode(_0x45927c){const _0x276c47=a159_0x2dca,_0x173240=_0x45927c[_0x276c47(0x1e6)]();if(/^<(select|insert|update|delete)\b/i[_0x276c47(0x1e9)](_0x173240))return _0x276c47(0x1d9);return _0x276c47(0x1ed);}function a159_0x2dca(_0x4a4c27,_0x5b920b){_0x4a4c27=_0x4a4c27-0x1d9;const _0x10f0c4=a159_0x10f0();let _0x2dca15=_0x10f0c4[_0x4a4c27];return _0x2dca15;}export function getSqlFileExtension(_0x544246){const _0x43e0d2=a159_0x2dca;return _0x544246===_0x43e0d2(0x1d9)?_0x43e0d2(0x1ec):'.sql';}function a159_0x10f0(){const _0x50527b=['12CmGHWz','30CaTeAk','205308WneILx','trim','1148NoMDxK','31517TIBmYs','2384472wnSmVC','db-','266247PwytNa','2805LbEjaU','trimStart','replace','3650KqQKgf','test','unknown-db','5190yhxnEC','.xml','sql','9wQhLKE','mybatisXml','2971064ryFtys','unknown-sql'];a159_0x10f0=function(){return _0x50527b;};return a159_0x10f0();}export function buildDefaultSqlFileName(_0x1dd610,_0x589d54){return''+_0x1dd610+getSqlFileExtension(_0x589d54);}export function sanitizeSqlPathSegment(_0x1c925a,_0x3f70e9){const _0x195194=a159_0x2dca,_0x5438a9=String(_0x1c925a??'')[_0x195194(0x1df)](),_0x3f84a4=_0x5438a9['replace'](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x195194(0x1e7)](/\s+/g,'-')[_0x195194(0x1e7)](/-+/g,'-')[_0x195194(0x1e7)](/^\.+/,'')[_0x195194(0x1e7)](/\.+$/,'')['replace'](/^-+/,'')[_0x195194(0x1e7)](/-+$/,'');return _0x3f84a4||_0x3f70e9;}export function buildDbDirectoryName(_0x4e6669,_0x39c789){const _0x4cfb92=a159_0x2dca;return sanitizeSqlPathSegment(_0x4e6669,_0x39c789!=null?_0x4cfb92(0x1e3)+_0x39c789:_0x4cfb92(0x1ea));}export function buildSqlRelativePath(_0x784124,_0x5758c1,_0x2eaddf,_0x198123,_0x59aebd){const _0x15a887=a159_0x2dca,_0x37c163=buildDbDirectoryName(_0x2eaddf,_0x59aebd),_0xb46cf3=sanitizeSqlPathSegment(_0x784124,_0x15a887(0x1db)),_0x211d23=sanitizeSqlPathSegment(_0x5758c1,_0xb46cf3);return _0x37c163+'/'+_0xb46cf3+'_'+_0x211d23+getSqlFileExtension(_0x198123);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a160_0x406d(_0x5cb2ec,_0x52e44f){_0x5cb2ec=_0x5cb2ec-0x153;const _0x3245b5=a160_0x3245();let _0x406dee=_0x3245b5[_0x5cb2ec];return _0x406dee;}function a160_0x3245(){const _0x485298=['11zmxrhF','join','type','UPDATE','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','INSERT','DDL','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','188DNGaGj','1784snIOZJ','match','push','67911PhiwYG','startsWith','877970jVVASc','11212DmxjVD','reason','length','6820RSnmvR','test','9218376FmIQDp','262xoizux','matchAll','WITH','split','trim','DELETE','4994743CyRPOs','includes','SQL\x20content\x20is\x20empty','unknown\x20table(s)','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','\x20query\x20targeting\x20','6666znVnsk','84FMJMir','from','toUpperCase','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','SELECT','52150STEOXd','replace','UNKNOWN'];a160_0x3245=function(){return _0x485298;};return a160_0x3245();}(function(_0x837f98,_0x2fff12){const _0x59e68b=a160_0x406d,_0x43f6b2=_0x837f98();while(!![]){try{const _0x58c865=parseInt(_0x59e68b(0x16a))/0x1*(-parseInt(_0x59e68b(0x170))/0x2)+-parseInt(_0x59e68b(0x167))/0x3*(parseInt(_0x59e68b(0x163))/0x4)+-parseInt(_0x59e68b(0x16d))/0x5*(-parseInt(_0x59e68b(0x17c))/0x6)+parseInt(_0x59e68b(0x158))/0x7*(-parseInt(_0x59e68b(0x164))/0x8)+parseInt(_0x59e68b(0x16f))/0x9+-parseInt(_0x59e68b(0x169))/0xa*(parseInt(_0x59e68b(0x15b))/0xb)+-parseInt(_0x59e68b(0x153))/0xc*(-parseInt(_0x59e68b(0x176))/0xd);if(_0x58c865===_0x2fff12)break;else _0x43f6b2['push'](_0x43f6b2['shift']());}catch(_0x302a28){_0x43f6b2['push'](_0x43f6b2['shift']());}}}(a160_0x3245,0xe7457));export function detectSqlType(_0x42a424){const _0x97e51f=a160_0x406d;if(!_0x42a424?.[_0x97e51f(0x174)]())return{'type':_0x97e51f(0x15a),'isSelectOnly':![],'isDangerous':![],'reason':_0x97e51f(0x178)};const _0xbcae8b=_0x42a424[_0x97e51f(0x159)](/#\{[^}]*\}/g,'?')[_0x97e51f(0x159)](/\$\{[^}]*\}/g,'?')[_0x97e51f(0x159)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x97e51f(0x159)](/\/\*[\s\S]*?\*\//g,'')[_0x97e51f(0x174)](),_0xde3a27=_0xbcae8b[_0x97e51f(0x173)]('\x0a');let _0x48cce5='';for(const _0x340bb1 of _0xde3a27){const _0x162134=_0x340bb1[_0x97e51f(0x174)]();if(!_0x162134||_0x162134[_0x97e51f(0x168)]('--')||_0x162134[_0x97e51f(0x168)]('/*'))continue;_0x48cce5=_0x162134;break;}const _0x7e410d=_0x48cce5[_0x97e51f(0x155)]();if(_0x7e410d[_0x97e51f(0x168)](_0x97e51f(0x157))||_0x7e410d['startsWith'](_0x97e51f(0x172))){const _0x2644d0=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x97e51f(0x16e)](_0xbcae8b);return{'type':_0x97e51f(0x157),'isSelectOnly':!_0x2644d0,'isDangerous':_0x2644d0,'reason':_0x2644d0?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x7e410d[_0x97e51f(0x168)](_0x97e51f(0x160)))return{'type':_0x97e51f(0x160),'isSelectOnly':![],'isDangerous':![]};if(_0x7e410d[_0x97e51f(0x168)](_0x97e51f(0x15e)))return{'type':_0x97e51f(0x15e),'isSelectOnly':![],'isDangerous':![]};if(_0x7e410d[_0x97e51f(0x168)](_0x97e51f(0x175)))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x97e51f(0x17a)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i['test'](_0x7e410d))return{'type':_0x97e51f(0x161),'isSelectOnly':![],'isDangerous':!![],'reason':_0x97e51f(0x156)};return{'type':_0x97e51f(0x15a),'isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x2f1ede){const _0x3443ae=a160_0x406d,_0x3878f2=_0x2f1ede[_0x3443ae(0x159)](/#\{[^}]*\}/g,'?')[_0x3443ae(0x159)](/\$\{[^}]*\}/g,'?')[_0x3443ae(0x159)](/'[^']*'/g,'\x27\x27')[_0x3443ae(0x159)](/--.*$/gm,'')[_0x3443ae(0x159)](/\/\*[\s\S]*?\*\//g,''),_0xfb0669=[],_0x5b4583=_0x3878f2['match'](/FROM\s+([^\s,)(]+)/i);if(_0x5b4583?.[0x1])_0xfb0669['push'](_0x5b4583[0x1][_0x3443ae(0x159)](/[`"]/g,''));for(const _0x54fcc2 of _0x3878f2[_0x3443ae(0x171)](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x5b1cb0=_0x54fcc2[0x1]?.[_0x3443ae(0x159)](/[`"]/g,'');if(_0x5b1cb0&&!_0xfb0669[_0x3443ae(0x177)](_0x5b1cb0))_0xfb0669[_0x3443ae(0x166)](_0x5b1cb0);}const _0x59af4e=_0x3878f2[_0x3443ae(0x165)](/INTO\s+([^\s(]+)/i);if(_0x59af4e?.[0x1]){const _0x5d7270=_0x59af4e[0x1][_0x3443ae(0x159)](/[`"]/g,'');if(!_0xfb0669[_0x3443ae(0x177)](_0x5d7270))_0xfb0669[_0x3443ae(0x166)](_0x5d7270);}const _0x503805=_0x3878f2[_0x3443ae(0x165)](/UPDATE\s+([^\s,)(]+)/i);if(_0x503805?.[0x1]){const _0x245f82=_0x503805[0x1][_0x3443ae(0x159)](/[`"]/g,'');if(!_0xfb0669[_0x3443ae(0x177)](_0x245f82))_0xfb0669[_0x3443ae(0x166)](_0x245f82);}return _0xfb0669;}function extractParameters(_0x83cd0c){const _0x125ebe=a160_0x406d,_0x444504=new Set();for(const _0x109db9 of _0x83cd0c['matchAll'](/#\{(\w+)\}/g))if(_0x109db9[0x1])_0x444504['add'](_0x109db9[0x1]);for(const _0x2a3eed of _0x83cd0c[_0x125ebe(0x171)](/\$\{(\w+)\}/g))if(_0x2a3eed[0x1])_0x444504['add'](_0x2a3eed[0x1]);return Array[_0x125ebe(0x154)](_0x444504);}export function validateSql(_0xc3a098){const _0x23bd6d=a160_0x406d,_0x7f0e0f=detectSqlType(_0xc3a098),_0x47eed=extractTables(_0xc3a098),_0x35545b=extractParameters(_0xc3a098);if(_0x7f0e0f['isDangerous'])return{'valid':![],'sqlType':_0x7f0e0f,'tables':_0x47eed,'parameters':_0x35545b,'message':_0x7f0e0f[_0x23bd6d(0x16b)]||_0x7f0e0f['type']+_0x23bd6d(0x15f)};if(_0x7f0e0f['type']===_0x23bd6d(0x15a))return{'valid':![],'sqlType':_0x7f0e0f,'tables':_0x47eed,'parameters':_0x35545b,'message':_0x23bd6d(0x162)};return{'valid':!![],'sqlType':_0x7f0e0f,'tables':_0x47eed,'parameters':_0x35545b,'message':_0x7f0e0f[_0x23bd6d(0x15d)]+_0x23bd6d(0x17b)+(_0x47eed[_0x23bd6d(0x16c)]?_0x47eed[_0x23bd6d(0x15c)](',\x20'):_0x23bd6d(0x179))+(_0x35545b[_0x23bd6d(0x16c)]?'\x20with\x20parameters:\x20'+_0x35545b[_0x23bd6d(0x15c)](',\x20'):'')};}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a161_0x5ad514=a161_0x375e;(function(_0x521e56,_0x12ecbd){const _0x26e3b0=a161_0x375e,_0x54985f=_0x521e56();while(!![]){try{const _0x324966=-parseInt(_0x26e3b0(0x93))/0x1+-parseInt(_0x26e3b0(0x92))/0x2+-parseInt(_0x26e3b0(0x94))/0x3+-parseInt(_0x26e3b0(0x98))/0x4+-parseInt(_0x26e3b0(0x9c))/0x5*(parseInt(_0x26e3b0(0x96))/0x6)+parseInt(_0x26e3b0(0x9b))/0x7*(-parseInt(_0x26e3b0(0x9a))/0x8)+parseInt(_0x26e3b0(0x97))/0x9*(parseInt(_0x26e3b0(0x99))/0xa);if(_0x324966===_0x12ecbd)break;else _0x54985f['push'](_0x54985f['shift']());}catch(_0x570a22){_0x54985f['push'](_0x54985f['shift']());}}}(a161_0xc283,0x198bd));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';function a161_0xc283(){const _0x17f30a=['5575670wibrDf','136OzGfJn','14469KBHzuB','45485bVbomx','Set\x20appcode\x20via\x20`','join','\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.','\x0a\x20\x20\x20\x20\x20\x20\x20','298870ZDqMlq','59902aSblYk','108078yCJLhL','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','54wPFIlH','9nFMoRe','362220qgWzeB'];a161_0xc283=function(){return _0x17f30a;};return a161_0xc283();}function a161_0x375e(_0x428350,_0x565aaa){_0x428350=_0x428350-0x8f;const _0xc283ca=a161_0xc283();let _0x375eb3=_0xc283ca[_0x428350];return _0x375eb3;}export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Run\x20`'+CLI_BIN_NAME+'\x20auth`\x20to\x20login\x20first.','configMissingHint':[a161_0x5ad514(0x9d)+CLI_BIN_NAME+a161_0x5ad514(0x95),'Tip:\x20`'+CLI_BIN_NAME+a161_0x5ad514(0x90)][a161_0x5ad514(0x8f)](a161_0x5ad514(0x91)),'notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a162_0x3da8(){var _0x220afc=['502221rHhlEA','117IbdQPq','188629hkjWgE','1408129yvarAY','1362590SfZBXI','3204060LSnTqI','72QagQwJ','2lhPJnb','2448868TkfHGB','231735eEZRoQ'];a162_0x3da8=function(){return _0x220afc;};return a162_0x3da8();}(function(_0x6ed9da,_0x3ce581){var _0x60c513=a162_0x57ec,_0x5a3429=_0x6ed9da();while(!![]){try{var _0x1b7891=parseInt(_0x60c513(0x73))/0x1+parseInt(_0x60c513(0x77))/0x2*(parseInt(_0x60c513(0x7a))/0x3)+parseInt(_0x60c513(0x78))/0x4+parseInt(_0x60c513(0x79))/0x5+parseInt(_0x60c513(0x75))/0x6+parseInt(_0x60c513(0x7c))/0x7*(-parseInt(_0x60c513(0x76))/0x8)+parseInt(_0x60c513(0x7b))/0x9*(-parseInt(_0x60c513(0x74))/0xa);if(_0x1b7891===_0x3ce581)break;else _0x5a3429['push'](_0x5a3429['shift']());}catch(_0x1ccfae){_0x5a3429['push'](_0x5a3429['shift']());}}}(a162_0x3da8,0xb822c));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a162_0x57ec(_0x53c6cd,_0x5664dc){_0x53c6cd=_0x53c6cd-0x73;var _0x3da8bc=a162_0x3da8();var _0x57ec07=_0x3da8bc[_0x53c6cd];return _0x57ec07;}import{buildAllFlags as a162_0x3e095d}from'@lovrabet/cli-framework';export function buildAllFlags(_0xd8b88){return a162_0x3e095d(_0xd8b88,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a163_0x42bc91=a163_0x59ea;(function(_0x2d5029,_0x3f779e){const _0xa87979=a163_0x59ea,_0x4ab4c0=_0x2d5029();while(!![]){try{const _0x266250=parseInt(_0xa87979(0x13d))/0x1+parseInt(_0xa87979(0x13e))/0x2*(parseInt(_0xa87979(0x137))/0x3)+parseInt(_0xa87979(0x139))/0x4*(-parseInt(_0xa87979(0x133))/0x5)+parseInt(_0xa87979(0x13b))/0x6+parseInt(_0xa87979(0x13c))/0x7+-parseInt(_0xa87979(0x135))/0x8*(parseInt(_0xa87979(0x13a))/0x9)+-parseInt(_0xa87979(0x134))/0xa;if(_0x266250===_0x3f779e)break;else _0x4ab4c0['push'](_0x4ab4c0['shift']());}catch(_0x4a8d2d){_0x4ab4c0['push'](_0x4ab4c0['shift']());}}}(a163_0x56f1,0x99012));import{createFlagHelpers}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a163_0x42bc91(0x138)];function a163_0x59ea(_0x1c8eb6,_0x443d5c){_0x1c8eb6=_0x1c8eb6-0x133;const _0x56f119=a163_0x56f1();let _0x59ea38=_0x56f119[_0x1c8eb6];return _0x59ea38;}function a163_0x56f1(){const _0x3c508c=['4792GXvWmU','validateFlags','3xRisoI','parseFlags','16urIGeP','17694qhoQum','5312772wOaGgH','6999321WKDPSs','923849cGieQO','2469026hwUSIc','21865NXswHo','22218950WAuSKC'];a163_0x56f1=function(){return _0x3c508c;};return a163_0x56f1();}export const validateFlags=helpers[a163_0x42bc91(0x136)];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a164_0xecdc34=a164_0x149c;(function(_0x1d3851,_0x3e9592){const _0x1909d7=a164_0x149c,_0x4f9985=_0x1d3851();while(!![]){try{const _0x356991=-parseInt(_0x1909d7(0x171))/0x1*(parseInt(_0x1909d7(0x16e))/0x2)+-parseInt(_0x1909d7(0x16a))/0x3*(-parseInt(_0x1909d7(0x16f))/0x4)+parseInt(_0x1909d7(0x172))/0x5*(-parseInt(_0x1909d7(0x175))/0x6)+-parseInt(_0x1909d7(0x170))/0x7+parseInt(_0x1909d7(0x176))/0x8+parseInt(_0x1909d7(0x174))/0x9+-parseInt(_0x1909d7(0x16d))/0xa;if(_0x356991===_0x3e9592)break;else _0x4f9985['push'](_0x4f9985['shift']());}catch(_0xd3c971){_0x4f9985['push'](_0x4f9985['shift']());}}}(a164_0x37ea,0x66149));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';const generators=createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':serviceRegistry,'getServiceEntry':getServiceEntry,'getServiceDefinitions':_0x14c547=>serviceGroups['get'](_0x14c547),'buildAllFlags':buildAllFlags,'appPrerequisiteText':'Requires\x20appcode\x20(set\x20via\x20`'+CLI_BIN_NAME+'\x20project\x20init`\x20or\x20--appcode).','serviceUsageSuffix':a164_0xecdc34(0x16c),'includeWildcardExtraInFullHelp':!![]});function a164_0x149c(_0x268653,_0x3d94fe){_0x268653=_0x268653-0x16a;const _0x37eadf=a164_0x37ea();let _0x149cdc=_0x37eadf[_0x268653];return _0x149cdc;}export function generateCommandHelp(_0x220020){return generators['generateCommandHelp'](_0x220020);}export const generateServiceHelp=generators[a164_0xecdc34(0x16b)];function a164_0x37ea(){const _0x664e4f=['27UDmRaa','generateServiceHelp','\x20[args]\x20[flags]','1246510fqPGyo','604426sQXedS','116540PBUJDF','1096347LbJkux','1HGUFUl','5cdIzCL','generateFullHelp','1594890siQBqP','1542138gYFhub','6553632IpqKEE'];a164_0x37ea=function(){return _0x664e4f;};return a164_0x37ea();}export const generateFullHelp=generators[a164_0xecdc34(0x173)];
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34d63e,_0x17cf60){var _0x2acba7=a165_0x23fd,_0xdefb0a=_0x34d63e();while(!![]){try{var _0x2731bf=parseInt(_0x2acba7(0xb9))/0x1*(parseInt(_0x2acba7(0xb8))/0x2)+parseInt(_0x2acba7(0xb2))/0x3*(-parseInt(_0x2acba7(0xb0))/0x4)+parseInt(_0x2acba7(0xba))/0x5*(-parseInt(_0x2acba7(0xb6))/0x6)+parseInt(_0x2acba7(0xb7))/0x7*(parseInt(_0x2acba7(0xb4))/0x8)+parseInt(_0x2acba7(0xb1))/0x9+-parseInt(_0x2acba7(0xb5))/0xa*(-parseInt(_0x2acba7(0xb3))/0xb)+-parseInt(_0x2acba7(0xbb))/0xc;if(_0x2731bf===_0x17cf60)break;else _0xdefb0a['push'](_0xdefb0a['shift']());}catch(_0x5121bc){_0xdefb0a['push'](_0xdefb0a['shift']());}}}(a165_0x4d6d,0x559fe));function a165_0x4d6d(){var _0x409bc8=['28700WeQxgf','5004477MsdJXD','30HYZBhb','1859FEWQfM','24LcWdmr','30830hqduPf','945132mXDCSW','1174425UkSglP','914830SdmtLZ','1bGYWvv','15RxqVCZ','13713432qkZaAS'];a165_0x4d6d=function(){return _0x409bc8;};return a165_0x4d6d();}export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';export{formatOutput}from'../framework/output.js';function a165_0x23fd(_0x2ddddd,_0x34ea94){_0x2ddddd=_0x2ddddd-0xb0;var _0x4d6da2=a165_0x4d6d();var _0x23fd78=_0x4d6da2[_0x2ddddd];return _0x23fd78;}export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{riskLevelOrder}from'../framework/types.js';
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fd8f1,_0x404540){const _0x15b8ee=a166_0x118a,_0x4851e7=_0x4fd8f1();while(!![]){try{const _0x364311=parseInt(_0x15b8ee(0x94))/0x1*(-parseInt(_0x15b8ee(0x8d))/0x2)+-parseInt(_0x15b8ee(0x91))/0x3+parseInt(_0x15b8ee(0x8e))/0x4*(parseInt(_0x15b8ee(0x90))/0x5)+parseInt(_0x15b8ee(0x8f))/0x6+parseInt(_0x15b8ee(0x93))/0x7+-parseInt(_0x15b8ee(0x92))/0x8+parseInt(_0x15b8ee(0x8c))/0x9;if(_0x364311===_0x404540)break;else _0x4851e7['push'](_0x4851e7['shift']());}catch(_0xdf74c0){_0x4851e7['push'](_0x4851e7['shift']());}}}(a166_0x2e57,0x27268));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a166_0x2e57(){const _0x40314c=['26231DTPvpi','2294307yECdet','22dneVgX','176516ZtrQwR','454956TNkgtg','35ENFeGS','705363EMuMDf','1943112eefrvf','2010813psqsLT'];a166_0x2e57=function(){return _0x40314c;};return a166_0x2e57();}function a166_0x118a(_0x4d6bf3,_0x429612){_0x4d6bf3=_0x4d6bf3-0x8c;const _0x2e57a0=a166_0x2e57();let _0x118a2a=_0x2e57a0[_0x4d6bf3];return _0x118a2a;}export const formatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a167_0x38de(){var _0x196d46=['2943702KgiJQC','276KvBhSV','3729936DPnIpm','56oqaziE','1203IALwDE','20595003adfyTg','114159MmuZjy','616TNHVwK','63735BVfJTQ','157490KZdAYj','10Qpoqcv'];a167_0x38de=function(){return _0x196d46;};return a167_0x38de();}(function(_0x47ae74,_0x487ead){var _0x4c8244=a167_0x1575,_0x94849b=_0x47ae74();while(!![]){try{var _0xe90680=parseInt(_0x4c8244(0x1ca))/0x1*(parseInt(_0x4c8244(0x1c7))/0x2)+-parseInt(_0x4c8244(0x1c1))/0x3*(parseInt(_0x4c8244(0x1c9))/0x4)+-parseInt(_0x4c8244(0x1c4))/0x5+-parseInt(_0x4c8244(0x1c8))/0x6+-parseInt(_0x4c8244(0x1c3))/0x7*(parseInt(_0x4c8244(0x1c2))/0x8)+parseInt(_0x4c8244(0x1c6))/0x9+parseInt(_0x4c8244(0x1c5))/0xa*(parseInt(_0x4c8244(0x1cb))/0xb);if(_0xe90680===_0x487ead)break;else _0x94849b['push'](_0x94849b['shift']());}catch(_0x5404f0){_0x94849b['push'](_0x94849b['shift']());}}}(a167_0x38de,0x74cb0));function a167_0x1575(_0x188b03,_0x3f2183){_0x188b03=_0x188b03-0x1c1;var _0x38ded6=a167_0x38de();var _0x1575f9=_0x38ded6[_0x188b03];return _0x1575f9;}export{extractList,extractPaging}from'@lovrabet/cli-framework';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a168_0x1aa3(_0x56241f,_0x24e604){_0x56241f=_0x56241f-0x11f;const _0x418dfe=a168_0x418d();let _0x1aa396=_0x418dfe[_0x56241f];return _0x1aa396;}(function(_0xf28121,_0x335e37){const _0x528f9e=a168_0x1aa3,_0x20a5ca=_0xf28121();while(!![]){try{const _0x443515=parseInt(_0x528f9e(0x131))/0x1*(parseInt(_0x528f9e(0x129))/0x2)+-parseInt(_0x528f9e(0x130))/0x3+parseInt(_0x528f9e(0x120))/0x4+parseInt(_0x528f9e(0x134))/0x5+-parseInt(_0x528f9e(0x12d))/0x6*(parseInt(_0x528f9e(0x124))/0x7)+parseInt(_0x528f9e(0x12b))/0x8+-parseInt(_0x528f9e(0x12a))/0x9;if(_0x443515===_0x335e37)break;else _0x20a5ca['push'](_0x20a5ca['shift']());}catch(_0x48dd43){_0x20a5ca['push'](_0x20a5ca['shift']());}}}(a168_0x418d,0xcf16c));import{CliErrors}from'../errors.js';import{resolveAlias,listAliases}from'../core/alias-resolver.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a168_0x418d(){const _0x507e78=['validation','.\x20Run\x20`','45423DXQeaW','flags','map','string','alias','18gxJkdu','20776023IMlOry','13571104hhLOKG','Available\x20aliases:\x20','1044HOhiOS','`\x20requires\x20either\x20--code\x20or\x20--alias.','code','3615996OVpcIy','183451RgXJxv','No\x20api.ts\x20found\x20in\x20','some','7155420wPAPpW','name','\x20api\x20pull`\x20first.','join','2850280QOUzqR','\x22.\x20'];a168_0x418d=function(){return _0x507e78;};return a168_0x418d();}export function resolveAliasToCode(_0xff816a,_0x134ae1,_0x1e417e,_0x2c247e){const _0x4c0cc9=a168_0x1aa3,_0x976259=_0xff816a['flags'][_0x4c0cc9(0x133)](_0x591755=>_0x591755['name']===_0x4c0cc9(0x12f)&&_0x591755['type']===_0x4c0cc9(0x127)),_0x16093a=_0xff816a[_0x4c0cc9(0x125)][_0x4c0cc9(0x133)](_0x3db604=>_0x3db604[_0x4c0cc9(0x135)]==='alias'&&_0x3db604['type']==='string');if(!_0x976259||!_0x16093a)return;const _0x23ccf3=_0x134ae1[_0x4c0cc9(0x12f)]?String(_0x134ae1[_0x4c0cc9(0x12f)]):'',_0x36c3e1=_0x134ae1[_0x4c0cc9(0x128)]?String(_0x134ae1['alias']):'';if(!_0x23ccf3&&!_0x36c3e1)throw CliErrors['validation']('`'+_0x2c247e+_0x4c0cc9(0x12e));if(_0x36c3e1&&!_0x23ccf3){const _0x30623c=resolveAlias(_0x1e417e,_0x36c3e1);if(!_0x30623c){const _0x10e0d9=listAliases(_0x1e417e)[_0x4c0cc9(0x126)](_0x2b585d=>_0x2b585d[_0x4c0cc9(0x128)]),_0x961514=_0x10e0d9['length']?_0x4c0cc9(0x12c)+_0x10e0d9[_0x4c0cc9(0x11f)](',\x20'):_0x4c0cc9(0x132)+_0x1e417e+_0x4c0cc9(0x123)+CLI_BIN_NAME+_0x4c0cc9(0x136);throw CliErrors[_0x4c0cc9(0x122)]('Unknown\x20alias\x20\x22'+_0x36c3e1+_0x4c0cc9(0x121)+_0x961514);}_0x134ae1[_0x4c0cc9(0x12f)]=_0x30623c;}}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a169_0x1f1726=a169_0x3f67;(function(_0x4c8d84,_0xc1f19f){const _0x228946=a169_0x3f67,_0x129f12=_0x4c8d84();while(!![]){try{const _0x1d97b2=parseInt(_0x228946(0x1bd))/0x1+-parseInt(_0x228946(0x1ba))/0x2*(-parseInt(_0x228946(0x1ad))/0x3)+parseInt(_0x228946(0x1b4))/0x4*(parseInt(_0x228946(0x1c0))/0x5)+-parseInt(_0x228946(0x1ab))/0x6+-parseInt(_0x228946(0x1c5))/0x7+parseInt(_0x228946(0x1a8))/0x8*(parseInt(_0x228946(0x1ae))/0x9)+parseInt(_0x228946(0x1b6))/0xa*(parseInt(_0x228946(0x1a5))/0xb);if(_0x1d97b2===_0xc1f19f)break;else _0x129f12['push'](_0x129f12['shift']());}catch(_0x3b0fbb){_0x129f12['push'](_0x129f12['shift']());}}}(a169_0x4e95,0x73c4b));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';function a169_0x3f67(_0x397298,_0x429671){_0x397298=_0x397298-0x1a3;const _0x4e9500=a169_0x4e95();let _0x3f67a6=_0x4e9500[_0x397298];return _0x3f67a6;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a169_0x4e95(){const _0x4eba05=['60LbfFCL','Set\x20appcode\x20via\x20`','requiresAuth','resolveAppCode','2iLFlMZ','appCode','mergedCli','750352AiSEYW','format','service','6685DBUefl','currentApp','pageSize','authRequired','verbose','6625227tafKzj','defaultPageSize','validation','../core/api-client.js','⚠\x20\x20High-risk\x20operation:\x20','riskLevel','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.','204457vDoyfs','resolveApiDomain','map','24RWxMUT','cancelled','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','995160wSnklI','explicitAppName','1473429dcPGpG','584154adBHHY','requiresAppCode','isNonInteractive','command','cookie','apiDir','116okdmPb','defaultApp'];a169_0x4e95=function(){return _0x4eba05;};return a169_0x4e95();}import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{DEFAULT_API_DIR}from'../constant/paths.js';import{isNonInteractive as a169_0x104bbf}from'../utils/is-non-interactive.js';import{resolveAliasToCode}from'../framework/runner-alias.js';export function createPipelineEnv(_0xeeeb43,_0x47fe43,_0x5bade5=[]){const _0x48eb49=a169_0x3f67;return{'rawFlags':_0x47fe43,'args':_0x5bade5,'resolveAppCode':()=>_0xeeeb43[_0x48eb49(0x1bb)]||_0x47fe43['appcode']||process.env.RABETBASE_APPCODE||process.env.LOVRABET_APPCODE||undefined,'resolveCookie':()=>_0xeeeb43[_0x48eb49(0x1b2)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a169_0x104bbf(_0x47fe43),'defaultFormat':_0xeeeb43[_0x48eb49(0x1be)],'defaultPageSize':_0xeeeb43[_0x48eb49(0x1c2)],'defaultVerbose':_0xeeeb43[_0x48eb49(0x1c4)],'apiDir':_0xeeeb43[_0x48eb49(0x1b3)],'riskLevel':_0xeeeb43[_0x48eb49(0x1a3)],'selectedAppName':_0xeeeb43[_0x48eb49(0x1ac)],'mergedCli':{'defaultApp':_0xeeeb43[_0x48eb49(0x1b5)],'currentApp':_0xeeeb43[_0x48eb49(0x1c1)],'appCode':_0xeeeb43[_0x48eb49(0x1bb)],'apps':_0xeeeb43['apps']}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS['filter'](_0x4ae15c=>PIPELINE_FLAG_NAMES['has'](_0x4ae15c['name']))[a169_0x1f1726(0x1a7)](({name:_0x4abac7,type:_0x2083df,description:_0x178da6})=>({'name':_0x4abac7,'type':_0x2083df,'description':_0x178da6})),'formatOutput':formatOutput,'getCommandLabel'(_0x580070){const _0x4f4128=a169_0x1f1726;return CLI_BIN_NAME+'\x20'+_0x580070[_0x4f4128(0x1bf)]+'\x20'+_0x580070[_0x4f4128(0x1b1)];},'riskPolicy':{'skipWhenDryRun':!![],'createError'(_0x4cb937){const _0x273376=a169_0x1f1726;return CliErrors[_0x273376(0x1c7)](_0x4cb937);}},async 'prepare'(_0x4df030,_0x519384,_0x43e7b9,_0x429b8f){const _0x16df2f=a169_0x1f1726,_0x533770=_0x519384[_0x16df2f(0x1b3)]||DEFAULT_API_DIR;resolveAliasToCode(_0x4df030,_0x43e7b9,_0x533770,_0x429b8f);let _0x1f7d3b='';if(_0x4df030[_0x16df2f(0x1b8)]!==![]){_0x1f7d3b=_0x519384['resolveCookie']();if(!_0x1f7d3b)throw CliErrors[_0x16df2f(0x1c3)]();const {setActiveCookie:_0x238d13}=await import('../core/api-client.js');_0x238d13(_0x1f7d3b);}const _0xd31b8c=_0x519384[_0x16df2f(0x1b9)]()??'';if(_0x4df030[_0x16df2f(0x1af)]!==![]){if(!_0xd31b8c)throw CliErrors['configMissing'](_0x16df2f(0x1b7)+CLI_BIN_NAME+_0x16df2f(0x1aa));}return{'defaults':{'booleans':{'verbose':_0x519384['defaultVerbose']},'numbers':{'pagesize':_0x519384[_0x16df2f(0x1c6)]}},'extras':{'appCode':_0xd31b8c,'cookie':_0x1f7d3b,'apiDomain':_0x519384[_0x16df2f(0x1a6)](),'apiDir':_0x533770,'selectedAppName':_0x519384['selectedAppName'],'mergedCli':_0x519384[_0x16df2f(0x1bc)]}};},async 'confirmHighRisk'({env:_0x44398b,commandLabel:_0x2afee9}){const _0xbc2f04=a169_0x1f1726;if(_0x44398b[_0xbc2f04(0x1b0)])throw CliErrors[_0xbc2f04(0x1c7)]('High-risk\x20operation\x20`'+_0x2afee9+_0xbc2f04(0x1a4));await requireConfirmationPrompt({'lines':[_0xbc2f04(0x1c9)+_0x2afee9,'\x20\x20\x20Continue?\x20[y/N]\x20'],'createCancelledError':_0x1c3555=>CliErrors[_0xbc2f04(0x1a9)](_0x1c3555)});},async 'finalize'(){const _0x50d23d=a169_0x1f1726,{clearActiveCookie:_0x15553d}=await import(_0x50d23d(0x1c8));_0x15553d();}};export async function runCommand(_0x34e8e7,_0x1c455a){await runCommandWithAdapter(_0x34e8e7,_0x1c455a,runnerAdapter);}
|