@lovrabet/rabetbase-cli 2.1.14-beta.1 → 2.1.14-beta.2
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/README.md +18 -0
- 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/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -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 +3 -3
package/README.md
CHANGED
|
@@ -77,6 +77,24 @@ rabetbase api pull --appcode <app-code>
|
|
|
77
77
|
rabetbase add page
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
## 🤖 Agent Runtime 智能发布
|
|
81
|
+
|
|
82
|
+
在支持仓库 Agent Skill 的 Agent Runtime terminal 中,可以输入发布意图。Agent 会加载并遵循本仓 repo-local deploy skill:`.agents/skills/flow-rabetbase-cli-deploy/SKILL.md`,该 skill 会引用 `wiki/policies/cli-deploy-policy.md`,并最终调用受保护的 npm 发布脚本:
|
|
83
|
+
|
|
84
|
+
| 输入 | Agent 执行动作 |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `deploy beta` | 按 `flow-rabetbase-cli-deploy` 的 beta 流程执行门禁,临时写 beta 版本并发布 npm beta;不创建 MR、不把 beta 版本提交回 `main` |
|
|
87
|
+
| `deploy latest` | 按 `flow-rabetbase-cli-deploy` 的 latest 流程执行门禁,临时写 stable 版本并发布 npm latest / Open Skill;不创建 MR、不把 latest 版本提交回 `main` |
|
|
88
|
+
|
|
89
|
+
`deploy beta` / `deploy latest` 是 Agent 意图短语,不是普通 shell 命令;也不是直接在 shell 中执行 `SKILL.md` 文件。普通终端中请直接使用 `npm run beta-release` 或 `npm run release`。裸 `deploy` 不作为推荐发布入口;Agent 收到时应先要求用户明确 `beta` 或 `latest` 通道,不能默认执行正式发布。
|
|
90
|
+
|
|
91
|
+
发布硬规则:
|
|
92
|
+
|
|
93
|
+
- `deploy beta` / `deploy latest` 不要求 MR,也不写 `main`;可在干净的 `main` 或 release 工作区执行,但脚本不得提交或推送当前分支。
|
|
94
|
+
- 修改代码、文档、Skill、脚本、测试等仓库持久化内容必须走 CodeUp MR。
|
|
95
|
+
- 发布前必须完成本地验证,并确认当前 npmjs 发布身份。
|
|
96
|
+
- npm 发布认证以 npm CLI 提供的 WebAuthn / Security Key 链路为主;OTP 仅在 npm CLI 明确要求时作为兜底。
|
|
97
|
+
|
|
80
98
|
## 分场景使用教程
|
|
81
99
|
|
|
82
100
|
由浅入深的说明见 **[docs/user-guide/README.md](./docs/user-guide/README.md)**(安装与登录、配置与多应用、API/数据集、自定义 SQL、BFF 同步、代码生成与菜单、排障等)。逐项参数仍以 [docs/commands.md](./docs/commands.md) 为准。
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x4acc34=a0_0x3e58;(function(_0x4b4afe,_0x240620){const _0x4f04e4=a0_0x3e58,_0x5b6275=_0x4b4afe();while(!![]){try{const _0x469b3c=-parseInt(_0x4f04e4(0xb0))/0x1+-parseInt(_0x4f04e4(0x9d))/0x2*(-parseInt(_0x4f04e4(0xa6))/0x3)+parseInt(_0x4f04e4(0xaf))/0x4+parseInt(_0x4f04e4(0xae))/0x5+parseInt(_0x4f04e4(0xb1))/0x6*(parseInt(_0x4f04e4(0xb7))/0x7)+-parseInt(_0x4f04e4(0xab))/0x8+-parseInt(_0x4f04e4(0xa2))/0x9;if(_0x469b3c===_0x240620)break;else _0x5b6275['push'](_0x5b6275['shift']());}catch(_0x5b58a0){_0x5b6275['push'](_0x5b6275['shift']());}}}(a0_0x5972,0xd9d4e));import{mkdirSync,writeFileSync}from'node:fs';import a0_0x30181b from'node:path';import{getApiDomain}from'../constant/domain.js';function a0_0x3e58(_0x13e234,_0x4ab93d){_0x13e234=_0x13e234-0x9c;const _0x59722f=a0_0x5972();let _0x3e58f6=_0x59722f[_0x13e234];return _0x3e58f6;}import{logger}from'../utils/logger.js';function a0_0x5972(){const _0x155e26=['length','65380kaoEIF','string',']\x20Generating:\x20','Waiting\x203\x20seconds...\x0a','POST','2408286YUGnbe','.md\x20(','tableName','✓\x20Generated:\x20','./docs','8184006oAPJej','api-doc','datasetCode','name','3AcKPTf','log','utf8','join','生成文档失败:\x20','13070024VBCsKr','✗\x20Failed:\x20','生成文档成功:\x20','985055OsRNrs','6434504YIUiHF','555155Edxbnl','630zsFAnq','.md\x20-\x20','.md','push','message'];a0_0x5972=function(){return _0x155e26;};return a0_0x5972();}import{platformFetch}from'../core/api-client.js';export async function fetchDatasetDoc(_0x5a5b35){const _0x52507a=a0_0x3e58,{appCode:_0x5225ea,cookie:_0x16bbd5,datasetCode:_0x4b18d8,datasetId:_0x97fe0a,extraParams:_0x5a27b4}=_0x5a5b35,_0x440fad=getApiDomain()+'/api/node-toolbox/api-doc-generator',_0x45bd96=await platformFetch(_0x440fad,{'method':_0x52507a(0x9c),'body':{'appCode':_0x5225ea,'datasetCode':_0x4b18d8,'datasetId':_0x97fe0a,..._0x5a27b4||{}},'cookie':_0x16bbd5,'label':'Fetch\x20doc\x20('+_0x4b18d8+')'});if(!_0x45bd96||typeof _0x45bd96['markdown']!==_0x52507a(0xb8))throw new Error('Invalid\x20response\x20format\x20('+_0x4b18d8+'):\x20missing\x20data.markdown\x20field');return _0x45bd96['markdown'];}function delay(_0x160616){return new Promise(_0x2c6f3b=>setTimeout(_0x2c6f3b,_0x160616));}export async function generateDatasetDocs(_0x449722,_0x1a16fa,_0xc5af40,_0x539d0c=a0_0x4acc34(0xa1),_0x47ff60,_0x58e386){const _0x4c31d1=a0_0x4acc34;mkdirSync(_0x539d0c,{'recursive':!![]});const _0x2dd71b=[],_0x57f52d=_0x449722['length'];console[_0x4c31d1(0xa7)]('\x0a'+_0x57f52d+'\x20datasets\x20to\x20generate\x20docs\x20for\x0a');for(let _0x14250d=0x0;_0x14250d<_0x449722[_0x4c31d1(0xb6)];_0x14250d++){const _0x2e720b=_0x449722[_0x14250d],_0x2c9223=_0x14250d+0x1,_0x2807d7=_0x2e720b[_0x4c31d1(0x9f)];try{console[_0x4c31d1(0xa7)]('['+_0x2c9223+'/'+_0x57f52d+_0x4c31d1(0xb9)+_0x2807d7+_0x4c31d1(0x9e)+_0x2e720b[_0x4c31d1(0xa5)]+')');if(_0x47ff60)_0x47ff60(_0x2c9223,_0x57f52d,_0x2807d7);const _0x75289f=await fetchDatasetDoc({'appCode':_0x1a16fa,'cookie':_0xc5af40,'datasetCode':_0x2e720b[_0x4c31d1(0xa4)],'datasetId':_0x2e720b['id'],'enableAI':![],'extraParams':_0x58e386}),_0x5f1905=a0_0x30181b[_0x4c31d1(0xa9)](_0x539d0c,_0x2807d7+_0x4c31d1(0xb3));writeFileSync(_0x5f1905,_0x75289f,{'encoding':_0x4c31d1(0xa8)}),console['log'](_0x4c31d1(0xa0)+_0x2807d7+_0x4c31d1(0xb3)),logger['success'](_0x4c31d1(0xa3),_0x4c31d1(0xad)+_0x2807d7,undefined,{'datasetCode':_0x2e720b[_0x4c31d1(0xa4)],'datasetName':_0x2e720b[_0x4c31d1(0xa5)],'filePath':_0x5f1905,'progress':_0x2c9223+'/'+_0x57f52d}),_0x2dd71b['push']({'datasetCode':_0x2e720b[_0x4c31d1(0xa4)],'datasetName':_0x2e720b['name'],'filePath':_0x5f1905,'success':!![]});if(_0x2c9223<_0x57f52d)await delay(0x1388);}catch(_0x436671){const _0x4ad306=_0x436671 instanceof Error?_0x436671[_0x4c31d1(0xb5)]:String(_0x436671);console['log'](_0x4c31d1(0xac)+_0x2807d7+_0x4c31d1(0xb2)+_0x4ad306),logger['error']('api-doc',_0x4c31d1(0xaa)+_0x2e720b[_0x4c31d1(0xa4)],{'datasetCode':_0x2e720b[_0x4c31d1(0xa4)],'datasetName':_0x2e720b['name'],'error':_0x4ad306,'progress':_0x2c9223+'/'+_0x57f52d}),_0x2dd71b[_0x4c31d1(0xb4)]({'datasetCode':_0x2e720b['datasetCode'],'datasetName':_0x2e720b['name'],'filePath':'','success':![],'error':_0x4ad306}),_0x2c9223<_0x57f52d&&(console[_0x4c31d1(0xa7)](_0x4c31d1(0xba)),await delay(0xbb8));}}return _0x2dd71b;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x447321,_0x3294e8){const _0x391dd3=a1_0x4eb2,_0x1d133c=_0x447321();while(!![]){try{const _0xc8e1dc=parseInt(_0x391dd3(0x1c3))/0x1+parseInt(_0x391dd3(0x1c7))/0x2*(-parseInt(_0x391dd3(0x1c4))/0x3)+-parseInt(_0x391dd3(0x1c6))/0x4+-parseInt(_0x391dd3(0x1cc))/0x5+-parseInt(_0x391dd3(0x1cf))/0x6+-parseInt(_0x391dd3(0x1c2))/0x7*(parseInt(_0x391dd3(0x1c5))/0x8)+-parseInt(_0x391dd3(0x1c8))/0x9*(-parseInt(_0x391dd3(0x1ca))/0xa);if(_0xc8e1dc===_0x3294e8)break;else _0x1d133c['push'](_0x1d133c['shift']());}catch(_0x5a3940){_0x1d133c['push'](_0x1d133c['shift']());}}}(a1_0x432f,0x36434));import{getApiDomain}from'../constant/domain.js';function a1_0x4eb2(_0x579268,_0x2395f2){_0x579268=_0x579268-0x1c0;const _0x432fe7=a1_0x432f();let _0x4eb2b2=_0x432fe7[_0x579268];return _0x4eb2b2;}function a1_0x432f(){const _0x24acf7=['8wexLOl','224556vxcukE','38LtJreo','45SUYUFc','configArray','2109250HXZUpL','正在从服务器拉取模型列表...\x20(环境:\x20','490525CkLvRU','length','&otype=array','1445106clYSVq','name','replace','1903804VLtfOI','224829PCUDaV','61599xtLnVL'];a1_0x432f=function(){return _0x24acf7;};return a1_0x432f();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import{platformFetch}from'../core/api-client.js';function cleanNewlines(_0x29748a){const _0x3aefe6=a1_0x4eb2;return _0x29748a[_0x3aefe6(0x1c1)](/[\r\n]+/g,'\x20')['trim']();}function cleanDatasetName(_0x3b72cc){const _0x5a2cc6=a1_0x4eb2;if(!_0x3b72cc['name'])return _0x3b72cc;return{..._0x3b72cc,'name':cleanNewlines(_0x3b72cc[_0x5a2cc6(0x1c0)])};}export async function fetchModelList(_0x4ecc26,_0x44686b){const _0x42bcd8=a1_0x4eb2,_0x122b25=getEnv(),_0x44f4bc=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x4ecc26+_0x42bcd8(0x1ce);logger['info']('fetch-model-list',_0x42bcd8(0x1cb)+_0x122b25+')',{'apiUrl':_0x44f4bc});const _0x3dd300=await platformFetch(_0x44f4bc,{'cookie':_0x44686b,'label':'Fetch\x20datasets'}),_0x3a55da=(_0x3dd300[_0x42bcd8(0x1c9)]??[])['map'](cleanDatasetName);return{'configArray':_0x3a55da,'count':_0x3a55da[_0x42bcd8(0x1cd)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5480a6,_0x4e7c60){const _0xc8f5c8=a2_0x1a04,_0xccba5=_0x5480a6();while(!![]){try{const _0x16765e=-parseInt(_0xc8f5c8(0x97))/0x1*(-parseInt(_0xc8f5c8(0xa9))/0x2)+parseInt(_0xc8f5c8(0x8c))/0x3+-parseInt(_0xc8f5c8(0x8a))/0x4*(-parseInt(_0xc8f5c8(0x9c))/0x5)+-parseInt(_0xc8f5c8(0x8d))/0x6+parseInt(_0xc8f5c8(0x8f))/0x7+parseInt(_0xc8f5c8(0xa1))/0x8+-parseInt(_0xc8f5c8(0x9d))/0x9;if(_0x16765e===_0x4e7c60)break;else _0xccba5['push'](_0xccba5['shift']());}catch(_0x18943d){_0xccba5['push'](_0xccba5['shift']());}}}(a2_0x3c44,0xbb487));import a2_0x456a92 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a2_0x1a04(_0x240780,_0x59ba0f){_0x240780=_0x240780-0x86;const _0x3c441d=a2_0x3c44();let _0x1a0489=_0x3c441d[_0x240780];return _0x1a0489;}import a2_0xb58535 from'node:path';import{fileURLToPath}from'node:url';import{TemplateReplacer}from'../utils/template-replacer.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{logger}from'../utils/logger.js';import{isProduction}from'../constant/env.js';function a2_0x3c44(){const _0x18c69b=['test','resolve','forEach','key','414055JIFfGH','2074293feRYiV','typescript','Please\x20configure\x20app\x20code\x20first\x20via\x20`','-api','3566648KGQvMO','api','\x20config\x20set\x20app\x20<value>`','join','.ts','replace','API\x20文件生成成功!','tableName','2AFIfeU','{\x20apiConfigName:\x20\x22','templates/generate-api',',\x20env:\x20\x22','dirname','name','init-api','client.ts.tpl','../..','-client','8FViAfI','utf8','1987803kdzleA','8652018tfVlHX','client','273546dhJDOd','\x22\x20}','CONFIG_NAMES.DEFAULT','format','success','replaceApiContent','api.ts.tpl','alias','1126459GZttXY'];a2_0x3c44=function(){return _0x18c69b;};return a2_0x3c44();}export async function generateApiFile(_0x21014f,_0xdfe13b,_0x320558,_0x15d193,_0x335f1a,_0x3efcdf,_0x140e55){const _0x75863e=a2_0x1a04;if(!_0x320558)throw new Error(_0x75863e(0x9f)+CLI_BIN_NAME+_0x75863e(0xa3));const _0x47c235=_0x15d193&&!_0x140e55,_0xd1254c=_0x140e55||_0x320558,_0x4c579f=_0x47c235?_0x75863e(0x91):'\x22'+_0xd1254c+'\x22',_0x3e2f72=!isProduction(_0x335f1a);let _0x49e190;if(_0x47c235)_0x3e2f72?_0x49e190='{\x20apiConfigName:\x20'+_0x4c579f+_0x75863e(0xac)+_0x335f1a+_0x75863e(0x90):_0x49e190='';else{const _0x306477=_0x3e2f72?_0x75863e(0xac)+_0x335f1a+'\x22':'';_0x49e190=_0x75863e(0xaa)+_0xd1254c+'\x22'+_0x306477+'\x20}';}const _0x1ca58f=_0xdfe13b?_0xdfe13b+_0x75863e(0xa0):_0x75863e(0xa2),_0x5836b1=_0xdfe13b?_0xdfe13b+_0x75863e(0x89):_0x75863e(0x8e),_0x1c4258=_0xdfe13b&&!/^app-[a-f0-9]+$/i[_0x75863e(0x98)](_0xdfe13b)?_0xdfe13b[_0x75863e(0xa6)](/-/g,'_')['toUpperCase']():'LOVRABET',_0x3b5a9c=[];_0x21014f[_0x75863e(0x9a)](_0x5982b8=>{const _0x5e27ce=_0x75863e;_0x3b5a9c['push']({'datasetCode':_0x5982b8['datasetCode'],'tableName':_0x5982b8[_0x5e27ce(0xa8)],'name':_0x5982b8[_0x5e27ce(0xae)]||'','alias':_0x5982b8[_0x5e27ce(0x96)]||_0x5982b8[_0x5e27ce(0x9b)]});});const _0xc382fc=fileURLToPath(import.meta.url),_0x5c45c9=a2_0xb58535[_0x75863e(0x99)](a2_0xb58535[_0x75863e(0xad)](_0xc382fc),_0x75863e(0x88)),_0x4246df=a2_0xb58535[_0x75863e(0xa4)](_0x5c45c9,_0x75863e(0xab)),_0x2a64b0=a2_0xb58535[_0x75863e(0xa4)](_0x4246df,_0x75863e(0x95)),_0x3a4798=a2_0xb58535['join'](_0x4246df,_0x75863e(0x87)),_0x5d0fae=_0x3efcdf;mkdirSync(_0x5d0fae,{'recursive':!![]});const _0x34ee73=_0x3b5a9c[0x0]?.[_0x75863e(0x96)],_0xabc93f=readFileSync(_0x2a64b0,'utf8'),_0x1b2409=TemplateReplacer[_0x75863e(0x94)](_0xabc93f,_0x320558,_0x3b5a9c,_0x34ee73,_0x1ca58f,_0x4c579f,undefined,_0x1c4258),_0x2ff196=await a2_0x456a92['format'](_0x1b2409,{'parser':'typescript'}),_0x47926b=a2_0xb58535['join'](_0x5d0fae,_0x1ca58f+'.ts');writeFileSync(_0x47926b,_0x2ff196,{'encoding':_0x75863e(0x8b)});const _0x40f6dc=readFileSync(_0x3a4798,'utf8'),_0x59b4e7=TemplateReplacer['replaceApiContent'](_0x40f6dc,_0x320558,_0x3b5a9c,_0x34ee73,_0x1ca58f,_0x4c579f,_0x49e190,_0x1c4258),_0x3dcc87=await a2_0x456a92[_0x75863e(0x92)](_0x59b4e7,{'parser':_0x75863e(0x9e)}),_0x228b47=a2_0xb58535[_0x75863e(0xa4)](_0x5d0fae,_0x5836b1+_0x75863e(0xa5));writeFileSync(_0x228b47,_0x3dcc87,{'encoding':_0x75863e(0x8b)});const _0x3710bb=_0x3b5a9c['length'];return logger[_0x75863e(0x93)](_0x75863e(0x86),_0x75863e(0xa7),undefined,{'apiFile':_0x47926b,'clientFile':_0x228b47,'modelCount':_0x3710bb,'configName':_0x4c579f}),{'modelCount':_0x3710bb,'apiFilePath':_0x47926b,'clientFilePath':_0x228b47,'configName':_0x4c579f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a3_0x3f48(){const _0xa00c60=['No\x20valid\x20session.\x20Login\x20now?','8wYDuHd','209dbttJH','Browser\x20login\x20cannot\x20run\x20in\x20non-interactive\x20mode.','log','12564ABVRzr','autoYes','3298722OvzANE','Starting\x20browser\x20login.\x20Share\x20the\x20printed\x20URL\x20with\x20the\x20user.','\x20auth\x20login\x20--yes`\x20and\x20open\x20the\x20printed\x20URL\x20in\x20your\x20browser.','30612CpfIQT','707688YGjodL','685rUUQAn','√\x20Valid\x20session\x20detected,\x20no\x20login\x20required.','6699600vThdlr','1073406AdMzyk','7kYnJJb','36MVvWYl','!\x20Login\x20failed.','nonInteractive','Logging\x20in...\x20Please\x20complete\x20login\x20in\x20your\x20browser.','2244mJQzRo'];a3_0x3f48=function(){return _0xa00c60;};return a3_0x3f48();}(function(_0x384867,_0x2bfd31){const _0x33c43e=a3_0x402d,_0x484c37=_0x384867();while(!![]){try{const _0x4e4f75=-parseInt(_0x33c43e(0x1e4))/0x1*(-parseInt(_0x33c43e(0x1db))/0x2)+-parseInt(_0x33c43e(0x1d3))/0x3+-parseInt(_0x33c43e(0x1d9))/0x4*(-parseInt(_0x33c43e(0x1e6))/0x5)+parseInt(_0x33c43e(0x1e1))/0x6*(-parseInt(_0x33c43e(0x1d4))/0x7)+parseInt(_0x33c43e(0x1e5))/0x8*(parseInt(_0x33c43e(0x1d5))/0x9)+parseInt(_0x33c43e(0x1d2))/0xa+parseInt(_0x33c43e(0x1dc))/0xb*(parseInt(_0x33c43e(0x1df))/0xc);if(_0x4e4f75===_0x2bfd31)break;else _0x484c37['push'](_0x484c37['shift']());}catch(_0x3326cf){_0x484c37['push'](_0x484c37['shift']());}}}(a3_0x3f48,0x51e35));import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a3_0x402d(_0x46b4ab,_0x16a70e){_0x46b4ab=_0x46b4ab-0x1d1;const _0x3f487e=a3_0x3f48();let _0x402dda=_0x3f487e[_0x46b4ab];return _0x402dda;}import{CliErrors}from'../errors.js';import{confirm}from'@inquirer/prompts';import a3_0x8aeb3e from'ora';export async function runAuthServer(_0x353236){const _0x500e2e=a3_0x402d,_0x1ac1c4=await getIsSessionValid();if(_0x1ac1c4){console[_0x500e2e(0x1de)](_0x500e2e(0x1d1));return;}if(_0x353236?.[_0x500e2e(0x1d7)]&&!_0x353236['autoYes'])throw CliErrors['validation'](_0x500e2e(0x1dd),'Run\x20`'+CLI_BIN_NAME+_0x500e2e(0x1e3));const _0x16a42a=_0x353236?.[_0x500e2e(0x1e0)]?!![]:await confirm({'message':_0x500e2e(0x1da),'default':!![]});if(!_0x16a42a)return;if(_0x353236?.['nonInteractive']){console[_0x500e2e(0x1de)](_0x500e2e(0x1e2));const _0x245e29=await authServer({'silent':![],'openBrowser':![]});_0x245e29?console['log']('*\x20Login\x20successful!'):console[_0x500e2e(0x1de)](_0x500e2e(0x1d6));return;}const _0xff8b58=a3_0x8aeb3e(_0x500e2e(0x1d8))['start'](),_0x4671c7=await authServer({'silent':!![],'openBrowser':!![]});_0xff8b58['stop'](),_0x4671c7?console[_0x500e2e(0x1de)]('*\x20Login\x20successful!'):console[_0x500e2e(0x1de)](_0x500e2e(0x1d6));}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a4_0x2d8cff=a4_0x1441;(function(_0x7411fa,_0x19cbd0){const _0xefa657=a4_0x1441,_0xcbdc33=_0x7411fa();while(!![]){try{const _0x1eac6f=-parseInt(_0xefa657(0x9a))/0x1+-parseInt(_0xefa657(0x9c))/0x2*(-parseInt(_0xefa657(0xa2))/0x3)+parseInt(_0xefa657(0x9f))/0x4+-parseInt(_0xefa657(0x94))/0x5*(parseInt(_0xefa657(0xa5))/0x6)+parseInt(_0xefa657(0xa1))/0x7*(-parseInt(_0xefa657(0xa9))/0x8)+-parseInt(_0xefa657(0x88))/0x9+-parseInt(_0xefa657(0xac))/0xa*(-parseInt(_0xefa657(0xaf))/0xb);if(_0x1eac6f===_0x19cbd0)break;else _0xcbdc33['push'](_0xcbdc33['shift']());}catch(_0x4fc3c7){_0xcbdc33['push'](_0xcbdc33['shift']());}}}(a4_0x4939,0xc77fb));import{writeFileSync}from'node:fs';import a4_0x214244 from'node:https';function a4_0x1441(_0x20e9f9,_0x5e54c2){_0x20e9f9=_0x20e9f9-0x88;const _0x493988=a4_0x4939();let _0x14415e=_0x493988[_0x20e9f9];return _0x14415e;}import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'../auth/is-session-valid.js';import{cookieFile}from'../auth/constant.js';import{buildLoginSuccessHtml}from'../auth/login-success-html.js';function a4_0x4939(){const _0x479e64=['17067770vyabOH','text/html;\x20charset=utf-8','catch','11SbyKEK','session','1586088jcuUqY','headers','🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:','https://dev.lovrabet.com:','end','createServer','user','utf-8','open\x20\x22','error','log','/api/auth/get-session','60710cBWDWY','cmd\x20/c\x20start\x20\x22\x22\x20\x22','listen','close','object','cookie','41828jXHYDJ','127.0.0.1','123698lnpquZ','⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically','silent','3433984zsQOzg','🌐\x20Attempting\x20to\x20open\x20browser\x20automatically...','637LUOIRH','3uVNMlD','https://g.yuntooai.com/cert/lovrabet-dev.json','darwin','204LeIere','writeHead','✅\x20Browser\x20opened.\x20Please\x20complete\x20login\x20in\x20the\x20browser.','then','103656xLJdqr','json','💡\x20If\x20the\x20browser\x20does\x20not\x20open\x20automatically,\x20copy\x20the\x20login\x20URL\x20above\x20into\x20your\x20browser.'];a4_0x4939=function(){return _0x479e64;};return a4_0x4939();}export const AUTH_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;export async function authServer(_0x15737b){const _0xf44695=a4_0x1441,_0x648176=_0x15737b?.[_0xf44695(0x9e)]||![],_0x5a2138=_0x15737b?.['openBrowser']??!![],_0x3308d7=_0x15737b?.['timeoutMs']??AUTH_LOGIN_TIMEOUT_MS;if(await getIsSessionValid())return!![];const _0x2c9463=await(await fetch(_0xf44695(0xa3)))[_0xf44695(0xaa)]();return new Promise(async(_0x3f37fe,_0x209ff3)=>{const _0x632761=_0xf44695;let _0x1b95b1=0x0,_0x4ffcbe=![],_0xae7ed6;const _0x117bbf=a4_0x214244[_0x632761(0x8d)](_0x2c9463,async(_0x127b5d,_0x5d35a5)=>{const _0x581765=_0x632761,_0xa969c0=getUserDomain(),_0xd1e481=_0x127b5d[_0x581765(0x89)][_0x581765(0x99)]||'',_0x2e4232=await fetch(_0xa969c0+_0x581765(0x93),{'headers':{'cookie':_0xd1e481}})[_0x581765(0xa8)](_0x1f795d=>_0x1f795d[_0x581765(0xaa)]()),_0x3139ba=_0x2e4232&&_0x2e4232[_0x581765(0xb0)]&&_0x2e4232[_0x581765(0x8e)];if(_0x3139ba){writeFileSync(cookieFile,_0xd1e481,_0x581765(0x8f));const _0x2a6621=buildLoginSuccessHtml();_0x5d35a5[_0x581765(0xa6)](0xc8,{'Content-Type':_0x581765(0xad)}),_0x5d35a5[_0x581765(0x8c)](_0x2a6621),_0x56198f(!![]);}else{const _0x39fc06=''+encodeURIComponent(_0x581765(0x8b)+_0x1b95b1);_0x5d35a5[_0x581765(0xa6)](0x12e,{'location':_0xa969c0+'/sign-in?redirect='+_0x39fc06}),_0x5d35a5[_0x581765(0x8c)]();return;}});function _0x56198f(_0xb9878e){const _0x19244f=_0x632761;if(_0x4ffcbe)return;_0x4ffcbe=!![],_0xae7ed6&&clearTimeout(_0xae7ed6),_0x117bbf[_0x19244f(0x97)](),_0x3f37fe(_0xb9878e);}_0x117bbf[_0x632761(0x96)](0x0,_0x632761(0x9b),()=>{const _0xa33313=_0x632761,_0x4ea9dd=_0x117bbf['address']();_0x1b95b1=typeof _0x4ea9dd===_0xa33313(0x98)&&_0x4ea9dd?_0x4ea9dd['port']:Number(_0x4ea9dd);const _0x5cb3f5=_0xa33313(0x8b)+_0x1b95b1;_0xae7ed6=setTimeout(()=>{const _0x3f7998=_0xa33313;!_0x648176&&console[_0x3f7998(0x92)]('!\x20Login\x20URL\x20expired\x20after\x2010\x20minutes.\x20Run\x20the\x20login\x20command\x20again\x20to\x20get\x20a\x20new\x20URL.'),_0x56198f(![]);},_0x3308d7);!_0x648176&&(console[_0xa33313(0x92)]('🔐\x20Starting\x20login\x20service...'),console[_0xa33313(0x92)]('📍\x20Login\x20URL:',_0x5cb3f5),_0x5a2138?(console[_0xa33313(0x92)](_0xa33313(0xa0)),console[_0xa33313(0x92)](''),console['log'](_0xa33313(0xab))):console[_0xa33313(0x92)]('💡\x20Open\x20the\x20login\x20URL\x20above\x20in\x20your\x20browser\x20to\x20complete\x20authorization.'),console[_0xa33313(0x92)](''));if(!_0x5a2138)return;openInBrowser(_0x5cb3f5)[_0xa33313(0xa8)](_0x5e702c=>{const _0x31be3f=_0xa33313;!_0x648176&&(_0x5e702c?console['log'](_0x31be3f(0xa7)):(console[_0x31be3f(0x92)](_0x31be3f(0x9d)),console[_0x31be3f(0x92)](_0x31be3f(0x8a),_0x5cb3f5)),console[_0x31be3f(0x92)](''));})[_0xa33313(0xae)](()=>{const _0x4cd66f=_0xa33313;!_0x648176&&(console[_0x4cd66f(0x92)](_0x4cd66f(0x9d)),console[_0x4cd66f(0x92)](_0x4cd66f(0x8a),_0x5cb3f5),console[_0x4cd66f(0x92)](''));});}),_0x117bbf['on'](_0x632761(0x91),_0x40c6bf=>{const _0xaccd3e=_0x632761;if(_0x4ffcbe)return;_0x4ffcbe=!![],_0xae7ed6&&clearTimeout(_0xae7ed6),!_0x648176&&console[_0xaccd3e(0x91)]('Auth\x20server\x20error:',_0x40c6bf),_0x117bbf[_0xaccd3e(0x97)](),_0x209ff3(_0x40c6bf);});});}function openInBrowser(_0x203206){return new Promise(_0x43fb69=>{const _0x298535=a4_0x1441,_0x4e19a8=process['platform'];let _0x21ad31;if(_0x4e19a8==='win32')_0x21ad31=_0x298535(0x95)+_0x203206+'\x22';else _0x4e19a8===_0x298535(0xa4)?_0x21ad31=_0x298535(0x90)+_0x203206+'\x22':_0x21ad31='xdg-open\x20\x22'+_0x203206+'\x22';exec(_0x21ad31,_0x5da7c8=>{_0x5da7c8?_0x43fb69(![]):_0x43fb69(!![]);});});}if(import.meta.main){const isAuth=await authServer();console[a4_0x2d8cff(0x92)]('isAuth',isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a5_0x180493=a5_0x2f65;(function(_0x364a0c,_0x5d3b93){const _0xe064f4=a5_0x2f65,_0x23b80b=_0x364a0c();while(!![]){try{const _0x1330b4=-parseInt(_0xe064f4(0x18c))/0x1*(-parseInt(_0xe064f4(0x191))/0x2)+-parseInt(_0xe064f4(0x18f))/0x3+parseInt(_0xe064f4(0x190))/0x4*(parseInt(_0xe064f4(0x18d))/0x5)+parseInt(_0xe064f4(0x192))/0x6*(parseInt(_0xe064f4(0x188))/0x7)+parseInt(_0xe064f4(0x187))/0x8*(parseInt(_0xe064f4(0x18e))/0x9)+parseInt(_0xe064f4(0x189))/0xa*(-parseInt(_0xe064f4(0x18b))/0xb)+-parseInt(_0xe064f4(0x18a))/0xc;if(_0x1330b4===_0x5d3b93)break;else _0x23b80b['push'](_0x23b80b['shift']());}catch(_0x169ab6){_0x23b80b['push'](_0x23b80b['shift']());}}}(a5_0x59ac,0xdce2d));function a5_0x2f65(_0x5a1c2d,_0x15d02d){_0x5a1c2d=_0x5a1c2d-0x186;const _0x59acdc=a5_0x59ac();let _0x2f6529=_0x59acdc[_0x5a1c2d];return _0x2f6529;}import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';function a5_0x59ac(){const _0x24dbc2=['378665Wlytjb','5MjeDDO','36027mArkAA','3582768qimXHc','6235244wtZqOM','6kAeLEi','498fSHcRg','.lovrabet','1432emUfKe','122003aZmnwR','10ljExln','27937080rHSrFG','4739405jeDQIu'];a5_0x59ac=function(){return _0x24dbc2;};return a5_0x59ac();}export const configDir=join(homedir(),a5_0x180493(0x186));export const cookieFile=join(configDir,'cookie');mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x788e24,_0x53b4c9){var _0x500562=a6_0x4408,_0x360cc7=_0x788e24();while(!![]){try{var _0x38719d=-parseInt(_0x500562(0xed))/0x1*(-parseInt(_0x500562(0xee))/0x2)+parseInt(_0x500562(0xef))/0x3+-parseInt(_0x500562(0xf3))/0x4+parseInt(_0x500562(0xec))/0x5+parseInt(_0x500562(0xf2))/0x6+-parseInt(_0x500562(0xf1))/0x7+parseInt(_0x500562(0xf4))/0x8;if(_0x38719d===_0x53b4c9)break;else _0x360cc7['push'](_0x360cc7['shift']());}catch(_0xee63a5){_0x360cc7['push'](_0x360cc7['shift']());}}}(a6_0x26ed,0x26865));import{readFileSync}from'node:fs';import{cookieFile}from'../auth/constant.js';function a6_0x26ed(){var _0x127a2a=['2143393hveofb','802758MvyCSa','1124372KQiUZI','1511264vYytSz','1244620WuRYYH','21736VwrAjZ','2QgUAtT','455184jDdkDq','utf-8'];a6_0x26ed=function(){return _0x127a2a;};return a6_0x26ed();}function a6_0x4408(_0x207d21,_0x58a5b0){_0x207d21=_0x207d21-0xec;var _0x26ed67=a6_0x26ed();var _0x440845=_0x26ed67[_0x207d21];return _0x440845;}export function getCookie(){var _0x5ed7c3=a6_0x4408;try{return readFileSync(cookieFile,_0x5ed7c3(0xf0));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35a806,_0x2926f6){const _0x808e3e=a7_0x40a3,_0x12761d=_0x35a806();while(!![]){try{const _0x325c1c=-parseInt(_0x808e3e(0x80))/0x1*(parseInt(_0x808e3e(0x83))/0x2)+parseInt(_0x808e3e(0x75))/0x3*(-parseInt(_0x808e3e(0x7b))/0x4)+-parseInt(_0x808e3e(0x7f))/0x5*(parseInt(_0x808e3e(0x77))/0x6)+-parseInt(_0x808e3e(0x7d))/0x7+parseInt(_0x808e3e(0x74))/0x8*(-parseInt(_0x808e3e(0x81))/0x9)+-parseInt(_0x808e3e(0x76))/0xa*(parseInt(_0x808e3e(0x7e))/0xb)+-parseInt(_0x808e3e(0x78))/0xc*(-parseInt(_0x808e3e(0x79))/0xd);if(_0x325c1c===_0x2926f6)break;else _0x12761d['push'](_0x12761d['shift']());}catch(_0x5b316a){_0x12761d['push'](_0x12761d['shift']());}}}(a7_0x316b,0xbb9ea));import{existsSync,readFileSync}from'node:fs';function a7_0x316b(){const _0x584bf1=['15678NOLkYH','utf-8','122078OWayKj','session','200nGBkBK','261861FwGcqR','130pwoxlp','2106474aGtNxH','48ywiQaP','15750319jzlePb','user','24YFFLNT','/api/auth/get-session','7026705hUGdxr','636053CZieKZ','5hqVsiB','23iRZFTC'];a7_0x316b=function(){return _0x584bf1;};return a7_0x316b();}function a7_0x40a3(_0x2edfd1,_0x49ae89){_0x2edfd1=_0x2edfd1-0x74;const _0x316b3a=a7_0x316b();let _0x40a382=_0x316b3a[_0x2edfd1];return _0x40a382;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';export async function getSessionUserInfo(){const _0x409453=a7_0x40a3;try{if(!existsSync(cookieFile))return null;const _0x1591b2=readFileSync(cookieFile,_0x409453(0x82)),_0x21db87=await fetch(getUserDomain()+_0x409453(0x7c),{'headers':{'cookie':_0x1591b2}});if(!_0x21db87['ok'])return null;const _0xbffbcf=await _0x21db87['json']();if(!_0xbffbcf[_0x409453(0x84)]||!_0xbffbcf[_0x409453(0x7a)])return null;return _0xbffbcf;}catch{return null;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x531714,_0x302c5d){const _0x4a12af=a8_0x5248,_0x105f8f=_0x531714();while(!![]){try{const _0x225fe9=-parseInt(_0x4a12af(0x12a))/0x1*(parseInt(_0x4a12af(0x123))/0x2)+parseInt(_0x4a12af(0x122))/0x3*(parseInt(_0x4a12af(0x120))/0x4)+-parseInt(_0x4a12af(0x12c))/0x5*(-parseInt(_0x4a12af(0x126))/0x6)+-parseInt(_0x4a12af(0x124))/0x7+parseInt(_0x4a12af(0x11f))/0x8+parseInt(_0x4a12af(0x128))/0x9+-parseInt(_0x4a12af(0x12d))/0xa*(parseInt(_0x4a12af(0x127))/0xb);if(_0x225fe9===_0x302c5d)break;else _0x105f8f['push'](_0x105f8f['shift']());}catch(_0x142142){_0x105f8f['push'](_0x105f8f['shift']());}}}(a8_0x4f62,0x600fc));import{existsSync,readFileSync}from'node:fs';function a8_0x5248(_0x2290ab,_0xd20745){_0x2290ab=_0x2290ab-0x11f;const _0x4f62ec=a8_0x4f62();let _0x524855=_0x4f62ec[_0x2290ab];return _0x524855;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';export async function getIsSessionValid(){const _0x9253fe=a8_0x5248;try{if(!existsSync(cookieFile))return![];const _0x34d2d7=readFileSync(cookieFile,'utf-8'),_0x3934c9=await fetch(getUserDomain()+_0x9253fe(0x12b),{'headers':{'cookie':_0x34d2d7}})[_0x9253fe(0x121)](_0x115423=>_0x115423[_0x9253fe(0x129)]());return _0x3934c9&&_0x3934c9[_0x9253fe(0x125)]&&_0x3934c9[_0x9253fe(0x12e)];}catch{}return![];}function a8_0x4f62(){const _0x2fdeb1=['2968791jCNNrC','session','732ANlwZG','393833NuivAq','6575904wnwgwE','json','20428ClqaJA','/api/auth/get-session','27755EGxlgs','220nXubYs','user','3885064lupRSS','8QYvvOZ','then','364296TqcANU','52jgpCju'];a8_0x4f62=function(){return _0x2fdeb1;};return a8_0x4f62();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a9_0x60dc(_0x417c7d,_0x2c8d1e){_0x417c7d=_0x417c7d-0xb1;const _0x4f65f6=a9_0x4f65();let _0x60dc71=_0x4f65f6[_0x417c7d];return _0x60dc71;}(function(_0x352e39,_0x124a52){const _0x2761e8=a9_0x60dc,_0x1656f2=_0x352e39();while(!![]){try{const _0x2002cf=-parseInt(_0x2761e8(0xbb))/0x1+parseInt(_0x2761e8(0xb3))/0x2+parseInt(_0x2761e8(0xb5))/0x3*(parseInt(_0x2761e8(0xb2))/0x4)+parseInt(_0x2761e8(0xba))/0x5+-parseInt(_0x2761e8(0xb6))/0x6*(parseInt(_0x2761e8(0xb1))/0x7)+parseInt(_0x2761e8(0xb4))/0x8*(parseInt(_0x2761e8(0xb7))/0x9)+parseInt(_0x2761e8(0xb9))/0xa*(-parseInt(_0x2761e8(0xbc))/0xb);if(_0x2002cf===_0x124a52)break;else _0x1656f2['push'](_0x1656f2['shift']());}catch(_0x416032){_0x1656f2['push'](_0x1656f2['shift']());}}}(a9_0x4f65,0x40308));export function buildLoginSuccessHtml(){const _0x2dfad2=a9_0x60dc,_0x2f052a=_0x2dfad2(0xbd);return'<!doctype\x20html>\x0a<html\x20lang=\x22en\x22>\x0a<head>\x0a\x20\x20<meta\x20charset=\x22utf-8\x22>\x0a\x20\x20<meta\x20name=\x22viewport\x22\x20content=\x22width=device-width,\x20initial-scale=1\x22>\x0a\x20\x20<title>Login\x20successful\x20·\x20Rabetbase\x20CLI</title>\x0a\x20\x20<style>\x0a\x20\x20\x20\x20:root\x20{\x0a\x20\x20\x20\x20\x20\x20--bg0:\x20#0f1419;\x0a\x20\x20\x20\x20\x20\x20--bg1:\x20#1a2332;\x0a\x20\x20\x20\x20\x20\x20--card:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20--text:\x20#1c2128;\x0a\x20\x20\x20\x20\x20\x20--muted:\x20#5c6570;\x0a\x20\x20\x20\x20\x20\x20--accent:\x20#2563eb;\x0a\x20\x20\x20\x20\x20\x20--accent-soft:\x20#eff6ff;\x0a\x20\x20\x20\x20\x20\x20--success:\x20#059669;\x0a\x20\x20\x20\x20\x20\x20--radius:\x2016px;\x0a\x20\x20\x20\x20\x20\x20--shadow:\x200\x2025px\x2050px\x20-12px\x20rgba(15,\x2020,\x2025,\x200.35);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20*\x20{\x20box-sizing:\x20border-box;\x20}\x0a\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20min-height:\x20100vh;\x0a\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20padding:\x2024px;\x0a\x20\x20\x20\x20\x20\x20font-family:\x20ui-sans-serif,\x20system-ui,\x20-apple-system,\x20\x22Segoe\x20UI\x22,\x20Roboto,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x22Helvetica\x20Neue\x22,\x20Arial,\x20\x22Noto\x20Sans\x22,\x20\x22PingFang\x20SC\x22,\x20\x22Microsoft\x20YaHei\x22,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20background:\x20linear-gradient(160deg,\x20var(--bg0)\x200%,\x20var(--bg1)\x2045%,\x20#243047\x20100%);\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--text);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.card\x20{\x0a\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20max-width:\x20420px;\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--card);\x0a\x20\x20\x20\x20\x20\x20border-radius:\x20var(--radius);\x0a\x20\x20\x20\x20\x20\x20box-shadow:\x20var(--shadow);\x0a\x20\x20\x20\x20\x20\x20padding:\x2040px\x2036px\x2032px;\x0a\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.icon\x20{\x0a\x20\x20\x20\x20\x20\x20width:\x2064px;\x0a\x20\x20\x20\x20\x20\x20height:\x2064px;\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x20auto\x2020px;\x0a\x20\x20\x20\x20\x20\x20border-radius:\x2050%;\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--accent-soft);\x0a\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.icon\x20svg\x20{\x20width:\x2036px;\x20height:\x2036px;\x20}\x0a\x20\x20\x20\x20h1\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x200\x2012px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x201.375rem;\x0a\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20letter-spacing:\x20-0.02em;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20p.lead\x20{\x0a\x20\x20\x20\x20\x20\x20margin:\x200\x200\x208px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.9375rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--muted);\x0a\x20\x20\x20\x20\x20\x20line-height:\x201.55;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.countdown\x20{\x0a\x20\x20\x20\x20\x20\x20display:\x20inline-flex;\x0a\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20gap:\x206px;\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2016px;\x0a\x20\x20\x20\x20\x20\x20padding:\x208px\x2014px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.875rem;\x0a\x20\x20\x20\x20\x20\x20font-variant-numeric:\x20tabular-nums;\x0a\x20\x20\x20\x20\x20\x20color:\x20var(--accent);\x0a\x20\x20\x20\x20\x20\x20background:\x20var(--accent-soft);\x0a\x20\x20\x20\x20\x20\x20border-radius:\x20999px;\x0a\x20\x20\x20\x20\x20\x20font-weight:\x20500;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20#manualMsg\x20{\x0a\x20\x20\x20\x20\x20\x20display:\x20none;\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.8125rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20#b91c1c;\x0a\x20\x20\x20\x20\x20\x20line-height:\x201.45;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.cli-hint\x20{\x0a\x20\x20\x20\x20\x20\x20margin-top:\x2028px;\x0a\x20\x20\x20\x20\x20\x20padding-top:\x2024px;\x0a\x20\x20\x20\x20\x20\x20border-top:\x201px\x20solid\x20#e8ecf0;\x0a\x20\x20\x20\x20\x20\x20font-size:\x200.75rem;\x0a\x20\x20\x20\x20\x20\x20color:\x20#8b949e;\x0a\x20\x20\x20\x20}\x0a\x20\x20</style>\x0a</head>\x0a<body>\x0a\x20\x20<div\x20class=\x22card\x22\x20role=\x22status\x22\x20aria-live=\x22polite\x22>\x0a\x20\x20\x20\x20<div\x20class=\x22icon\x22\x20aria-hidden=\x22true\x22>\x0a\x20\x20\x20\x20\x20\x20<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20stroke=\x22#059669\x22\x20stroke-width=\x222\x22\x20fill=\x22none\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M8\x2012.5l2.5\x202.5L16\x209\x22\x20stroke=\x22#059669\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20<h1>Login\x20successful</h1>\x0a\x20\x20\x20\x20<p\x20class=\x22lead\x22>You\x20can\x20return\x20to\x20the\x20terminal\x20to\x20continue.\x20This\x20window\x20will\x20try\x20to\x20close\x20automatically.</p>\x0a\x20\x20\x20\x20<div\x20class=\x22countdown\x22>\x0a\x20\x20\x20\x20\x20\x20Closing\x20in\x20<span\x20id=\x22t\x22>5</span>s\x0a\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20<div\x20id=\x22manualMsg\x22>'+_0x2f052a+_0x2dfad2(0xb8);}function a9_0x4f65(){const _0x2a0c79=['Unable\x20to\x20close\x20automatically.\x20Please\x20close\x20this\x20tab\x20or\x20window\x20manually.','119BEUTIU','5592ESuDff','922554JKYXBi','3752AVNhOe','681vZYTwD','139632VnmjTL','189iqFiNq','</div>\x0a\x20\x20\x20\x20<p\x20class=\x22cli-hint\x22>Rabetbase\x20CLI\x20·\x20session\x20saved\x20locally</p>\x0a\x20\x20</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','1691370exKZiS','718740nLgeBi','104539yjmtaQ','11tBYYPj'];a9_0x4f65=function(){return _0x2a0c79;};return a9_0x4f65();}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7d0a99,_0x1fa5d9){var _0x299e0f=a10_0x41ba,_0x5742c2=_0x7d0a99();while(!![]){try{var _0x43fea7=parseInt(_0x299e0f(0x104))/0x1+-parseInt(_0x299e0f(0x10a))/0x2+-parseInt(_0x299e0f(0x107))/0x3*(-parseInt(_0x299e0f(0x108))/0x4)+-parseInt(_0x299e0f(0x102))/0x5+-parseInt(_0x299e0f(0x109))/0x6+parseInt(_0x299e0f(0x105))/0x7*(parseInt(_0x299e0f(0x106))/0x8)+-parseInt(_0x299e0f(0x10b))/0x9*(-parseInt(_0x299e0f(0x103))/0xa);if(_0x43fea7===_0x1fa5d9)break;else _0x5742c2['push'](_0x5742c2['shift']());}catch(_0x31c517){_0x5742c2['push'](_0x5742c2['shift']());}}}(a10_0x22ba,0xecdc3));function a10_0x41ba(_0x1e4a58,_0x2c116a){_0x1e4a58=_0x1e4a58-0x102;var _0x22bac0=a10_0x22ba();var _0x41bad0=_0x22bac0[_0x1e4a58];return _0x41bad0;}import{unlinkSync,existsSync}from'node:fs';function a10_0x22ba(){var _0x3cab8b=['1585451BvqAaD','44877sBkYPQ','2152VtKvHl','279579DvsrpK','4VkKcnG','10356114syxHSL','2886560efZMIZ','81rCVyrE','!\x20Not\x20logged\x20in','log','2377875mrApJY','1346500UFeHYh'];a10_0x22ba=function(){return _0x3cab8b;};return a10_0x22ba();}import{cookieFile}from'../auth/constant.js';export function logout(){var _0x5ee677=a10_0x41ba;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5ee677(0x10d)]('✓\x20Logged\x20out')):console['log'](_0x5ee677(0x10c));}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a11_0x446aae=a11_0xae60;function a11_0xae60(_0x464e5b,_0xca7523){_0x464e5b=_0x464e5b-0x95;const _0x5a5a85=a11_0x5a5a();let _0xae60c8=_0x5a5a85[_0x464e5b];return _0xae60c8;}function a11_0x5a5a(){const _0x3c6b80=['1922EhzRxy','boolean','1663CsqppM','154ZPnHwX','7362216SQXDEV','10533078BqtaKI','2177304xnSeJP','7IzlNVc','632420vidYJR','28IgMwqg','12392144JQccTZ','58005LOepmi'];a11_0x5a5a=function(){return _0x3c6b80;};return a11_0x5a5a();}(function(_0x19e28f,_0x4256fe){const _0x77367c=a11_0xae60,_0x163b52=_0x19e28f();while(!![]){try{const _0xb68feb=-parseInt(_0x77367c(0x9e))/0x1*(-parseInt(_0x77367c(0x9c))/0x2)+parseInt(_0x77367c(0x96))/0x3+-parseInt(_0x77367c(0x99))/0x4*(-parseInt(_0x77367c(0x9b))/0x5)+parseInt(_0x77367c(0x95))/0x6+-parseInt(_0x77367c(0x97))/0x7*(parseInt(_0x77367c(0x9a))/0x8)+-parseInt(_0x77367c(0xa0))/0x9+parseInt(_0x77367c(0x98))/0xa*(-parseInt(_0x77367c(0x9f))/0xb);if(_0xb68feb===_0x4256fe)break;else _0x163b52['push'](_0x163b52['shift']());}catch(_0xe9a8da){_0x163b52['push'](_0x163b52['shift']());}}}(a11_0x5a5a,0xddba9));export const dynamicCliFlags={'enableBffSave':{'type':a11_0x446aae(0x9d)}};
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a12_0x5d0419=a12_0x3230;function a12_0x23e8(){const _0x973b97=['apiDomain','exitCode','dynamicCliFlags','1154DnJNKI','log','\x20\x20Please\x20update\x20your\x20command\x20and\x20try\x20again.\x0a','⚠\x20`','runtimeDomain','service','21235zwHwtU','681TDIRsY','4XQXTqo','raw','140556mCecHR','./context.js','76713HtAFem','write','wildcardDef','320EOhPba','unknown','Error:\x20','./cli-flags.js','12821500ziwUmC','string','\x0aCancelled.\x0a','1280439aENyzP','userDomain','hint','slice','Hint:\x20','`\x20has\x20been\x20moved\x20to\x20`','name','./constant/env.js','unknown_service','code','input','now','command','Unexpected\x20error:','defaultCommand','`;\x20prefer\x20`','help','message','cancelled','global','env','error','`\x20in\x20new\x20scripts.\x0a','flags','./constant/domain.js','ExitPromptError','2709702LnrTgx'];a12_0x23e8=function(){return _0x973b97;};return a12_0x23e8();}(function(_0x1cd140,_0x44d622){const _0x349fc6=a12_0x3230,_0x4b4850=_0x1cd140();while(!![]){try{const _0x1cb696=-parseInt(_0x349fc6(0x94))/0x1*(parseInt(_0x349fc6(0x8d))/0x2)+-parseInt(_0x349fc6(0x6f))/0x3+-parseInt(_0x349fc6(0x95))/0x4*(parseInt(_0x349fc6(0x93))/0x5)+-parseInt(_0x349fc6(0x97))/0x6+parseInt(_0x349fc6(0x65))/0x7*(-parseInt(_0x349fc6(0x68))/0x8)+parseInt(_0x349fc6(0x89))/0x9+parseInt(_0x349fc6(0x6c))/0xa;if(_0x1cb696===_0x44d622)break;else _0x4b4850['push'](_0x4b4850['shift']());}catch(_0x2dea33){_0x4b4850['push'](_0x4b4850['shift']());}}}(a12_0x23e8,0x489e5));import a12_0x1b32da from'meow';import{showHelp}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{isKnownService,getServiceEntry,findDefinition,deprecatedAliases,resolveDeprecatedSubcommand}from'./commands/registry.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{CLI_BIN_NAME,buildMeowFlags}from'./constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'./generated/build-info.js';import{reportCliHelpTrace}from'./telemetry/cli-help-trace.js';import{reportCommandTrace}from'./telemetry/cli-command-trace.js';import{registerOtelShutdownOnExit,exitWithOtelShutdown}from'./telemetry/register-otel-exit-shutdown.js';import{printIssueReportNudgeForError}from'./commands/issue/nudge.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a12_0x5d0419(0x6b)))[a12_0x5d0419(0x8c)];}catch{}const helpText=generateFullHelp(),cliVersion=GIT_COMMIT!==a12_0x5d0419(0x69)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[a12_0x5d0419(0x72)](0x0,0xa)+')':VERSION,cli=a12_0x1b32da(helpText,{'importMeta':import.meta,'version':cliVersion,'flags':{...buildMeowFlags(),...dynamicCliFlags||{}}});registerOtelShutdownOnExit(),await run();async function run(){const _0x2e7d82=a12_0x5d0419;let _0x14409c=cli[_0x2e7d82(0x79)][0x0],_0x87db4=cli[_0x2e7d82(0x79)][0x1];const _0x14eb8d=cli[_0x2e7d82(0x86)];if(!_0x14409c){await reportCliHelpTrace(_0x2e7d82(0x82)),showHelp();return;}const _0x20a184=deprecatedAliases[_0x14409c];if(_0x20a184&&!isKnownService(_0x14409c)){const _0x507f7c=_0x87db4?CLI_BIN_NAME+'\x20'+_0x14409c+'\x20'+_0x87db4:CLI_BIN_NAME+'\x20'+_0x14409c,_0x2a1ffb=CLI_BIN_NAME+'\x20'+_0x20a184[_0x2e7d82(0x92)]+'\x20'+_0x20a184[_0x2e7d82(0x7b)];console[_0x2e7d82(0x84)](_0x2e7d82(0x90)+_0x507f7c+_0x2e7d82(0x74)+_0x2a1ffb+'`\x20in\x20v2.0.\x0a'+_0x2e7d82(0x8f)),await exitWithOtelShutdown(0x1);}if(!isKnownService(_0x14409c)){await reportCliHelpTrace(_0x2e7d82(0x77),{'service':_0x14409c}),showHelp();return;}const _0x457052=getServiceEntry(_0x14409c);if(_0x14eb8d['env']&&typeof _0x14eb8d['env']===_0x2e7d82(0x6d)){const {initEnv:_0xd14af6}=await import(_0x2e7d82(0x76));_0xd14af6(_0x14eb8d[_0x2e7d82(0x83)]);}const {buildConfigFromFlags:_0x8acfed}=await import(_0x2e7d82(0x98)),_0x3d051e=_0x8acfed(_0x14eb8d);if(!_0x14eb8d['env']&&_0x3d051e['env']){const {initEnv:_0x26bf1b}=await import(_0x2e7d82(0x76));_0x26bf1b(_0x3d051e[_0x2e7d82(0x83)]);}if(_0x3d051e[_0x2e7d82(0x96)]?.[_0x2e7d82(0x8a)]||_0x3d051e[_0x2e7d82(0x96)]?.[_0x2e7d82(0x70)]||_0x3d051e[_0x2e7d82(0x96)]?.[_0x2e7d82(0x91)]){const {initDomains:_0x5286cc}=await import(_0x2e7d82(0x87));_0x5286cc({'apiDomain':_0x3d051e[_0x2e7d82(0x96)][_0x2e7d82(0x8a)]||undefined,'userDomain':_0x3d051e[_0x2e7d82(0x96)]['userDomain']||undefined,'runtimeDomain':_0x3d051e[_0x2e7d82(0x96)][_0x2e7d82(0x91)]||undefined});}if(!_0x87db4){if(_0x14eb8d['help']){printServiceHelp(_0x14409c);return;}if(_0x457052[_0x2e7d82(0x7d)])_0x87db4=_0x457052[_0x2e7d82(0x7d)];else{if(_0x457052[_0x2e7d82(0x67)]){await dispatchDeclarative(_0x457052[_0x2e7d82(0x67)],_0x14409c,'',[],_0x14eb8d,_0x3d051e);return;}else{printServiceHelp(_0x14409c);return;}}}const _0x350727=resolveDeprecatedSubcommand(_0x14409c,_0x87db4);if(_0x350727){const _0x4a54d6=CLI_BIN_NAME+'\x20'+_0x14409c+'\x20'+_0x87db4,_0x45a3f9=CLI_BIN_NAME+'\x20'+_0x14409c+'\x20'+_0x350727;console['error']('⚠\x20`'+_0x4a54d6+'`\x20is\x20an\x20alias\x20of\x20`'+_0x45a3f9+_0x2e7d82(0x7e)+_0x45a3f9+_0x2e7d82(0x85)),_0x87db4=_0x350727;}if(_0x14eb8d[_0x2e7d82(0x7f)]&&!findDefinition(_0x14409c,_0x87db4)){printServiceHelp(_0x14409c);return;}{let _0x320f11=findDefinition(_0x14409c,_0x87db4),_0x48e9b2=cli[_0x2e7d82(0x79)][_0x2e7d82(0x72)](0x2);if(!_0x320f11){if(_0x457052[_0x2e7d82(0x67)]){if(_0x14eb8d[_0x2e7d82(0x7f)]){console[_0x2e7d82(0x8e)](generateCommandHelp(_0x457052[_0x2e7d82(0x67)]));return;}_0x320f11=_0x457052[_0x2e7d82(0x67)],_0x48e9b2=[_0x87db4,...cli[_0x2e7d82(0x79)][_0x2e7d82(0x72)](0x2)];}else{printServiceHelp(_0x14409c),await handleErrorAsync(CliErrors['unknownCommand'](_0x14409c+'\x20'+_0x87db4));return;}}if(_0x14eb8d[_0x2e7d82(0x7f)]){console['log'](generateCommandHelp(_0x320f11));return;}await dispatchDeclarative(_0x320f11,_0x14409c,_0x87db4,_0x48e9b2,_0x14eb8d,_0x3d051e);}}async function dispatchDeclarative(_0x1339eb,_0x3c02d7,_0x231704,_0x2bfdb7,_0x3b4776,_0x448d53){const _0x3e8f4e=a12_0x5d0419,_0x2032d5=Date[_0x3e8f4e(0x7a)]();let _0x54ca2d;try{await runCommand(_0x1339eb,createPipelineEnv(_0x448d53,_0x3b4776,_0x2bfdb7));}catch(_0x588c37){_0x54ca2d=_0x588c37;}await reportCommandTrace({'service':_0x3c02d7,'command':_0x231704,'flags':_0x3b4776,'durationMs':Date[_0x3e8f4e(0x7a)]()-_0x2032d5,'error':_0x54ca2d});if(_0x54ca2d)await handleErrorAsync(_0x54ca2d,{'service':_0x3c02d7,'command':_0x231704});}function a12_0x3230(_0x3b0885,_0x3542b0){_0x3b0885=_0x3b0885-0x65;const _0x23e88f=a12_0x23e8();let _0x3230bc=_0x23e88f[_0x3b0885];return _0x3230bc;}function printServiceHelp(_0x5391f5){const _0x2df603=a12_0x5d0419;console[_0x2df603(0x8e)](generateServiceHelp(_0x5391f5));}async function handleErrorAsync(_0x282754,_0x2f229c){const _0x4cb416=a12_0x5d0419;if(_0x282754 instanceof Error&&_0x282754[_0x4cb416(0x75)]===_0x4cb416(0x88))return process['stderr'][_0x4cb416(0x66)](_0x4cb416(0x6e)),await exitWithOtelShutdown(0x0);if(_0x282754 instanceof CliError){if(_0x282754[_0x4cb416(0x78)]===_0x4cb416(0x81))return process['stderr'][_0x4cb416(0x66)]('\x0a'+_0x282754[_0x4cb416(0x80)]+'\x0a'),await exitWithOtelShutdown(0x0);console['error'](_0x4cb416(0x6a)+_0x282754[_0x4cb416(0x80)]);if(_0x282754[_0x4cb416(0x71)])console[_0x4cb416(0x84)](_0x4cb416(0x73)+_0x282754[_0x4cb416(0x71)]);if(_0x2f229c)printIssueReportNudgeForError(_0x282754,_0x2f229c);return await exitWithOtelShutdown(_0x282754[_0x4cb416(0x8b)]);}console[_0x4cb416(0x84)](_0x4cb416(0x7c),_0x282754);if(_0x2f229c)printIssueReportNudgeForError(_0x282754,_0x2f229c);return await exitWithOtelShutdown(0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a13_0x4cea84=a13_0x32a8;(function(_0x182d16,_0x29da18){const _0x59343a=a13_0x32a8,_0x4901ab=_0x182d16();while(!![]){try{const _0x37de71=-parseInt(_0x59343a(0x13d))/0x1*(parseInt(_0x59343a(0x145))/0x2)+-parseInt(_0x59343a(0x10a))/0x3+parseInt(_0x59343a(0x12a))/0x4+parseInt(_0x59343a(0x111))/0x5*(-parseInt(_0x59343a(0x113))/0x6)+-parseInt(_0x59343a(0x10f))/0x7*(parseInt(_0x59343a(0x12b))/0x8)+parseInt(_0x59343a(0x148))/0x9*(parseInt(_0x59343a(0x144))/0xa)+parseInt(_0x59343a(0x139))/0xb*(parseInt(_0x59343a(0x130))/0xc);if(_0x37de71===_0x29da18)break;else _0x4901ab['push'](_0x4901ab['shift']());}catch(_0x4e24a4){_0x4901ab['push'](_0x4901ab['shift']());}}}(a13_0x5cef,0xa8061));import a13_0x2d1f32 from'ora';import{fetchModelList}from'../../api/fetch-model-list.js';import{generateDatasetDocs}from'../../api/api-doc.js';import{CliErrors}from'../../errors.js';function a13_0x5cef(){const _0x3274f6=['3536631iVaTin','stdout','\x20doc(s)\x20failed','length','\x1b[0m','56Hdbqlf','Output\x20directory\x20(default:\x20./docs)','5ujWdqN','Filter:\x20comma-separated\x20dataset\x20codes\x20to\x20generate\x20docs\x20for','7205622bWdsJp','join','message','datasetCode','trim','\x0d\x20\x20[','validation','filter','✓\x20Generated\x20','parse','Invalid\x20--params:\x20','--datasetcode\x20cannot\x20be\x20empty.','None\x20of\x20the\x20specified\x20dataset\x20codes\x20exist:\x20','\x20dataset(s)\x1b[0m','map','\x1b[90m*\x20Generating\x20docs\x20for:\x20','./docs','params','\x1b[90m*\x20Filtered\x20','str','string','Provide\x20a\x20valid\x20JSON\x20object,\x20e.g.\x20--params\x20\x27{\x22key\x22:\x22value\x22}\x27','output','333536dxTokm','1328064ofBqGJ','isArray','start','generate','\x20of\x20','5226852SCyAHJ','Doc\x20generation\x20complete:\x20','Extra\x20params\x20passed\x20to\x20the\x20doc\x20generator\x20(JSON\x20object)','fail','datasetcode','Generate\x20markdown\x20documentation\x20for\x20all\x20datasets','write','success','some','121mdAQlr','object','padStart','cookie','15RsYldV','error','must\x20be\x20a\x20JSON\x20object','\x1b[33m!\x20The\x20following\x20dataset\x20codes\x20do\x20not\x20exist:\x20','):\x20','\x20dataset(s)','appCode','370xziDsa','136718dLWqnG','split','\x20failed','133011jaryql','succeed','Fetching\x20dataset\x20list\x20for\x20'];a13_0x5cef=function(){return _0x3274f6;};return a13_0x5cef();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a13_0x32a8(_0x354086,_0x39f3d8){_0x354086=_0x354086-0x109;const _0x5ceff8=a13_0x5cef();let _0x32a81b=_0x5ceff8[_0x354086];return _0x32a81b;}export const apiGenerate={'service':'api','command':a13_0x4cea84(0x12e),'description':a13_0x4cea84(0x135),'risk':'write','requiresAppCode':!![],'hasFormat':![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a13_0x4cea84(0x129),'type':a13_0x4cea84(0x127),'description':a13_0x4cea84(0x110)},{'name':a13_0x4cea84(0x134),'type':a13_0x4cea84(0x127),'description':a13_0x4cea84(0x112)},{'name':a13_0x4cea84(0x124),'type':'string','description':a13_0x4cea84(0x132)}],async 'execute'(_0x40914f){const _0x52d228=a13_0x4cea84,_0x3003c2=_0x40914f[_0x52d228(0x126)](_0x52d228(0x129))||_0x52d228(0x123),_0x234656=_0x40914f[_0x52d228(0x126)](_0x52d228(0x134)),_0x54760f=_0x40914f['str'](_0x52d228(0x124));let _0x42b5ab;if(_0x54760f)try{_0x42b5ab=JSON[_0x52d228(0x11c)](_0x54760f);if(typeof _0x42b5ab!==_0x52d228(0x13a)||_0x42b5ab===null||Array[_0x52d228(0x12c)](_0x42b5ab))throw new Error(_0x52d228(0x13f));}catch(_0x5bb6ca){throw CliErrors[_0x52d228(0x119)](_0x52d228(0x11d)+(_0x5bb6ca instanceof Error?_0x5bb6ca[_0x52d228(0x115)]:String(_0x5bb6ca)),_0x52d228(0x128));}let _0x11cd73;if(_0x234656){const _0x416f0a=_0x234656[_0x52d228(0x146)](',')[_0x52d228(0x121)](_0x4c7703=>_0x4c7703[_0x52d228(0x117)]())['filter'](_0x3e08a4=>_0x3e08a4[_0x52d228(0x10d)]>0x0);if(_0x416f0a[_0x52d228(0x10d)]===0x0)throw CliErrors[_0x52d228(0x119)](_0x52d228(0x11e));_0x11cd73=new Set(_0x416f0a),writeCliSideChannelLine(_0x52d228(0x122)+_0x416f0a[_0x52d228(0x114)](',\x20')+'\x1b[0m');}const _0xe8f560=a13_0x2d1f32(_0x52d228(0x109)+_0x40914f[_0x52d228(0x143)]+'...')[_0x52d228(0x12d)]();let _0x34adbf;try{({configArray:_0x34adbf}=await fetchModelList(_0x40914f['appCode'],_0x40914f[_0x52d228(0x13c)]),_0xe8f560[_0x52d228(0x149)]('Fetched\x20'+_0x34adbf['length']+_0x52d228(0x142)));}catch(_0x2eae60){_0xe8f560[_0x52d228(0x133)]('Failed\x20to\x20fetch\x20datasets');throw _0x2eae60;}if(_0x34adbf[_0x52d228(0x10d)]===0x0)return writeCliSideChannelLine('!\x20No\x20datasets\x20found.'),{'ok':!![]};let _0x17838b=_0x34adbf;if(_0x11cd73){_0x17838b=_0x34adbf['filter'](_0x80a165=>_0x11cd73['has'](_0x80a165[_0x52d228(0x116)]));const _0x2e2915=[..._0x11cd73]['filter'](_0x3ca91c=>!_0x34adbf[_0x52d228(0x138)](_0x187723=>_0x187723[_0x52d228(0x116)]===_0x3ca91c));_0x2e2915[_0x52d228(0x10d)]>0x0&&writeCliSideChannelLine(_0x52d228(0x140)+_0x2e2915[_0x52d228(0x114)](',\x20')+_0x52d228(0x10e));if(_0x17838b[_0x52d228(0x10d)]===0x0)throw CliErrors[_0x52d228(0x119)](_0x52d228(0x11f)+[..._0x11cd73][_0x52d228(0x114)](',\x20'));writeCliSideChannelLine(_0x52d228(0x125)+_0x17838b[_0x52d228(0x10d)]+_0x52d228(0x12f)+_0x34adbf[_0x52d228(0x10d)]+_0x52d228(0x120));}let _0x325325=0x0;const _0x5b136d=await generateDatasetDocs(_0x17838b,_0x40914f[_0x52d228(0x143)],_0x40914f[_0x52d228(0x13c)],_0x3003c2,(_0x192c45,_0x68b000,_0x5b2761)=>{const _0xfd1c48=_0x52d228;_0x325325=_0x192c45,process[_0xfd1c48(0x10b)][_0xfd1c48(0x136)](_0xfd1c48(0x118)+String(_0x192c45)[_0xfd1c48(0x13b)](String(_0x68b000)[_0xfd1c48(0x10d)])+'/'+_0x68b000+']\x20'+_0x5b2761+'.md');},_0x42b5ab);if(_0x325325>0x0)process[_0x52d228(0x10b)][_0x52d228(0x136)]('\x0a');const _0xf91e64=_0x5b136d[_0x52d228(0x11a)](_0x1a1ba0=>_0x1a1ba0[_0x52d228(0x137)])[_0x52d228(0x10d)],_0x657202=_0x5b136d[_0x52d228(0x11a)](_0x37c9ac=>!_0x37c9ac[_0x52d228(0x137)])[_0x52d228(0x10d)];writeCliSideChannelLine(''),writeCliSideChannelLine(_0x52d228(0x11b)+_0xf91e64+'\x20doc(s)\x20in\x20'+_0x3003c2);if(_0x657202>0x0){writeCliSideChannelLine('!\x20'+_0x657202+_0x52d228(0x10c));for(const _0x57cca0 of _0x5b136d[_0x52d228(0x11a)](_0x1711f1=>!_0x1711f1[_0x52d228(0x137)])){writeCliSideChannelLine('\x20\x20•\x20'+_0x57cca0['datasetName']+'\x20('+_0x57cca0[_0x52d228(0x116)]+_0x52d228(0x141)+_0x57cca0[_0x52d228(0x13e)]);}}return{'ok':_0x657202===0x0,'message':_0x657202>0x0?'Doc\x20generation:\x20'+_0xf91e64+'\x20succeeded,\x20'+_0x657202+_0x52d228(0x147):_0x52d228(0x131)+_0xf91e64+'\x20file(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x192889,_0x1d0b6e){const _0x514a38=a14_0x4e5e,_0x4790ab=_0x192889();while(!![]){try{const _0x4a3b44=-parseInt(_0x514a38(0x162))/0x1*(-parseInt(_0x514a38(0x160))/0x2)+parseInt(_0x514a38(0x159))/0x3*(parseInt(_0x514a38(0x15c))/0x4)+parseInt(_0x514a38(0x15a))/0x5+-parseInt(_0x514a38(0x15e))/0x6*(parseInt(_0x514a38(0x15b))/0x7)+-parseInt(_0x514a38(0x161))/0x8+parseInt(_0x514a38(0x163))/0x9*(parseInt(_0x514a38(0x15d))/0xa)+parseInt(_0x514a38(0x15f))/0xb;if(_0x4a3b44===_0x1d0b6e)break;else _0x4790ab['push'](_0x4790ab['shift']());}catch(_0x3b6b93){_0x4790ab['push'](_0x4790ab['shift']());}}}(a14_0x1c39,0x95b5c));function a14_0x1c39(){const _0x39bfb2=['9uAqsJq','3HaKNrB','3943965BXFIxb','1346387KsESOO','66244VyCGQi','2681090pjJLaM','18lAXoTU','1196415LEOUTK','1216676adWqFa','4802648YviVyg','1OMDXsh'];a14_0x1c39=function(){return _0x39bfb2;};return a14_0x1c39();}function a14_0x4e5e(_0x42010e,_0x5b3645){_0x42010e=_0x42010e-0x159;const _0x1c39f7=a14_0x1c39();let _0x4e5eb1=_0x1c39f7[_0x42010e];return _0x4e5eb1;}import{apiList}from'../../commands/api/list.js';import{apiPull}from'../../commands/api/pull.js';import{apiGenerate}from'../../commands/api/generate.js';export const apiDefinitions=[apiList,apiPull,apiGenerate];
|
package/lib/commands/api/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x86064d=a15_0x3b88;function a15_0x3b88(_0x2d8641,_0x109108){_0x2d8641=_0x2d8641-0x11d;const _0x4416a0=a15_0x4416();let _0x3b88ae=_0x4416a0[_0x2d8641];return _0x3b88ae;}(function(_0x159a80,_0x2a725d){const _0x474615=a15_0x3b88,_0x4354a5=_0x159a80();while(!![]){try{const _0x50aec5=parseInt(_0x474615(0x133))/0x1*(parseInt(_0x474615(0x12b))/0x2)+parseInt(_0x474615(0x127))/0x3*(parseInt(_0x474615(0x12f))/0x4)+-parseInt(_0x474615(0x12c))/0x5+-parseInt(_0x474615(0x12d))/0x6+parseInt(_0x474615(0x11e))/0x7*(-parseInt(_0x474615(0x125))/0x8)+parseInt(_0x474615(0x130))/0x9*(-parseInt(_0x474615(0x12a))/0xa)+-parseInt(_0x474615(0x123))/0xb*(-parseInt(_0x474615(0x12e))/0xc);if(_0x50aec5===_0x2a725d)break;else _0x4354a5['push'](_0x4354a5['shift']());}catch(_0x1ee357){_0x4354a5['push'](_0x4354a5['shift']());}}}(a15_0x4416,0x6d666));import{initEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';function a15_0x4416(){const _0x4df608=['appCode','List\x20all\x20datasets/models\x20for\x20the\x20configured\x20app(s)','7jxlDqR','isDefault','name','boolean','cookie','418Ysibnl','read','414168oRISOc','map','2013231DEMtJW','appcode','api','1029980SWUuXD','26XYtMIq','1455500qtsAum','2246826WeogRT','23064vzPVPi','4hXMLCz','9GNfHCG','list','rawFlags','40333Odmbpi'];a15_0x4416=function(){return _0x4df608;};return a15_0x4416();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveTargetApps}from'../../commands/api/shared.js';export const apiList={'service':a15_0x86064d(0x129),'command':a15_0x86064d(0x131),'description':a15_0x86064d(0x11d),'risk':a15_0x86064d(0x124),'requiresAppCode':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':'global','type':a15_0x86064d(0x121),'description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]}],async 'execute'(_0xa4b7dc){const _0x5ce04b=a15_0x86064d,_0x84c61a=_0xa4b7dc['rawFlags'][_0x5ce04b(0x128)]?String(_0xa4b7dc[_0x5ce04b(0x132)][_0x5ce04b(0x128)]):undefined,_0x1f873e=resolveTargetApps(_0xa4b7dc,_0x84c61a);if(_0x1f873e){const _0x479ecc=[];for(const _0x51f879 of _0x1f873e){const _0xeff997=_0x51f879[_0x5ce04b(0x122)]||_0xa4b7dc[_0x5ce04b(0x122)],_0x47518b=_0x51f879['env']||'production';initEnv(_0x47518b);const {configArray:_0x1fc0b7}=await fetchModelList(_0x51f879['appcode'],_0xeff997);_0x479ecc['push'](..._0x1fc0b7[_0x5ce04b(0x126)](_0x1a096e=>({..._0x1a096e,'_appName':_0x51f879[_0x5ce04b(0x120)],'_appCode':_0x51f879[_0x5ce04b(0x128)],'_env':_0x47518b,'_isDefault':_0x51f879[_0x5ce04b(0x11f)]})));}return{'ok':!![],'data':_0x479ecc};}const {configArray:_0x2d5361}=await fetchModelList(_0xa4b7dc[_0x5ce04b(0x134)],_0xa4b7dc[_0x5ce04b(0x122)]);return{'ok':!![],'data':_0x2d5361};}};
|
package/lib/commands/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a16_0x4469(){const _0x2f3ea8=['client','output','length','global','isDefault','2199105DmNMev','slice','apiFilePath','586548dpwCkc','3463525NBqtog','appcode','Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','\x20app(s)\x20failed','cookie','1173230XODWTB','rawFlags','-client','66848lbNpZZ',')...','fail','.ts','succeed','6sWJdZN','Pulled\x20','Failed:\x20','\x20dataset(s)\x20→\x20','Done:\x20','env','14UFzpjU','\x20succeeded,\x20','pull','\x20\x20•\x20','clientFilePath','start','Pulling\x20API\x20config\x20for\x20','appCode','str','api','-api','\x20model(s)','modelCount','message','string','Output\x20directory\x20(default:\x20','apiDir','includes','2737648VNCbmf','\x20failed','507996eeEFYD','boolean','name','join','9UfOBqe'];a16_0x4469=function(){return _0x2f3ea8;};return a16_0x4469();}const a16_0xc6c75e=a16_0x291f;(function(_0x1bc74f,_0x5d6a2e){const _0x10e118=a16_0x291f,_0x1f5b04=_0x1bc74f();while(!![]){try{const _0x39e819=-parseInt(_0x10e118(0x145))/0x1+parseInt(_0x10e118(0x11d))/0x2+parseInt(_0x10e118(0x14f))/0x3+parseInt(_0x10e118(0x143))/0x4+parseInt(_0x10e118(0x11e))/0x5*(-parseInt(_0x10e118(0x12b))/0x6)+-parseInt(_0x10e118(0x131))/0x7*(parseInt(_0x10e118(0x126))/0x8)+-parseInt(_0x10e118(0x149))/0x9*(parseInt(_0x10e118(0x123))/0xa);if(_0x39e819===_0x5d6a2e)break;else _0x1f5b04['push'](_0x1f5b04['shift']());}catch(_0x39e8dc){_0x1f5b04['push'](_0x1f5b04['shift']());}}}(a16_0x4469,0x5bcb1));import a16_0x231eb1 from'ora';import a16_0x4ec612 from'node:path';import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';import{generateApiFile}from'../../api/generate-api-file.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';function a16_0x291f(_0x294ecc,_0x4bdb0d){_0x294ecc=_0x294ecc-0x11b;const _0x446910=a16_0x4469();let _0x291fd0=_0x446910[_0x294ecc];return _0x291fd0;}import{resolveTargetApps}from'../../commands/api/shared.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export const apiPull={'service':a16_0xc6c75e(0x13a),'command':a16_0xc6c75e(0x133),'description':'Pull\x20datasets\x20and\x20generate\x20API\x20config\x20files\x20('+DEFAULT_API_DIR+'/)','risk':'write','requiresAppCode':!![],'hasFormat':![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a16_0xc6c75e(0x14b),'type':a16_0xc6c75e(0x13f),'description':a16_0xc6c75e(0x140)+DEFAULT_API_DIR+'/)'},{'name':a16_0xc6c75e(0x14d),'type':a16_0xc6c75e(0x146),'description':a16_0xc6c75e(0x120),'default':![]}],async 'execute'(_0x23b211){const _0x2312cd=a16_0xc6c75e,_0x5029c6=_0x23b211[_0x2312cd(0x124)][_0x2312cd(0x11f)]?String(_0x23b211['rawFlags'][_0x2312cd(0x11f)]):undefined,_0x32161e=_0x23b211[_0x2312cd(0x139)](_0x2312cd(0x14b))||undefined,_0x2ddf28=resolveTargetApps(_0x23b211,_0x5029c6);if(_0x2ddf28){let _0x4d7f3a=0x0,_0x4a2aac=0x0;for(const _0x4feff9 of _0x2ddf28){const _0x26cb94=_0x4feff9[_0x2312cd(0x122)]||_0x23b211['cookie'],_0x12d503=_0x4feff9[_0x2312cd(0x130)]||'production';initEnv(_0x12d503);const _0x5bad1f=_0x4feff9['apiDir']||_0x32161e||_0x23b211[_0x2312cd(0x141)]||DEFAULT_API_DIR,_0x5203e5=_0x4feff9[_0x2312cd(0x14e)]?'':_0x4feff9[_0x2312cd(0x147)]||_0x4feff9['appcode'],_0x4a9e87=a16_0x231eb1('Pulling\x20'+_0x4feff9[_0x2312cd(0x147)]+'\x20('+_0x4feff9[_0x2312cd(0x11f)]+_0x2312cd(0x127))[_0x2312cd(0x136)]();try{const {configArray:_0x855e5b}=await fetchModelList(_0x4feff9[_0x2312cd(0x11f)],_0x26cb94),_0x1377fc=await generateApiFile(_0x855e5b,_0x5203e5,_0x4feff9[_0x2312cd(0x11f)],_0x4feff9['isDefault'],_0x12d503,_0x5bad1f,_0x4feff9[_0x2312cd(0x147)]);_0x4a9e87['succeed'](_0x4feff9['name']+':\x20'+_0x855e5b[_0x2312cd(0x14c)]+_0x2312cd(0x12e)+_0x1377fc[_0x2312cd(0x13d)]+_0x2312cd(0x13c)),writeCliSideChannelLine(_0x2312cd(0x134)+_0x1377fc[_0x2312cd(0x11c)]),writeCliSideChannelLine('\x20\x20•\x20'+_0x1377fc[_0x2312cd(0x135)]),_0x4d7f3a++;}catch(_0x5b3cfb){_0x4a9e87[_0x2312cd(0x128)](_0x4feff9[_0x2312cd(0x147)]+':\x20'+(_0x5b3cfb instanceof Error?_0x5b3cfb[_0x2312cd(0x13e)]:String(_0x5b3cfb))),_0x4a2aac++;}}writeCliSideChannelLine('');if(_0x4a2aac>0x0)writeCliSideChannelLine('!\x20'+_0x4a2aac+_0x2312cd(0x121));return{'ok':_0x4a2aac===0x0,'message':_0x2312cd(0x12f)+_0x4d7f3a+_0x2312cd(0x132)+_0x4a2aac+_0x2312cd(0x144)};}const _0x50dacf=_0x5029c6&&_0x5029c6[_0x2312cd(0x142)]('-')?_0x5029c6['split']('-')[_0x2312cd(0x11b)](0x1)[_0x2312cd(0x148)]('-'):'',_0x51d9b1=_0x32161e||_0x23b211[_0x2312cd(0x141)]||DEFAULT_API_DIR,_0x3ea5ae=!_0x5029c6,_0x2c4121=a16_0x231eb1(_0x2312cd(0x137)+_0x23b211[_0x2312cd(0x138)]+'...')[_0x2312cd(0x136)]();try{const {configArray:_0x41f3f2}=await fetchModelList(_0x23b211[_0x2312cd(0x138)],_0x23b211['cookie']),_0x166730=await generateApiFile(_0x41f3f2,_0x50dacf,_0x23b211['appCode'],_0x3ea5ae,getEnv(),_0x51d9b1);_0x2c4121[_0x2312cd(0x12a)](_0x2312cd(0x12c)+_0x41f3f2['length']+'\x20dataset(s),\x20generated\x20'+_0x166730[_0x2312cd(0x13d)]+'\x20model(s)');const _0x126695=_0x50dacf?_0x50dacf+_0x2312cd(0x13b):'api',_0x29c972=_0x50dacf?_0x50dacf+_0x2312cd(0x125):_0x2312cd(0x14a);return writeCliSideChannelLine(_0x2312cd(0x134)+a16_0x4ec612[_0x2312cd(0x148)](_0x51d9b1,_0x126695+'.ts')),writeCliSideChannelLine(_0x2312cd(0x134)+a16_0x4ec612['join'](_0x51d9b1,_0x29c972+_0x2312cd(0x129))),{'ok':!![],'data':{'datasetCount':_0x41f3f2[_0x2312cd(0x14c)],'modelCount':_0x166730['modelCount']}};}catch(_0x44f954){_0x2c4121[_0x2312cd(0x128)](_0x2312cd(0x12d)+(_0x44f954 instanceof Error?_0x44f954[_0x2312cd(0x13e)]:String(_0x44f954)));throw _0x44f954;}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5dae74,_0xf5af8c){const _0x3af140=a17_0x2dc7,_0x5719cb=_0x5dae74();while(!![]){try{const _0x2ff73=-parseInt(_0x3af140(0x143))/0x1*(parseInt(_0x3af140(0x138))/0x2)+parseInt(_0x3af140(0x13e))/0x3+parseInt(_0x3af140(0x140))/0x4+-parseInt(_0x3af140(0x13f))/0x5*(parseInt(_0x3af140(0x132))/0x6)+-parseInt(_0x3af140(0x145))/0x7*(parseInt(_0x3af140(0x136))/0x8)+parseInt(_0x3af140(0x141))/0x9+-parseInt(_0x3af140(0x13a))/0xa*(parseInt(_0x3af140(0x139))/0xb);if(_0x2ff73===_0xf5af8c)break;else _0x5719cb['push'](_0x5719cb['shift']());}catch(_0x5005cd){_0x5719cb['push'](_0x5719cb['shift']());}}}(a17_0x41b5,0x3a9d3));import{getMultiAppConfigs}from'../../utils/config.js';function a17_0x2dc7(_0x127553,_0x5c2edc){_0x127553=_0x127553-0x131;const _0x41b55a=a17_0x41b5();let _0x2dc7d4=_0x41b55a[_0x127553];return _0x2dc7d4;}function a17_0x41b5(){const _0x58f567=['342096VgIdEZ','filter','length','validation','8DUSdNP','project','2MkHrKX','11acPTjs','2170640lZsQOJ','selectedAppName','global','merged','1183473iQjuPv','20YfAlgx','1181736elZmvm','2739627wgQIox','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','23873HAaONM','App\x20\x22','1996708pjhvGg','map'];a17_0x41b5=function(){return _0x58f567;};return a17_0x41b5();}import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x93d882,_0x90c041){const _0x2cfd0c=a17_0x2dc7;if(_0x90c041)return null;const _0x5942a9=_0x93d882['bool'](_0x2cfd0c(0x13c))?_0x2cfd0c(0x13d):_0x2cfd0c(0x137);let _0xc00be=getMultiAppConfigs(_0x5942a9);if(!_0xc00be||_0xc00be[_0x2cfd0c(0x134)]===0x0)return null;if(_0x93d882[_0x2cfd0c(0x13b)]){const _0xddbc05=_0xc00be[_0x2cfd0c(0x133)](_0x41b2fa=>_0x41b2fa['name']===_0x93d882[_0x2cfd0c(0x13b)]);if(_0xddbc05[_0x2cfd0c(0x134)]===0x0){const _0x4d7550=_0xc00be[_0x2cfd0c(0x131)](_0xe233e=>_0xe233e['name'])['join'](',\x20');throw CliErrors[_0x2cfd0c(0x135)](_0x2cfd0c(0x144)+_0x93d882[_0x2cfd0c(0x13b)]+_0x2cfd0c(0x142)+_0x4d7550);}_0xc00be=_0xddbc05;}return _0xc00be;}
|