@lovrabet/rabetbase-cli 2.1.12-beta.2 → 2.1.12-beta.4
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/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
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x184f52=a132_0x4770;(function(_0x579265,_0x18090a){const _0x5e9d60=a132_0x4770,_0x21734a=_0x579265();while(!![]){try{const _0x19713d=-parseInt(_0x5e9d60(0x1e2))/0x1+parseInt(_0x5e9d60(0x244))/0x2*(parseInt(_0x5e9d60(0x248))/0x3)+parseInt(_0x5e9d60(0x247))/0x4*(-parseInt(_0x5e9d60(0x1fa))/0x5)+parseInt(_0x5e9d60(0x225))/0x6*(-parseInt(_0x5e9d60(0x1f2))/0x7)+parseInt(_0x5e9d60(0x1f3))/0x8*(-parseInt(_0x5e9d60(0x1e1))/0x9)+parseInt(_0x5e9d60(0x223))/0xa+parseInt(_0x5e9d60(0x21c))/0xb*(parseInt(_0x5e9d60(0x243))/0xc);if(_0x19713d===_0x18090a)break;else _0x21734a['push'](_0x21734a['shift']());}catch(_0x398036){_0x21734a['push'](_0x21734a['shift']());}}}(a132_0x11a8,0x8f510));export const CLI_BIN_NAME=a132_0x184f52(0x245);function a132_0x4770(_0x622dfb,_0x494257){_0x622dfb=_0x622dfb-0x1e1;const _0x11a85e=a132_0x11a8();let _0x477067=_0x11a85e[_0x622dfb];return _0x477067;}export const CLI_DISPLAY_NAME=a132_0x184f52(0x20d);function a132_0x11a8(){const _0x1b9285=['27BrZjZK','771164xHxvfE','Schemas','Type\x20filter','title','Page\x20number','project','name','Apply\x20to\x20all','sqlname','<expr>','env','Confirm\x20destructive\x20action','db-id','Config\x20key','DB\x20ID','force','28InrjzN','2331456hLpLVB','code','Output\x20path','keyword','Config\x20value','Function\x20node','Description','11230XhzgXi','description-file','@lovrabet/rabetbase-cli','page','type','fromEntries','clear','appcode','non-interactive','watch','confirm','Skip\x20import\x20generation','Description\x20file','Name','dry-run','SQL\x20string','Record\x20ID','Expected\x20affected\x20count','dryRun','Rabetbase\x20CLI','Use\x20project\x20config\x20scope','SQL\x20name','expectedCount','Title','key','Force\x20overwrite','help','Page\x20size','Target\x20path','JSON\x20params','boolean','schemas','Force\x20non-interactive\x20mode\x20(CI)','operationType','2101JZrlfT','format','Output\x20format','Preview\x20operation\x20without\x20executing','Clear','yes','skipImports','11264750imMXmf','<name>','894324EeMMWy','Keyword\x20filter','Alias\x20for\x20--non-interactive','datasetcode','enableBffSave','value','app','output','descriptionFile','dbId','Use\x20remote','sqlcode','enable-bff-save','Dataset\x20code','functionNode','remote','Operation\x20type','target','description','SQL\x20code','string','<code>','sql','dbid','pagesize','all','global','operation','file','verbose','86568AWCJww','2MicNja','rabetbase','Show\x20help','768zpXCuy','2266749PEaAFF','expected-count','json\x20|\x20pretty\x20|\x20compress'];a132_0x11a8=function(){return _0x1b9285;};return a132_0x11a8();}export const NPM_PACKAGE_NAME=a132_0x184f52(0x1fc);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a132_0x184f52(0x201),'type':a132_0x184f52(0x239),'description':'Override\x20appcode','hint':a132_0x184f52(0x23a)},{'name':a132_0x184f52(0x22b),'meowKey':a132_0x184f52(0x22b),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a132_0x184f52(0x224)},{'name':a132_0x184f52(0x1ec),'meowKey':a132_0x184f52(0x1ec),'type':a132_0x184f52(0x239),'description':'Environment','hint':'production\x20|\x20daily'},{'name':'format','meowKey':a132_0x184f52(0x21d),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x21e),'hint':a132_0x184f52(0x24a)},{'name':'jq','meowKey':'jq','type':a132_0x184f52(0x239),'description':'Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','hint':a132_0x184f52(0x1eb)},{'name':a132_0x184f52(0x208),'meowKey':a132_0x184f52(0x20c),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x21f)},{'name':a132_0x184f52(0x221),'meowKey':a132_0x184f52(0x221),'type':a132_0x184f52(0x218),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a132_0x184f52(0x202),'meowKey':'nonInteractive','type':'boolean','description':a132_0x184f52(0x21a)},{'name':a132_0x184f52(0x23f),'meowKey':a132_0x184f52(0x23f),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':a132_0x184f52(0x1e7),'meowKey':'project','type':a132_0x184f52(0x218),'description':a132_0x184f52(0x20e)},{'name':'ci','meowKey':'ci','type':a132_0x184f52(0x218),'description':a132_0x184f52(0x227),'hidden':!![]},{'name':a132_0x184f52(0x214),'meowKey':a132_0x184f52(0x214),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x246)},{'name':a132_0x184f52(0x1e8),'meowKey':a132_0x184f52(0x1e8),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x207),'hidden':!![]},{'name':'title','meowKey':a132_0x184f52(0x1e5),'type':'string','description':a132_0x184f52(0x211),'hidden':!![]},{'name':a132_0x184f52(0x200),'meowKey':a132_0x184f52(0x200),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x220),'hidden':!![]},{'name':'watch','meowKey':a132_0x184f52(0x203),'type':'boolean','description':'Watch\x20mode','hidden':!![]},{'name':a132_0x184f52(0x22c),'meowKey':a132_0x184f52(0x22c),'type':'string','description':a132_0x184f52(0x1f5),'hidden':!![]},{'name':'params','meowKey':'params','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x217),'hidden':!![]},{'name':a132_0x184f52(0x228),'meowKey':'datasetcode','type':'string','description':a132_0x184f52(0x232),'hidden':!![]},{'name':'all','meowKey':a132_0x184f52(0x23e),'type':'boolean','description':a132_0x184f52(0x1e9),'hidden':!![]},{'name':a132_0x184f52(0x231),'meowKey':a132_0x184f52(0x229),'type':'boolean','description':'Enable\x20BFF\x20save','hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':a132_0x184f52(0x20a),'hidden':!![]},{'name':a132_0x184f52(0x1fe),'meowKey':a132_0x184f52(0x1fe),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1e4),'hidden':!![]},{'name':a132_0x184f52(0x241),'meowKey':a132_0x184f52(0x241),'type':a132_0x184f52(0x239),'description':'File\x20path','hidden':!![]},{'name':a132_0x184f52(0x230),'meowKey':a132_0x184f52(0x230),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x238),'hidden':!![]},{'name':'sql-name','meowKey':'sqlName','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x20f),'hidden':!![]},{'name':'sqlname','meowKey':a132_0x184f52(0x1ea),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x20f),'hidden':!![]},{'name':a132_0x184f52(0x1ee),'meowKey':a132_0x184f52(0x22e),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1f0),'hidden':!![]},{'name':'dbid','meowKey':a132_0x184f52(0x23c),'type':'string','description':a132_0x184f52(0x1f0),'hidden':!![]},{'name':a132_0x184f52(0x237),'meowKey':a132_0x184f52(0x237),'type':'string','description':a132_0x184f52(0x1f9),'hidden':!![]},{'name':a132_0x184f52(0x1fb),'meowKey':a132_0x184f52(0x22d),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x206),'hidden':!![]},{'name':a132_0x184f52(0x1fd),'meowKey':'page','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1e6),'hidden':!![]},{'name':a132_0x184f52(0x23d),'meowKey':'pagesize','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x215),'hidden':!![]},{'name':a132_0x184f52(0x1f6),'meowKey':a132_0x184f52(0x1f6),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x226),'hidden':!![]},{'name':a132_0x184f52(0x1f4),'meowKey':a132_0x184f52(0x1f4),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':a132_0x184f52(0x23b),'meowKey':'sql','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x209),'hidden':!![]},{'name':a132_0x184f52(0x219),'meowKey':'schemas','type':'string','description':a132_0x184f52(0x1e3),'hidden':!![]},{'name':a132_0x184f52(0x240),'meowKey':'operation','type':a132_0x184f52(0x239),'description':a132_0x184f52(0x235),'hidden':!![]},{'name':a132_0x184f52(0x236),'meowKey':a132_0x184f52(0x236),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x216),'hidden':!![]},{'name':'skip-imports','meowKey':a132_0x184f52(0x222),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x205),'hidden':!![]},{'name':a132_0x184f52(0x212),'meowKey':a132_0x184f52(0x212),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1ef),'hidden':!![]},{'name':'value','meowKey':a132_0x184f52(0x22a),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1f7),'hidden':!![]},{'name':'force','meowKey':a132_0x184f52(0x1f1),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x213),'hidden':!![]},{'name':a132_0x184f52(0x204),'meowKey':a132_0x184f52(0x204),'type':a132_0x184f52(0x218),'description':a132_0x184f52(0x1ed),'hidden':!![]},{'name':a132_0x184f52(0x234),'meowKey':'remote','type':a132_0x184f52(0x218),'description':a132_0x184f52(0x22f),'hidden':!![]},{'name':'verbose','meowKey':a132_0x184f52(0x242),'type':'boolean','description':'Verbose\x20output','hidden':!![]},{'name':a132_0x184f52(0x249),'meowKey':a132_0x184f52(0x210),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x20b),'hidden':!![]},{'name':'operation-type','meowKey':a132_0x184f52(0x21b),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x235),'hidden':!![]},{'name':'function-node','meowKey':a132_0x184f52(0x233),'type':a132_0x184f52(0x239),'description':a132_0x184f52(0x1f8),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a132_0x184f52(0x201),a132_0x184f52(0x22b),a132_0x184f52(0x1ec),'format','jq',a132_0x184f52(0x208),a132_0x184f52(0x221),a132_0x184f52(0x202),'ci']);export function buildMeowFlags(){const _0x1c5817=a132_0x184f52;return Object[_0x1c5817(0x1ff)](GLOBAL_FLAGS['map'](_0x214d30=>[_0x214d30['meowKey'],{'type':_0x214d30[_0x1c5817(0x1fe)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x39e318=a133_0x1c02;function a133_0x1c02(_0x1b2aab,_0x42a2ac){_0x1b2aab=_0x1b2aab-0x11a;const _0x30b639=a133_0x30b6();let _0x1c02d6=_0x30b639[_0x1b2aab];return _0x1c02d6;}function a133_0x30b6(){const _0x5eae2c=['4495554NrqTlf','9259416rDfgKW','en-US','52376ukzEtD','138FTyAla','production','751497TVzxLc','5zzIDrl','31170cTpgKQ','high-risk-write','4qckysx','8229UQIrcZ','7577vtmRha','4961ZQpySS','287HWbHlI','compress','21144SgjpXY'];a133_0x30b6=function(){return _0x5eae2c;};return a133_0x30b6();}(function(_0x393e95,_0x3c0afa){const _0x450981=a133_0x1c02,_0x5f39e5=_0x393e95();while(!![]){try{const _0xe4af38=parseInt(_0x450981(0x122))/0x1*(-parseInt(_0x450981(0x11a))/0x2)+parseInt(_0x450981(0x11c))/0x3*(-parseInt(_0x450981(0x120))/0x4)+-parseInt(_0x450981(0x11d))/0x5*(-parseInt(_0x450981(0x128))/0x6)+parseInt(_0x450981(0x124))/0x7*(parseInt(_0x450981(0x12a))/0x8)+-parseInt(_0x450981(0x127))/0x9+-parseInt(_0x450981(0x11e))/0xa*(-parseInt(_0x450981(0x123))/0xb)+-parseInt(_0x450981(0x126))/0xc*(parseInt(_0x450981(0x121))/0xd);if(_0xe4af38===_0x3c0afa)break;else _0x5f39e5['push'](_0x5f39e5['shift']());}catch(_0x10634b){_0x5f39e5['push'](_0x5f39e5['shift']());}}}(a133_0x30b6,0xca752));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a133_0x39e318(0x11b),'format':a133_0x39e318(0x125),'locale':a133_0x39e318(0x129),'riskLevel':a133_0x39e318(0x11f),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a133_0x39e318(0x125);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x1dd1f5=a134_0x1cbb;(function(_0x2f7fe6,_0x504c52){const _0x338784=a134_0x1cbb,_0x13e1fc=_0x2f7fe6();while(!![]){try{const _0x2880db=-parseInt(_0x338784(0x16e))/0x1+parseInt(_0x338784(0x176))/0x2*(parseInt(_0x338784(0x174))/0x3)+parseInt(_0x338784(0x171))/0x4*(parseInt(_0x338784(0x16c))/0x5)+-parseInt(_0x338784(0x169))/0x6*(-parseInt(_0x338784(0x175))/0x7)+parseInt(_0x338784(0x167))/0x8*(-parseInt(_0x338784(0x178))/0x9)+parseInt(_0x338784(0x179))/0xa+-parseInt(_0x338784(0x16d))/0xb*(-parseInt(_0x338784(0x16b))/0xc);if(_0x2880db===_0x504c52)break;else _0x13e1fc['push'](_0x13e1fc['shift']());}catch(_0x270552){_0x13e1fc['push'](_0x13e1fc['shift']());}}}(a134_0x20da,0x7269d));import{getEnv,isProduction}from'../constant/env.js';function a134_0x20da(){const _0x2cd718=['12lHzZnx','2504410QNwxin','3800203HVUhbY','844403khgAul','https://user-daily.lovrabet.com','apiDomain','4YorlZB','runtimeDomain','https://daily-runtime.lovrabet.com','3TTaLnV','1818733kohQrq','171426xeZlgA','https://user.lovrabet.com','18HdEPwK','3601850YPZvQD','956128MSoWDj','userDomain','6WxAjxq','https://daily-api.lovrabet.com'];a134_0x20da=function(){return _0x2cd718;};return a134_0x20da();}let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2fba83){const _0x133ce5=a134_0x1cbb;customApiDomain=_0x2fba83?.[_0x133ce5(0x170)],customUserDomain=_0x2fba83?.[_0x133ce5(0x168)],customRuntimeDomain=_0x2fba83?.[_0x133ce5(0x172)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a134_0x1dd1f5(0x177):a134_0x1dd1f5(0x16f));function a134_0x1cbb(_0x2d20df,_0x46a6ae){_0x2d20df=_0x2d20df-0x167;const _0x20da4b=a134_0x20da();let _0x1cbb52=_0x20da4b[_0x2d20df];return _0x1cbb52;}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a134_0x1dd1f5(0x16a));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a134_0x1dd1f5(0x173));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x149ccd=a135_0x36e2;(function(_0xd052b5,_0x41e12d){const _0x5a3f6b=a135_0x36e2,_0x2628f7=_0xd052b5();while(!![]){try{const _0x596f3c=-parseInt(_0x5a3f6b(0x157))/0x1+parseInt(_0x5a3f6b(0x152))/0x2*(parseInt(_0x5a3f6b(0x15b))/0x3)+-parseInt(_0x5a3f6b(0x159))/0x4+-parseInt(_0x5a3f6b(0x156))/0x5+parseInt(_0x5a3f6b(0x154))/0x6+-parseInt(_0x5a3f6b(0x15c))/0x7+parseInt(_0x5a3f6b(0x15a))/0x8;if(_0x596f3c===_0x41e12d)break;else _0x2628f7['push'](_0x2628f7['shift']());}catch(_0x23cfea){_0x2628f7['push'](_0x2628f7['shift']());}}}(a135_0x3ed7,0x5650f));export const RABETBASE_ENV_VALUES=[a135_0x149ccd(0x15d),a135_0x149ccd(0x155)];function a135_0x3ed7(){const _0x5620eb=['daily','2474250HMtsuf','255136IMtBxN','development','1975864ifusoR','5620936stJqsC','15ZLYpBV','1629922jDjbLd','production','dev','264626DZpHrw','online','2797002WVoeFS'];a135_0x3ed7=function(){return _0x5620eb;};return a135_0x3ed7();}export function normalizeEnv(_0x58c42b){const _0xcf6011=a135_0x149ccd;return _0x58c42b===_0xcf6011(0x153)?_0xcf6011(0x15d):_0x58c42b;}function a135_0x36e2(_0x1d7a1b,_0x267d4a){_0x1d7a1b=_0x1d7a1b-0x152;const _0x3ed756=a135_0x3ed7();let _0x36e26a=_0x3ed756[_0x1d7a1b];return _0x36e26a;}export function isProduction(_0x16ac87){const _0x28c832=a135_0x149ccd;return normalizeEnv(_0x16ac87)===_0x28c832(0x15d);}export function isDaily(_0x3b4277){return normalizeEnv(_0x3b4277)==='daily';}export function isDev(_0x5b7886){const _0x486af4=a135_0x149ccd,_0x2c2e1b=normalizeEnv(_0x5b7886);return _0x2c2e1b===_0x486af4(0x158)||_0x2c2e1b===_0x486af4(0x15e);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||'production');export function getEnv(){return env;}export function initEnv(_0x5dcb9c){env=normalizeEnv(_0x5dcb9c);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x411b52=a136_0x9c2b;function a136_0x4069(){const _0x20931a=['1923512dDvtOU','91imliJf','9aASmNK','89176CVCSAU','pretty','42oeDLrE','3HTQOIK','50855lzuLxW','11nreGko','1808716qfQaAZ','compress','1447932PqirLj','json','3111580iGEHSb','8NKqREr','311667XhaJmZ'];a136_0x4069=function(){return _0x20931a;};return a136_0x4069();}function a136_0x9c2b(_0x49abd1,_0x29a03b){_0x49abd1=_0x49abd1-0xee;const _0x40690a=a136_0x4069();let _0x9c2b42=_0x40690a[_0x49abd1];return _0x9c2b42;}(function(_0x5d49a2,_0x583764){const _0x30d028=a136_0x9c2b,_0x513826=_0x5d49a2();while(!![]){try{const _0xe81a8=parseInt(_0x30d028(0xfa))/0x1*(-parseInt(_0x30d028(0xf7))/0x2)+parseInt(_0x30d028(0xf3))/0x3*(parseInt(_0x30d028(0xf2))/0x4)+parseInt(_0x30d028(0xfb))/0x5*(parseInt(_0x30d028(0xf9))/0x6)+-parseInt(_0x30d028(0xfd))/0x7+parseInt(_0x30d028(0xf4))/0x8*(-parseInt(_0x30d028(0xf6))/0x9)+-parseInt(_0x30d028(0xf1))/0xa*(parseInt(_0x30d028(0xfc))/0xb)+-parseInt(_0x30d028(0xef))/0xc*(-parseInt(_0x30d028(0xf5))/0xd);if(_0xe81a8===_0x583764)break;else _0x513826['push'](_0x513826['shift']());}catch(_0x3b676b){_0x513826['push'](_0x513826['shift']());}}}(a136_0x4069,0x2be8d));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a136_0x411b52(0xf0),a136_0x411b52(0xf8),a136_0x411b52(0xee)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x47640d=a137_0x53e0;(function(_0x569ffe,_0x326847){const _0x35c235=a137_0x53e0,_0x387256=_0x569ffe();while(!![]){try{const _0x2cbd8d=-parseInt(_0x35c235(0xd3))/0x1+parseInt(_0x35c235(0xcc))/0x2+-parseInt(_0x35c235(0xcf))/0x3*(-parseInt(_0x35c235(0xd4))/0x4)+-parseInt(_0x35c235(0xcd))/0x5*(-parseInt(_0x35c235(0xcb))/0x6)+-parseInt(_0x35c235(0xd2))/0x7+-parseInt(_0x35c235(0xd1))/0x8+parseInt(_0x35c235(0xd0))/0x9;if(_0x2cbd8d===_0x326847)break;else _0x387256['push'](_0x387256['shift']());}catch(_0xdbd9ed){_0x387256['push'](_0x387256['shift']());}}}(a137_0x3666,0xd9448));function a137_0x53e0(_0x155e34,_0x54321a){_0x155e34=_0x155e34-0xcb;const _0x366680=a137_0x3666();let _0x53e027=_0x366680[_0x155e34];return _0x53e027;}function a137_0x3666(){const _0x76b90e=['8723200dpIKRb','3151974MeIWtK','450606pCydRW','2619092xVZZXn','16566YyDGJW','2912856uznhqY','1315HEbCRU','./src/api','3BcRorS','394848oWjoaU'];a137_0x3666=function(){return _0x76b90e;};return a137_0x3666();}export const DEFAULT_API_DIR=a137_0x47640d(0xce);
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a138_0x56b9(){const _0x518a21=['36880ILURiJ','2436328qHrfIu','7EMmgfn','4994766skGydd','1017ZBCYbR','4kgqQQB','1194303jBDQOU','869950dFCihw','write','226549JovXGX','1388BahuWP','read','high-risk-write','903RYPSIX'];a138_0x56b9=function(){return _0x518a21;};return a138_0x56b9();}const a138_0x3ab065=a138_0x2a1d;function a138_0x2a1d(_0x341c16,_0x47847f){_0x341c16=_0x341c16-0x125;const _0x56b9f2=a138_0x56b9();let _0x2a1d0c=_0x56b9f2[_0x341c16];return _0x2a1d0c;}(function(_0x215ac6,_0x45c88c){const _0x4a00fc=a138_0x2a1d,_0x576c0e=_0x215ac6();while(!![]){try{const _0xaa5d6c=parseInt(_0x4a00fc(0x12e))/0x1*(-parseInt(_0x4a00fc(0x12a))/0x2)+-parseInt(_0x4a00fc(0x132))/0x3*(-parseInt(_0x4a00fc(0x12f))/0x4)+parseInt(_0x4a00fc(0x12c))/0x5+parseInt(_0x4a00fc(0x128))/0x6+-parseInt(_0x4a00fc(0x127))/0x7*(-parseInt(_0x4a00fc(0x126))/0x8)+-parseInt(_0x4a00fc(0x129))/0x9*(parseInt(_0x4a00fc(0x125))/0xa)+-parseInt(_0x4a00fc(0x12b))/0xb;if(_0xaa5d6c===_0x45c88c)break;else _0x576c0e['push'](_0x576c0e['shift']());}catch(_0x40f0ff){_0x576c0e['push'](_0x576c0e['shift']());}}}(a138_0x56b9,0x6ab20));export const RISK_LEVEL_VALUES=[a138_0x3ab065(0x130),a138_0x3ab065(0x12d),a138_0x3ab065(0x131)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a139_0x21c6b8=a139_0x2a3b;(function(_0x41976a,_0x15f378){const _0x53ed87=a139_0x2a3b,_0xdb60ba=_0x41976a();while(!![]){try{const _0x4d8a10=-parseInt(_0x53ed87(0x223))/0x1+-parseInt(_0x53ed87(0x206))/0x2*(parseInt(_0x53ed87(0x210))/0x3)+-parseInt(_0x53ed87(0x22c))/0x4+parseInt(_0x53ed87(0x221))/0x5+-parseInt(_0x53ed87(0x238))/0x6+parseInt(_0x53ed87(0x23c))/0x7*(parseInt(_0x53ed87(0x209))/0x8)+parseInt(_0x53ed87(0x1f6))/0x9;if(_0x4d8a10===_0x15f378)break;else _0xdb60ba['push'](_0xdb60ba['shift']());}catch(_0x3fe636){_0xdb60ba['push'](_0xdb60ba['shift']());}}}(a139_0x1677,0x47a7c));function a139_0x2a3b(_0x532a81,_0x46e5de){_0x532a81=_0x532a81-0x1ef;const _0x1677f7=a139_0x1677();let _0x2a3baf=_0x1677f7[_0x532a81];return _0x2a3baf;}import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x42bea4){return process.env[`RABETBASE_${_0x42bea4}`]||process.env[`LOVRABET_${_0x42bea4}`]||undefined;}export const NEW_CONFIG_NAME=a139_0x21c6b8(0x1f9);export const CONFIG_NAMES=[a139_0x21c6b8(0x1f9),a139_0x21c6b8(0x217),a139_0x21c6b8(0x204)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x2ba3be=>_0x2ba3be!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x14c8d3){for(const _0x405f26 of CONFIG_NAMES){const _0x50375e=resolve(_0x14c8d3,_0x405f26);if(existsSync(_0x50375e))return _0x50375e;}return undefined;}export function findProjectRootDirectory(_0x393357=process[a139_0x21c6b8(0x200)]()){let _0x22c786=resolve(_0x393357);const {root:_0x4dba18}=parse(_0x22c786),_0x1d610b=homedir();while(!![]){if(resolveConfigPath(_0x22c786)){if(_0x22c786===_0x1d610b)break;return _0x22c786;}if(_0x22c786===_0x4dba18||_0x22c786===_0x1d610b)break;const _0x3335a5=dirname(_0x22c786);if(_0x3335a5===_0x22c786)break;_0x22c786=_0x3335a5;}return resolve(_0x393357);}export async function createContext(_0x2ac366){const _0x5c9723=a139_0x21c6b8,_0x142f5d=readRawConfig(),_0x2cbe92=buildConfig(_0x142f5d,_0x2ac366),{initEnv:_0x577787}=await import(_0x5c9723(0x237));if(_0x2cbe92[_0x5c9723(0x207)])_0x577787(_0x2cbe92[_0x5c9723(0x207)]);else _0x2ac366[_0x5c9723(0x207)]&&typeof _0x2ac366['env']==='string'&&_0x577787(_0x2ac366[_0x5c9723(0x207)]);const {initDomains:_0x45f77b,getUserDomain:_0x1407e4,getApiDomain:_0x56ea4a}=await import('./constant/domain.js');_0x45f77b({'apiDomain':_0x142f5d[_0x5c9723(0x23d)]||undefined,'userDomain':_0x142f5d[_0x5c9723(0x22b)]||undefined,'runtimeDomain':_0x142f5d['runtimeDomain']||undefined});const _0x14c15c={'apiDomain':_0x56ea4a(),'userDomain':_0x1407e4()},_0x2ced33=await buildAuth(_0x2cbe92);logger[_0x5c9723(0x1fb)](process['cwd']());const _0x3d84e6=(CLI_BIN_NAME+'\x20'+process[_0x5c9723(0x224)][_0x5c9723(0x20f)](0x2)[_0x5c9723(0x222)]('\x20'))[_0x5c9723(0x1f1)]();logger[_0x5c9723(0x241)](_0x3d84e6);const {isNonInteractive:_0x17ad0c}=await import(_0x5c9723(0x21a)),_0x18d47f=_0x17ad0c(_0x2ac366);return{'config':_0x2cbe92,'auth':_0x2ced33,'logger':logger,'env':_0x14c15c,'nonInteractive':_0x18d47f};}export function buildConfigFromFlags(_0x5cb323){return buildConfig(readRawConfig(),_0x5cb323);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x177491){const _0x4c5ab9=a139_0x21c6b8;if(!existsSync(_0x177491))return{'status':_0x4c5ab9(0x230)};try{const _0x51911a=readFileSync(_0x177491,{'encoding':_0x4c5ab9(0x23e)});if(!_0x51911a?.[_0x4c5ab9(0x1f1)]())return{'status':'empty'};const _0x2d8147=JSON[_0x4c5ab9(0x22f)](_0x51911a);return{'status':'ok','data':_0x2d8147};}catch(_0x487c0){return{'status':'error','message':_0x487c0 instanceof Error?_0x487c0[_0x4c5ab9(0x203)]:String(_0x487c0)};}}function parseCliConfigJsonFile(_0xeeaab6,_0x499fda,_0x56017f){const _0x4ae55d=a139_0x21c6b8,_0x46e658=inspectCliConfigJsonFile(_0xeeaab6);if(_0x46e658[_0x4ae55d(0x21c)]==='missing'||_0x46e658[_0x4ae55d(0x21c)]===_0x4ae55d(0x1ff))return{};if(_0x46e658[_0x4ae55d(0x21c)]==='ok')return _0x46e658['data'];return _0x499fda==='warn'&&_0x56017f&&console[_0x4ae55d(0x20e)](CLI_BIN_NAME+':\x20'+_0x56017f+_0x4ae55d(0x1fa)+_0xeeaab6+_0x4ae55d(0x22d)+_0x46e658[_0x4ae55d(0x203)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x1e3809){const _0x5ab3a2=a139_0x21c6b8;if(!_0x1e3809||typeof _0x1e3809!==_0x5ab3a2(0x229))return{'config':{},'migrated':![]};const _0x260475={..._0x1e3809},_0x53df12=_0x260475['apps']&&typeof _0x260475['apps']===_0x5ab3a2(0x229)?{..._0x260475[_0x5ab3a2(0x218)]}:{},_0x42e3eb=Object[_0x5ab3a2(0x1fd)](_0x53df12)[_0x5ab3a2(0x211)],_0x3e91b3=_0x260475['appcode']||_0x260475['app'];let _0x8850f2=![];if(_0x3e91b3&&_0x42e3eb===0x0){const _0x3119fe=typeof _0x260475[_0x5ab3a2(0x21b)]===_0x5ab3a2(0x1f2)&&_0x260475[_0x5ab3a2(0x21b)]['trim']()?_0x260475[_0x5ab3a2(0x21b)]:String(_0x3e91b3)[_0x5ab3a2(0x1f1)]();_0x53df12[_0x3119fe]={'appcode':String(_0x3e91b3)[_0x5ab3a2(0x1f1)](),..._0x260475[_0x5ab3a2(0x207)]!=null?{'env':_0x260475[_0x5ab3a2(0x207)]}:{},..._0x260475['apiDir']!=null?{'apiDir':_0x260475['apiDir']}:{},..._0x260475[_0x5ab3a2(0x227)]!=null?{'cookie':_0x260475[_0x5ab3a2(0x227)]}:{},..._0x260475[_0x5ab3a2(0x22a)]!=null?{'accessKey':_0x260475[_0x5ab3a2(0x22a)]}:{},..._0x260475[_0x5ab3a2(0x201)]!=null?{'format':_0x260475[_0x5ab3a2(0x201)]}:{},..._0x260475[_0x5ab3a2(0x212)]!=null?{'pageSize':_0x260475[_0x5ab3a2(0x212)]}:{},..._0x260475[_0x5ab3a2(0x234)]!=null?{'riskLevel':_0x260475[_0x5ab3a2(0x234)]}:{},..._0x260475[_0x5ab3a2(0x240)]!=null?{'locale':_0x260475[_0x5ab3a2(0x240)]}:{}},_0x260475[_0x5ab3a2(0x218)]=_0x53df12;if(!_0x260475[_0x5ab3a2(0x21b)])_0x260475[_0x5ab3a2(0x21b)]=_0x3119fe;_0x8850f2=!![];}return(_0x5ab3a2(0x239)in _0x260475||_0x5ab3a2(0x215)in _0x260475)&&(delete _0x260475['appcode'],delete _0x260475['app'],_0x8850f2=!![]),{'config':_0x260475,'migrated':_0x8850f2};}function writeNormalizedConfigIfNeeded(_0x142035,_0x2b15ea){const _0xfc5c8e=a139_0x21c6b8,_0x2e277b=JSON[_0xfc5c8e(0x208)](_0x2b15ea,null,0x2)+'\x0a';if(normalizedWriteCache[_0xfc5c8e(0x23f)](_0x142035)===_0x2e277b)return;writeConfigFile(_0x142035,_0x2b15ea),normalizedWriteCache[_0xfc5c8e(0x219)](_0x142035,_0x2e277b);}function parseAndNormalizeConfig(_0xe3f2db,_0x37babf,_0x364696){const _0x520c08=a139_0x21c6b8,_0x21c6cf=parseCliConfigJsonFile(_0xe3f2db,_0x37babf,_0x364696),_0x592da3=normalizeLegacyConfigShape(_0x21c6cf);if(_0x592da3[_0x520c08(0x233)])try{writeNormalizedConfigIfNeeded(_0xe3f2db,_0x592da3['config']);}catch{}return _0x592da3[_0x520c08(0x20b)];}export function loadRawConfigLayers(_0x1ee6a4){const _0x5b08cc=a139_0x21c6b8;let _0x56b6da={},_0x327144={};const _0x2060af=resolveConfigPath(homedir());_0x2060af&&(_0x56b6da=parseAndNormalizeConfig(_0x2060af,_0x5b08cc(0x225),'Global'));const _0x218574=_0x1ee6a4??findProjectRootDirectory(),_0x199f7e=resolveConfigPath(_0x218574);return _0x199f7e&&(_0x327144=parseAndNormalizeConfig(_0x199f7e,_0x5b08cc(0x225),'Project')),{'globalPath':_0x2060af,'projectPath':_0x199f7e,'globalConfig':_0x56b6da,'projectConfig':_0x327144};}function mergeRawConfigLayers(_0x16d212){const _0x285070=a139_0x21c6b8,{globalConfig:_0x1e8778,projectConfig:_0x23cd16}=_0x16d212;if(_0x23cd16['inherit']===![]){const _0x3349c7={..._0x23cd16};delete _0x3349c7[_0x285070(0x213)];const _0x2f5391=_0x23cd16[_0x285070(0x218)]&&typeof _0x23cd16['apps']==='object'?_0x23cd16[_0x285070(0x218)]:{};Object[_0x285070(0x1fd)](_0x2f5391)[_0x285070(0x211)]>0x0?_0x3349c7[_0x285070(0x218)]=_0x2f5391:delete _0x3349c7[_0x285070(0x218)];if(_0x285070(0x21b)in _0x23cd16)_0x3349c7[_0x285070(0x21b)]=_0x23cd16['defaultApp'];else Object[_0x285070(0x1fd)](_0x2f5391)[_0x285070(0x211)]>0x0&&(_0x3349c7[_0x285070(0x21b)]=Object[_0x285070(0x1fd)](_0x2f5391)[0x0]);return _0x3349c7;}const _0x3e0cb5=_0x1e8778[_0x285070(0x218)]&&typeof _0x1e8778[_0x285070(0x218)]==='object'?_0x1e8778[_0x285070(0x218)]:{},_0x57ef3c=_0x23cd16['apps']&&typeof _0x23cd16['apps']===_0x285070(0x229)?_0x23cd16[_0x285070(0x218)]:{},_0x2acbe4={..._0x3e0cb5,..._0x57ef3c},_0xa5e0e2={..._0x1e8778,..._0x23cd16};Object[_0x285070(0x1fd)](_0x2acbe4)[_0x285070(0x211)]>0x0&&(_0xa5e0e2[_0x285070(0x218)]=_0x2acbe4);if(_0x285070(0x21b)in _0x23cd16)_0xa5e0e2[_0x285070(0x21b)]=_0x23cd16[_0x285070(0x21b)];else{if(_0x57ef3c&&Object[_0x285070(0x1fd)](_0x57ef3c)[_0x285070(0x211)]>0x0)_0xa5e0e2['defaultApp']=Object[_0x285070(0x1fd)](_0x57ef3c)[0x0];else{if(_0x1e8778[_0x285070(0x21b)])_0xa5e0e2[_0x285070(0x21b)]=_0x1e8778[_0x285070(0x21b)];else{const _0x46aa79=Object[_0x285070(0x1fd)](_0x3e0cb5);_0x46aa79[_0x285070(0x211)]>0x0&&(_0xa5e0e2[_0x285070(0x21b)]=_0x46aa79[0x0]);}}}return _0xa5e0e2;}export function readRawConfigWithLayers(_0x38fc70){const _0x3fa34f=loadRawConfigLayers(_0x38fc70);return{'config':mergeRawConfigLayers(_0x3fa34f),'layers':_0x3fa34f};}export function readRawConfig(_0x281ed5){return mergeRawConfigLayers(loadRawConfigLayers(_0x281ed5));}export function getConfigAppCode(_0x2756a4){const _0x5da0d2=a139_0x21c6b8,_0x390431=readRawConfig(_0x2756a4);if(_0x390431[_0x5da0d2(0x218)]&&typeof _0x390431[_0x5da0d2(0x218)]===_0x5da0d2(0x229)){const _0xf33f64=_0x390431[_0x5da0d2(0x21b)];if(_0xf33f64&&_0x390431[_0x5da0d2(0x218)][_0xf33f64]?.[_0x5da0d2(0x239)])return String(_0x390431[_0x5da0d2(0x218)][_0xf33f64][_0x5da0d2(0x239)])[_0x5da0d2(0x1f1)]();const _0x4544f5=Object['values'](_0x390431[_0x5da0d2(0x218)])[0x0];if(_0x4544f5?.['appcode'])return String(_0x4544f5[_0x5da0d2(0x239)])[_0x5da0d2(0x1f1)]();}const _0x31d8c4=_0x390431[_0x5da0d2(0x239)]||_0x390431['app'];if(typeof _0x31d8c4!==_0x5da0d2(0x1f2)||_0x31d8c4[_0x5da0d2(0x1f1)]()==='')return undefined;return _0x31d8c4[_0x5da0d2(0x1f1)]();}export function getMultiAppConfigs(_0x33c147=a139_0x21c6b8(0x1f3),_0x2ddcef){const _0x6fb76f=a139_0x21c6b8,_0x56af25=_0x33c147===_0x6fb76f(0x1fc)?readRawConfig(_0x2ddcef):loadRawConfigLayers(_0x2ddcef)[_0x6fb76f(0x1f4)],_0x526ae4=_0x56af25[_0x6fb76f(0x218)];if(!_0x526ae4||typeof _0x526ae4!==_0x6fb76f(0x229)||Object[_0x6fb76f(0x1fd)](_0x526ae4)[_0x6fb76f(0x211)]===0x0)return null;const _0x32d4f2=_0x56af25[_0x6fb76f(0x21b)];return Object[_0x6fb76f(0x235)](_0x526ae4)[_0x6fb76f(0x202)](([_0x3c40c3,_0x99a8d0])=>({'name':_0x3c40c3,'appcode':_0x99a8d0?.[_0x6fb76f(0x239)]||'','isDefault':_0x3c40c3===_0x32d4f2,'env':_0x99a8d0?.[_0x6fb76f(0x207)],'apiDir':_0x99a8d0?.[_0x6fb76f(0x232)],'cookie':_0x99a8d0?.[_0x6fb76f(0x227)]||undefined}))['filter'](_0x1903b2=>_0x1903b2[_0x6fb76f(0x239)]);}export function getTemplateBaseUrl(_0x3e4f99){const _0x3181d6=a139_0x21c6b8,_0x2c606c=readRawConfig(_0x3e4f99);if(_0x2c606c[_0x3181d6(0x20a)]&&typeof _0x2c606c[_0x3181d6(0x20a)]==='string')return _0x2c606c['template_base_url'][_0x3181d6(0x1f8)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}export function readConfigFile(_0x2a5a6b){const _0x5507f3=a139_0x21c6b8;return parseAndNormalizeConfig(_0x2a5a6b,_0x5507f3(0x21d));}export function writeConfigFile(_0x2b665b,_0x28d8b7){const _0xc43396=a139_0x21c6b8,_0x5d6f2f=dirname(_0x2b665b);!existsSync(_0x5d6f2f)&&mkdirSync(_0x5d6f2f,{'recursive':!![]});const _0x98f74e=_0x2b665b+'.tmp';try{writeFileSync(_0x98f74e,JSON[_0xc43396(0x208)](_0x28d8b7,null,0x2)+'\x0a',{'encoding':_0xc43396(0x23e),'mode':0x180}),renameSync(_0x98f74e,_0x2b665b);}catch(_0x9fac4a){try{unlinkSync(_0x98f74e);}catch{}throw _0x9fac4a;}}export function resolveWriteConfigPath(_0x46e181){const _0x1f3969=a139_0x21c6b8,_0x39f598=_0x46e181===_0x1f3969(0x1f3)?process[_0x1f3969(0x200)]():homedir(),_0x580fa5=resolveConfigPath(_0x39f598);return _0x580fa5??resolve(_0x39f598,NEW_CONFIG_NAME);}function buildConfig(_0x8d8d0f,_0x1942f0){const _0x7d214d=a139_0x21c6b8,_0x495a9a={};if(_0x8d8d0f[_0x7d214d(0x218)]&&typeof _0x8d8d0f[_0x7d214d(0x218)]==='object')for(const [_0x399bed,_0x5ddcf9]of Object[_0x7d214d(0x235)](_0x8d8d0f[_0x7d214d(0x218)])){_0x5ddcf9&&typeof _0x5ddcf9===_0x7d214d(0x229)&&_0x5ddcf9[_0x7d214d(0x239)]&&(_0x495a9a[_0x399bed]=_0x5ddcf9);}const _0x332f33=_0x8d8d0f[_0x7d214d(0x21b)]||undefined,_0x175f18=Object['keys'](_0x495a9a)['length']>0x0,_0x4f0478=_0x1942f0[_0x7d214d(0x215)]||env(_0x7d214d(0x220))||undefined,_0x1d2ca5=_0x4f0478||_0x332f33||undefined,_0x303b4b=_0x1942f0[_0x7d214d(0x239)]||env(_0x7d214d(0x231))||undefined,_0x25a547=_0x303b4b?Object[_0x7d214d(0x235)](_0x495a9a)[_0x7d214d(0x236)](([,_0x34ae6e])=>_0x34ae6e?.[_0x7d214d(0x239)]===_0x303b4b):undefined,_0x5a44b8=_0x25a547?.[0x0],_0x447841=_0x25a547?.[0x1];let _0x4b5e0b=_0x303b4b?_0x5a44b8:_0x1d2ca5,_0xeaa0b9=_0x4b5e0b&&_0x495a9a[_0x4b5e0b]?_0x495a9a[_0x4b5e0b]:undefined;_0x303b4b&&_0x447841&&(_0xeaa0b9=_0x447841);const _0x35550f=_0x303b4b?_0x447841??_0xeaa0b9:_0xeaa0b9,_0x1d596f=_0x4f0478||(_0x303b4b?_0x5a44b8:undefined),_0x2b2510=_0x303b4b||_0x35550f?.[_0x7d214d(0x239)]||undefined,_0x2c7c6f=_0x1942f0[_0x7d214d(0x207)]||env(_0x7d214d(0x228))||_0x35550f?.['env']||_0x8d8d0f[_0x7d214d(0x207)]||DEFAULT_CONFIG_VALUES[_0x7d214d(0x207)],_0x585575=_0x35550f?.[_0x7d214d(0x240)]||_0x8d8d0f['locale']||DEFAULT_CONFIG_VALUES['locale'],_0x42974d=env(_0x7d214d(0x23a))||_0x35550f?.['cookie']||_0x8d8d0f['cookie']||undefined,_0x1ce77b=env(_0x7d214d(0x23b))||_0x35550f?.[_0x7d214d(0x22a)]||_0x8d8d0f[_0x7d214d(0x22a)]||undefined,_0x2a46eb=_0x1942f0[_0x7d214d(0x201)]||env(_0x7d214d(0x216))||_0x35550f?.['format']||_0x8d8d0f[_0x7d214d(0x201)],_0x373be1=normalizeLegacyOutputFormat(_0x2a46eb),_0x49318a=env(_0x7d214d(0x226))||_0x35550f?.[_0x7d214d(0x212)]||_0x8d8d0f[_0x7d214d(0x212)],_0xdf9ed4=_0x49318a?Number(_0x49318a)||undefined:undefined,_0x28ec8d=env(_0x7d214d(0x20c))||env(_0x7d214d(0x205))||_0x35550f?.[_0x7d214d(0x234)]||_0x8d8d0f[_0x7d214d(0x234)]||_0x8d8d0f[_0x7d214d(0x21e)],_0x35edf1=_0x28ec8d===_0x7d214d(0x21f)||_0x28ec8d===_0x7d214d(0x1fe)?_0x28ec8d:DEFAULT_CONFIG_VALUES[_0x7d214d(0x234)],_0x4e1ea5=env('VERBOSE'),_0x5f402e=_0x4e1ea5==='1'||_0x4e1ea5===_0x7d214d(0x1f7),_0x1d7cee=_0x35550f?.[_0x7d214d(0x232)]||_0x8d8d0f[_0x7d214d(0x232)]||DEFAULT_CONFIG_VALUES['apiDir'],_0x550d15=isDaily(normalizeEnv(String(_0x2c7c6f)))?_0x7d214d(0x22e):_0x7d214d(0x214);return{'appCode':typeof _0x2b2510===_0x7d214d(0x1f2)&&_0x2b2510[_0x7d214d(0x1f1)]()?_0x2b2510['trim']():undefined,'env':_0x550d15,'locale':_0x585575,'cookie':_0x42974d,'accessKey':_0x1ce77b,'format':_0x373be1,'pageSize':_0xdf9ed4,'riskLevel':_0x35edf1,'verbose':_0x5f402e,'apiDir':_0x1d7cee,'apps':_0x495a9a,'defaultApp':_0x332f33,'currentApp':_0x175f18?_0x4b5e0b:undefined,'explicitAppName':_0x1d596f,'raw':_0x8d8d0f};}async function buildAuth(_0x15d3d8){const _0xa79073=a139_0x21c6b8,{getCookie:_0x277cbf}=await import(_0xa79073(0x1f0)),_0x5a69ea=_0x15d3d8[_0xa79073(0x227)]||_0x277cbf(),_0x989f99=_0x5a69ea?await getIsSessionValid():![];return{'cookie':_0x5a69ea,'isLoggedIn':_0x989f99,async 'getOrLogin'(){const _0x28d82f=_0xa79073;if(_0x5a69ea&&_0x989f99)return _0x5a69ea;throw CliErrors[_0x28d82f(0x1f5)]();}};}function a139_0x1677(){const _0x557a60=['\x0a\x20\x20','daily','parse','missing','APPCODE','apiDir','migrated','riskLevel','entries','find','./constant/env.js','2569644UhFCbW','appcode','COOKIE','ACCESS_KEY','389613rZQalm','apiDomain','utf8','get','locale','setRawCommand','api.ts','./auth/get-cookie.js','trim','string','project','projectConfig','authRequired','8651601nYJuBK','true','replace','.rabetbase.json','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','setLogPath','merged','keys','write','empty','cwd','format','map','message','.lovrabetrc','MAX_RISK','82944TtJQtl','env','stringify','72skJHjr','template_base_url','config','RISK_LEVEL','-api.ts','error','slice','36pjiGCM','length','pageSize','inherit','production','app','FORMAT','.lovrabet.json','apps','set','./utils/is-non-interactive.js','defaultApp','status','silent','maxRisk','read','APP','731105dDJJxo','join','198669KNeeJm','argv','warn','PAGE_SIZE','cookie','ENV','object','accessKey','userDomain','761336DtfHrV'];a139_0x1677=function(){return _0x557a60;};return a139_0x1677();}export function resolveApiFilePath(_0x48187d,_0x5d49dc){const _0x1a522a=a139_0x21c6b8,_0x2aefde=resolve(process[_0x1a522a(0x200)](),_0x48187d),_0x23defe=resolve(_0x2aefde,_0x1a522a(0x1ef));if(!_0x5d49dc)return _0x23defe;const _0x33679f=readRawConfig(),_0x50b6dc=_0x33679f[_0x1a522a(0x218)]&&typeof _0x33679f[_0x1a522a(0x218)]==='object'?_0x33679f[_0x1a522a(0x218)]:{},_0x2f43b5=Object['entries'](_0x50b6dc)[_0x1a522a(0x236)](([,_0x156e12])=>_0x156e12?.[_0x1a522a(0x239)]===_0x5d49dc);if(!_0x2f43b5)return _0x23defe;const [_0x24c7b6,_0x3fab6d]=_0x2f43b5,_0x1dd3c9=typeof _0x33679f[_0x1a522a(0x21b)]===_0x1a522a(0x1f2)?_0x33679f[_0x1a522a(0x21b)]:undefined;if(_0x3fab6d?.[_0x1a522a(0x232)])return _0x23defe;if(_0x1dd3c9&&_0x24c7b6!==_0x1dd3c9)return resolve(_0x2aefde,_0x24c7b6+_0x1a522a(0x20d));return _0x23defe;}
|
|
1
|
+
const a139_0x1112df=a139_0x994f;(function(_0x1c3b12,_0x4a0ef7){const _0x3ac127=a139_0x994f,_0xa9944f=_0x1c3b12();while(!![]){try{const _0x2a2032=parseInt(_0x3ac127(0x1b9))/0x1+parseInt(_0x3ac127(0x199))/0x2*(parseInt(_0x3ac127(0x19a))/0x3)+parseInt(_0x3ac127(0x190))/0x4*(-parseInt(_0x3ac127(0x19d))/0x5)+-parseInt(_0x3ac127(0x1aa))/0x6*(-parseInt(_0x3ac127(0x19e))/0x7)+parseInt(_0x3ac127(0x16e))/0x8*(parseInt(_0x3ac127(0x1a9))/0x9)+-parseInt(_0x3ac127(0x18f))/0xa*(parseInt(_0x3ac127(0x187))/0xb)+-parseInt(_0x3ac127(0x1a1))/0xc*(parseInt(_0x3ac127(0x1b0))/0xd);if(_0x2a2032===_0x4a0ef7)break;else _0xa9944f['push'](_0xa9944f['shift']());}catch(_0x104509){_0xa9944f['push'](_0xa9944f['shift']());}}}(a139_0x1d7b,0x79d91));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x12bd7f){return process.env[`RABETBASE_${_0x12bd7f}`]||process.env[`LOVRABET_${_0x12bd7f}`]||undefined;}function a139_0x994f(_0x3fc414,_0x51b7ad){_0x3fc414=_0x3fc414-0x16a;const _0x1d7b25=a139_0x1d7b();let _0x994f7b=_0x1d7b25[_0x3fc414];return _0x994f7b;}export const NEW_CONFIG_NAME=a139_0x1112df(0x186);export const CONFIG_NAMES=['.rabetbase.json',a139_0x1112df(0x16b),a139_0x1112df(0x1a8)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x41913c=>_0x41913c!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x4d612a){for(const _0x516dd3 of CONFIG_NAMES){const _0x16b926=resolve(_0x4d612a,_0x516dd3);if(existsSync(_0x16b926))return _0x16b926;}return undefined;}export function findProjectRootDirectory(_0x3982d6=process['cwd']()){let _0x45a443=resolve(_0x3982d6);const {root:_0x4e1bf1}=parse(_0x45a443),_0x220cf9=homedir();while(!![]){if(resolveConfigPath(_0x45a443)){if(_0x45a443===_0x220cf9)break;return _0x45a443;}if(_0x45a443===_0x4e1bf1||_0x45a443===_0x220cf9)break;const _0x551805=dirname(_0x45a443);if(_0x551805===_0x45a443)break;_0x45a443=_0x551805;}return resolve(_0x3982d6);}export async function createContext(_0x14b6a4){const _0xde751b=a139_0x1112df,_0x18b8c4=readRawConfig(),_0x270a40=buildConfig(_0x18b8c4,_0x14b6a4),{initEnv:_0x2ae376}=await import(_0xde751b(0x193));if(_0x270a40[_0xde751b(0x16f)])_0x2ae376(_0x270a40['env']);else _0x14b6a4[_0xde751b(0x16f)]&&typeof _0x14b6a4['env']===_0xde751b(0x16a)&&_0x2ae376(_0x14b6a4[_0xde751b(0x16f)]);const {initDomains:_0x557fc4,getUserDomain:_0x47a412,getApiDomain:_0x2e08e4}=await import(_0xde751b(0x1ba));_0x557fc4({'apiDomain':_0x18b8c4[_0xde751b(0x17f)]||undefined,'userDomain':_0x18b8c4[_0xde751b(0x1a2)]||undefined,'runtimeDomain':_0x18b8c4['runtimeDomain']||undefined});const _0x4ab8b1={'apiDomain':_0x2e08e4(),'userDomain':_0x47a412()},_0x98f2e2=await buildAuth(_0x270a40);logger[_0xde751b(0x198)](process['cwd']());const _0x241f62=(CLI_BIN_NAME+'\x20'+process[_0xde751b(0x19b)][_0xde751b(0x1a6)](0x2)['join']('\x20'))[_0xde751b(0x1a5)]();logger[_0xde751b(0x177)](_0x241f62);const {isNonInteractive:_0x3edbc0}=await import('./utils/is-non-interactive.js'),_0x49fbf5=_0x3edbc0(_0x14b6a4);return{'config':_0x270a40,'auth':_0x98f2e2,'logger':logger,'env':_0x4ab8b1,'nonInteractive':_0x49fbf5};}function a139_0x1d7b(){const _0x4dda05=['message','13395vdSLVv','6424523QWQuci','project','template_base_url','308196jAalRi','userDomain','warn','ENV','trim','slice','error','.lovrabetrc','9189xZSNNf','6YkBRyi','read','stringify','parse','ACCESS_KEY','get','91dUCXEg','https://g.lovrabet.com/dist/lovrabet-skill','riskLevel','cwd','RISK_LEVEL','accessKey','daily','apps','appcode','445585YHEBuP','./constant/domain.js','COOKIE','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','.tmp','MAX_RISK','pageSize','find','string','.lovrabet.json','keys','true','736LIscqH','env','locale','format','APP','status','utf8','empty','APPCODE','setRawCommand','entries','Global','cookie','map','VERBOSE','api.ts','set','apiDomain','app','silent','apiDir','inherit','config','Project','.rabetbase.json','720731lTQbTZ','length','filter','data','projectConfig','defaultApp','write','merged','70LNmwID','556ntSafQ','globalConfig','PAGE_SIZE','./constant/env.js','authRequired','\x0a\x20\x20','object','replace','setLogPath','16ssLVOK','19722QRsyCr','argv'];a139_0x1d7b=function(){return _0x4dda05;};return a139_0x1d7b();}export function buildConfigFromFlags(_0x76bf35){return buildConfig(readRawConfig(),_0x76bf35);}export function getProjectConfigPath(){const _0x5f58f9=a139_0x1112df;return resolveConfigPath(process[_0x5f58f9(0x1b3)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x1a08f2){const _0x2bdbf7=a139_0x1112df;if(!existsSync(_0x1a08f2))return{'status':'missing'};try{const _0x44cd8c=readFileSync(_0x1a08f2,{'encoding':_0x2bdbf7(0x174)});if(!_0x44cd8c?.[_0x2bdbf7(0x1a5)]())return{'status':_0x2bdbf7(0x175)};const _0x18e278=JSON[_0x2bdbf7(0x1ad)](_0x44cd8c);return{'status':'ok','data':_0x18e278};}catch(_0x53380c){return{'status':_0x2bdbf7(0x1a7),'message':_0x53380c instanceof Error?_0x53380c[_0x2bdbf7(0x19c)]:String(_0x53380c)};}}function parseCliConfigJsonFile(_0xc361ff,_0xe7ce45,_0x2316d8){const _0x132b49=a139_0x1112df,_0xfd46f2=inspectCliConfigJsonFile(_0xc361ff);if(_0xfd46f2[_0x132b49(0x173)]==='missing'||_0xfd46f2[_0x132b49(0x173)]===_0x132b49(0x175))return{};if(_0xfd46f2[_0x132b49(0x173)]==='ok')return _0xfd46f2[_0x132b49(0x18a)];return _0xe7ce45===_0x132b49(0x1a3)&&_0x2316d8&&console[_0x132b49(0x1a7)](CLI_BIN_NAME+':\x20'+_0x2316d8+_0x132b49(0x1bc)+_0xc361ff+_0x132b49(0x195)+_0xfd46f2[_0x132b49(0x19c)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x48391f){const _0x289556=a139_0x1112df;if(!_0x48391f||typeof _0x48391f!==_0x289556(0x196))return{'config':{},'migrated':![]};const _0x5c0953={..._0x48391f},_0x1dee05=_0x5c0953[_0x289556(0x1b7)]&&typeof _0x5c0953['apps']===_0x289556(0x196)?{..._0x5c0953[_0x289556(0x1b7)]}:{},_0x30b19b=Object[_0x289556(0x16c)](_0x1dee05)[_0x289556(0x188)],_0x5f0769=_0x5c0953[_0x289556(0x1b8)]||_0x5c0953[_0x289556(0x180)];let _0x4968fb=![];if(_0x5f0769&&_0x30b19b===0x0){const _0x1f9998=typeof _0x5c0953[_0x289556(0x18c)]==='string'&&_0x5c0953[_0x289556(0x18c)][_0x289556(0x1a5)]()?_0x5c0953[_0x289556(0x18c)]:String(_0x5f0769)[_0x289556(0x1a5)]();_0x1dee05[_0x1f9998]={'appcode':String(_0x5f0769)['trim'](),..._0x5c0953[_0x289556(0x16f)]!=null?{'env':_0x5c0953[_0x289556(0x16f)]}:{},..._0x5c0953[_0x289556(0x182)]!=null?{'apiDir':_0x5c0953[_0x289556(0x182)]}:{},..._0x5c0953['cookie']!=null?{'cookie':_0x5c0953[_0x289556(0x17a)]}:{},..._0x5c0953[_0x289556(0x1b5)]!=null?{'accessKey':_0x5c0953[_0x289556(0x1b5)]}:{},..._0x5c0953[_0x289556(0x171)]!=null?{'format':_0x5c0953[_0x289556(0x171)]}:{},..._0x5c0953[_0x289556(0x1bf)]!=null?{'pageSize':_0x5c0953[_0x289556(0x1bf)]}:{},..._0x5c0953[_0x289556(0x1b2)]!=null?{'riskLevel':_0x5c0953[_0x289556(0x1b2)]}:{},..._0x5c0953[_0x289556(0x170)]!=null?{'locale':_0x5c0953[_0x289556(0x170)]}:{}},_0x5c0953[_0x289556(0x1b7)]=_0x1dee05;if(!_0x5c0953[_0x289556(0x18c)])_0x5c0953['defaultApp']=_0x1f9998;_0x4968fb=!![];}return(_0x289556(0x1b8)in _0x5c0953||_0x289556(0x180)in _0x5c0953)&&(delete _0x5c0953['appcode'],delete _0x5c0953[_0x289556(0x180)],_0x4968fb=!![]),{'config':_0x5c0953,'migrated':_0x4968fb};}function writeNormalizedConfigIfNeeded(_0x3b978d,_0x296237){const _0xb6529d=a139_0x1112df,_0x5a0e2c=JSON[_0xb6529d(0x1ac)](_0x296237,null,0x2)+'\x0a';if(normalizedWriteCache[_0xb6529d(0x1af)](_0x3b978d)===_0x5a0e2c)return;writeConfigFile(_0x3b978d,_0x296237),normalizedWriteCache[_0xb6529d(0x17e)](_0x3b978d,_0x5a0e2c);}function parseAndNormalizeConfig(_0x1bcea7,_0x382424,_0x10fd75){const _0x79ef75=a139_0x1112df,_0x26790a=parseCliConfigJsonFile(_0x1bcea7,_0x382424,_0x10fd75),_0x27b0af=normalizeLegacyConfigShape(_0x26790a);if(_0x27b0af['migrated'])try{writeNormalizedConfigIfNeeded(_0x1bcea7,_0x27b0af[_0x79ef75(0x184)]);}catch{}return _0x27b0af[_0x79ef75(0x184)];}export function loadRawConfigLayers(_0x8bff47){const _0x1ce0d6=a139_0x1112df;let _0x45ef6b={},_0x5d8a7b={};const _0x32f89d=resolveConfigPath(homedir());_0x32f89d&&(_0x45ef6b=parseAndNormalizeConfig(_0x32f89d,'warn',_0x1ce0d6(0x179)));const _0x15e032=_0x8bff47??findProjectRootDirectory(),_0x11767e=resolveConfigPath(_0x15e032);return _0x11767e&&(_0x5d8a7b=parseAndNormalizeConfig(_0x11767e,'warn',_0x1ce0d6(0x185))),{'globalPath':_0x32f89d,'projectPath':_0x11767e,'globalConfig':_0x45ef6b,'projectConfig':_0x5d8a7b};}const INHERIT_WHITELIST=['cookie',a139_0x1112df(0x1b5),a139_0x1112df(0x170),a139_0x1112df(0x171),a139_0x1112df(0x1b2),a139_0x1112df(0x1bf)];function mergeRawConfigLayers(_0x2cd3ef){const _0x4efb30=a139_0x1112df,{globalConfig:_0x9a1966,projectConfig:_0x304274}=_0x2cd3ef,_0x364e68=Object[_0x4efb30(0x16c)](_0x304274)[_0x4efb30(0x188)]>0x0;if(!_0x364e68)return mergeGlobalOnly(_0x9a1966);if(_0x304274[_0x4efb30(0x183)]===!![])return mergeFullInherit(_0x9a1966,_0x304274);if(_0x304274[_0x4efb30(0x183)]===![])return mergeIsolated(_0x304274);return mergeProjectFirst(_0x9a1966,_0x304274);}function mergeGlobalOnly(_0x1cee83){const _0x3997a6=a139_0x1112df,_0x49327a={..._0x1cee83},_0x3a60f1=_0x1cee83['apps']&&typeof _0x1cee83[_0x3997a6(0x1b7)]===_0x3997a6(0x196)?_0x1cee83[_0x3997a6(0x1b7)]:{};Object[_0x3997a6(0x16c)](_0x3a60f1)[_0x3997a6(0x188)]>0x0&&(_0x49327a[_0x3997a6(0x1b7)]=_0x3a60f1);if(_0x1cee83[_0x3997a6(0x18c)])_0x49327a[_0x3997a6(0x18c)]=_0x1cee83[_0x3997a6(0x18c)];else{const _0x261993=Object[_0x3997a6(0x16c)](_0x3a60f1);if(_0x261993['length']>0x0)_0x49327a[_0x3997a6(0x18c)]=_0x261993[0x0];}return _0x49327a;}function mergeIsolated(_0x3b76f5){const _0x499b2b=a139_0x1112df,_0x50d849={..._0x3b76f5};delete _0x50d849[_0x499b2b(0x183)];const _0x1ec91a=_0x3b76f5[_0x499b2b(0x1b7)]&&typeof _0x3b76f5['apps']==='object'?_0x3b76f5[_0x499b2b(0x1b7)]:{};Object[_0x499b2b(0x16c)](_0x1ec91a)['length']>0x0?_0x50d849['apps']=_0x1ec91a:delete _0x50d849[_0x499b2b(0x1b7)];if('defaultApp'in _0x3b76f5)_0x50d849['defaultApp']=_0x3b76f5[_0x499b2b(0x18c)];else Object[_0x499b2b(0x16c)](_0x1ec91a)[_0x499b2b(0x188)]>0x0?_0x50d849[_0x499b2b(0x18c)]=Object['keys'](_0x1ec91a)[0x0]:delete _0x50d849['defaultApp'];return _0x50d849;}function mergeProjectFirst(_0x2ade73,_0x316497){const _0x2002dd=a139_0x1112df,_0x1a077f={..._0x316497};delete _0x1a077f[_0x2002dd(0x183)];for(const _0x5d9433 of INHERIT_WHITELIST){!(_0x5d9433 in _0x1a077f)&&_0x5d9433 in _0x2ade73&&(_0x1a077f[_0x5d9433]=_0x2ade73[_0x5d9433]);}const _0x5ba919=_0x316497[_0x2002dd(0x1b7)]&&typeof _0x316497[_0x2002dd(0x1b7)]===_0x2002dd(0x196)?_0x316497[_0x2002dd(0x1b7)]:{};Object[_0x2002dd(0x16c)](_0x5ba919)[_0x2002dd(0x188)]>0x0?_0x1a077f[_0x2002dd(0x1b7)]=_0x5ba919:delete _0x1a077f[_0x2002dd(0x1b7)];if(_0x2002dd(0x18c)in _0x316497)_0x1a077f[_0x2002dd(0x18c)]=_0x316497[_0x2002dd(0x18c)];else Object[_0x2002dd(0x16c)](_0x5ba919)[_0x2002dd(0x188)]>0x0?_0x1a077f[_0x2002dd(0x18c)]=Object[_0x2002dd(0x16c)](_0x5ba919)[0x0]:delete _0x1a077f[_0x2002dd(0x18c)];return _0x1a077f;}function mergeFullInherit(_0x5caa6f,_0x5f4a08){const _0x1a2a06=a139_0x1112df,_0x340efb=_0x5caa6f['apps']&&typeof _0x5caa6f[_0x1a2a06(0x1b7)]===_0x1a2a06(0x196)?_0x5caa6f[_0x1a2a06(0x1b7)]:{},_0x31fd64=_0x5f4a08[_0x1a2a06(0x1b7)]&&typeof _0x5f4a08['apps']===_0x1a2a06(0x196)?_0x5f4a08['apps']:{},_0x2ffa33={..._0x340efb,..._0x31fd64},_0xc39c2d={..._0x5caa6f,..._0x5f4a08};delete _0xc39c2d[_0x1a2a06(0x183)];Object[_0x1a2a06(0x16c)](_0x2ffa33)[_0x1a2a06(0x188)]>0x0&&(_0xc39c2d[_0x1a2a06(0x1b7)]=_0x2ffa33);if(_0x1a2a06(0x18c)in _0x5f4a08)_0xc39c2d[_0x1a2a06(0x18c)]=_0x5f4a08[_0x1a2a06(0x18c)];else{if(Object[_0x1a2a06(0x16c)](_0x31fd64)[_0x1a2a06(0x188)]>0x0)_0xc39c2d[_0x1a2a06(0x18c)]=Object['keys'](_0x31fd64)[0x0];else{if(_0x5caa6f['defaultApp'])_0xc39c2d[_0x1a2a06(0x18c)]=_0x5caa6f[_0x1a2a06(0x18c)];else{const _0x17fecb=Object[_0x1a2a06(0x16c)](_0x340efb);if(_0x17fecb[_0x1a2a06(0x188)]>0x0)_0xc39c2d[_0x1a2a06(0x18c)]=_0x17fecb[0x0];}}}return _0xc39c2d;}export function readRawConfigWithLayers(_0xd682d){const _0x29d870=loadRawConfigLayers(_0xd682d);return{'config':mergeRawConfigLayers(_0x29d870),'layers':_0x29d870};}export function readRawConfig(_0x397623){return mergeRawConfigLayers(loadRawConfigLayers(_0x397623));}export function getConfigAppCode(_0x1f9701){const _0x212924=a139_0x1112df,_0x16e039=readRawConfig(_0x1f9701);if(_0x16e039[_0x212924(0x1b7)]&&typeof _0x16e039[_0x212924(0x1b7)]===_0x212924(0x196)){const _0x2bdb28=_0x16e039[_0x212924(0x18c)];if(_0x2bdb28&&_0x16e039[_0x212924(0x1b7)][_0x2bdb28]?.[_0x212924(0x1b8)])return String(_0x16e039[_0x212924(0x1b7)][_0x2bdb28][_0x212924(0x1b8)])[_0x212924(0x1a5)]();const _0x2ae071=Object['values'](_0x16e039[_0x212924(0x1b7)])[0x0];if(_0x2ae071?.[_0x212924(0x1b8)])return String(_0x2ae071[_0x212924(0x1b8)])['trim']();}const _0xb6220a=_0x16e039['appcode']||_0x16e039['app'];if(typeof _0xb6220a!==_0x212924(0x16a)||_0xb6220a['trim']()==='')return undefined;return _0xb6220a[_0x212924(0x1a5)]();}export function getMultiAppConfigs(_0x4934f2=a139_0x1112df(0x19f),_0x47dd8e){const _0x1d3e07=a139_0x1112df,_0x540e1c=loadRawConfigLayers(_0x47dd8e);let _0x73d26c,_0x2ffe88;if(_0x4934f2===_0x1d3e07(0x18e)){const _0x288d3d=_0x540e1c[_0x1d3e07(0x191)][_0x1d3e07(0x1b7)]&&typeof _0x540e1c[_0x1d3e07(0x191)][_0x1d3e07(0x1b7)]===_0x1d3e07(0x196)?_0x540e1c['globalConfig']['apps']:{},_0xa8a13b=_0x540e1c[_0x1d3e07(0x18b)][_0x1d3e07(0x1b7)]&&typeof _0x540e1c['projectConfig'][_0x1d3e07(0x1b7)]===_0x1d3e07(0x196)?_0x540e1c['projectConfig'][_0x1d3e07(0x1b7)]:{};_0x73d26c={..._0x288d3d,..._0xa8a13b};const _0x1aec4d=readRawConfig(_0x47dd8e);_0x2ffe88=_0x1aec4d['defaultApp'];}else _0x73d26c=_0x540e1c[_0x1d3e07(0x18b)][_0x1d3e07(0x1b7)],_0x2ffe88=_0x540e1c[_0x1d3e07(0x18b)]['defaultApp'];if(!_0x73d26c||typeof _0x73d26c!=='object'||Object[_0x1d3e07(0x16c)](_0x73d26c)[_0x1d3e07(0x188)]===0x0)return null;return Object[_0x1d3e07(0x178)](_0x73d26c)[_0x1d3e07(0x17b)](([_0x40b97b,_0x300f26])=>({'name':_0x40b97b,'appcode':_0x300f26?.[_0x1d3e07(0x1b8)]||'','isDefault':_0x40b97b===_0x2ffe88,'env':_0x300f26?.[_0x1d3e07(0x16f)],'apiDir':_0x300f26?.[_0x1d3e07(0x182)],'cookie':_0x300f26?.[_0x1d3e07(0x17a)]||undefined}))[_0x1d3e07(0x189)](_0x10a2b1=>_0x10a2b1['appcode']);}export function getTemplateBaseUrl(_0x4fef89){const _0x4bbb1b=a139_0x1112df,_0x417b4c=readRawConfig(_0x4fef89);if(_0x417b4c[_0x4bbb1b(0x1a0)]&&typeof _0x417b4c[_0x4bbb1b(0x1a0)]===_0x4bbb1b(0x16a))return _0x417b4c[_0x4bbb1b(0x1a0)][_0x4bbb1b(0x197)](/\/$/,'');return _0x4bbb1b(0x1b1);}export function readConfigFile(_0x13d664){const _0x163955=a139_0x1112df;return parseAndNormalizeConfig(_0x13d664,_0x163955(0x181));}export function writeConfigFile(_0x4cedf3,_0xa1a665){const _0x372b1b=a139_0x1112df,_0x27fb49=dirname(_0x4cedf3);!existsSync(_0x27fb49)&&mkdirSync(_0x27fb49,{'recursive':!![]});const _0x139efb=_0x4cedf3+_0x372b1b(0x1bd);try{writeFileSync(_0x139efb,JSON[_0x372b1b(0x1ac)](_0xa1a665,null,0x2)+'\x0a',{'encoding':_0x372b1b(0x174),'mode':0x180}),renameSync(_0x139efb,_0x4cedf3);}catch(_0x5aa51d){try{unlinkSync(_0x139efb);}catch{}throw _0x5aa51d;}}export function resolveWriteConfigPath(_0x1413e3){const _0x57740f=a139_0x1112df,_0x1fa039=_0x1413e3===_0x57740f(0x19f)?process[_0x57740f(0x1b3)]():homedir(),_0x54bce7=resolveConfigPath(_0x1fa039);return _0x54bce7??resolve(_0x1fa039,NEW_CONFIG_NAME);}function buildConfig(_0x5ebcb6,_0x3266d8){const _0x275349=a139_0x1112df,_0xccc50f={};if(_0x5ebcb6[_0x275349(0x1b7)]&&typeof _0x5ebcb6[_0x275349(0x1b7)]==='object')for(const [_0x2e2112,_0x451842]of Object[_0x275349(0x178)](_0x5ebcb6[_0x275349(0x1b7)])){_0x451842&&typeof _0x451842===_0x275349(0x196)&&_0x451842[_0x275349(0x1b8)]&&(_0xccc50f[_0x2e2112]=_0x451842);}const _0x7e53ec=_0x5ebcb6['defaultApp']||undefined,_0x4216d9=Object[_0x275349(0x16c)](_0xccc50f)[_0x275349(0x188)]>0x0,_0x3a9826=_0x3266d8[_0x275349(0x180)]||env(_0x275349(0x172))||undefined,_0x1bca86=_0x3a9826||_0x7e53ec||undefined,_0x26cf45=_0x3266d8['appcode']||env(_0x275349(0x176))||undefined,_0x292975=_0x26cf45?Object[_0x275349(0x178)](_0xccc50f)[_0x275349(0x1c0)](([,_0x13df83])=>_0x13df83?.[_0x275349(0x1b8)]===_0x26cf45):undefined,_0x4029cd=_0x292975?.[0x0],_0x37cbd5=_0x292975?.[0x1];let _0xa19dd8=_0x26cf45?_0x4029cd:_0x1bca86,_0x1abe9d=_0xa19dd8&&_0xccc50f[_0xa19dd8]?_0xccc50f[_0xa19dd8]:undefined;_0x26cf45&&_0x37cbd5&&(_0x1abe9d=_0x37cbd5);const _0x2a1485=_0x26cf45?_0x37cbd5??_0x1abe9d:_0x1abe9d,_0x524d81=_0x3a9826||(_0x26cf45?_0x4029cd:undefined),_0x308f4d=_0x26cf45||_0x2a1485?.['appcode']||undefined,_0x185275=_0x3266d8[_0x275349(0x16f)]||env(_0x275349(0x1a4))||_0x2a1485?.[_0x275349(0x16f)]||_0x5ebcb6['env']||DEFAULT_CONFIG_VALUES[_0x275349(0x16f)],_0xc8c69c=_0x2a1485?.[_0x275349(0x170)]||_0x5ebcb6[_0x275349(0x170)]||DEFAULT_CONFIG_VALUES[_0x275349(0x170)],_0xf9895a=env(_0x275349(0x1bb))||_0x2a1485?.[_0x275349(0x17a)]||_0x5ebcb6[_0x275349(0x17a)]||undefined,_0x375ce7=env(_0x275349(0x1ae))||_0x2a1485?.[_0x275349(0x1b5)]||_0x5ebcb6[_0x275349(0x1b5)]||undefined,_0x3fc0df=_0x3266d8[_0x275349(0x171)]||env('FORMAT')||_0x2a1485?.[_0x275349(0x171)]||_0x5ebcb6[_0x275349(0x171)],_0x2c3ed5=normalizeLegacyOutputFormat(_0x3fc0df),_0x2c71c0=env(_0x275349(0x192))||_0x2a1485?.[_0x275349(0x1bf)]||_0x5ebcb6[_0x275349(0x1bf)],_0x252f17=_0x2c71c0?Number(_0x2c71c0)||undefined:undefined,_0x2f84a4=env(_0x275349(0x1b4))||env(_0x275349(0x1be))||_0x2a1485?.[_0x275349(0x1b2)]||_0x5ebcb6['riskLevel']||_0x5ebcb6['maxRisk'],_0x144128=_0x2f84a4===_0x275349(0x1ab)||_0x2f84a4===_0x275349(0x18d)?_0x2f84a4:DEFAULT_CONFIG_VALUES['riskLevel'],_0x442dd2=env(_0x275349(0x17c)),_0x4f9421=_0x442dd2==='1'||_0x442dd2===_0x275349(0x16d),_0x3c8fde=_0x2a1485?.['apiDir']||_0x5ebcb6[_0x275349(0x182)]||DEFAULT_CONFIG_VALUES[_0x275349(0x182)],_0xe7c250=isDaily(normalizeEnv(String(_0x185275)))?_0x275349(0x1b6):'production';return{'appCode':typeof _0x308f4d==='string'&&_0x308f4d[_0x275349(0x1a5)]()?_0x308f4d[_0x275349(0x1a5)]():undefined,'env':_0xe7c250,'locale':_0xc8c69c,'cookie':_0xf9895a,'accessKey':_0x375ce7,'format':_0x2c3ed5,'pageSize':_0x252f17,'riskLevel':_0x144128,'verbose':_0x4f9421,'apiDir':_0x3c8fde,'apps':_0xccc50f,'defaultApp':_0x7e53ec,'currentApp':_0x4216d9?_0xa19dd8:undefined,'explicitAppName':_0x524d81,'raw':_0x5ebcb6};}async function buildAuth(_0x289ab4){const {getCookie:_0x14915f}=await import('./auth/get-cookie.js'),_0x7b841c=_0x289ab4['cookie']||_0x14915f(),_0x4fb93a=_0x7b841c?await getIsSessionValid():![];return{'cookie':_0x7b841c,'isLoggedIn':_0x4fb93a,async 'getOrLogin'(){const _0x3efb61=a139_0x994f;if(_0x7b841c&&_0x4fb93a)return _0x7b841c;throw CliErrors[_0x3efb61(0x194)]();}};}export function resolveApiFilePath(_0x37b590,_0x1c062a){const _0x35c81a=a139_0x1112df,_0x3c04ef=resolve(process[_0x35c81a(0x1b3)](),_0x37b590),_0x5a55d0=resolve(_0x3c04ef,_0x35c81a(0x17d));if(!_0x1c062a)return _0x5a55d0;const _0x59c973=readRawConfig(),_0x2d3a26=_0x59c973[_0x35c81a(0x1b7)]&&typeof _0x59c973[_0x35c81a(0x1b7)]==='object'?_0x59c973['apps']:{},_0xfb5113=Object[_0x35c81a(0x178)](_0x2d3a26)['find'](([,_0x6e0291])=>_0x6e0291?.[_0x35c81a(0x1b8)]===_0x1c062a);if(!_0xfb5113)return _0x5a55d0;const [_0x11fbe4,_0x3107e4]=_0xfb5113,_0x1062ea=typeof _0x59c973[_0x35c81a(0x18c)]===_0x35c81a(0x16a)?_0x59c973[_0x35c81a(0x18c)]:undefined;if(_0x3107e4?.['apiDir'])return _0x5a55d0;if(_0x1062ea&&_0x11fbe4!==_0x1062ea)return resolve(_0x3c04ef,_0x11fbe4+'-api.ts');return _0x5a55d0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58022a,_0xfdf74e){const _0x5e885f=a140_0x58c3,_0x3ff65b=_0x58022a();while(!![]){try{const _0x521e08=parseInt(_0x5e885f(0x1c5))/0x1*(parseInt(_0x5e885f(0x1c3))/0x2)+parseInt(_0x5e885f(0x1ba))/0x3*(-parseInt(_0x5e885f(0x1be))/0x4)+parseInt(_0x5e885f(0x1c7))/0x5*(-parseInt(_0x5e885f(0x1b6))/0x6)+-parseInt(_0x5e885f(0x1c1))/0x7+-parseInt(_0x5e885f(0x1b2))/0x8+parseInt(_0x5e885f(0x1b3))/0x9*(parseInt(_0x5e885f(0x1b5))/0xa)+parseInt(_0x5e885f(0x1c4))/0xb*(parseInt(_0x5e885f(0x1bd))/0xc);if(_0x521e08===_0xfdf74e)break;else _0x3ff65b['push'](_0x3ff65b['shift']());}catch(_0x4459f8){_0x3ff65b['push'](_0x3ff65b['shift']());}}}(a140_0x3d69,0xa893c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a140_0x58c3(_0x247657,_0x540087){_0x247657=_0x247657-0x1b2;const _0x3d6966=a140_0x3d69();let _0x58c3fb=_0x3d6966[_0x247657];return _0x58c3fb;}function parseApiFile(_0x4ccfe9){const _0x66dd4b=a140_0x58c3,_0x5cba02=[],_0x4f797a=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x371e81;while((_0x371e81=_0x4f797a[_0x66dd4b(0x1b9)](_0x4ccfe9))!==null){_0x5cba02[_0x66dd4b(0x1b7)]({'datasetCode':_0x371e81[0x1],'tableName':_0x371e81[0x2],'name':_0x371e81[0x3],'alias':_0x371e81[0x4]});}return _0x5cba02;}export function loadAliasMap(_0x1086f5,_0x5e5d1b,_0x4571e4){const _0x372583=a140_0x58c3,_0x63f4bd=_0x4571e4??resolve(process[_0x372583(0x1c0)](),_0x1086f5,_0x372583(0x1b8));if(cache[_0x372583(0x1b4)](_0x63f4bd))return cache[_0x372583(0x1c6)](_0x63f4bd);if(!existsSync(_0x63f4bd))return cache[_0x372583(0x1c2)](_0x63f4bd,[]),[];try{const _0x533966=readFileSync(_0x63f4bd,'utf-8'),_0x1ebb25=parseApiFile(_0x533966);return cache['set'](_0x63f4bd,_0x1ebb25),_0x1ebb25;}catch{return cache[_0x372583(0x1c2)](_0x63f4bd,[]),[];}}export function resolveAlias(_0x5a2254,_0x47752e,_0x387f33,_0x56e793){const _0x34c1c4=a140_0x58c3;if(!_0x47752e)return undefined;const _0x4c868b=loadAliasMap(_0x5a2254,_0x387f33,_0x56e793),_0x2304a3=_0x4c868b[_0x34c1c4(0x1bb)](_0x262fe7=>_0x262fe7[_0x34c1c4(0x1bf)]===_0x47752e);return _0x2304a3?.[_0x34c1c4(0x1bc)];}export function listAliases(_0x11f297,_0x3521a9,_0xe858e4){return loadAliasMap(_0x11f297,_0x3521a9,_0xe858e4);}function a140_0x3d69(){const _0x1be07e=['545688HlbOwm','alias','cwd','1086155ihrIHZ','set','152gIgSBZ','17788485FTSJCd','409nELZyw','get','5234140wFdzQf','3504000rSVjfP','1170boabom','has','73470mGfxBI','6oniiZO','push','api.ts','exec','6iGujnn','find','datasetCode','12imGBsj'];a140_0x3d69=function(){return _0x1be07e;};return a140_0x3d69();}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1b308d,_0x57bb8d){const _0x3ce507=a141_0x4248,_0x1e1db3=_0x1b308d();while(!![]){try{const _0x1a0ca4=-parseInt(_0x3ce507(0x15f))/0x1+-parseInt(_0x3ce507(0x15d))/0x2+-parseInt(_0x3ce507(0xce))/0x3+parseInt(_0x3ce507(0x16a))/0x4+parseInt(_0x3ce507(0x134))/0x5+parseInt(_0x3ce507(0xda))/0x6+parseInt(_0x3ce507(0xe0))/0x7*(-parseInt(_0x3ce507(0x108))/0x8);if(_0x1a0ca4===_0x57bb8d)break;else _0x1e1db3['push'](_0x1e1db3['shift']());}catch(_0x2b0e48){_0x1e1db3['push'](_0x1e1db3['shift']());}}}(a141_0x5b03,0x672dd));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x3f8f7c){_activeCookie=_0x3f8f7c||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x4ceaa4,_0x3baf2a){const _0x475c26=a141_0x4248,_0x4e1c37=_0x3baf2a instanceof Error?_0x3baf2a[_0x475c26(0x14e)]:String(_0x3baf2a);return CliErrors[_0x475c26(0x13d)](_0x475c26(0x142)+_0x4ceaa4+(_0x4e1c37?'\x20('+_0x4e1c37+')':''),_0x475c26(0x11d));}async function apiRequest(_0x123c01,_0x1f4c88={}){const _0x40c268=a141_0x4248,{method:method=_0x40c268(0xe4),body:_0x553d0a,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x1f4c88,_0x4a6038=useRuntime?getRuntimeDomain():getApiDomain(),_0x106350=_activeCookie||getCookie(),_0x34b878=''+_0x4a6038+_0x123c01,_0x26d6ee=new AbortController(),_0x365fd8=setTimeout(()=>_0x26d6ee[_0x40c268(0x154)](),timeout);try{const _0x56b505=await fetch(_0x34b878,{'method':method,'headers':{'Content-Type':_0x40c268(0x165),'Cookie':_0x106350,'X-Invoke-Source':_0x40c268(0x14d),...headers},'body':_0x553d0a?JSON[_0x40c268(0xc9)](_0x553d0a):undefined,'signal':_0x26d6ee[_0x40c268(0x136)]});let _0x5dcbb6;try{_0x5dcbb6=await _0x56b505['json']();}catch{throw CliErrors[_0x40c268(0x13d)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x56b505[_0x40c268(0xe3)]+')',_0x56b505[_0x40c268(0xe3)]>=0x190?_0x40c268(0x109):undefined);}if(!_0x56b505['ok']||_0x5dcbb6[_0x40c268(0x115)]===![])throw CliErrors[_0x40c268(0x13d)](_0x5dcbb6[_0x40c268(0xd6)]||_0x5dcbb6['message']||_0x40c268(0x169)+_0x56b505[_0x40c268(0xe3)],_0x5dcbb6['errorCode']?_0x40c268(0xfe)+_0x5dcbb6[_0x40c268(0xdc)]:undefined);return _0x5dcbb6;}catch(_0x5ca4fb){if(_0x5ca4fb instanceof CliError)throw _0x5ca4fb;if(_0x5ca4fb instanceof Error&&_0x5ca4fb[_0x40c268(0xe9)]===_0x40c268(0x13b))throw CliErrors[_0x40c268(0x13d)](_0x40c268(0x167)+_0x34b878);throw createFetchFailureError(_0x34b878,_0x5ca4fb);}finally{clearTimeout(_0x365fd8);}}function isAuthFailure(_0x2f0694){const _0xfd9364=a141_0x4248,_0x514fba=_0x2f0694[_0xfd9364(0xd6)]||_0x2f0694[_0xfd9364(0x14e)]||_0x2f0694[_0xfd9364(0x164)]?.[_0xfd9364(0x14e)]||_0x2f0694[_0xfd9364(0xef)]||_0x2f0694[_0xfd9364(0x137)]||'';return _0x2f0694['errorCode']===_0xfd9364(0xed)||_0x2f0694[_0xfd9364(0x113)]===0x191||_0x2f0694[_0xfd9364(0x113)]==='401'||_0x514fba[_0xfd9364(0xec)](_0xfd9364(0xf0))||_0x514fba['includes'](_0xfd9364(0x105))||_0x514fba[_0xfd9364(0xec)]('登录')||_0x514fba[_0xfd9364(0xec)]('认证');}function a141_0x4248(_0x568495,_0x4a9b39){_0x568495=_0x568495-0xc9;const _0x5b0304=a141_0x5b03();let _0x424872=_0x5b0304[_0x568495];return _0x424872;}export async function platformFetch(_0x3b0458,_0x13a01e){const _0x3869a5=a141_0x4248;let _0x866ada;try{_0x866ada=await fetch(_0x3b0458,{'method':_0x13a01e[_0x3869a5(0x149)]??_0x3869a5(0xe4),'headers':{'Content-Type':_0x3869a5(0x165),'Cookie':_0x13a01e[_0x3869a5(0x139)],'X-Invoke-Source':_0x3869a5(0x14d)},..._0x13a01e[_0x3869a5(0x162)]&&{'body':JSON['stringify'](_0x13a01e['body'])}});}catch(_0x3a3913){throw createFetchFailureError(_0x3b0458,_0x3a3913);}if(!_0x866ada['ok']){if(_0x866ada[_0x3869a5(0xe3)]===0x191)throw CliErrors[_0x3869a5(0xdf)]();throw CliErrors['apiError'](_0x13a01e[_0x3869a5(0xf8)]+_0x3869a5(0x11f)+_0x866ada['status']);}const _0x2a456e=await _0x866ada[_0x3869a5(0x13e)]();if(_0x2a456e[_0x3869a5(0x115)]===![]){if(isAuthFailure(_0x2a456e))throw CliErrors[_0x3869a5(0xdf)]();throw CliErrors[_0x3869a5(0x13d)](_0x2a456e[_0x3869a5(0xd6)]||_0x2a456e[_0x3869a5(0x14e)]||_0x13a01e[_0x3869a5(0xf8)]+_0x3869a5(0xf7));}return _0x2a456e[_0x3869a5(0x164)];}export async function listBffScripts(_0x3caaec,_0x57b739,_0x3d0252){const _0x296e51=a141_0x4248;let _0x3997a0=_0x296e51(0x140)+_0x3caaec;if(_0x57b739)_0x3997a0+='&type='+_0x57b739;const _0x242d0f=await apiRequest(_0x3997a0);let _0x31895e=extractList(_0x242d0f[_0x296e51(0x164)]);if(_0x3d0252?.['scriptName']){const _0x193c9e=_0x3d0252[_0x296e51(0x153)]['toLowerCase']();_0x31895e=_0x31895e[_0x296e51(0xe1)](_0x4035ce=>_0x4035ce[_0x296e51(0x14f)]?.[_0x296e51(0x135)]()[_0x296e51(0xec)](_0x193c9e)||_0x4035ce[_0x296e51(0x125)]?.[_0x296e51(0x135)]()[_0x296e51(0xec)](_0x193c9e));}return _0x31895e;}export async function getBffScriptInfo(_0x472898){const _0x387d8e=a141_0x4248,_0x28b96e=await apiRequest(_0x387d8e(0x15c)+_0x472898);if(!_0x28b96e[_0x387d8e(0x164)])throw CliErrors[_0x387d8e(0x10d)](_0x387d8e(0x15a)+_0x472898);return _0x28b96e[_0x387d8e(0x164)];}export async function saveBffScript(_0x1b66fb){const _0x4bb0af=a141_0x4248,_0xa71790=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x1b66fb}),{id:_0x4a7c15,entity:_0x55c9ea}=normalizeEntityWithIdResponse(_0xa71790['data']);if(_0x4a7c15!==undefined){const _0x268001=typeof _0x55c9ea[_0x4bb0af(0x14f)]===_0x4bb0af(0x146)||typeof _0x55c9ea[_0x4bb0af(0xfa)]==='string'?_0x55c9ea:undefined;return{'id':_0x4a7c15,'script':_0x268001};}throw CliErrors[_0x4bb0af(0x13d)](_0x4bb0af(0xf9));}export async function deleteBffScript(_0x31ed2f){const _0x49a563=a141_0x4248;await apiRequest('/api/management/library/scripts/delete',{'method':_0x49a563(0xca),'body':{'id':_0x31ed2f}});}export async function getBffScriptStatistics(_0x15cb50){const _0x1a0035=a141_0x4248,_0x553869=await apiRequest(_0x1a0035(0x117)+_0x15cb50);return extractList(_0x553869[_0x1a0035(0x164)]);}export async function clearBffScriptCache(){const _0x27d67b=a141_0x4248,_0x14f0fb=await apiRequest(_0x27d67b(0x107),{'method':_0x27d67b(0xca),'useRuntime':!![]});return typeof _0x14f0fb[_0x27d67b(0x164)]===_0x27d67b(0x146)?_0x14f0fb[_0x27d67b(0x164)]:'';}export async function listBffDatasetOperations(_0x26c854,_0x4e88a2){const _0x4f3675=a141_0x4248,_0x515e03=await apiRequest(_0x4f3675(0x13c),{'method':'POST','body':{'appCode':_0x26c854,'datasetId':_0x4e88a2}});return _0x515e03[_0x4f3675(0x164)];}export async function listSqlQueries(_0x4add4c,_0x16547b){const _0x3c8d77=a141_0x4248,_0x5f3f37=await apiRequest(_0x3c8d77(0xde),{'method':_0x3c8d77(0xca),'body':{'appCode':_0x4add4c,'currentPage':_0x16547b?.['currentPage']??0x1,'pageSize':_0x16547b?.[_0x3c8d77(0x101)]??0x32,'sqlCode':_0x16547b?.[_0x3c8d77(0x10a)],'sqlName':_0x16547b?.['sqlName']}});return _0x5f3f37['data'];}export async function getSqlQueryInfo(_0x565671,_0xcbf2ce){const _0x1b4071=a141_0x4248,_0x4a0dd3=await listSqlQueries(_0x565671,{'sqlCode':_0xcbf2ce}),_0x4cca00=_0x4a0dd3[_0x1b4071(0xee)]?.[0x0];if(!_0x4cca00)throw CliErrors[_0x1b4071(0x10d)](_0x1b4071(0xd9)+_0xcbf2ce);return _0x4cca00;}export async function getSqlQueryDetail(_0x4af52a){const _0x201dc2=a141_0x4248,_0x10235e=await apiRequest(_0x201dc2(0x110)+(_0x201dc2(0x14c)+encodeURIComponent(_0x4af52a)));if(!_0x10235e[_0x201dc2(0x164)])throw CliErrors[_0x201dc2(0x10d)](_0x201dc2(0xd9)+_0x4af52a);return _0x10235e[_0x201dc2(0x164)];}export async function getSqlQueryDetailById(_0x4ab3e3){const _0x152ebb=a141_0x4248,_0x4a7d9d=await apiRequest(_0x152ebb(0x111)+_0x4ab3e3);if(!_0x4a7d9d['data'])throw CliErrors[_0x152ebb(0x10d)](_0x152ebb(0x10e)+_0x4ab3e3);return _0x4a7d9d['data'];}export async function createSqlQuery(_0x28f9dd){const _0x42cdcc=a141_0x4248,_0x56f900=await apiRequest(_0x42cdcc(0x131),{'method':_0x42cdcc(0xca),'body':_0x28f9dd}),{id:_0x4d6ff2,entity:_0x276aaf}=normalizeEntityWithIdResponse(_0x56f900[_0x42cdcc(0x164)]);if(!(_0x42cdcc(0x10a)in _0x276aaf)&&_0x4d6ff2)return getSqlQueryDetailById(_0x4d6ff2);return normalizeSqlQueryEntity(_0x276aaf);}export async function updateSqlQuery(_0x265885){const _0x2d6168=a141_0x4248,_0x320dd9=await apiRequest(_0x2d6168(0xdb),{'method':_0x2d6168(0xca),'body':_0x265885}),{id:_0x3f2a79,entity:_0x331584}=normalizeEntityWithIdResponse(_0x320dd9[_0x2d6168(0x164)]);if(!(_0x2d6168(0x10a)in _0x331584)){if(_0x265885[_0x2d6168(0x10a)])return getSqlQueryDetail(_0x265885[_0x2d6168(0x10a)]);if(_0x3f2a79)return getSqlQueryDetailById(_0x3f2a79);}return normalizeSqlQueryEntity(_0x331584);}export async function deleteSqlQuery(_0x651a03){const _0x12d8c8=a141_0x4248;await apiRequest(_0x12d8c8(0x122),{'method':_0x12d8c8(0xca),'body':_0x651a03});}export async function saveSqlQuery(_0x17a791){const _0x1dedcd=await apiRequest('/api/node-toolbox/sql/save',{'method':'POST','body':_0x17a791});return _0x1dedcd['data'];}function normalizeSqlQueryEntity(_0x3b2442){const _0x4c477d=a141_0x4248;return{..._0x3b2442,'id':Number(_0x3b2442['id']),'dbId':_0x3b2442[_0x4c477d(0x11a)]==null?undefined:Number(_0x3b2442[_0x4c477d(0x11a)]),'version':_0x3b2442[_0x4c477d(0x10f)]==null?undefined:Number(_0x3b2442[_0x4c477d(0x10f)])};}export async function executeSql(_0x3d2bcb,_0xf91d89,_0x1cb0ca){const _0x4b5d32=a141_0x4248,_0x3f3072=await apiRequest(_0x4b5d32(0xeb),{'method':_0x4b5d32(0xca),'body':{'appCode':_0x3d2bcb,'sqlCode':_0xf91d89,..._0x1cb0ca&&{'params':_0x1cb0ca}},'useRuntime':!![]});return _0x3f3072[_0x4b5d32(0x164)];}export async function executeDatasetDataOperation(_0x2523a8,_0x2f74ef,_0x4e4d38,_0x2f6614={}){const _0x550841=a141_0x4248;try{const _0x1d390e=await apiRequest(_0x550841(0x102)+_0x2523a8+'/'+_0x2f74ef+'/'+_0x4e4d38,{'method':_0x550841(0xca),'body':_0x2f6614,'useRuntime':!![]});return _0x1d390e['data'];}catch(_0x1dea03){if(_0x4e4d38===_0x550841(0x12f)&&_0x1dea03 instanceof CliError&&_0x1dea03[_0x550841(0x113)]===_0x550841(0xfc)&&_0x2f6614['id']!==undefined&&_0x2f6614['id']!==null&&_0x2f6614['id']!==''){const _0x32e7e2=await apiRequest(_0x550841(0x102)+_0x2523a8+'/'+_0x2f74ef+_0x550841(0x12a),{'method':'POST','body':{'where':{'id':{'$eq':_0x2f6614['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0xab7b81=Array[_0x550841(0x156)](_0x32e7e2[_0x550841(0x164)]?.[_0x550841(0xee)])?_0x32e7e2[_0x550841(0x164)][_0x550841(0xee)]:[];return _0xab7b81[0x0]??null;}throw _0x1dea03;}}export async function listDatasets(_0x297a57,_0x53cd67){const _0x35f8af=a141_0x4248,_0x35f4dc={'appCode':_0x297a57,'deleted':![]};if(_0x53cd67?.[_0x35f8af(0x113)])_0x35f4dc['code']=_0x53cd67[_0x35f8af(0x113)];if(_0x53cd67?.[_0x35f8af(0xe9)])_0x35f4dc[_0x35f8af(0xe9)]=_0x53cd67['name'];const _0x432198=await apiRequest(_0x35f8af(0xf2),{'method':_0x35f8af(0xca),'body':_0x35f4dc});return extractList(_0x432198[_0x35f8af(0x164)]);}export async function deleteDataset(_0x15fabd,_0x45d6ed){const _0x344f8c=a141_0x4248;await apiRequest(_0x344f8c(0x14a),{'method':_0x344f8c(0xca),'body':{'appCode':_0x15fabd,'datasetId':_0x45d6ed}});}export async function searchDatasets(_0x8d4f4d,_0x1ddf9d){const _0x579ad2=a141_0x4248,_0x499069=await listDatasets(_0x8d4f4d,{'name':_0x1ddf9d}),_0x587176=_0x1ddf9d[_0x579ad2(0x135)](),_0x2418b9=new Set(_0x499069[_0x579ad2(0x159)](_0x399b90=>_0x399b90['id'])),_0x1ff799=_0x499069[_0x579ad2(0xe1)](_0xe94c7b=>_0xe94c7b['dbtableConfig']?.[_0x579ad2(0xf3)]?.['toLowerCase']()[_0x579ad2(0xec)](_0x587176)||_0xe94c7b[_0x579ad2(0x125)]?.['toLowerCase']()[_0x579ad2(0xec)](_0x587176)),_0x9d454a=await listDatasets(_0x8d4f4d,{'code':_0x1ddf9d});for(const _0x5314ca of _0x9d454a){!_0x2418b9['has'](_0x5314ca['id'])&&(_0x499069['push'](_0x5314ca),_0x2418b9[_0x579ad2(0x14b)](_0x5314ca['id']));}return _0x499069;}export function normalizeDatasetOperations(_0x2334cc){const _0xc7fc23=a141_0x4248;if(Array['isArray'](_0x2334cc))return _0x2334cc['filter'](_0x107d92=>_0x107d92!=null&&typeof _0x107d92===_0xc7fc23(0x144));if(_0x2334cc&&typeof _0x2334cc===_0xc7fc23(0x144))return Object[_0xc7fc23(0x166)](_0x2334cc)[_0xc7fc23(0xe1)](([,_0x51fce0])=>_0x51fce0!=null&&typeof _0x51fce0===_0xc7fc23(0x144))['map'](([_0x5bcec5,_0x175e0e])=>({..._0x175e0e,'name':_0x175e0e['name']??_0x175e0e[_0xc7fc23(0xf1)]??_0x5bcec5}));return[];}export async function getDatasetDetail(_0xe84dea){const _0x5d061f=a141_0x4248,_0x36910b=/^\d+$/[_0x5d061f(0x16c)](_0xe84dea)?'id':_0x5d061f(0x113),_0x1e5187=await apiRequest(_0x5d061f(0x124)+_0x36910b+'='+_0xe84dea);return _0x1e5187[_0x5d061f(0x164)];}export async function updateDrivenData(_0x511a15){const _0x7e3471=a141_0x4248,_0x1e5165=await apiRequest('/smartapi/dataset/update-driven-data',{'method':'POST','body':_0x511a15});return _0x1e5165[_0x7e3471(0x164)];}export async function getDatasetOperations(_0x4054a4){const _0x2b6059=a141_0x4248,_0x207fd7=await getDatasetDetail(_0x4054a4),_0x3ceecc=normalizeDatasetOperations(_0x207fd7[_0x2b6059(0x114)])[_0x2b6059(0x159)](_0x4a04e3=>({'name':_0x4a04e3[_0x2b6059(0xe9)]||_0x4a04e3[_0x2b6059(0xf1)],'displayName':_0x4a04e3[_0x2b6059(0x145)]||_0x4a04e3[_0x2b6059(0xe9)],'type':_0x4a04e3[_0x2b6059(0x128)],'method':_0x4a04e3[_0x2b6059(0x149)],'path':_0x4a04e3[_0x2b6059(0x123)],'enabled':_0x4a04e3[_0x2b6059(0xd0)]??!![],'requestFields':_0x4a04e3[_0x2b6059(0x12b)],'responseFields':_0x4a04e3['responseFields']}));return{'dataset':{'id':_0x207fd7['id']??_0x207fd7[_0x2b6059(0x11e)],'name':_0x207fd7[_0x2b6059(0xe9)],'code':_0x207fd7[_0x2b6059(0x113)]||_0x207fd7['modelCode'],'tableName':_0x207fd7[_0x2b6059(0xf3)]||_0x207fd7[_0x2b6059(0x141)]?.[_0x2b6059(0xf3)]},'operations':_0x3ceecc};}export async function getOperationDetail(_0x5c9f01,_0x193ed1,_0xc13e71){const _0x1670e3=a141_0x4248;let _0x291695=_0x193ed1;if(!/^\d+$/[_0x1670e3(0x16c)](_0x193ed1)){const _0x3735c5=await listDatasets(_0x5c9f01,{'code':_0x193ed1}),_0x139b67=_0x3735c5['find'](_0x5d7ec2=>_0x5d7ec2[_0x1670e3(0x113)]===_0x193ed1||String(_0x5d7ec2['id'])===_0x193ed1);if(!_0x139b67)throw CliErrors[_0x1670e3(0x10d)]('Dataset\x20not\x20found:\x20'+_0x193ed1);_0x291695=String(_0x139b67['id']);}const _0x6221c6=await getDatasetDetail(_0x291695),_0x337eb7=normalizeDatasetOperations(_0x6221c6[_0x1670e3(0x114)])['find'](_0x271d68=>(_0x271d68[_0x1670e3(0xe9)]||_0x271d68[_0x1670e3(0xf1)])===_0xc13e71);if(!_0x337eb7)throw CliErrors['validation'](_0x1670e3(0x157)+_0xc13e71+_0x1670e3(0x138)+_0x193ed1);return{'dataset':{'id':_0x6221c6['id']??_0x6221c6[_0x1670e3(0x11e)],'name':_0x6221c6[_0x1670e3(0xe9)],'code':_0x6221c6[_0x1670e3(0x113)]||_0x6221c6[_0x1670e3(0x12c)],'tableName':_0x6221c6[_0x1670e3(0xf3)]||_0x6221c6[_0x1670e3(0x141)]?.['tableName']},'operation':_0x337eb7};}export async function startGenerateStandardPages(_0x19e0fc,_0x1574c4,_0x21ee89){const _0x24b09c=a141_0x4248,_0x332630=await apiRequest('/smartapi/lovrabet/dataset/'+_0x1574c4+'/generate-standard-pages/start',{'method':_0x24b09c(0xca),'body':{'appCode':_0x19e0fc,..._0x21ee89?.[_0x24b09c(0x132)]?{'clientOperationId':_0x21ee89['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x332630['data'];}export async function getGenerateStandardPagesStatus(_0x1982d2,_0x16a3b0,_0x219007){const _0x5006b1=a141_0x4248,_0x30166f=new URLSearchParams({'appCode':_0x1982d2});_0x219007[_0x5006b1(0xea)]&&_0x30166f['set'](_0x5006b1(0xea),_0x219007[_0x5006b1(0xea)]);_0x219007[_0x5006b1(0x132)]&&_0x30166f[_0x5006b1(0xd7)]('clientOperationId',_0x219007[_0x5006b1(0x132)]);const _0x48adc5=await apiRequest(_0x5006b1(0x116)+_0x16a3b0+_0x5006b1(0x119)+_0x30166f['toString']());return _0x48adc5[_0x5006b1(0x164)];}function a141_0x5b03(){const _0x9db68c=['/smartapi/question/er-config/erCreate','sqlName','stringify','POST','\x20\x20where:\x20{},','/smartapi/lovrabet/detail?pageId=','/smartapi/db-analysis/status/','1647954JSPBVk','/smartapi/dblink/getList','enabled','currentPage','(/*\x20params\x20*/);','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','Warning:\x20showing\x20first\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','errorMsg','set','.remove(id);','SQL\x20query\x20not\x20found:\x20','4060296icgloW','/smartapi/custom/updateUserCustomSql','errorCode','/smartapi/dblink/update','/smartapi/custom/queryUserCustomSqlList','authRequired','77Ypgufc','filter','\x20\x20sqlCode:\x20\x27','status','GET','push','/smartapi/question/er-config/update-single','\x20of\x20','\x20\x20});','name','operationId','/api/custom/executeSql','includes','UNAUTHORIZED','tableData','errorMessage','401','operationName','/smartapi/dataset/get-dataset-list','tableName','toString','warn','/sync-to-pages','\x20failed','label','BFF\x20save\x20returned\x20no\x20valid\x20id','scriptType','.create({\x20/*\x20fields\x20*/\x20});','api_error','dataset_','API\x20error\x20code:\x20','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','pageSize','/api/','\x20\x20currentPage:\x201,','/smartapi/lovrabet/update-page','Unauthorized','//\x20SQL:\x20','/api/management/script/cache/clear','66944GdcoRJ','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','sqlCode','target','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','validation','SQL\x20query\x20not\x20found:\x20id=','version','/smartapi/custom/getUserCustomSql','/smartapi/custom/getUserCustomSql?id=','length','code','operations','success','/smartapi/lovrabet/dataset/','/api/management/library/scripts/statistics?appCode=','\x20\x20pageSize:\x2020,','/generate-standard-pages/status?','dbId','const\x20result\x20=\x20await\x20client.models.','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','Check\x20network\x20connectivity\x20and\x20try\x20again.','modelId','\x20failed,\x20HTTP\x20','});','/smartapi/question/er-config/erDelete','/smartapi/custom/deleteUserCustomSql','path','/smartapi/dataset/get-driven-data?','description','tableList','table','type','delete','/filter','requestFields','modelCode','sdk','/smartapi/dblink/delete','getOne','join','/smartapi/custom/saveUserCustomSql','clientOperationId','\x20\x20\x20\x20sqlCode:\x20\x27','1235235SJpLSA','toLowerCase','signal','error','\x22\x20not\x20found\x20in\x20dataset\x20','cookie','/smartapi/db-analysis/jobs/cancel','AbortError','/smartapi/dataset/get-dataset-operation','apiError','json','replace','/api/management/library/scripts/list?appCode=','dbtableConfig','Request\x20failed:\x20','totalCount','object','displayName','string','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','//\x20','method','/smartapi/dataset/delete-dataset','add','?sqlCode=','cli:rabetbase','message','functionName','/smartapi/question/er-config','/smartapi/dblink/getAllTableList','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','scriptName','abort','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','isArray','Operation\x20\x22','/smartapi/dblink/create','map','BFF\x20script\x20not\x20found:\x20id=','Page\x20not\x20found:\x20','/api/management/library/scripts/info?id=','1046962VryJJg','remove','32831IXqcUB','includeImports','/smartapi/db-analysis/start','body','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','data','application/json','entries','Request\x20timeout:\x20','update','API\x20error:\x20','2786144jibkxv','/smartapi/app/getList','test'];a141_0x5b03=function(){return _0x9db68c;};return a141_0x5b03();}export async function getStandardPageStatus(_0x871812,_0xb78318){const _0x2365d6=a141_0x4248,_0x573932=await apiRequest(_0x2365d6(0x116)+_0xb78318+'/standard-page-status?appCode='+encodeURIComponent(_0x871812));return _0x573932[_0x2365d6(0x164)];}export async function tryGetStandardPageStatus(_0x439ca0,_0x5eb818){const _0x9b613d=a141_0x4248;try{return await getStandardPageStatus(_0x439ca0,_0x5eb818);}catch(_0x520637){if(_0x520637 instanceof CliError&&_0x520637[_0x9b613d(0x113)]===_0x9b613d(0xfc)&&/404|not found|non-json response/i[_0x9b613d(0x16c)](_0x520637[_0x9b613d(0x14e)]))return null;throw _0x520637;}}export async function syncStandardPages(_0x583078,_0x13f9b7){const _0x1a6adc=a141_0x4248,_0x51cd9d=await apiRequest(_0x1a6adc(0x116)+_0x13f9b7+_0x1a6adc(0xf6),{'method':'POST','body':{'appCode':_0x583078}});return _0x51cd9d[_0x1a6adc(0x164)];}export async function getPageDetail(_0x555ff5){const _0x42e449=a141_0x4248,_0x593e85=await apiRequest(_0x42e449(0xcc)+_0x555ff5);if(!_0x593e85[_0x42e449(0x164)])throw CliErrors[_0x42e449(0x10d)](_0x42e449(0x15b)+_0x555ff5);return _0x593e85['data'];}export async function updatePage(_0x161f91,_0x4d22d1,_0x393d7b,_0x3d9257){const _0xc93d8f=a141_0x4248,_0x6e3544=await apiRequest(_0xc93d8f(0x104),{'method':_0xc93d8f(0xca),'body':{'appCode':_0x161f91,'pageId':_0x4d22d1,'code':_0x393d7b,'datasetIds':_0x3d9257}});return _0x6e3544[_0xc93d8f(0x164)];}export function generateSdkCode(_0x379fa0,_0x2b7a3e,_0x2be69a){const _0x2d8bda=a141_0x4248,_0x783b05=_0x2be69a?.[_0x2d8bda(0x160)]??!![],_0xc0aed=_0x2d8bda(0xfd)+_0x379fa0['code']?.[_0x2d8bda(0x13f)](/-/g,'_'),_0x5edefb=_0x2b7a3e[_0x2d8bda(0xe9)]||_0x2b7a3e[_0x2d8bda(0xf1)]||_0x2d8bda(0xe1),_0x524b93=[];_0x783b05&&_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x152),'',_0x2d8bda(0x100),'');_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x148)+_0x379fa0[_0x2d8bda(0xe9)]+'\x20('+(_0x379fa0[_0x2d8bda(0xf3)]||_0x2d8bda(0x127))+')');if(_0x5edefb==='filter')_0x524b93[_0x2d8bda(0xe5)]('const\x20result\x20=\x20await\x20client.models.'+_0xc0aed+'.filter({',_0x2d8bda(0xcb),_0x2d8bda(0x118),_0x2d8bda(0x103),_0x2d8bda(0x120));else{if(_0x5edefb===_0x2d8bda(0x12f))_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x11b)+_0xc0aed+'.getOne(id);');else{if(_0x5edefb==='create')_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x11b)+_0xc0aed+_0x2d8bda(0xfb));else{if(_0x5edefb===_0x2d8bda(0x168))_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x11b)+_0xc0aed+_0x2d8bda(0x163));else _0x5edefb===_0x2d8bda(0x129)||_0x5edefb===_0x2d8bda(0x15e)?_0x524b93[_0x2d8bda(0xe5)](_0x2d8bda(0x11b)+_0xc0aed+_0x2d8bda(0xd8)):_0x524b93['push'](_0x2d8bda(0x11b)+_0xc0aed+'.'+_0x5edefb+_0x2d8bda(0xd2));}}}return _0x524b93[_0x2d8bda(0x130)]('\x0a');}export function generateSqlCodeTemplate(_0x4e3239,_0x4232cf){const _0x4da76a=a141_0x4248,_0xb1c488=_0x4232cf?.[_0x4da76a(0x10b)]??_0x4da76a(0x12d),_0x5aded5=_0x4232cf?.[_0x4da76a(0x160)]??!![],_0x39179e=[];return _0x39179e[_0x4da76a(0xe5)](_0x4da76a(0x106)+_0x4e3239[_0x4da76a(0x16e)]+'\x20('+_0x4e3239[_0x4da76a(0x10a)]+')'),_0xb1c488===_0x4da76a(0x12d)?(_0x5aded5&&_0x39179e[_0x4da76a(0xe5)](_0x4da76a(0x152),'',_0x4da76a(0x100),''),_0x39179e[_0x4da76a(0xe5)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4da76a(0xe2)+_0x4e3239[_0x4da76a(0x10a)]+'\x27,',_0x4da76a(0xd5),_0x4da76a(0x120),_0x4da76a(0xd3),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x39179e['push'](_0x4da76a(0x11c),_0x4da76a(0xff),_0x4da76a(0x10c),_0x4da76a(0x133)+_0x4e3239[_0x4da76a(0x10a)]+'\x27,',_0x4da76a(0x147),_0x4da76a(0xe8),'\x20\x20return\x20rows;','}'),_0x39179e[_0x4da76a(0x130)]('\x0a');}export async function getErConfig(_0x3665ec,_0x5cad30){const _0x374fde=a141_0x4248,_0x569fb7=await apiRequest(_0x374fde(0x150),{'method':_0x374fde(0xca),'body':{'appCode':_0x3665ec,'dblinkId':_0x5cad30}});return _0x569fb7[_0x374fde(0x164)];}export async function createErRelation(_0x41612a){const _0x1c33d4=a141_0x4248,_0xf1991d=await apiRequest(_0x1c33d4(0x16d),{'method':'POST','body':_0x41612a});return _0xf1991d[_0x1c33d4(0x164)];}export async function updateErRelation(_0x3e1fb8){const _0x57d08b=a141_0x4248,_0x5be3ad=await apiRequest(_0x57d08b(0xe6),{'method':_0x57d08b(0xca),'body':_0x3e1fb8});return _0x5be3ad[_0x57d08b(0x164)];}export async function deleteErRelation(_0x3756f2){const _0x25a4e0=a141_0x4248,_0x4c2218=await apiRequest(_0x25a4e0(0x121),{'method':_0x25a4e0(0xca),'body':_0x3756f2});return _0x4c2218[_0x25a4e0(0x164)];}function buildQuery(_0x2508c2){const _0x2d326f=a141_0x4248,_0x4c3e15=new URLSearchParams();for(const [_0x3fc0d3,_0x20130b]of Object[_0x2d326f(0x166)](_0x2508c2)){if(_0x20130b===undefined||_0x20130b==='')continue;_0x4c3e15[_0x2d326f(0xd7)](_0x3fc0d3,String(_0x20130b));}const _0x5c2d42=_0x4c3e15[_0x2d326f(0xf4)]();return _0x5c2d42?'?'+_0x5c2d42:'';}export async function listDbLinks(_0x4e6acc,_0x88b12f){const _0x1c7d08=a141_0x4248,_0x4391c7=await apiRequest(_0x1c7d08(0xcf),{'method':_0x1c7d08(0xca),'body':{'appCode':_0x4e6acc,'currentPage':_0x88b12f?.[_0x1c7d08(0xd1)]??0x1,'pageSize':_0x88b12f?.['pageSize']??0x64}});return{'items':extractList(_0x4391c7[_0x1c7d08(0x164)]),'paging':extractPaging(_0x4391c7[_0x1c7d08(0x164)])};}export async function getDbLinkInfo(_0x28a49a){const _0x426fa3=a141_0x4248,_0x44e27b=await apiRequest('/smartapi/dblink/getOne'+buildQuery({'id':_0x28a49a}));return _0x44e27b[_0x426fa3(0x164)];}export async function createDbLink(_0x9221cf){const _0x5c028e=a141_0x4248,_0x44eba0=await apiRequest(_0x5c028e(0x158),{'method':_0x5c028e(0xca),'body':_0x9221cf});return _0x44eba0['data'];}export async function updateDbLink(_0x2d1df6){const _0x1533ba=a141_0x4248,_0x36ce93=await apiRequest(_0x1533ba(0xdd),{'method':_0x1533ba(0xca),'body':_0x2d1df6});return _0x36ce93[_0x1533ba(0x164)];}export async function deleteDbLink(_0x5eddac){const _0x5a70ce=a141_0x4248;await apiRequest(_0x5a70ce(0x12e),{'method':_0x5a70ce(0xca),'body':{'id':_0x5eddac}});}export async function testDbLinkConnect(_0x190bc8){const _0x2eba4a=a141_0x4248,_0x2e4469=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x190bc8}));return _0x2e4469[_0x2eba4a(0x164)];}export async function startDbAnalysis(_0x245b35,_0x1a1454){const _0x4d4995=a141_0x4248,_0x3e81ac=await apiRequest(_0x4d4995(0x161),{'method':'POST','body':{'dbLinkId':_0x245b35,..._0x1a1454&&_0x1a1454[_0x4d4995(0x112)]>0x0?{'tableNames':_0x1a1454}:{}}}),_0x536664=_0x3e81ac[_0x4d4995(0x164)];if(typeof _0x536664==='string')return _0x536664;if(_0x536664&&typeof _0x536664===_0x4d4995(0x144)&&typeof _0x536664['planId']===_0x4d4995(0x146))return _0x536664['planId'];return _0x536664!=null?String(_0x536664):'';}export async function cancelDbAnalysis(_0x4e647d){const _0x36e4ea=a141_0x4248;await apiRequest(_0x36e4ea(0x13a)+buildQuery({'planId':_0x4e647d}),{'method':_0x36e4ea(0xca)});}export async function getDbAnalysisStatus(_0x295fcc){const _0x49a6b5=a141_0x4248,_0x45e8a6=await apiRequest(_0x49a6b5(0xcd)+encodeURIComponent(_0x295fcc));return _0x45e8a6[_0x49a6b5(0x164)];}export async function getDbAllTableList(_0x57b8b4,_0x4ee1db){const _0x466eec=a141_0x4248,_0x11a1d3=await apiRequest(_0x466eec(0x151)+buildQuery({'appCode':_0x57b8b4,'dbLinkId':_0x4ee1db})),_0x42f21c=_0x11a1d3[_0x466eec(0x164)];if(Array[_0x466eec(0x156)](_0x42f21c))return _0x42f21c;return extractList(_0x42f21c);}export async function getDbTableDiff(_0x4b3094,_0x3c8b17,_0x37f84e){const _0x4abc03=a141_0x4248,_0xa26012=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x4b3094,'dbLinkId':_0x3c8b17,'pageIndex':_0x37f84e?.['pageIndex']??0x1,'pageSize':_0x37f84e?.[_0x4abc03(0x101)]??0x14,'tableName':_0x37f84e?.[_0x4abc03(0xf3)]})),_0x1d4c70=_0xa26012[_0x4abc03(0x164)];return{'totalCount':_0x1d4c70?.[_0x4abc03(0x143)]??0x0,'tableList':Array[_0x4abc03(0x156)](_0x1d4c70?.['tableList'])?_0x1d4c70[_0x4abc03(0x126)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x14a124=a141_0x4248,_0x17931a=await apiRequest(_0x14a124(0x16b),{'method':_0x14a124(0xca),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4db993=extractList(_0x17931a[_0x14a124(0x164)]),_0x165103=extractPaging(_0x17931a[_0x14a124(0x164)]);return _0x165103&&_0x165103['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x14a124(0xf5)](_0x14a124(0xd4)+REMOTE_APP_PAGE_SIZE+_0x14a124(0xe7)+_0x165103['totalCount']+'\x20apps.\x20'+_0x14a124(0x155)),_0x4db993;}
|
|
1
|
+
(function(_0x3f36be,_0x1f256b){const _0x538698=a141_0x102f,_0x11f6b7=_0x3f36be();while(!![]){try{const _0x10bad9=parseInt(_0x538698(0x11b))/0x1+-parseInt(_0x538698(0x18d))/0x2+-parseInt(_0x538698(0x176))/0x3+parseInt(_0x538698(0x12e))/0x4+parseInt(_0x538698(0x14e))/0x5+-parseInt(_0x538698(0x142))/0x6*(-parseInt(_0x538698(0x120))/0x7)+-parseInt(_0x538698(0x179))/0x8*(-parseInt(_0x538698(0x165))/0x9);if(_0x10bad9===_0x1f256b)break;else _0x11f6b7['push'](_0x11f6b7['shift']());}catch(_0x5705c2){_0x11f6b7['push'](_0x11f6b7['shift']());}}}(a141_0xd1eb,0x4acf9));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';let _activeCookie;export function setActiveCookie(_0x202abc){_activeCookie=_0x202abc||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530;function createFetchFailureError(_0x2be4ff,_0x521c35){const _0x436dd3=a141_0x102f,_0x28e28f=_0x521c35 instanceof Error?_0x521c35['message']:String(_0x521c35);return CliErrors[_0x436dd3(0x15f)]('Request\x20failed:\x20'+_0x2be4ff+(_0x28e28f?'\x20('+_0x28e28f+')':''),_0x436dd3(0x15e));}async function apiRequest(_0x59e42b,_0x57489f={}){const _0x4e5de0=a141_0x102f,{method:method='GET',body:_0x38bbc5,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![]}=_0x57489f,_0x587a18=useRuntime?getRuntimeDomain():getApiDomain(),_0x506e09=_activeCookie||getCookie(),_0x3576ac=''+_0x587a18+_0x59e42b,_0x441b05=new AbortController(),_0x408d10=setTimeout(()=>_0x441b05[_0x4e5de0(0x115)](),timeout);try{const _0x2960bd=await fetch(_0x3576ac,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x506e09,'X-Invoke-Source':_0x4e5de0(0x18f),...headers},'body':_0x38bbc5?JSON[_0x4e5de0(0x13d)](_0x38bbc5):undefined,'signal':_0x441b05[_0x4e5de0(0x137)]});let _0x1fd45f;try{_0x1fd45f=await _0x2960bd[_0x4e5de0(0xfa)]();}catch{throw CliErrors['apiError'](_0x4e5de0(0x170)+_0x2960bd[_0x4e5de0(0x158)]+')',_0x2960bd[_0x4e5de0(0x158)]>=0x190?_0x4e5de0(0x188):undefined);}if(!_0x2960bd['ok']||_0x1fd45f[_0x4e5de0(0x14a)]===![])throw CliErrors['apiError'](_0x1fd45f[_0x4e5de0(0x182)]||_0x1fd45f[_0x4e5de0(0x134)]||_0x4e5de0(0xfd)+_0x2960bd['status'],_0x1fd45f[_0x4e5de0(0x16d)]?_0x4e5de0(0x17d)+_0x1fd45f[_0x4e5de0(0x16d)]:undefined);return _0x1fd45f;}catch(_0x12ad00){if(_0x12ad00 instanceof CliError)throw _0x12ad00;if(_0x12ad00 instanceof Error&&_0x12ad00['name']===_0x4e5de0(0x104))throw CliErrors[_0x4e5de0(0x15f)](_0x4e5de0(0x12a)+_0x3576ac);throw createFetchFailureError(_0x3576ac,_0x12ad00);}finally{clearTimeout(_0x408d10);}}function isAuthFailure(_0x44908c){const _0x39411d=a141_0x102f,_0x31e1e0=_0x44908c[_0x39411d(0x182)]||_0x44908c[_0x39411d(0x134)]||_0x44908c[_0x39411d(0x157)]?.['message']||_0x44908c['errorMessage']||_0x44908c[_0x39411d(0x12d)]||'';return _0x44908c['errorCode']===_0x39411d(0x184)||_0x44908c['code']===0x191||_0x44908c[_0x39411d(0x183)]===_0x39411d(0xff)||_0x31e1e0[_0x39411d(0x11f)](_0x39411d(0xff))||_0x31e1e0['includes']('Unauthorized')||_0x31e1e0[_0x39411d(0x11f)]('登录')||_0x31e1e0['includes']('认证');}export async function platformFetch(_0x2092f0,_0xb4567e){const _0x591e6b=a141_0x102f;let _0x4b2bec;try{_0x4b2bec=await fetch(_0x2092f0,{'method':_0xb4567e['method']??'GET','headers':{'Content-Type':_0x591e6b(0x15b),'Cookie':_0xb4567e[_0x591e6b(0x155)],'X-Invoke-Source':_0x591e6b(0x18f)},..._0xb4567e['body']&&{'body':JSON[_0x591e6b(0x13d)](_0xb4567e[_0x591e6b(0x17c)])}});}catch(_0x1d786f){throw createFetchFailureError(_0x2092f0,_0x1d786f);}if(!_0x4b2bec['ok']){if(_0x4b2bec[_0x591e6b(0x158)]===0x191)throw CliErrors[_0x591e6b(0x11c)]();throw CliErrors[_0x591e6b(0x15f)](_0xb4567e['label']+'\x20failed,\x20HTTP\x20'+_0x4b2bec[_0x591e6b(0x158)]);}const _0x37c9fc=await _0x4b2bec[_0x591e6b(0xfa)]();if(_0x37c9fc[_0x591e6b(0x14a)]===![]){if(isAuthFailure(_0x37c9fc))throw CliErrors['authRequired']();throw CliErrors[_0x591e6b(0x15f)](_0x37c9fc[_0x591e6b(0x182)]||_0x37c9fc[_0x591e6b(0x134)]||_0xb4567e[_0x591e6b(0x14d)]+'\x20failed');}return _0x37c9fc[_0x591e6b(0x157)];}export async function listBffScripts(_0x412ba6,_0x32c502,_0x15cd64){const _0x5ab0d4=a141_0x102f;let _0x8201f5=_0x5ab0d4(0x178)+_0x412ba6;if(_0x32c502)_0x8201f5+=_0x5ab0d4(0x133)+_0x32c502;const _0x238153=await apiRequest(_0x8201f5);let _0x5e1877=extractList(_0x238153[_0x5ab0d4(0x157)]);if(_0x15cd64?.['scriptName']){const _0x516234=_0x15cd64[_0x5ab0d4(0x11e)][_0x5ab0d4(0x123)]();_0x5e1877=_0x5e1877[_0x5ab0d4(0x12b)](_0x4b7ab6=>_0x4b7ab6[_0x5ab0d4(0xf7)]?.[_0x5ab0d4(0x123)]()[_0x5ab0d4(0x11f)](_0x516234)||_0x4b7ab6[_0x5ab0d4(0x12c)]?.['toLowerCase']()[_0x5ab0d4(0x11f)](_0x516234));}return _0x5e1877;}export async function getBffScriptInfo(_0x5bc724){const _0x466308=a141_0x102f,_0x2bfdee=await apiRequest(_0x466308(0x156)+_0x5bc724);if(!_0x2bfdee['data'])throw CliErrors['validation']('BFF\x20script\x20not\x20found:\x20id='+_0x5bc724);return _0x2bfdee['data'];}export async function saveBffScript(_0x50da54){const _0x498d34=a141_0x102f,_0x3a17dc=await apiRequest(_0x498d34(0x180),{'method':'POST','body':_0x50da54}),{id:_0x4e55f1,entity:_0x1c5dd2}=normalizeEntityWithIdResponse(_0x3a17dc[_0x498d34(0x157)]);if(_0x4e55f1!==undefined){const _0x3f97b9=typeof _0x1c5dd2[_0x498d34(0xf7)]===_0x498d34(0x119)||typeof _0x1c5dd2['scriptType']===_0x498d34(0x119)?_0x1c5dd2:undefined;return{'id':_0x4e55f1,'script':_0x3f97b9};}throw CliErrors[_0x498d34(0x15f)](_0x498d34(0xf8));}export async function deleteBffScript(_0x2be4c9){const _0x6f9f22=a141_0x102f;await apiRequest(_0x6f9f22(0x167),{'method':_0x6f9f22(0x160),'body':{'id':_0x2be4c9}});}export async function getBffScriptStatistics(_0x4a90fe){const _0x1d06af=a141_0x102f,_0x31501c=await apiRequest(_0x1d06af(0x18b)+_0x4a90fe);return extractList(_0x31501c[_0x1d06af(0x157)]);}export async function clearBffScriptCache(){const _0x5caeb1=a141_0x102f,_0x2897cd=await apiRequest('/api/management/script/cache/clear',{'method':'POST','useRuntime':!![]});return typeof _0x2897cd[_0x5caeb1(0x157)]==='string'?_0x2897cd[_0x5caeb1(0x157)]:'';}export async function listBffDatasetOperations(_0x5de0fa,_0x47bd3b){const _0x16639c=a141_0x102f,_0x4aad7b=await apiRequest(_0x16639c(0x13e),{'method':_0x16639c(0x160),'body':{'appCode':_0x5de0fa,'datasetId':_0x47bd3b}});return _0x4aad7b[_0x16639c(0x157)];}export async function listSqlQueries(_0x407bb1,_0x1fff94){const _0x423057=a141_0x102f,_0x3ffb90=await apiRequest(_0x423057(0x13a),{'method':'POST','body':{'appCode':_0x407bb1,'currentPage':_0x1fff94?.[_0x423057(0x128)]??0x1,'pageSize':_0x1fff94?.[_0x423057(0x152)]??0x32,'sqlCode':_0x1fff94?.['sqlCode'],'sqlName':_0x1fff94?.['sqlName']}});return _0x3ffb90[_0x423057(0x157)];}export async function getSqlQueryInfo(_0x6437cb,_0x470baa){const _0x49ec0a=a141_0x102f,_0x16d78e=await listSqlQueries(_0x6437cb,{'sqlCode':_0x470baa}),_0x5cdcc3=_0x16d78e[_0x49ec0a(0x171)]?.[0x0];if(!_0x5cdcc3)throw CliErrors[_0x49ec0a(0x13f)](_0x49ec0a(0x121)+_0x470baa);return _0x5cdcc3;}export async function getSqlQueryDetail(_0x4d761d){const _0x4e80d2=a141_0x102f,_0xf2ac54=await apiRequest(_0x4e80d2(0x144)+(_0x4e80d2(0x16f)+encodeURIComponent(_0x4d761d)));if(!_0xf2ac54['data'])throw CliErrors['validation'](_0x4e80d2(0x121)+_0x4d761d);return _0xf2ac54[_0x4e80d2(0x157)];}export async function getSqlQueryDetailById(_0x3b298d){const _0x2d248c=a141_0x102f,_0x2ee8c5=await apiRequest(_0x2d248c(0x122)+_0x3b298d);if(!_0x2ee8c5[_0x2d248c(0x157)])throw CliErrors[_0x2d248c(0x13f)](_0x2d248c(0x118)+_0x3b298d);return _0x2ee8c5[_0x2d248c(0x157)];}export async function createSqlQuery(_0x1a0a0d){const _0x12687a=a141_0x102f,_0x5a7796=await apiRequest(_0x12687a(0x175),{'method':_0x12687a(0x160),'body':_0x1a0a0d}),{id:_0x5c10f9,entity:_0x1b49c5}=normalizeEntityWithIdResponse(_0x5a7796[_0x12687a(0x157)]);if(!(_0x12687a(0x130)in _0x1b49c5)&&_0x5c10f9)return getSqlQueryDetailById(_0x5c10f9);return normalizeSqlQueryEntity(_0x1b49c5);}export async function updateSqlQuery(_0x533190){const _0x33705f=a141_0x102f,_0x5dfcb6=await apiRequest(_0x33705f(0x116),{'method':_0x33705f(0x160),'body':_0x533190}),{id:_0x15fa06,entity:_0x72de39}=normalizeEntityWithIdResponse(_0x5dfcb6[_0x33705f(0x157)]);if(!(_0x33705f(0x130)in _0x72de39)){if(_0x533190[_0x33705f(0x130)])return getSqlQueryDetail(_0x533190[_0x33705f(0x130)]);if(_0x15fa06)return getSqlQueryDetailById(_0x15fa06);}return normalizeSqlQueryEntity(_0x72de39);}export async function deleteSqlQuery(_0xa94f68){const _0xed9fec=a141_0x102f;await apiRequest(_0xed9fec(0xfc),{'method':_0xed9fec(0x160),'body':_0xa94f68});}export async function saveSqlQuery(_0x517efd){const _0x45d20b=a141_0x102f,_0x44a225=await apiRequest(_0x45d20b(0x109),{'method':_0x45d20b(0x160),'body':_0x517efd});return _0x44a225[_0x45d20b(0x157)];}function normalizeSqlQueryEntity(_0x1cbf10){const _0x3c2d16=a141_0x102f;return{..._0x1cbf10,'id':Number(_0x1cbf10['id']),'dbId':_0x1cbf10[_0x3c2d16(0x186)]==null?undefined:Number(_0x1cbf10['dbId']),'version':_0x1cbf10[_0x3c2d16(0x169)]==null?undefined:Number(_0x1cbf10[_0x3c2d16(0x169)])};}export async function executeSql(_0x39c7bb,_0x2eefeb,_0x211896){const _0x121a2f=a141_0x102f,_0x12730b=await apiRequest(_0x121a2f(0xf9),{'method':_0x121a2f(0x160),'body':{'appCode':_0x39c7bb,'sqlCode':_0x2eefeb,..._0x211896&&{'params':_0x211896}},'useRuntime':!![]});return _0x12730b[_0x121a2f(0x157)];}export async function executeDatasetDataOperation(_0x16744e,_0x26d263,_0x4562ea,_0x2896d9={}){const _0x1f47ac=a141_0x102f;try{const _0x34620f=await apiRequest(_0x1f47ac(0x173)+_0x16744e+'/'+_0x26d263+'/'+_0x4562ea,{'method':_0x1f47ac(0x160),'body':_0x2896d9,'useRuntime':!![]});return _0x34620f[_0x1f47ac(0x157)];}catch(_0x12540f){if(_0x4562ea===_0x1f47ac(0x17f)&&_0x12540f instanceof CliError&&_0x12540f[_0x1f47ac(0x183)]==='api_error'&&_0x2896d9['id']!==undefined&&_0x2896d9['id']!==null&&_0x2896d9['id']!==''){const _0x2850ed=await apiRequest(_0x1f47ac(0x173)+_0x16744e+'/'+_0x26d263+'/filter',{'method':_0x1f47ac(0x160),'body':{'where':{'id':{'$eq':_0x2896d9['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x1a7028=Array[_0x1f47ac(0x108)](_0x2850ed[_0x1f47ac(0x157)]?.[_0x1f47ac(0x171)])?_0x2850ed[_0x1f47ac(0x157)][_0x1f47ac(0x171)]:[];return _0x1a7028[0x0]??null;}throw _0x12540f;}}export async function listDatasets(_0x56b541,_0x3a619e){const _0x593a34=a141_0x102f,_0x235c6f={'appCode':_0x56b541,'deleted':![]};if(_0x3a619e?.[_0x593a34(0x183)])_0x235c6f[_0x593a34(0x183)]=_0x3a619e[_0x593a34(0x183)];if(_0x3a619e?.[_0x593a34(0x174)])_0x235c6f['name']=_0x3a619e['name'];const _0x110f5b=await apiRequest(_0x593a34(0x106),{'method':_0x593a34(0x160),'body':_0x235c6f});return extractList(_0x110f5b[_0x593a34(0x157)]);}export async function deleteDataset(_0x2c4e1f,_0xaefb90){const _0x4d38d9=a141_0x102f;await apiRequest(_0x4d38d9(0x132),{'method':_0x4d38d9(0x160),'body':{'appCode':_0x2c4e1f,'datasetId':_0xaefb90}});}export async function searchDatasets(_0x223bb4,_0x206865){const _0x5370d1=a141_0x102f,_0x433d04=await listDatasets(_0x223bb4,{'name':_0x206865}),_0xe2d561=_0x206865['toLowerCase'](),_0x264d02=new Set(_0x433d04[_0x5370d1(0x10d)](_0x3801cb=>_0x3801cb['id'])),_0x220bd9=_0x433d04[_0x5370d1(0x12b)](_0x31b5eb=>_0x31b5eb[_0x5370d1(0x135)]?.[_0x5370d1(0x147)]?.[_0x5370d1(0x123)]()['includes'](_0xe2d561)||_0x31b5eb['description']?.[_0x5370d1(0x123)]()[_0x5370d1(0x11f)](_0xe2d561)),_0xedb9b6=await listDatasets(_0x223bb4,{'code':_0x206865});for(const _0x38b33d of _0xedb9b6){!_0x264d02[_0x5370d1(0x101)](_0x38b33d['id'])&&(_0x433d04['push'](_0x38b33d),_0x264d02['add'](_0x38b33d['id']));}return _0x433d04;}export function normalizeDatasetOperations(_0xe271e2){const _0x2a2489=a141_0x102f;if(Array['isArray'](_0xe271e2))return _0xe271e2[_0x2a2489(0x12b)](_0x5397e9=>_0x5397e9!=null&&typeof _0x5397e9===_0x2a2489(0xf4));if(_0xe271e2&&typeof _0xe271e2===_0x2a2489(0xf4))return Object['entries'](_0xe271e2)['filter'](([,_0x588c54])=>_0x588c54!=null&&typeof _0x588c54===_0x2a2489(0xf4))[_0x2a2489(0x10d)](([_0x4fbc8c,_0xaf13a8])=>({..._0xaf13a8,'name':_0xaf13a8[_0x2a2489(0x174)]??_0xaf13a8[_0x2a2489(0x15c)]??_0x4fbc8c}));return[];}export async function getDatasetDetail(_0x37c16e){const _0x4a0888=a141_0x102f,_0x5984f2=/^\d+$/[_0x4a0888(0x124)](_0x37c16e)?'id':_0x4a0888(0x183),_0x179141=await apiRequest(_0x4a0888(0x13c)+_0x5984f2+'='+_0x37c16e);return _0x179141[_0x4a0888(0x157)];}export async function updateDrivenData(_0x9e6c22){const _0x125206=a141_0x102f,_0x4fe9c8=await apiRequest(_0x125206(0x148),{'method':_0x125206(0x160),'body':_0x9e6c22});return _0x4fe9c8['data'];}export async function getDatasetOperations(_0x5477aa){const _0x3d6d12=a141_0x102f,_0x3cdc2a=await getDatasetDetail(_0x5477aa),_0xbeca1d=normalizeDatasetOperations(_0x3cdc2a[_0x3d6d12(0x16b)])[_0x3d6d12(0x10d)](_0x13c727=>({'name':_0x13c727[_0x3d6d12(0x174)]||_0x13c727[_0x3d6d12(0x15c)],'displayName':_0x13c727['displayName']||_0x13c727[_0x3d6d12(0x174)],'type':_0x13c727[_0x3d6d12(0x185)],'method':_0x13c727[_0x3d6d12(0x143)],'path':_0x13c727[_0x3d6d12(0x14b)],'enabled':_0x13c727[_0x3d6d12(0x103)]??!![],'requestFields':_0x13c727[_0x3d6d12(0x15d)],'responseFields':_0x13c727['responseFields']}));return{'dataset':{'id':_0x3cdc2a['id']??_0x3cdc2a['modelId'],'name':_0x3cdc2a['name'],'code':_0x3cdc2a[_0x3d6d12(0x183)]||_0x3cdc2a[_0x3d6d12(0x166)],'tableName':_0x3cdc2a[_0x3d6d12(0x147)]||_0x3cdc2a['dbtableConfig']?.[_0x3d6d12(0x147)]},'operations':_0xbeca1d};}export async function getOperationDetail(_0x2ebec8,_0x386099,_0x468b2a){const _0x1c05b9=a141_0x102f;let _0x595412=_0x386099;if(!/^\d+$/['test'](_0x386099)){const _0x30337e=await listDatasets(_0x2ebec8,{'code':_0x386099}),_0x55fd91=_0x30337e[_0x1c05b9(0xf2)](_0x1c5be4=>_0x1c5be4['code']===_0x386099||String(_0x1c5be4['id'])===_0x386099);if(!_0x55fd91)throw CliErrors[_0x1c05b9(0x13f)](_0x1c05b9(0x18e)+_0x386099);_0x595412=String(_0x55fd91['id']);}const _0x4ebb60=await getDatasetDetail(_0x595412),_0x35604e=normalizeDatasetOperations(_0x4ebb60[_0x1c05b9(0x16b)])[_0x1c05b9(0xf2)](_0x5ee848=>(_0x5ee848['name']||_0x5ee848[_0x1c05b9(0x15c)])===_0x468b2a);if(!_0x35604e)throw CliErrors['validation'](_0x1c05b9(0x18c)+_0x468b2a+_0x1c05b9(0x107)+_0x386099);return{'dataset':{'id':_0x4ebb60['id']??_0x4ebb60[_0x1c05b9(0xf3)],'name':_0x4ebb60[_0x1c05b9(0x174)],'code':_0x4ebb60[_0x1c05b9(0x183)]||_0x4ebb60[_0x1c05b9(0x166)],'tableName':_0x4ebb60[_0x1c05b9(0x147)]||_0x4ebb60['dbtableConfig']?.[_0x1c05b9(0x147)]},'operation':_0x35604e};}export async function startGenerateStandardPages(_0x3b2562,_0x39938e,_0x591710){const _0x311cde=a141_0x102f,_0x23a54d=await apiRequest('/smartapi/lovrabet/dataset/'+_0x39938e+_0x311cde(0x129),{'method':_0x311cde(0x160),'body':{'appCode':_0x3b2562,..._0x591710?.[_0x311cde(0x11a)]?{'clientOperationId':_0x591710[_0x311cde(0x11a)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x23a54d['data'];}export async function getGenerateStandardPagesStatus(_0x1b8271,_0xa05440,_0x10f131){const _0x2b4ec3=a141_0x102f,_0x81bc64=new URLSearchParams({'appCode':_0x1b8271});_0x10f131[_0x2b4ec3(0x126)]&&_0x81bc64[_0x2b4ec3(0x10b)](_0x2b4ec3(0x126),_0x10f131['operationId']);_0x10f131[_0x2b4ec3(0x11a)]&&_0x81bc64[_0x2b4ec3(0x10b)](_0x2b4ec3(0x11a),_0x10f131['clientOperationId']);const _0x2120fd=await apiRequest(_0x2b4ec3(0x10e)+_0xa05440+_0x2b4ec3(0x154)+_0x81bc64[_0x2b4ec3(0x187)]());return _0x2120fd[_0x2b4ec3(0x157)];}export async function getStandardPageStatus(_0x24f826,_0x174ac5){const _0x2736fb=a141_0x102f,_0xa6257b=await apiRequest(_0x2736fb(0x10e)+_0x174ac5+_0x2736fb(0xf0)+encodeURIComponent(_0x24f826));return _0xa6257b[_0x2736fb(0x157)];}export async function tryGetStandardPageStatus(_0x120153,_0x1deb0a){const _0x2b5eb2=a141_0x102f;try{return await getStandardPageStatus(_0x120153,_0x1deb0a);}catch(_0x2719ce){if(_0x2719ce instanceof CliError&&_0x2719ce[_0x2b5eb2(0x183)]===_0x2b5eb2(0x139)&&/404|not found|non-json response/i['test'](_0x2719ce[_0x2b5eb2(0x134)]))return null;throw _0x2719ce;}}export async function syncStandardPages(_0x2d2c38,_0x3acb7d){const _0xcff8bc=a141_0x102f,_0x44db52=await apiRequest('/smartapi/lovrabet/dataset/'+_0x3acb7d+_0xcff8bc(0x151),{'method':_0xcff8bc(0x160),'body':{'appCode':_0x2d2c38}});return _0x44db52['data'];}export async function getPageDetail(_0x341a70){const _0xca0e0c=a141_0x102f,_0x19da39=await apiRequest(_0xca0e0c(0xfe)+_0x341a70);if(!_0x19da39[_0xca0e0c(0x157)])throw CliErrors[_0xca0e0c(0x13f)](_0xca0e0c(0x14c)+_0x341a70);return _0x19da39[_0xca0e0c(0x157)];}export async function updatePage(_0x73d5a8,_0x1347b6,_0x54f19b,_0x24dbb2){const _0x2a4274=a141_0x102f,_0x3b2e92=await apiRequest(_0x2a4274(0x105),{'method':_0x2a4274(0x160),'body':{'appCode':_0x73d5a8,'pageId':_0x1347b6,'code':_0x54f19b,'datasetIds':_0x24dbb2}});return _0x3b2e92[_0x2a4274(0x157)];}export function generateSdkCode(_0x12fa08,_0x3decc4,_0x4b2a69){const _0x3f8a62=a141_0x102f,_0xb611a7=_0x4b2a69?.[_0x3f8a62(0x10c)]??!![],_0x4fd7fb=_0x3f8a62(0x18a)+_0x12fa08['code']?.[_0x3f8a62(0x159)](/-/g,'_'),_0x5c6633=_0x3decc4[_0x3f8a62(0x174)]||_0x3decc4['operationName']||_0x3f8a62(0x12b),_0x22fa9b=[];_0xb611a7&&_0x22fa9b[_0x3f8a62(0x110)](_0x3f8a62(0x164),'',_0x3f8a62(0x16a),'');_0x22fa9b[_0x3f8a62(0x110)](_0x3f8a62(0x14f)+_0x12fa08[_0x3f8a62(0x174)]+'\x20('+(_0x12fa08[_0x3f8a62(0x147)]||'table')+')');if(_0x5c6633===_0x3f8a62(0x12b))_0x22fa9b[_0x3f8a62(0x110)](_0x3f8a62(0x102)+_0x4fd7fb+_0x3f8a62(0x17b),'\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,','\x20\x20currentPage:\x201,',_0x3f8a62(0x125));else{if(_0x5c6633===_0x3f8a62(0x17f))_0x22fa9b['push']('const\x20result\x20=\x20await\x20client.models.'+_0x4fd7fb+_0x3f8a62(0x138));else{if(_0x5c6633===_0x3f8a62(0x10a))_0x22fa9b['push'](_0x3f8a62(0x102)+_0x4fd7fb+_0x3f8a62(0x16e));else{if(_0x5c6633==='update')_0x22fa9b['push'](_0x3f8a62(0x102)+_0x4fd7fb+_0x3f8a62(0xf1));else _0x5c6633===_0x3f8a62(0x15a)||_0x5c6633===_0x3f8a62(0x145)?_0x22fa9b['push'](_0x3f8a62(0x102)+_0x4fd7fb+_0x3f8a62(0x117)):_0x22fa9b[_0x3f8a62(0x110)](_0x3f8a62(0x102)+_0x4fd7fb+'.'+_0x5c6633+_0x3f8a62(0x161));}}}return _0x22fa9b[_0x3f8a62(0x127)]('\x0a');}export function generateSqlCodeTemplate(_0x4d6516,_0x257323){const _0x4bfcf4=a141_0x102f,_0x24c1c6=_0x257323?.[_0x4bfcf4(0xf6)]??_0x4bfcf4(0x140),_0x2bf5cf=_0x257323?.[_0x4bfcf4(0x10c)]??!![],_0x547dc5=[];return _0x547dc5[_0x4bfcf4(0x110)](_0x4bfcf4(0x146)+_0x4d6516[_0x4bfcf4(0xf5)]+'\x20('+_0x4d6516['sqlCode']+')'),_0x24c1c6===_0x4bfcf4(0x140)?(_0x2bf5cf&&_0x547dc5['push'](_0x4bfcf4(0x164),'',_0x4bfcf4(0x16a),''),_0x547dc5[_0x4bfcf4(0x110)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x4bfcf4(0x163)+_0x4d6516[_0x4bfcf4(0x130)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});',_0x4bfcf4(0x177),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x547dc5[_0x4bfcf4(0x110)](_0x4bfcf4(0x112),_0x4bfcf4(0x136),_0x4bfcf4(0xfb),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x4d6516[_0x4bfcf4(0x130)]+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x4bfcf4(0x131),_0x4bfcf4(0x11d),'}'),_0x547dc5[_0x4bfcf4(0x127)]('\x0a');}export async function getErConfig(_0x25da5a,_0x427651){const _0xccf5c6=a141_0x102f,_0x5afbe0=await apiRequest(_0xccf5c6(0x153),{'method':_0xccf5c6(0x160),'body':{'appCode':_0x25da5a,'dblinkId':_0x427651}});return _0x5afbe0[_0xccf5c6(0x157)];}function a141_0x102f(_0x42cf41,_0x22280f){_0x42cf41=_0x42cf41-0xf0;const _0xd1eb2a=a141_0xd1eb();let _0x102f04=_0xd1eb2a[_0x42cf41];return _0x102f04;}export async function createErRelation(_0x38d7a3){const _0x421ab2=await apiRequest('/smartapi/question/er-config/erCreate',{'method':'POST','body':_0x38d7a3});return _0x421ab2['data'];}function a141_0xd1eb(){const _0x2b2984=['string','clientOperationId','133018HjNbts','authRequired','\x20\x20return\x20rows;','scriptName','includes','2294173SaANHr','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/getUserCustomSql?id=','toLowerCase','test','});','operationId','join','currentPage','/generate-standard-pages/start','Request\x20timeout:\x20','filter','description','error','1222320BWeHSY','/smartapi/dblink/getTableDiffV2ByPage','sqlCode','\x20\x20});','/smartapi/dataset/delete-dataset','&type=','message','dbtableConfig','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','signal','.getOne(id);','api_error','/smartapi/custom/queryUserCustomSqlList','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','/smartapi/dataset/get-driven-data?','stringify','/smartapi/dataset/get-dataset-operation','validation','sdk','entries','6TylPES','method','/smartapi/custom/getUserCustomSql','remove','//\x20SQL:\x20','tableName','/smartapi/dataset/update-driven-data','/smartapi/db-analysis/jobs/cancel','success','path','Page\x20not\x20found:\x20','label','1023130WNAPIT','//\x20','/smartapi/dblink/delete','/sync-to-pages','pageSize','/smartapi/question/er-config','/generate-standard-pages/status?','cookie','/api/management/library/scripts/info?id=','data','status','replace','delete','application/json','operationName','requestFields','Check\x20network\x20connectivity\x20and\x20try\x20again.','apiError','POST','(/*\x20params\x20*/);','planId','\x20\x20sqlCode:\x20\x27','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','117ZMszPu','modelCode','/api/management/library/scripts/delete','length','version','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','operations','/smartapi/dblink/getOne','errorCode','.create({\x20/*\x20fields\x20*/\x20});','?sqlCode=','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','tableData','/smartapi/dblink/create','/api/','name','/smartapi/custom/saveUserCustomSql','1093170DutQJm','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','/api/management/library/scripts/list?appCode=','29928HxiyrY','\x20of\x20','.filter({','body','API\x20error\x20code:\x20','/smartapi/db-analysis/start','getOne','/api/management/library/scripts/save','tableList','errorMsg','code','UNAUTHORIZED','type','dbId','toString','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','totalCount','dataset_','/api/management/library/scripts/statistics?appCode=','Operation\x20\x22','697562SwSmPw','Dataset\x20not\x20found:\x20','cli:rabetbase','/standard-page-status?appCode=','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','find','modelId','object','sqlName','target','functionName','BFF\x20save\x20returned\x20no\x20valid\x20id','/api/custom/executeSql','json','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/custom/deleteUserCustomSql','API\x20error:\x20','/smartapi/lovrabet/detail?pageId=','401','/smartapi/app/getList','has','const\x20result\x20=\x20await\x20client.models.','enabled','AbortError','/smartapi/lovrabet/update-page','/smartapi/dataset/get-dataset-list','\x22\x20not\x20found\x20in\x20dataset\x20','isArray','/api/node-toolbox/sql/save','create','set','includeImports','map','/smartapi/lovrabet/dataset/','/smartapi/dblink/getList','push','Warning:\x20showing\x20first\x20','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','warn','/smartapi/dblink/getAllTableList','abort','/smartapi/custom/updateUserCustomSql','.remove(id);','SQL\x20query\x20not\x20found:\x20id='];a141_0xd1eb=function(){return _0x2b2984;};return a141_0xd1eb();}export async function updateErRelation(_0x3f952c){const _0x10cee8=a141_0x102f,_0x2acf5f=await apiRequest('/smartapi/question/er-config/update-single',{'method':'POST','body':_0x3f952c});return _0x2acf5f[_0x10cee8(0x157)];}export async function deleteErRelation(_0x47b0b8){const _0x5ebe73=a141_0x102f,_0x5c3121=await apiRequest('/smartapi/question/er-config/erDelete',{'method':_0x5ebe73(0x160),'body':_0x47b0b8});return _0x5c3121[_0x5ebe73(0x157)];}function buildQuery(_0x35b117){const _0x36f290=a141_0x102f,_0x15fb50=new URLSearchParams();for(const [_0x4271da,_0x212a85]of Object[_0x36f290(0x141)](_0x35b117)){if(_0x212a85===undefined||_0x212a85==='')continue;_0x15fb50[_0x36f290(0x10b)](_0x4271da,String(_0x212a85));}const _0x2fa8d1=_0x15fb50[_0x36f290(0x187)]();return _0x2fa8d1?'?'+_0x2fa8d1:'';}export async function listDbLinks(_0x4d2d43,_0x1a6e14){const _0x4b875b=a141_0x102f,_0x174a63=await apiRequest(_0x4b875b(0x10f),{'method':_0x4b875b(0x160),'body':{'appCode':_0x4d2d43,'currentPage':_0x1a6e14?.[_0x4b875b(0x128)]??0x1,'pageSize':_0x1a6e14?.[_0x4b875b(0x152)]??0x64}});return{'items':extractList(_0x174a63[_0x4b875b(0x157)]),'paging':extractPaging(_0x174a63[_0x4b875b(0x157)])};}export async function getDbLinkInfo(_0x35f887){const _0x532840=a141_0x102f,_0x17f208=await apiRequest(_0x532840(0x16c)+buildQuery({'id':_0x35f887}));return _0x17f208['data'];}export async function createDbLink(_0x45e845){const _0x11afc6=a141_0x102f,_0x54b4a8=await apiRequest(_0x11afc6(0x172),{'method':_0x11afc6(0x160),'body':_0x45e845});return _0x54b4a8[_0x11afc6(0x157)];}export async function updateDbLink(_0x3b2a93){const _0x53494a=a141_0x102f,_0x522b2f=await apiRequest('/smartapi/dblink/update',{'method':_0x53494a(0x160),'body':_0x3b2a93});return _0x522b2f[_0x53494a(0x157)];}export async function deleteDbLink(_0x23772e){const _0xb6888d=a141_0x102f;await apiRequest(_0xb6888d(0x150),{'method':_0xb6888d(0x160),'body':{'id':_0x23772e}});}export async function testDbLinkConnect(_0x39905e){const _0x198291=await apiRequest('/smartapi/dblink/testConnect'+buildQuery({'id':_0x39905e}));return _0x198291['data'];}export async function startDbAnalysis(_0x2e0c5d,_0x15d1d8){const _0x1aa28c=a141_0x102f,_0x4b45c0=await apiRequest(_0x1aa28c(0x17e),{'method':_0x1aa28c(0x160),'body':{'dbLinkId':_0x2e0c5d,..._0x15d1d8&&_0x15d1d8[_0x1aa28c(0x168)]>0x0?{'tableNames':_0x15d1d8}:{}}}),_0x414ef2=_0x4b45c0[_0x1aa28c(0x157)];if(typeof _0x414ef2===_0x1aa28c(0x119))return _0x414ef2;if(_0x414ef2&&typeof _0x414ef2===_0x1aa28c(0xf4)&&typeof _0x414ef2[_0x1aa28c(0x162)]==='string')return _0x414ef2[_0x1aa28c(0x162)];return _0x414ef2!=null?String(_0x414ef2):'';}export async function cancelDbAnalysis(_0x284920){const _0x307cab=a141_0x102f;await apiRequest(_0x307cab(0x149)+buildQuery({'planId':_0x284920}),{'method':_0x307cab(0x160)});}export async function getDbAnalysisStatus(_0x4641f4){const _0x150cbe=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x4641f4));return _0x150cbe['data'];}export async function getDbAllTableList(_0x134f68,_0x4f5738){const _0x69af70=a141_0x102f,_0x1485b1=await apiRequest(_0x69af70(0x114)+buildQuery({'appCode':_0x134f68,'dbLinkId':_0x4f5738})),_0x417c9c=_0x1485b1['data'];if(Array['isArray'](_0x417c9c))return _0x417c9c;return extractList(_0x417c9c);}export async function getDbTableDiff(_0x409e11,_0x23e4c7,_0x4b7e3c){const _0xf1d958=a141_0x102f,_0x3ec656=await apiRequest(_0xf1d958(0x12f)+buildQuery({'appCode':_0x409e11,'dbLinkId':_0x23e4c7,'pageIndex':_0x4b7e3c?.['pageIndex']??0x1,'pageSize':_0x4b7e3c?.[_0xf1d958(0x152)]??0x14,'tableName':_0x4b7e3c?.['tableName']})),_0x1d4e7a=_0x3ec656[_0xf1d958(0x157)];return{'totalCount':_0x1d4e7a?.['totalCount']??0x0,'tableList':Array[_0xf1d958(0x108)](_0x1d4e7a?.[_0xf1d958(0x181)])?_0x1d4e7a[_0xf1d958(0x181)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x58addb=a141_0x102f,_0x3471ce=await apiRequest(_0x58addb(0x100),{'method':_0x58addb(0x160),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0xa7285a=extractList(_0x3471ce[_0x58addb(0x157)]),_0x5bef6d=extractPaging(_0x3471ce[_0x58addb(0x157)]);return _0x5bef6d&&_0x5bef6d['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x58addb(0x113)](_0x58addb(0x111)+REMOTE_APP_PAGE_SIZE+_0x58addb(0x17a)+_0x5bef6d[_0x58addb(0x189)]+'\x20apps.\x20'+_0x58addb(0x13b)),_0xa7285a;}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a142_0x2bd372=a142_0x1fb9;(function(_0x30e4c0,_0x5627b9){const _0x48bc4d=a142_0x1fb9,_0x1cf348=_0x30e4c0();while(!![]){try{const _0x52122e=-parseInt(_0x48bc4d(0xa1))/0x1*(-parseInt(_0x48bc4d(0xa9))/0x2)+-parseInt(_0x48bc4d(0xaa))/0x3+parseInt(_0x48bc4d(0xa2))/0x4*(parseInt(_0x48bc4d(0xab))/0x5)+-parseInt(_0x48bc4d(0xa0))/0x6*(parseInt(_0x48bc4d(0xa3))/0x7)+-parseInt(_0x48bc4d(0xad))/0x8*(-parseInt(_0x48bc4d(0xa7))/0x9)+-parseInt(_0x48bc4d(0xa4))/0xa*(-parseInt(_0x48bc4d(0xa8))/0xb)+-parseInt(_0x48bc4d(0xae))/0xc;if(_0x52122e===_0x5627b9)break;else _0x1cf348['push'](_0x1cf348['shift']());}catch(_0x8fcfc8){_0x1cf348['push'](_0x1cf348['shift']());}}}(a142_0x4fe0,0x8efa0));function a142_0x1fb9(_0x5c3214,_0x4c7647){_0x5c3214=_0x5c3214-0xa0;const _0x4fe08f=a142_0x4fe0();let _0x1fb9e8=_0x4fe08f[_0x5c3214];return _0x1fb9e8;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a142_0x2bd372(0xac),LOCK_FILE_NAME=a142_0x2bd372(0xa5),TRASH_DIR_NAME=a142_0x2bd372(0xa6);export function loadBffProjectConfig(_0x4fb649,_0x3a6114){const _0xeebd88=resolve(_0x3a6114??findProjectRootDirectory()),_0x22a8b9=DOT_DIR+'/bff',_0x384ca9=_0x22a8b9+'/'+_0x4fb649;return{'projectRoot':_0xeebd88,'appCode':_0x4fb649,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x22a8b9,'scriptsRoot':_0x384ca9,'scriptsRootDir':resolve(_0xeebd88,DOT_DIR,'bff',_0x4fb649),'lockFilePath':resolve(_0xeebd88,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0xeebd88,DOT_DIR,TRASH_DIR_NAME)};}function a142_0x4fe0(){const _0x2e0d49=['2880585FSQUyS','4456800wGGoxl','.rabetbase','48weqSyS','23075184LuDADQ','36lAQBmi','3319KiDqUm','4QIByDZ','255381LQZXgD','40VjRBDv','bff.lock.json','bff-trash','1570527ykzLXN','1625107cxvoqd','698WVgMxf'];a142_0x4fe0=function(){return _0x2e0d49;};return a142_0x4fe0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a143_0x1e65(_0x24a9aa,_0x5546ba){_0x24a9aa=_0x24a9aa-0x95;const _0x210fa8=a143_0x210f();let _0x1e65ac=_0x210fa8[_0x24a9aa];return _0x1e65ac;}const a143_0x545416=a143_0x1e65;(function(_0x55c724,_0x48bfeb){const _0x2499e6=a143_0x1e65,_0x5a3759=_0x55c724();while(!![]){try{const _0x5a749b=parseInt(_0x2499e6(0xa4))/0x1+parseInt(_0x2499e6(0x9f))/0x2+parseInt(_0x2499e6(0xb2))/0x3*(parseInt(_0x2499e6(0xa9))/0x4)+parseInt(_0x2499e6(0x9b))/0x5*(parseInt(_0x2499e6(0xa1))/0x6)+parseInt(_0x2499e6(0xaf))/0x7*(-parseInt(_0x2499e6(0xb6))/0x8)+parseInt(_0x2499e6(0xb4))/0x9+parseInt(_0x2499e6(0xb9))/0xa*(-parseInt(_0x2499e6(0x9e))/0xb);if(_0x5a749b===_0x48bfeb)break;else _0x5a3759['push'](_0x5a3759['shift']());}catch(_0x45f598){_0x5a3759['push'](_0x5a3759['shift']());}}}(a143_0x210f,0xaf110));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a143_0x545416(0xab),'ENDPOINT',a143_0x545416(0xa7)];export function normalizeBffType(_0x57d3a6){const _0x4431eb=a143_0x545416;if(!_0x57d3a6)return undefined;const _0x149c16=_0x57d3a6[_0x4431eb(0xa3)]()[_0x4431eb(0xa8)]();return SUPPORTED_BFF_TYPES[_0x4431eb(0x9c)](_0x149c16)?_0x149c16:undefined;}async function scanJsFilesRecursively(_0xf6c89f,_0x3250b8){const _0x5700d3=a143_0x545416,_0x59deb7=[];try{const _0x52e080=await readdir(_0xf6c89f,{'withFileTypes':!![]});for(const _0x3c2243 of _0x52e080){const _0x50f5d3=join(_0xf6c89f,_0x3c2243[_0x5700d3(0x99)]);if(_0x3c2243[_0x5700d3(0xaa)]())_0x59deb7[_0x5700d3(0xa0)](...await scanJsFilesRecursively(_0x50f5d3,_0x3250b8+'/'+_0x3c2243[_0x5700d3(0x99)]));else _0x3c2243['isFile']()&&_0x3c2243[_0x5700d3(0x99)][_0x5700d3(0xb7)](_0x5700d3(0xbc))&&_0x59deb7[_0x5700d3(0xa0)]({'lockKey':_0x3250b8+'/'+_0x3c2243['name'][_0x5700d3(0x98)](/\.js$/,''),'filePath':_0x50f5d3});}}catch(_0x53c731){if(_0x53c731[_0x5700d3(0xb8)]!==_0x5700d3(0xba))throw _0x53c731;}return _0x59deb7;}async function scanFlatFunctions(_0x8d1458,_0x1259fc){const _0x14c42c=a143_0x545416,_0x1e7799=join(_0x8d1458['scriptsRootDir'],_0x1259fc),_0x225b1=await scanJsFilesRecursively(_0x1e7799,_0x1259fc);return _0x225b1[_0x14c42c(0xb0)](({lockKey:_0x3172ee,filePath:_0x13010f})=>({'type':_0x1259fc,'name':_0x3172ee[_0x14c42c(0xad)]('/')['at'](-0x1)??'','filePath':_0x13010f,'lockKey':_0x3172ee}));}async function scanHookFunctions(_0x3b1c27){const _0x4efd04=a143_0x545416,_0x33ecc5=join(_0x3b1c27[_0x4efd04(0xa2)],_0x4efd04(0xa7)),_0x3dcea2=[];try{const _0x1715d3=await readdir(_0x33ecc5,{'withFileTypes':!![]});for(const _0x46c235 of _0x1715d3){if(!_0x46c235['isDirectory']())continue;const _0xde10f5=_0x46c235[_0x4efd04(0x99)],_0x187250=join(_0x33ecc5,_0xde10f5),_0x358563=await readdir(_0x187250,{'withFileTypes':!![]});for(const _0x4b6226 of _0x358563){if(!_0x4b6226[_0x4efd04(0xaa)]())continue;const _0x3de6f1=_0x4b6226['name'],_0x4f5f74=join(_0x187250,_0x3de6f1),_0x17dc0d=await readdir(_0x4f5f74,{'withFileTypes':!![]});for(const _0x50a07a of _0x17dc0d){if(!_0x50a07a[_0x4efd04(0xaa)]())continue;const _0x3d0908=_0x50a07a['name'],_0x167cd4=join(_0x4f5f74,_0x3d0908),_0x8072c6=await readdir(_0x167cd4,{'withFileTypes':!![]});for(const _0x7075ee of _0x8072c6){if(!_0x7075ee['isFile']()||!_0x7075ee[_0x4efd04(0x99)][_0x4efd04(0xb7)](_0x4efd04(0xbc)))continue;const _0x1a7c30=_0x7075ee[_0x4efd04(0x99)]['replace'](/\.js$/,'');_0x3dcea2[_0x4efd04(0xa0)]({'type':'HOOK','name':_0x1a7c30,'filePath':join(_0x167cd4,_0x7075ee[_0x4efd04(0x99)]),'lockKey':_0x4efd04(0xa5)+_0xde10f5+'/'+_0x3de6f1+'/'+_0x3d0908+'/'+_0x1a7c30,'alias':_0xde10f5,'operationType':_0x3de6f1,'functionNode':_0x3d0908});}}}}}catch(_0x4fbf0e){if(_0x4fbf0e[_0x4efd04(0xb8)]!==_0x4efd04(0xba))throw _0x4fbf0e;}return _0x3dcea2;}export async function scanLocalBffFunctions(_0x47a9b7,_0x39ab9b){const _0x1808b8=a143_0x545416;if(_0x39ab9b===_0x1808b8(0xab)||_0x39ab9b===_0x1808b8(0x96))return scanFlatFunctions(_0x47a9b7,_0x39ab9b);if(_0x39ab9b===_0x1808b8(0xa7))return scanHookFunctions(_0x47a9b7);const [_0x3ae2fd,_0x4e9121,_0x450be2]=await Promise['all']([scanFlatFunctions(_0x47a9b7,_0x1808b8(0xab)),scanFlatFunctions(_0x47a9b7,_0x1808b8(0x96)),scanHookFunctions(_0x47a9b7)]);return[..._0x3ae2fd,..._0x4e9121,..._0x450be2];}export function resolveLocalFilePathFromLockKey(_0x1148a9,_0x44bd63){const _0x2ea8cd=a143_0x545416;return join(_0x1148a9[_0x2ea8cd(0xa2)],..._0x44bd63[_0x2ea8cd(0xad)]('/'))+_0x2ea8cd(0xbc);}export function createHookLocationMap(_0x2e600f){const _0x1816ef=a143_0x545416,_0x45c450=new Map();for(const _0x21c42b of _0x2e600f){_0x21c42b['beforeScriptId']&&_0x45c450[_0x1816ef(0xbb)](_0x21c42b['beforeScriptId'],{'datasetCode':_0x21c42b[_0x1816ef(0x95)],'operationType':snakeToCamel(_0x21c42b[_0x1816ef(0x9a)]),'functionNode':_0x1816ef(0xb1)}),_0x21c42b[_0x1816ef(0xb3)]&&_0x45c450['set'](_0x21c42b['afterScriptId'],{'datasetCode':_0x21c42b[_0x1816ef(0x95)],'operationType':snakeToCamel(_0x21c42b[_0x1816ef(0x9a)]),'functionNode':_0x1816ef(0xa6)});}return _0x45c450;}export function resolveRemoteScriptTarget(_0x4059d6,_0x313e6e,_0x1e1e4c,_0x546a6e,_0x2a9699){const _0x14b5be=a143_0x545416,_0x55703e=normalizeBffType(_0x313e6e['scriptType']);if(!_0x55703e||!_0x313e6e[_0x14b5be(0x9d)])return null;if(_0x55703e==='HOOK'){const _0x426d6a=(_0x313e6e['id']?_0x1e1e4c[_0x14b5be(0xac)](_0x313e6e['id']):undefined)??findHookLocationByRemoteId(_0x546a6e,_0x313e6e['id']);if(!_0x426d6a)return null;const _0x132151=_0x426d6a[_0x14b5be(0x97)]||_0x2a9699[_0x14b5be(0xac)](_0x426d6a[_0x14b5be(0x95)]),_0x4b96d8=_0x132151??_0x426d6a['datasetCode'],_0x3faff4={..._0x426d6a,'alias':_0x132151},_0x42614='HOOK/'+_0x4b96d8+'/'+_0x3faff4['operationType']+'/'+_0x3faff4[_0x14b5be(0xb5)]+'/'+_0x313e6e[_0x14b5be(0x9d)];return{'lockKey':_0x42614,'filePath':resolveLocalFilePathFromLockKey(_0x4059d6,_0x42614),'type':'HOOK','hookLocation':_0x3faff4};}const _0x1f02f6=_0x55703e+'/'+_0x313e6e[_0x14b5be(0x9d)];return{'lockKey':_0x1f02f6,'filePath':resolveLocalFilePathFromLockKey(_0x4059d6,_0x1f02f6),'type':_0x55703e};}function a143_0x210f(){const _0x2651eb=['includes','functionName','11jbNsUb','686364stuEzE','push','3552162eROzda','scriptsRootDir','trim','265405fTTGYm','HOOK/','after','HOOK','toUpperCase','18024qBNRpN','isDirectory','COMMON','get','split','F_OK','366233jMzJBv','map','before','309ldqEpT','afterScriptId','10170054EGRUaD','functionNode','96FQQHwY','endsWith','code','14498380TbsXVJ','ENOENT','set','.js','datasetCode','ENDPOINT','alias','replace','name','operationType','5kklVEL'];a143_0x210f=function(){return _0x2651eb;};return a143_0x210f();}export async function ensureParentDirectory(_0x51578a){await mkdir(dirname(_0x51578a),{'recursive':!![]});}export async function fileExists(_0x4d3c2c){const _0x506843=a143_0x545416;try{return await access(_0x4d3c2c,constants[_0x506843(0xae)]),!![];}catch{return![];}}export async function directoryExists(_0x5f2939){const _0x5c86fa=a143_0x545416;try{const _0x2975c7=await stat(_0x5f2939);return _0x2975c7[_0x5c86fa(0xaa)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x229ad0,_0x479bd5){const _0x23a5a0=a144_0x15f7,_0x2987b0=_0x229ad0();while(!![]){try{const _0x2c14a6=parseInt(_0x23a5a0(0x151))/0x1+parseInt(_0x23a5a0(0x14f))/0x2+-parseInt(_0x23a5a0(0x155))/0x3*(parseInt(_0x23a5a0(0x14d))/0x4)+-parseInt(_0x23a5a0(0x159))/0x5+-parseInt(_0x23a5a0(0x150))/0x6+-parseInt(_0x23a5a0(0x15a))/0x7*(-parseInt(_0x23a5a0(0x14e))/0x8)+parseInt(_0x23a5a0(0x158))/0x9;if(_0x2c14a6===_0x479bd5)break;else _0x2987b0['push'](_0x2987b0['shift']());}catch(_0x4e16ec){_0x2987b0['push'](_0x2987b0['shift']());}}}(a144_0x9222,0x7f5bc));function a144_0x15f7(_0xb9455f,_0x2d7866){_0xb9455f=_0xb9455f-0x14d;const _0x92227e=a144_0x9222();let _0x15f720=_0x92227e[_0xb9455f];return _0x15f720;}import{readFile}from'node:fs/promises';import a144_0x4906c2 from'node:crypto';function a144_0x9222(){const _0x1f465d=['220262LYdtTJ','3739472NPJfwL','40CidoAU','398692QxnpsA','5036778ELTBie','366798EukvFc','hex','update','digest','3yReAaP','createHash','utf8','20864070utifZg','3728565iBjIwD'];a144_0x9222=function(){return _0x1f465d;};return a144_0x9222();}export function computeContentHash(_0x138925){const _0x590570=a144_0x15f7;return a144_0x4906c2[_0x590570(0x156)]('md5')[_0x590570(0x153)](_0x138925)[_0x590570(0x154)](_0x590570(0x152));}export async function computeFileHash(_0x20952d){const _0x153102=a144_0x15f7,_0x38842b=await readFile(_0x20952d,_0x153102(0x157));return computeContentHash(_0x38842b);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x758bb1,_0x5d7b7d){const _0x4f27e0=a145_0x241f,_0x20b817=_0x758bb1();while(!![]){try{const _0x64ee03=parseInt(_0x4f27e0(0x169))/0x1+parseInt(_0x4f27e0(0x16a))/0x2*(-parseInt(_0x4f27e0(0x15d))/0x3)+parseInt(_0x4f27e0(0x162))/0x4*(parseInt(_0x4f27e0(0x161))/0x5)+parseInt(_0x4f27e0(0x157))/0x6*(parseInt(_0x4f27e0(0x160))/0x7)+parseInt(_0x4f27e0(0x154))/0x8+parseInt(_0x4f27e0(0x165))/0x9*(-parseInt(_0x4f27e0(0x15e))/0xa)+-parseInt(_0x4f27e0(0x15f))/0xb;if(_0x64ee03===_0x5d7b7d)break;else _0x20b817['push'](_0x20b817['shift']());}catch(_0x58d1c7){_0x20b817['push'](_0x20b817['shift']());}}}(a145_0x15b5,0x82b3f));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a145_0x15b5(){const _0x2f6768=['280RorTpC','5vGAyZV','1183708iQBRlr','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','object','333SfuaEq','parse','functions','ENOENT','200871ftNbdY','86XQPrwv','\x22\x20vs\x20lock\x20\x22','7752056nmceOT','apps','lastSync','47514oTNDsE','\x22.\x20','scriptsRoot','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','current\x20\x22','code','49548efjHkc','6730WRqyso','5633287TWfrzW'];a145_0x15b5=function(){return _0x2f6768;};return a145_0x15b5();}function a145_0x241f(_0xefe5e1,_0x3d9eaf){_0xefe5e1=_0xefe5e1-0x153;const _0x15b5da=a145_0x15b5();let _0x241f1d=_0x15b5da[_0xefe5e1];return _0x241f1d;}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x6dd9cf,_0x82d501,_0x378502,_0x5de286){const _0xbf24a2=a145_0x241f,_0x105d71={'apps':_0x6dd9cf[_0xbf24a2(0x155)]&&typeof _0x6dd9cf[_0xbf24a2(0x155)]===_0xbf24a2(0x164)?_0x6dd9cf[_0xbf24a2(0x155)]:{}};let _0x2d8567=_0x105d71[_0xbf24a2(0x155)][_0x82d501];if(!_0x2d8567)return _0x2d8567={'scriptsRoot':_0x378502,'lastSync':'','functions':{}},_0x105d71[_0xbf24a2(0x155)][_0x82d501]=_0x2d8567,{'lockData':_0x105d71,'appLock':_0x2d8567};if(!_0x2d8567['scriptsRoot'])_0x2d8567[_0xbf24a2(0x159)]=_0x378502;else{if(_0x2d8567['scriptsRoot']!==_0x378502)throw new Error(_0x5de286+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0xbf24a2(0x15b)+_0x378502+_0xbf24a2(0x153)+_0x2d8567[_0xbf24a2(0x159)]+_0xbf24a2(0x158))+_0xbf24a2(0x163));}return!_0x2d8567['functions']&&(_0x2d8567[_0xbf24a2(0x167)]={}),!_0x2d8567[_0xbf24a2(0x156)]&&(_0x2d8567[_0xbf24a2(0x156)]=''),{'lockData':_0x105d71,'appLock':_0x2d8567};}export async function readBffLockFile(_0x33973f){const _0x45c121=a145_0x241f;try{const _0x57c5ba=await readFile(_0x33973f,'utf8'),_0x5b0988=JSON[_0x45c121(0x166)](_0x57c5ba);return{'apps':_0x5b0988[_0x45c121(0x155)]&&typeof _0x5b0988[_0x45c121(0x155)]===_0x45c121(0x164)?_0x5b0988[_0x45c121(0x155)]:{}};}catch(_0x1f8be8){if(_0x1f8be8[_0x45c121(0x15c)]===_0x45c121(0x168))return null;throw new Error(_0x45c121(0x15a)+String(_0x1f8be8));}}export async function writeBffLockFile(_0x141f4f,_0x415b9e){await mkdir(dirname(_0x141f4f),{'recursive':!![]}),await writeFile(_0x141f4f,JSON['stringify'](_0x415b9e,null,0x2),'utf8');}
|