@lovrabet/rabetbase-cli 2.5.0-beta.4 → 2.5.0-beta.6
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 +28 -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/api/generate-sdk-config-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.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-skill/index.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-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.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/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/table-diff-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/file/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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.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/mutations.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/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.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/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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-index-auditor.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/error-output.js +1 -1
- package/lib/framework/explicit-yes.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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/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/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.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/skills/rabetbase/SKILL.md +2 -2
- package/skills/rabetbase.manifest.json +3 -3
package/README.md
CHANGED
|
@@ -27,12 +27,40 @@ rabetbase --version
|
|
|
27
27
|
rabetbase --help
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
To opt into the npm beta preview instead:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g @lovrabet/rabetbase-cli@beta
|
|
34
|
+
```
|
|
35
|
+
|
|
30
36
|
You can also run a specific version with npm tooling:
|
|
31
37
|
|
|
32
38
|
```bash
|
|
33
39
|
npx @lovrabet/rabetbase-cli@latest --help
|
|
34
40
|
```
|
|
35
41
|
|
|
42
|
+
## Update and Verify
|
|
43
|
+
|
|
44
|
+
Choose exactly one update command, then run the shared verification commands. Run the repair commands only if `doctor` reports a Built-in Skill mismatch.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Upgrade to the latest stable version
|
|
48
|
+
rabetbase update
|
|
49
|
+
|
|
50
|
+
# Or opt into the current beta preview instead
|
|
51
|
+
rabetbase update --beta
|
|
52
|
+
|
|
53
|
+
# Verify the installed CLI and its same-version Built-in Skill
|
|
54
|
+
rabetbase --version
|
|
55
|
+
rabetbase --help
|
|
56
|
+
rabetbase schema
|
|
57
|
+
rabetbase doctor
|
|
58
|
+
|
|
59
|
+
# Repair the Built-in Skill only when doctor reports a mismatch
|
|
60
|
+
rabetbase cli-skill install
|
|
61
|
+
rabetbase doctor
|
|
62
|
+
```
|
|
63
|
+
|
|
36
64
|
## Quick Start
|
|
37
65
|
|
|
38
66
|
Authenticate first:
|
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a0_0x2cb1b4=a0_0xab63;function a0_0x3712(){const _0x317bcd=['6rlNqHk','api-doc','.md\x20(','.md\x20-\x20','5504208paEquF','4686260EVjeIJ','Failed\x20to\x20generate\x20docs:\x20','6365261kvAXLM','tableName','13329048RJYxDi','utf8','message','8379621MRdGQW','name','27fiGZKf','push','error','log','346714MeqJmP','✓\x20Generated:\x20','.md','Generated\x20docs\x20successfully:\x20','datasetCode',']\x20Generating:\x20','524603YbntRx','✗\x20Failed:\x20','join','length','./docs'];a0_0x3712=function(){return _0x317bcd;};return a0_0x3712();}function a0_0xab63(_0x11ee7a,_0x18eb30){_0x11ee7a=_0x11ee7a-0xfc;const _0x371260=a0_0x3712();let _0xab63fe=_0x371260[_0x11ee7a];return _0xab63fe;}(function(_0x52f53c,_0xe9c312){const _0x102a79=a0_0xab63,_0x3b072d=_0x52f53c();while(!![]){try{const _0x10d838=parseInt(_0x102a79(0x107))/0x1+parseInt(_0x102a79(0x101))/0x2*(parseInt(_0x102a79(0xfd))/0x3)+parseInt(_0x102a79(0x110))/0x4+parseInt(_0x102a79(0x111))/0x5*(-parseInt(_0x102a79(0x10c))/0x6)+parseInt(_0x102a79(0x113))/0x7+-parseInt(_0x102a79(0x115))/0x8+-parseInt(_0x102a79(0x118))/0x9;if(_0x10d838===_0xe9c312)break;else _0x3b072d['push'](_0x3b072d['shift']());}catch(_0x53d4d7){_0x3b072d['push'](_0x3b072d['shift']());}}}(a0_0x3712,0xcc09b));import{mkdirSync,writeFileSync}from'node:fs';import a0_0x3a0e43 from'node:path';import{fetchDatasetDoc}from'../core/api-client.js';import{logger}from'../utils/logger.js';export{fetchDatasetDoc}from'../core/api-client.js';function delay(_0x916abf){return new Promise(_0x17dc59=>setTimeout(_0x17dc59,_0x916abf));}export async function generateDatasetDocs(_0x3c5799,_0x5350c6,_0x94c535,_0x477a90=a0_0x2cb1b4(0x10b),_0x287276,_0x23089b){const _0x2f466d=a0_0x2cb1b4;mkdirSync(_0x477a90,{'recursive':!![]});const _0x37aaaa=[],_0x2d852b=_0x3c5799[_0x2f466d(0x10a)];console[_0x2f466d(0x100)]('\x0a'+_0x2d852b+'\x20datasets\x20to\x20generate\x20docs\x20for\x0a');for(let _0xe1fa86=0x0;_0xe1fa86<_0x3c5799[_0x2f466d(0x10a)];_0xe1fa86++){const _0x119c8c=_0x3c5799[_0xe1fa86],_0x33f655=_0xe1fa86+0x1,_0x3981ed=_0x119c8c[_0x2f466d(0x114)];try{console[_0x2f466d(0x100)]('['+_0x33f655+'/'+_0x2d852b+_0x2f466d(0x106)+_0x3981ed+_0x2f466d(0x10e)+_0x119c8c[_0x2f466d(0xfc)]+')');if(_0x287276)_0x287276(_0x33f655,_0x2d852b,_0x3981ed);const _0x47f083=await fetchDatasetDoc({'appCode':_0x5350c6,'cookie':_0x94c535,'datasetCode':_0x119c8c[_0x2f466d(0x105)],'datasetId':_0x119c8c['id'],'enableAI':![],'extraParams':_0x23089b}),_0x221b5b=a0_0x3a0e43[_0x2f466d(0x109)](_0x477a90,_0x3981ed+_0x2f466d(0x103));writeFileSync(_0x221b5b,_0x47f083,{'encoding':_0x2f466d(0x116)}),console['log'](_0x2f466d(0x102)+_0x3981ed+_0x2f466d(0x103)),logger['success']('api-doc',_0x2f466d(0x104)+_0x3981ed,undefined,{'datasetCode':_0x119c8c[_0x2f466d(0x105)],'datasetName':_0x119c8c[_0x2f466d(0xfc)],'filePath':_0x221b5b,'progress':_0x33f655+'/'+_0x2d852b}),_0x37aaaa[_0x2f466d(0xfe)]({'datasetCode':_0x119c8c[_0x2f466d(0x105)],'datasetName':_0x119c8c[_0x2f466d(0xfc)],'filePath':_0x221b5b,'success':!![]});if(_0x33f655<_0x2d852b)await delay(0x1388);}catch(_0x2bfc94){const _0x39fa24=_0x2bfc94 instanceof Error?_0x2bfc94[_0x2f466d(0x117)]:String(_0x2bfc94);console[_0x2f466d(0x100)](_0x2f466d(0x108)+_0x3981ed+_0x2f466d(0x10f)+_0x39fa24),logger[_0x2f466d(0xff)](_0x2f466d(0x10d),_0x2f466d(0x112)+_0x119c8c[_0x2f466d(0x105)],{'datasetCode':_0x119c8c['datasetCode'],'datasetName':_0x119c8c[_0x2f466d(0xfc)],'error':_0x39fa24,'progress':_0x33f655+'/'+_0x2d852b}),_0x37aaaa[_0x2f466d(0xfe)]({'datasetCode':_0x119c8c['datasetCode'],'datasetName':_0x119c8c[_0x2f466d(0xfc)],'filePath':'','success':![],'error':_0x39fa24}),_0x33f655<_0x2d852b&&(console[_0x2f466d(0x100)]('Waiting\x203\x20seconds...\x0a'),await delay(0xbb8));}}return _0x37aaaa;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a1_0x28da(){var _0x52304b=['5840aYPhpP','144OtsTDs','4tzQexe','2QYHTrw','2652180hbVjwK','619771FGykVK','1290279zmQdfE','3885JlaNjf','803770acfABK','3113472ZvQeoI','54310LTNguK'];a1_0x28da=function(){return _0x52304b;};return a1_0x28da();}function a1_0x2158(_0x122b18,_0x22eb87){_0x122b18=_0x122b18-0x9e;var _0x28da73=a1_0x28da();var _0x2158e3=_0x28da73[_0x122b18];return _0x2158e3;}(function(_0x4ea54c,_0x131c80){var _0x555b1f=a1_0x2158,_0x4be666=_0x4ea54c();while(!![]){try{var _0x4a961a=-parseInt(_0x555b1f(0xa5))/0x1*(parseInt(_0x555b1f(0xa3))/0x2)+-parseInt(_0x555b1f(0xa6))/0x3*(parseInt(_0x555b1f(0xa2))/0x4)+parseInt(_0x555b1f(0xa4))/0x5+parseInt(_0x555b1f(0x9e))/0x6+-parseInt(_0x555b1f(0xa7))/0x7*(-parseInt(_0x555b1f(0xa0))/0x8)+parseInt(_0x555b1f(0xa1))/0x9*(parseInt(_0x555b1f(0x9f))/0xa)+parseInt(_0x555b1f(0xa8))/0xb;if(_0x4a961a===_0x131c80)break;else _0x4be666['push'](_0x4be666['shift']());}catch(_0x12fc21){_0x4be666['push'](_0x4be666['shift']());}}}(a1_0x28da,0x89d78));export{fetchModelList}from'../core/api-client.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1732f6,_0x26cc05){const _0x119258=a2_0xb1db,_0x2b8994=_0x1732f6();while(!![]){try{const _0xa6e48d=parseInt(_0x119258(0x109))/0x1*(parseInt(_0x119258(0x12b))/0x2)+parseInt(_0x119258(0x133))/0x3*(-parseInt(_0x119258(0x11c))/0x4)+-parseInt(_0x119258(0x11f))/0x5+-parseInt(_0x119258(0x118))/0x6+-parseInt(_0x119258(0x122))/0x7+parseInt(_0x119258(0x127))/0x8+parseInt(_0x119258(0x10e))/0x9*(parseInt(_0x119258(0x116))/0xa);if(_0xa6e48d===_0x26cc05)break;else _0x2b8994['push'](_0x2b8994['shift']());}catch(_0xb059eb){_0x2b8994['push'](_0x2b8994['shift']());}}}(a2_0x1194,0xc05c4));import a2_0x2ff9cb from'prettier';import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';function a2_0xb1db(_0x418e21,_0x1975a0){_0x418e21=_0x418e21-0x106;const _0x1194fd=a2_0x1194();let _0xb1db3f=_0x1194fd[_0x418e21];return _0xb1db3f;}import a2_0x57ec54 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';import{generateSdkConfigFile}from'../api/generate-sdk-config-file.js';function fileAction(_0xe76d14,_0x2de022){const _0x2fcea5=a2_0xb1db;if(!_0x2de022)return _0x2fcea5(0x106);return _0xe76d14?_0x2fcea5(0x111):'created';}function a2_0x1194(){const _0x3e8bda=['3172010feOwaL','overwriteTypescript','6456354shlFRh','test','name','alias','44dmfjwk','-client','stringify','2063485EObVey','client','API\x20scaffold\x20written.','8359393jZIUdj','tableName','toUpperCase','resolve','format','1643416iADmiR',',\x20env:\x20','length','dirname','2XTbbnR','../..','typescript','join','action','datasetCode','replaceApiContent','replace','26106ZXuaJG','preserved','utf8','APP_','1140751iuuILX','key','Please\x20configure\x20app\x20code\x20first\x20via\x20`','.ts','{\x20apiConfigName:\x20','63rayUDd','templates/generate-api',',\x20...LOVRABET_SDK_CONFIG\x20}','overwritten','LOVRABET','CONFIG_NAMES.DEFAULT','api.ts.tpl','api'];a2_0x1194=function(){return _0x3e8bda;};return a2_0x1194();}export async function generateApiFile(_0x5d89a0,_0x2f5721,_0x4f05db,_0x55c2c7,_0x3faaf2,_0x4ad065,_0x57dd87,_0x44fe9={},_0x563b07={}){const _0x4e8bdd=a2_0xb1db;if(!_0x4f05db)throw new Error(_0x4e8bdd(0x10b)+CLI_BIN_NAME+'\x20config\x20set\x20app\x20<value>`');const _0x382756=_0x55c2c7&&!_0x57dd87,_0x15ce0f=_0x57dd87||_0x4f05db,_0x52a498=_0x382756?'default':_0x15ce0f,_0x22c59a=_0x382756?_0x4e8bdd(0x113):JSON[_0x4e8bdd(0x11e)](_0x15ce0f),_0x2bce44=!isProduction(_0x3faaf2),_0x33f0eb=_0x2bce44?_0x4e8bdd(0x128)+JSON[_0x4e8bdd(0x11e)](_0x3faaf2):'',_0x48a48b=_0x4e8bdd(0x10d)+_0x22c59a+_0x33f0eb+_0x4e8bdd(0x110),_0x80fc53=_0x2f5721?_0x2f5721+'-api':'api',_0x1a5e74=_0x2f5721?_0x2f5721+_0x4e8bdd(0x11d):_0x4e8bdd(0x120),_0x936131=_0x2f5721&&!/^app-[a-f0-9]+$/i[_0x4e8bdd(0x119)](_0x2f5721)?_0x2f5721[_0x4e8bdd(0x132)](/-/g,'_')[_0x4e8bdd(0x124)]():_0x4e8bdd(0x112),_0x4c7d52=/^\d/['test'](_0x936131)?_0x4e8bdd(0x108)+_0x936131:_0x936131,_0x1946cb=_0x5d89a0['map'](_0x59ac06=>({'datasetCode':_0x59ac06[_0x4e8bdd(0x130)],'tableName':_0x59ac06[_0x4e8bdd(0x123)],'name':_0x59ac06[_0x4e8bdd(0x11a)]||'','alias':_0x59ac06['alias']||_0x59ac06[_0x4e8bdd(0x10a)]})),_0x2e980f=fileURLToPath(import.meta.url),_0x248903=a2_0x57ec54[_0x4e8bdd(0x125)](a2_0x57ec54[_0x4e8bdd(0x12a)](_0x2e980f),_0x4e8bdd(0x12c)),_0x38d10e=a2_0x57ec54[_0x4e8bdd(0x12e)](_0x248903,_0x4e8bdd(0x10f)),_0x3420f3=a2_0x57ec54['join'](_0x38d10e,_0x4e8bdd(0x114)),_0x4211a9=a2_0x57ec54['join'](_0x38d10e,'client.ts.tpl'),_0x3e79a4=_0x4ad065;mkdirSync(_0x3e79a4,{'recursive':!![]});const _0x8336ec=await generateSdkConfigFile(_0x3e79a4,_0x44fe9),_0x27c31f=a2_0x57ec54[_0x4e8bdd(0x12e)](_0x3e79a4,_0x80fc53+_0x4e8bdd(0x10c)),_0x457d4f=a2_0x57ec54[_0x4e8bdd(0x12e)](_0x3e79a4,_0x1a5e74+_0x4e8bdd(0x10c)),_0x1385b8=_0x563b07[_0x4e8bdd(0x117)]===!![],_0x58a417=existsSync(_0x27c31f),_0x1f6dc4=existsSync(_0x457d4f),_0x2ae94c=_0x1385b8||!_0x58a417,_0x230a1b=_0x1385b8||!_0x1f6dc4,_0x4d7939=_0x1946cb[0x0]?.[_0x4e8bdd(0x11b)];if(_0x2ae94c){const _0x56fcee=readFileSync(_0x3420f3,_0x4e8bdd(0x107)),_0x430fc5=TemplateReplacer['replaceApiContent'](_0x56fcee,_0x4f05db,_0x1946cb,_0x4d7939,_0x80fc53,_0x22c59a,undefined,_0x4c7d52);writeFileSync(_0x27c31f,await a2_0x2ff9cb[_0x4e8bdd(0x126)](_0x430fc5,{'parser':'typescript'}),{'encoding':'utf8'});}if(_0x230a1b){const _0xaf1180=readFileSync(_0x4211a9,_0x4e8bdd(0x107)),_0x2c819a=TemplateReplacer[_0x4e8bdd(0x131)](_0xaf1180,_0x4f05db,_0x1946cb,_0x4d7939,_0x80fc53,_0x22c59a,_0x48a48b,_0x4c7d52);writeFileSync(_0x457d4f,await a2_0x2ff9cb[_0x4e8bdd(0x126)](_0x2c819a,{'parser':_0x4e8bdd(0x12d)}),{'encoding':_0x4e8bdd(0x107)});}const _0x17639a=_0x1946cb[_0x4e8bdd(0x129)],_0x5b7da7={'api':{'path':_0x27c31f,'action':fileAction(_0x58a417,_0x2ae94c)},'client':{'path':_0x457d4f,'action':fileAction(_0x1f6dc4,_0x230a1b)},'sdkConfig':{'path':_0x8336ec,'action':'refreshed'}},_0x295c93=_0x5b7da7[_0x4e8bdd(0x115)][_0x4e8bdd(0x12f)]===_0x4e8bdd(0x106)||_0x5b7da7[_0x4e8bdd(0x120)]['action']==='preserved';return logger['success']('init-api',_0x295c93?'sdk-config.ts\x20refreshed;\x20existing\x20TypeScript\x20left\x20unchanged.':_0x4e8bdd(0x121),undefined,{'apiFile':_0x27c31f,'clientFile':_0x457d4f,'sdkConfig':_0x8336ec,'modelCount':_0x17639a,'configName':_0x52a498,'isDefaultConfig':_0x382756,'needsAgentMerge':_0x295c93,'files':_0x5b7da7}),{'appCode':_0x4f05db,'modelCount':_0x17639a,'models':_0x1946cb,'apiFilePath':_0x27c31f,'clientFilePath':_0x457d4f,'sdkConfigPath':_0x8336ec,'configName':_0x52a498,'isDefaultConfig':_0x382756,'sdkRouting':_0x44fe9,'files':_0x5b7da7,'needsAgentMerge':_0x295c93};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a3_0xcd79e3=a3_0x1dd5;(function(_0x191d80,_0x4304ce){const _0x7f6611=a3_0x1dd5,_0x371d23=_0x191d80();while(!![]){try{const _0x438368=-parseInt(_0x7f6611(0xe3))/0x1+-parseInt(_0x7f6611(0xda))/0x2*(-parseInt(_0x7f6611(0xe7))/0x3)+-parseInt(_0x7f6611(0xe5))/0x4+-parseInt(_0x7f6611(0xdd))/0x5+-parseInt(_0x7f6611(0xe2))/0x6*(parseInt(_0x7f6611(0xe1))/0x7)+parseInt(_0x7f6611(0xe8))/0x8*(parseInt(_0x7f6611(0xea))/0x9)+parseInt(_0x7f6611(0xe9))/0xa;if(_0x438368===_0x4304ce)break;else _0x371d23['push'](_0x371d23['shift']());}catch(_0x387518){_0x371d23['push'](_0x371d23['shift']());}}}(a3_0x33c1,0x6b8bd));function a3_0x1dd5(_0x49043b,_0x2d56c5){_0x49043b=_0x49043b-0xd8;const _0x33c196=a3_0x33c1();let _0x1dd5cd=_0x33c196[_0x49043b];return _0x1dd5cd;}import{mkdirSync,writeFileSync}from'node:fs';import a3_0x25e395 from'node:path';import a3_0x3a7777 from'prettier';export const SDK_CONFIG_FILE_NAME=a3_0xcd79e3(0xef);function a3_0x33c1(){const _0xcb598b=['join','772612GhQiap',',\x0a\x20\x20','/**\x0a\x20*\x20Lovrabet\x20SDK\x20runtime\x20routing.\x0a\x20*\x20Generated\x20by\x20Rabetbase\x20CLI.\x20Do\x20not\x20add\x20credentials\x20to\x20this\x20file.\x0a\x20*/\x0aexport\x20const\x20LOVRABET_SDK_CONFIG\x20=\x20','69630ECpjOj','runtimeDomain:\x20','{\x0a\x20\x20','region:\x20\x22id\x22','602357MNDqEE','42dkFWJk','795991TihmTE','utf8','500628LEoPfW','format','3tQvPOA','194088FoYSMT','11306750CPaBlL','171THubYi','\x20as\x20const;\x0a','stringify','length','push','sdk-config.ts','region'];a3_0x33c1=function(){return _0xcb598b;};return a3_0x33c1();}export async function generateSdkConfigFile(_0x1e6a93,_0x54da55={}){const _0x515521=a3_0xcd79e3,_0x28a801=[];if(_0x54da55['runtimeDomain'])_0x28a801[_0x515521(0xee)](_0x515521(0xde)+JSON[_0x515521(0xec)](_0x54da55['runtimeDomain']));else _0x54da55[_0x515521(0xd8)]==='id'&&_0x28a801[_0x515521(0xee)](_0x515521(0xe0));const _0x3f8b4a=_0x28a801[_0x515521(0xed)]>0x0?_0x515521(0xdf)+_0x28a801[_0x515521(0xd9)](_0x515521(0xdb))+',\x0a}':'{}',_0x10c149=_0x515521(0xdc)+_0x3f8b4a+_0x515521(0xeb);mkdirSync(_0x1e6a93,{'recursive':!![]});const _0x52b685=a3_0x25e395[_0x515521(0xd9)](_0x1e6a93,SDK_CONFIG_FILE_NAME);return writeFileSync(_0x52b685,await a3_0x3a7777[_0x515521(0xe6)](_0x10c149,{'parser':'typescript'}),_0x515521(0xe4)),_0x52b685;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x466c26,_0x32bcb7){const _0x463172=a4_0x1459,_0x3646aa=_0x466c26();while(!![]){try{const _0x30ae88=parseInt(_0x463172(0x1f4))/0x1*(-parseInt(_0x463172(0x1e7))/0x2)+-parseInt(_0x463172(0x1f5))/0x3+-parseInt(_0x463172(0x1ea))/0x4+parseInt(_0x463172(0x1f1))/0x5+-parseInt(_0x463172(0x1f6))/0x6*(-parseInt(_0x463172(0x1e5))/0x7)+-parseInt(_0x463172(0x1e9))/0x8+parseInt(_0x463172(0x1f3))/0x9*(parseInt(_0x463172(0x1f2))/0xa);if(_0x30ae88===_0x32bcb7)break;else _0x3646aa['push'](_0x3646aa['shift']());}catch(_0x4bf440){_0x3646aa['push'](_0x3646aa['shift']());}}}(a4_0x39e9,0x38c48));function a4_0x39e9(){const _0x2e65e0=['log','5638nccUWP','Logging\x20in...\x20Please\x20complete\x20login\x20in\x20your\x20browser.','3437544TJGEqO','849524fautdR','stop','validation','\x20auth\x20login\x20--yes`\x20and\x20open\x20the\x20printed\x20URL\x20in\x20your\x20browser.','start','Starting\x20browser\x20login.\x20Share\x20the\x20printed\x20URL\x20with\x20the\x20user.','√\x20Valid\x20session\x20detected,\x20no\x20login\x20required.','908135YiHVfN','1330530kQCiRt','27clWcQu','13uphBGo','154623ydpxEt','8748ckTrDV','autoYes','!\x20Login\x20failed.','nonInteractive','Browser\x20login\x20cannot\x20run\x20in\x20non-interactive\x20mode.','1834CbhVVI'];a4_0x39e9=function(){return _0x2e65e0;};return a4_0x39e9();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a4_0x1459(_0x5a7b33,_0x206536){_0x5a7b33=_0x5a7b33-0x1e1;const _0x39e936=a4_0x39e9();let _0x145963=_0x39e936[_0x5a7b33];return _0x145963;}import{CLI_BIN_NAME}from'../constant/cli.js';import{CliErrors}from'../errors.js';import{confirm}from'@inquirer/prompts';import a4_0x1aabf5 from'ora';export async function runAuthServer(_0x1cc341){const _0x40e9a4=a4_0x1459,_0x2402d2=await getIsSessionValid();if(_0x2402d2){console['log'](_0x40e9a4(0x1f0));return;}if(_0x1cc341?.[_0x40e9a4(0x1e3)]&&!_0x1cc341[_0x40e9a4(0x1e1)])throw CliErrors[_0x40e9a4(0x1ec)](_0x40e9a4(0x1e4),'Run\x20`'+CLI_BIN_NAME+_0x40e9a4(0x1ed));const _0x2f0fe3=_0x1cc341?.['autoYes']?!![]:await confirm({'message':'No\x20valid\x20session.\x20Login\x20now?','default':!![]});if(!_0x2f0fe3)return;if(_0x1cc341?.[_0x40e9a4(0x1e3)]){console[_0x40e9a4(0x1e6)](_0x40e9a4(0x1ef));const _0x1a2e03=await authServer({'silent':![],'openBrowser':![]});_0x1a2e03?console['log']('*\x20Login\x20successful!'):console[_0x40e9a4(0x1e6)](_0x40e9a4(0x1e2));return;}const _0x391949=a4_0x1aabf5(_0x40e9a4(0x1e8))[_0x40e9a4(0x1ee)](),_0x586a58=await authServer({'silent':!![],'openBrowser':!![]});_0x391949[_0x40e9a4(0x1eb)](),_0x586a58?console[_0x40e9a4(0x1e6)]('*\x20Login\x20successful!'):console['log'](_0x40e9a4(0x1e2));}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a5_0x3c6860=a5_0x49ef;(function(_0x35d2a3,_0x3c9afa){const _0x49ecc3=a5_0x49ef,_0xb624c8=_0x35d2a3();while(!![]){try{const _0x528fcd=-parseInt(_0x49ecc3(0xa4))/0x1*(parseInt(_0x49ecc3(0x92))/0x2)+parseInt(_0x49ecc3(0x8f))/0x3+-parseInt(_0x49ecc3(0x95))/0x4+-parseInt(_0x49ecc3(0x8c))/0x5*(parseInt(_0x49ecc3(0x79))/0x6)+parseInt(_0x49ecc3(0xa3))/0x7+parseInt(_0x49ecc3(0x7a))/0x8+parseInt(_0x49ecc3(0x7c))/0x9;if(_0x528fcd===_0x3c9afa)break;else _0xb624c8['push'](_0xb624c8['shift']());}catch(_0x2feca4){_0xb624c8['push'](_0xb624c8['shift']());}}}(a5_0x42f5,0xe347f));import{writeFileSync}from'node:fs';import a5_0x4370e2 from'node:https';import{getUserDomain}from'../constant/domain.js';function a5_0x49ef(_0x3ce641,_0x1f147f){_0x3ce641=_0x3ce641-0x78;const _0x42f596=a5_0x42f5();let _0x49ef6f=_0x42f596[_0x3ce641];return _0x49ef6f;}import{exec}from'node:child_process';import{getIsSessionValid}from'../auth/is-session-valid.js';function a5_0x42f5(){const _0x137745=['Auth\x20server\x20error:','end','timeoutMs','127.0.0.1','createServer','⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically','session','29395GGCLjc','log','📍\x20Login\x20URL:','1522794kksrbp','error','!\x20Login\x20URL\x20expired\x20after\x2010\x20minutes.\x20Run\x20the\x20login\x20command\x20again\x20to\x20get\x20a\x20new\x20URL.','2aAglfH','user','object','7057420FdNLeF','utf-8','darwin','json','openBrowser','💡\x20If\x20the\x20browser\x20does\x20not\x20open\x20automatically,\x20copy\x20the\x20login\x20URL\x20above\x20into\x20your\x20browser.','then','🌐\x20Attempting\x20to\x20open\x20browser\x20automatically...','https://dev.lovrabet.com:','address','writeHead','🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:','✅\x20Browser\x20opened.\x20Please\x20complete\x20login\x20in\x20the\x20browser.','silent','9098313uyWSod','1805203mJMgcd','/sign-in?redirect=','1404uMTrrk','2269952honMPm','xdg-open\x20\x22','34065774SPoNqy','🔐\x20Starting\x20login\x20service...','isAuth','platform','text/html;\x20charset=utf-8','open\x20\x22','headers','cookie','/api/auth/get-session'];a5_0x42f5=function(){return _0x137745;};return a5_0x42f5();}import{cookieFile}from'../auth/constant.js';import{buildLoginSuccessHtml}from'../auth/login-success-html.js';export const AUTH_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;export async function authServer(_0x2b5a77){const _0x29f2ac=a5_0x49ef,_0x14f0f9=_0x2b5a77?.[_0x29f2ac(0xa2)]||![],_0x27e3c6=_0x2b5a77?.[_0x29f2ac(0x99)]??!![],_0x2d8a66=_0x2b5a77?.[_0x29f2ac(0x87)]??AUTH_LOGIN_TIMEOUT_MS;if(await getIsSessionValid())return!![];const _0x5f1285=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))[_0x29f2ac(0x98)]();return new Promise(async(_0x42ab12,_0x1b90f4)=>{const _0x3a1b45=_0x29f2ac;let _0x48d0e6=0x0,_0x469024=![],_0x20b27c;const _0x2a0e26=a5_0x4370e2[_0x3a1b45(0x89)](_0x5f1285,async(_0x1edfc4,_0x37529b)=>{const _0x5939ee=_0x3a1b45,_0x43f6cd=getUserDomain(),_0x538d77=_0x1edfc4[_0x5939ee(0x82)][_0x5939ee(0x83)]||'',_0x562b41=await fetch(_0x43f6cd+_0x5939ee(0x84),{'headers':{'cookie':_0x538d77}})[_0x5939ee(0x9b)](_0x5a6642=>_0x5a6642[_0x5939ee(0x98)]()),_0x270008=_0x562b41&&_0x562b41[_0x5939ee(0x8b)]&&_0x562b41[_0x5939ee(0x93)];if(_0x270008){writeFileSync(cookieFile,_0x538d77,_0x5939ee(0x96));const _0x2763d0=buildLoginSuccessHtml();_0x37529b['writeHead'](0xc8,{'Content-Type':_0x5939ee(0x80)}),_0x37529b['end'](_0x2763d0),_0xe87bd(!![]);}else{const _0x269c7f=''+encodeURIComponent(_0x5939ee(0x9d)+_0x48d0e6);_0x37529b[_0x5939ee(0x9f)](0x12e,{'location':_0x43f6cd+_0x5939ee(0x78)+_0x269c7f}),_0x37529b[_0x5939ee(0x86)]();return;}});function _0xe87bd(_0x3ebd56){if(_0x469024)return;_0x469024=!![],_0x20b27c&&clearTimeout(_0x20b27c),_0x2a0e26['close'](),_0x42ab12(_0x3ebd56);}_0x2a0e26['listen'](0x0,_0x3a1b45(0x88),()=>{const _0x8fd304=_0x3a1b45,_0x14bc2e=_0x2a0e26[_0x8fd304(0x9e)]();_0x48d0e6=typeof _0x14bc2e===_0x8fd304(0x94)&&_0x14bc2e?_0x14bc2e['port']:Number(_0x14bc2e);const _0x2ea942=_0x8fd304(0x9d)+_0x48d0e6;_0x20b27c=setTimeout(()=>{const _0x55bb6d=_0x8fd304;!_0x14f0f9&&console[_0x55bb6d(0x8d)](_0x55bb6d(0x91)),_0xe87bd(![]);},_0x2d8a66);!_0x14f0f9&&(console[_0x8fd304(0x8d)](_0x8fd304(0x7d)),console[_0x8fd304(0x8d)](_0x8fd304(0x8e),_0x2ea942),_0x27e3c6?(console['log'](_0x8fd304(0x9c)),console[_0x8fd304(0x8d)](''),console[_0x8fd304(0x8d)](_0x8fd304(0x9a))):console['log']('💡\x20Open\x20the\x20login\x20URL\x20above\x20in\x20your\x20browser\x20to\x20complete\x20authorization.'),console['log'](''));if(!_0x27e3c6)return;openInBrowser(_0x2ea942)[_0x8fd304(0x9b)](_0x391066=>{const _0x278f9a=_0x8fd304;!_0x14f0f9&&(_0x391066?console[_0x278f9a(0x8d)](_0x278f9a(0xa1)):(console[_0x278f9a(0x8d)]('⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically'),console[_0x278f9a(0x8d)](_0x278f9a(0xa0),_0x2ea942)),console['log'](''));})['catch'](()=>{const _0x235453=_0x8fd304;!_0x14f0f9&&(console[_0x235453(0x8d)](_0x235453(0x8a)),console[_0x235453(0x8d)](_0x235453(0xa0),_0x2ea942),console[_0x235453(0x8d)](''));});}),_0x2a0e26['on'](_0x3a1b45(0x90),_0x38277b=>{const _0x509bf9=_0x3a1b45;if(_0x469024)return;_0x469024=!![],_0x20b27c&&clearTimeout(_0x20b27c),!_0x14f0f9&&console[_0x509bf9(0x90)](_0x509bf9(0x85),_0x38277b),_0x2a0e26['close'](),_0x1b90f4(_0x38277b);});});}function openInBrowser(_0x4f10f1){return new Promise(_0x3fd39a=>{const _0x493419=a5_0x49ef,_0x2213c8=process[_0x493419(0x7f)];let _0x154bb2;if(_0x2213c8==='win32')_0x154bb2='cmd\x20/c\x20start\x20\x22\x22\x20\x22'+_0x4f10f1+'\x22';else _0x2213c8===_0x493419(0x97)?_0x154bb2=_0x493419(0x81)+_0x4f10f1+'\x22':_0x154bb2=_0x493419(0x7b)+_0x4f10f1+'\x22';exec(_0x154bb2,_0x1f4a5c=>{_0x1f4a5c?_0x3fd39a(![]):_0x3fd39a(!![]);});});}if(import.meta.main){const isAuth=await authServer();console[a5_0x3c6860(0x8d)](a5_0x3c6860(0x7e),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x347e6b,_0x42c7d9){const _0x58c369=a6_0xfa02,_0x2c5286=_0x347e6b();while(!![]){try{const _0x5e4145=-parseInt(_0x58c369(0x71))/0x1+-parseInt(_0x58c369(0x74))/0x2+-parseInt(_0x58c369(0x73))/0x3+parseInt(_0x58c369(0x6f))/0x4*(parseInt(_0x58c369(0x6d))/0x5)+parseInt(_0x58c369(0x6e))/0x6+-parseInt(_0x58c369(0x70))/0x7+-parseInt(_0x58c369(0x72))/0x8;if(_0x5e4145===_0x42c7d9)break;else _0x2c5286['push'](_0x2c5286['shift']());}catch(_0x245353){_0x2c5286['push'](_0x2c5286['shift']());}}}(a6_0x50c6,0x7b56e));import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';function a6_0xfa02(_0x5c29d2,_0x126371){_0x5c29d2=_0x5c29d2-0x6d;const _0x50c6b4=a6_0x50c6();let _0xfa02d4=_0x50c6b4[_0x5c29d2];return _0xfa02d4;}export const configDir=join(homedir(),'.lovrabet');export const cookieFile=join(configDir,'cookie');mkdirSync(configDir,{'recursive':!![]});function a6_0x50c6(){const _0x15e4a2=['2046499TzlFJQ','59412ynXcSS','595256OSZLfX','1061067oRSxzT','190082lsKgZA','20eHFkeH','3609480VtNSyy','778524OBLKIs'];a6_0x50c6=function(){return _0x15e4a2;};return a6_0x50c6();}
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e5327,_0xc2c978){var _0x23796e=a7_0x5c8c,_0x248224=_0x3e5327();while(!![]){try{var _0x2a41b1=-parseInt(_0x23796e(0x17f))/0x1+parseInt(_0x23796e(0x17e))/0x2*(parseInt(_0x23796e(0x183))/0x3)+-parseInt(_0x23796e(0x186))/0x4*(-parseInt(_0x23796e(0x185))/0x5)+parseInt(_0x23796e(0x184))/0x6+-parseInt(_0x23796e(0x187))/0x7*(parseInt(_0x23796e(0x189))/0x8)+parseInt(_0x23796e(0x181))/0x9+parseInt(_0x23796e(0x188))/0xa*(-parseInt(_0x23796e(0x180))/0xb);if(_0x2a41b1===_0xc2c978)break;else _0x248224['push'](_0x248224['shift']());}catch(_0x186709){_0x248224['push'](_0x248224['shift']());}}}(a7_0x46d1,0xc349c));import{readFileSync}from'node:fs';import{cookieFile}from'../auth/constant.js';function a7_0x5c8c(_0x16620d,_0xc7f170){_0x16620d=_0x16620d-0x17e;var _0x46d1bc=a7_0x46d1();var _0x5c8c83=_0x46d1bc[_0x16620d];return _0x5c8c83;}export function getCookie(){var _0x12015a=a7_0x5c8c;try{return readFileSync(cookieFile,_0x12015a(0x182));}catch{}return'';}function a7_0x46d1(){var _0x36dde8=['10705519NoMMGZ','8315478EATrCm','utf-8','12MEmcja','2610390zxQKBO','30ZpAHVH','851280PQptGd','56wLVKnh','10rZwrZQ','737944wnjHHE','546564ZUMuiW','1217982odRgvr'];a7_0x46d1=function(){return _0x36dde8;};return a7_0x46d1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a8_0x5a49(_0x3e83cc,_0x45c37f){_0x3e83cc=_0x3e83cc-0x1e4;const _0x4050a5=a8_0x4050();let _0x5a49f5=_0x4050a5[_0x3e83cc];return _0x5a49f5;}(function(_0x57622b,_0x166a6f){const _0xd21fb8=a8_0x5a49,_0x4dc259=_0x57622b();while(!![]){try{const _0x4f6036=-parseInt(_0xd21fb8(0x1ef))/0x1+parseInt(_0xd21fb8(0x1f0))/0x2+-parseInt(_0xd21fb8(0x1e5))/0x3+parseInt(_0xd21fb8(0x1e6))/0x4*(parseInt(_0xd21fb8(0x1ee))/0x5)+parseInt(_0xd21fb8(0x1e7))/0x6*(parseInt(_0xd21fb8(0x1eb))/0x7)+-parseInt(_0xd21fb8(0x1ed))/0x8+parseInt(_0xd21fb8(0x1e8))/0x9;if(_0x4f6036===_0x166a6f)break;else _0x4dc259['push'](_0x4dc259['shift']());}catch(_0x4d9aec){_0x4dc259['push'](_0x4dc259['shift']());}}}(a8_0x4050,0x4b47a));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';function a8_0x4050(){const _0x38cc9a=['user','502674eXINNV','8TXbRKm','32346jkykuc','2223513FTOUne','utf-8','/api/auth/get-session','70BdYxgA','json','2069664eSNXfD','596415RnFYqq','420151RKSmzR','1230460DGhDrc'];a8_0x4050=function(){return _0x38cc9a;};return a8_0x4050();}export async function getSessionUserInfo(){const _0x3be9eb=a8_0x5a49;try{if(!existsSync(cookieFile))return null;const _0x5268eb=readFileSync(cookieFile,_0x3be9eb(0x1e9)),_0x284f2d=await fetch(getUserDomain()+_0x3be9eb(0x1ea),{'headers':{'cookie':_0x5268eb}});if(!_0x284f2d['ok'])return null;const _0x2cc9a0=await _0x284f2d[_0x3be9eb(0x1ec)]();if(!_0x2cc9a0['session']||!_0x2cc9a0[_0x3be9eb(0x1e4)])return null;return _0x2cc9a0;}catch{return null;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x431163,_0x658548){const _0x539ddd=a9_0x50a2,_0x2b22d4=_0x431163();while(!![]){try{const _0x38236c=parseInt(_0x539ddd(0x180))/0x1*(parseInt(_0x539ddd(0x188))/0x2)+-parseInt(_0x539ddd(0x186))/0x3+-parseInt(_0x539ddd(0x17b))/0x4*(parseInt(_0x539ddd(0x184))/0x5)+parseInt(_0x539ddd(0x182))/0x6*(-parseInt(_0x539ddd(0x185))/0x7)+parseInt(_0x539ddd(0x18a))/0x8*(parseInt(_0x539ddd(0x187))/0x9)+-parseInt(_0x539ddd(0x18b))/0xa*(-parseInt(_0x539ddd(0x17f))/0xb)+-parseInt(_0x539ddd(0x17e))/0xc*(parseInt(_0x539ddd(0x17c))/0xd);if(_0x38236c===_0x658548)break;else _0x2b22d4['push'](_0x2b22d4['shift']());}catch(_0x69e835){_0x2b22d4['push'](_0x2b22d4['shift']());}}}(a9_0x191d,0xc3ba5));function a9_0x191d(){const _0x43e0a0=['1017321RvCSEM','9109539ujOnyV','1246BkvBbR','/api/auth/get-session','8sRyKLK','10OMbPBH','180EKsTtO','6433453AsubSm','user','24qYkQVA','17079887jdYoVm','687nNuMGX','session','318ganReS','json','7050HHmAVE','105511koFUEp'];a9_0x191d=function(){return _0x43e0a0;};return a9_0x191d();}import{existsSync,readFileSync}from'node:fs';function a9_0x50a2(_0x3ba8cf,_0xc5f6d7){_0x3ba8cf=_0x3ba8cf-0x17b;const _0x191d61=a9_0x191d();let _0x50a2c6=_0x191d61[_0x3ba8cf];return _0x50a2c6;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';export async function getIsSessionValid(){const _0x3fe28a=a9_0x50a2;try{if(!existsSync(cookieFile))return![];const _0x68fa50=readFileSync(cookieFile,'utf-8'),_0x1f6099=await fetch(getUserDomain()+_0x3fe28a(0x189),{'headers':{'cookie':_0x68fa50}})['then'](_0x5e54ed=>_0x5e54ed[_0x3fe28a(0x183)]());return _0x1f6099&&_0x1f6099[_0x3fe28a(0x181)]&&_0x1f6099[_0x3fe28a(0x17d)];}catch{}return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c0cf3,_0x243ada){const _0x56cfc4=a10_0x3a95,_0x559c0e=_0x4c0cf3();while(!![]){try{const _0x264aee=parseInt(_0x56cfc4(0x100))/0x1*(-parseInt(_0x56cfc4(0xfc))/0x2)+-parseInt(_0x56cfc4(0x103))/0x3+-parseInt(_0x56cfc4(0xfe))/0x4+parseInt(_0x56cfc4(0xfb))/0x5*(parseInt(_0x56cfc4(0xfa))/0x6)+-parseInt(_0x56cfc4(0x102))/0x7+-parseInt(_0x56cfc4(0xfd))/0x8+parseInt(_0x56cfc4(0xff))/0x9;if(_0x264aee===_0x243ada)break;else _0x559c0e['push'](_0x559c0e['shift']());}catch(_0x4ed0ea){_0x559c0e['push'](_0x559c0e['shift']());}}}(a10_0x1d80,0xdeda6));function a10_0x1d80(){const _0x5b263d=['3350184kIFOTj','10yWBwBO','58biFIBu','11328312flXyeF','3349664SOZJxw','38843361uanYiD','25478gRSKAf','</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>','9800336rRdTWt','382458emyjCZ','<!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>','Unable\x20to\x20close\x20automatically.\x20Please\x20close\x20this\x20tab\x20or\x20window\x20manually.'];a10_0x1d80=function(){return _0x5b263d;};return a10_0x1d80();}function a10_0x3a95(_0x192698,_0x3594c0){_0x192698=_0x192698-0xfa;const _0x1d8039=a10_0x1d80();let _0x3a959e=_0x1d8039[_0x192698];return _0x3a959e;}export function buildLoginSuccessHtml(){const _0x1d972d=a10_0x3a95,_0x4c60b4=_0x1d972d(0x105);return _0x1d972d(0x104)+_0x4c60b4+_0x1d972d(0x101);}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a11_0x1a4f(_0x6ca953,_0x1f8a7d){_0x6ca953=_0x6ca953-0x130;var _0x2e05d6=a11_0x2e05();var _0x1a4fe0=_0x2e05d6[_0x6ca953];return _0x1a4fe0;}(function(_0x576dfa,_0x5f016e){var _0x13566b=a11_0x1a4f,_0x577386=_0x576dfa();while(!![]){try{var _0x3a27f5=-parseInt(_0x13566b(0x13a))/0x1+-parseInt(_0x13566b(0x138))/0x2+parseInt(_0x13566b(0x133))/0x3+parseInt(_0x13566b(0x137))/0x4+parseInt(_0x13566b(0x135))/0x5*(parseInt(_0x13566b(0x130))/0x6)+parseInt(_0x13566b(0x134))/0x7+-parseInt(_0x13566b(0x136))/0x8*(-parseInt(_0x13566b(0x139))/0x9);if(_0x3a27f5===_0x5f016e)break;else _0x577386['push'](_0x577386['shift']());}catch(_0x153cac){_0x577386['push'](_0x577386['shift']());}}}(a11_0x2e05,0x3ce83));function a11_0x2e05(){var _0xf5443e=['894896ygcBKN','9IKCGju','401908HKiMio','12DkwuRA','log','✓\x20Logged\x20out','1067460XtGvTn','1438185HayaET','529820BYrtSa','43368mbKSci','1280828mOOPOw'];a11_0x2e05=function(){return _0xf5443e;};return a11_0x2e05();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../auth/constant.js';export function logout(){var _0x1f1186=a11_0x1a4f;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1f1186(0x131)](_0x1f1186(0x132))):console['log']('!\x20Not\x20logged\x20in');}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a12_0x2ccd(){const _0x22ecb7=['86110yebbnt','15943JYavYv','33009xzZwJh','288010bsnLXd','680376vHslPD','boolean','6NXVZot','72fDezWH','156639CLmhHN','1059762VUfVAv','171mMqKki'];a12_0x2ccd=function(){return _0x22ecb7;};return a12_0x2ccd();}const a12_0x4101dc=a12_0x4858;function a12_0x4858(_0xfa6697,_0x58ac0c){_0xfa6697=_0xfa6697-0x1a0;const _0x2ccda3=a12_0x2ccd();let _0x485864=_0x2ccda3[_0xfa6697];return _0x485864;}(function(_0x50ac97,_0x297d0b){const _0x1e6a3f=a12_0x4858,_0x1757ea=_0x50ac97();while(!![]){try{const _0x134800=-parseInt(_0x1e6a3f(0x1a0))/0x1+parseInt(_0x1e6a3f(0x1a5))/0x2*(parseInt(_0x1e6a3f(0x1a1))/0x3)+parseInt(_0x1e6a3f(0x1a3))/0x4+-parseInt(_0x1e6a3f(0x1a2))/0x5+-parseInt(_0x1e6a3f(0x1a8))/0x6+-parseInt(_0x1e6a3f(0x1a7))/0x7*(-parseInt(_0x1e6a3f(0x1a6))/0x8)+-parseInt(_0x1e6a3f(0x1a9))/0x9*(-parseInt(_0x1e6a3f(0x1aa))/0xa);if(_0x134800===_0x297d0b)break;else _0x1757ea['push'](_0x1757ea['shift']());}catch(_0x1eeb64){_0x1757ea['push'](_0x1757ea['shift']());}}}(a12_0x2ccd,0x4d9ed));export const dynamicCliFlags={'enableBffSave':{'type':a12_0x4101dc(0x1a4)}};
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
const a13_0x1ec390=a13_0x26be;(function(_0xb6f030,_0x3465d6){const _0x305669=a13_0x26be,_0x3f8f3b=_0xb6f030();while(!![]){try{const _0x494e0f=parseInt(_0x305669(0xca))/0x1*(parseInt(_0x305669(0xb7))/0x2)+-parseInt(_0x305669(0xa9))/0x3*(parseInt(_0x305669(0xbb))/0x4)+parseInt(_0x305669(0xbc))/0x5+parseInt(_0x305669(0xbd))/0x6*(parseInt(_0x305669(0xb1))/0x7)+parseInt(_0x305669(0xac))/0x8+-parseInt(_0x305669(0xc0))/0x9*(-parseInt(_0x305669(0xcb))/0xa)+-parseInt(_0x305669(0xc6))/0xb;if(_0x494e0f===_0x3465d6)break;else _0x3f8f3b['push'](_0x3f8f3b['shift']());}catch(_0x54395d){_0x3f8f3b['push'](_0x3f8f3b['shift']());}}}(a13_0x6134,0xd0f49));import a13_0x531912 from'meow';import{showHelp}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{isKnownService,getServiceEntry,findDefinition,resolveRemovedCommand}from'./commands/registry.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{formatCliError}from'./framework/output.js';import{resolveErrorOutputFormat,usesStructuredErrorOutput}from'./framework/error-output.js';function a13_0x26be(_0x430c5e,_0x415108){_0x430c5e=_0x430c5e-0xa8;const _0x613437=a13_0x6134();let _0x26be97=_0x613437[_0x430c5e];return _0x26be97;}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('./cli-flags.js'))[a13_0x1ec390(0xb8)];}catch{}const helpText=generateFullHelp(),cliVersion=GIT_COMMIT!==a13_0x1ec390(0xaa)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[a13_0x1ec390(0xcc)](0x0,0xa)+')':VERSION,cli=a13_0x531912(helpText,{'importMeta':import.meta,'version':cliVersion,'flags':{...buildMeowFlags(),...dynamicCliFlags||{}}});registerOtelShutdownOnExit(),await run();function a13_0x6134(){const _0x21ce23=['error','global','risk','validation','wildcardDef','253138ylJlxt','dynamicCliFlags','unknownCommand','stderr','1756VFNBfv','947010WCBbDe','81174SKOGyT','now','\x0aCancelled.\x0a','829314OqHzKK','unknown_service','service','command','log','write','14540295PiRBym','input','Error:\x20','flags','2riQqmy','70fOkcLn','slice','name','help','5847DdezXB','unknown','def','13185096sdCUNR','hint','message','Unexpected\x20error:','code','154gfoKoz'];a13_0x6134=function(){return _0x21ce23;};return a13_0x6134();}async function run(){const _0x26ab7e=a13_0x1ec390;let _0x5c0325=cli['input'][0x0],_0x6540f2=cli[_0x26ab7e(0xc7)][0x1];const _0x32bbd3=cli[_0x26ab7e(0xc9)];if(!_0x5c0325){await reportCliHelpTrace(_0x26ab7e(0xb3)),showHelp();return;}const _0x1c3383=resolveRemovedCommand(_0x5c0325,_0x6540f2);_0x1c3383&&await handleErrorAsync(CliErrors[_0x26ab7e(0xb5)](_0x1c3383[_0x26ab7e(0xae)],_0x1c3383[_0x26ab7e(0xad)]));if(!isKnownService(_0x5c0325)){await reportCliHelpTrace(_0x26ab7e(0xc1),{'service':_0x5c0325}),showHelp();return;}const _0x36c49f=getServiceEntry(_0x5c0325),{buildConfigFromFlags:_0x58633a,initGlobalEnvironment:_0x275926}=await import('./context.js'),_0x46bea0=_0x58633a(_0x32bbd3);await _0x275926(_0x46bea0);if(!_0x6540f2){if(_0x32bbd3[_0x26ab7e(0xa8)]){printServiceHelp(_0x5c0325);return;}if(_0x36c49f['defaultCommand'])_0x6540f2=_0x36c49f['defaultCommand'];else{if(_0x36c49f[_0x26ab7e(0xb6)]){await dispatchDeclarative(_0x36c49f['wildcardDef'],_0x5c0325,'',[],_0x32bbd3,_0x46bea0);return;}else{printServiceHelp(_0x5c0325);return;}}}{let _0x57acb8=findDefinition(_0x5c0325,_0x6540f2),_0x372e5f=cli[_0x26ab7e(0xc7)][_0x26ab7e(0xcc)](0x2);if(!_0x57acb8){if(_0x36c49f['wildcardDef']){if(_0x32bbd3[_0x26ab7e(0xa8)]){console['log'](generateCommandHelp(_0x36c49f[_0x26ab7e(0xb6)]));return;}_0x57acb8=_0x36c49f[_0x26ab7e(0xb6)],_0x372e5f=[_0x6540f2,...cli['input']['slice'](0x2)];}else{printServiceHelp(_0x5c0325),await handleErrorAsync(CliErrors[_0x26ab7e(0xb9)](_0x5c0325+'\x20'+_0x6540f2));return;}}if(_0x32bbd3[_0x26ab7e(0xa8)]){console[_0x26ab7e(0xc4)](generateCommandHelp(_0x57acb8));return;}await dispatchDeclarative(_0x57acb8,_0x5c0325,_0x6540f2,_0x372e5f,_0x32bbd3,_0x46bea0);}}async function dispatchDeclarative(_0x38568a,_0x522e9d,_0x206af0,_0x20f189,_0x4cc54c,_0x5901f9){const _0xe8c775=a13_0x1ec390,_0x5b4c79=Date[_0xe8c775(0xbe)]();let _0x35af4f;try{await runCommand(_0x38568a,createPipelineEnv(_0x5901f9,_0x4cc54c,_0x20f189));}catch(_0x94e6a5){_0x35af4f=_0x94e6a5;}await reportCommandTrace({'service':_0x522e9d,'command':_0x206af0,'flags':_0x4cc54c,'durationMs':Date['now']()-_0x5b4c79,'error':_0x35af4f}),_0x35af4f&&await handleErrorAsync(_0x35af4f,{'service':_0x522e9d,'command':_0x206af0,'def':_0x38568a,'flags':_0x4cc54c,'defaultFormat':_0x5901f9['format']});}function printServiceHelp(_0x198b5e){const _0xef4c69=a13_0x1ec390;console[_0xef4c69(0xc4)](generateServiceHelp(_0x198b5e));}async function handleErrorAsync(_0x4be226,_0x29cbdf){const _0x32ea05=a13_0x1ec390;if(_0x4be226 instanceof Error&&_0x4be226[_0x32ea05(0xcd)]==='ExitPromptError')return process['stderr'][_0x32ea05(0xc5)](_0x32ea05(0xbf)),await exitWithOtelShutdown(0x0);if(_0x4be226 instanceof CliError){if(_0x4be226[_0x32ea05(0xb0)]==='cancelled')return process[_0x32ea05(0xba)][_0x32ea05(0xc5)]('\x0a'+_0x4be226[_0x32ea05(0xae)]+'\x0a'),await exitWithOtelShutdown(0x0);let _0x281e39=![];_0x29cbdf&&usesStructuredErrorOutput(_0x29cbdf[_0x32ea05(0xab)])&&(_0x281e39=formatCliError(_0x4be226,{'command':CLI_BIN_NAME+'\x20'+_0x29cbdf[_0x32ea05(0xab)][_0x32ea05(0xc2)]+'\x20'+_0x29cbdf[_0x32ea05(0xab)][_0x32ea05(0xc3)],'risk':_0x29cbdf[_0x32ea05(0xab)][_0x32ea05(0xb4)],'format':resolveErrorOutputFormat(_0x29cbdf),'jqFilter':typeof _0x29cbdf[_0x32ea05(0xc9)]?.['jq']==='string'?_0x29cbdf['flags']['jq']:undefined}));if(!_0x281e39){console[_0x32ea05(0xb2)](_0x32ea05(0xc8)+_0x4be226[_0x32ea05(0xae)]);if(_0x4be226[_0x32ea05(0xad)])console['error']('Hint:\x20'+_0x4be226[_0x32ea05(0xad)]);if(_0x29cbdf)printIssueReportNudgeForError(_0x4be226,_0x29cbdf);}return await exitWithOtelShutdown(_0x4be226['exitCode']);}console[_0x32ea05(0xb2)](_0x32ea05(0xaf),_0x4be226);if(_0x29cbdf)printIssueReportNudgeForError(_0x4be226,_0x29cbdf);return await exitWithOtelShutdown(0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x5c94bd=a14_0x5035;(function(_0x258c38,_0x34df95){const _0x577aeb=a14_0x5035,_0x3bca54=_0x258c38();while(!![]){try{const _0x3ee0e3=-parseInt(_0x577aeb(0x111))/0x1+parseInt(_0x577aeb(0x114))/0x2*(-parseInt(_0x577aeb(0x117))/0x3)+parseInt(_0x577aeb(0xea))/0x4+parseInt(_0x577aeb(0x10a))/0x5*(parseInt(_0x577aeb(0xe8))/0x6)+-parseInt(_0x577aeb(0xed))/0x7*(parseInt(_0x577aeb(0xfa))/0x8)+parseInt(_0x577aeb(0x109))/0x9+parseInt(_0x577aeb(0xf3))/0xa;if(_0x3ee0e3===_0x34df95)break;else _0x3bca54['push'](_0x3bca54['shift']());}catch(_0xe87233){_0x3bca54['push'](_0x3bca54['shift']());}}}(a14_0x9c1a,0x84600));import a14_0x26387c from'ora';import{fetchModelList}from'../../core/api-client.js';import{generateDatasetDocs}from'../../api/api-doc.js';import{CliErrors}from'../../errors.js';function a14_0x5035(_0x5e6367,_0x1e8e28){_0x5e6367=_0x5e6367-0xe7;const _0x9c1a38=a14_0x9c1a();let _0x5035cb=_0x9c1a38[_0x5e6367];return _0x5035cb;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a14_0x9c1a(){const _0x2f1cc8=['datasetName','api','datasetcode','Filter:\x20comma-separated\x20dataset\x20codes\x20to\x20generate\x20docs\x20for','output','\x1b[33m!\x20The\x20following\x20dataset\x20codes\x20do\x20not\x20exist:\x20','str','some','...','\x20\x20•\x20','Invalid\x20--params:\x20','datasetCode','.md','\x1b[90m*\x20Filtered\x20','4188yBBwnN','Doc\x20generation:\x20','785432nUALdH','succeed','filter','7jSuvzM','message','Output\x20directory\x20(default:\x20./docs)','Provide\x20a\x20valid\x20JSON\x20object,\x20e.g.\x20--params\x20\x27{\x22key\x22:\x22value\x22}\x27','appCode','✓\x20Generated\x20','4911000ITnOsV','padStart','write','Fetching\x20dataset\x20list\x20for\x20','join','Doc\x20generation\x20complete:\x20','stdout','513144BWPFbK','object','cookie','fail','\x20of\x20','\x20dataset(s)\x1b[0m','error','validation','start','length','trim','Fetched\x20','success','\x1b[0m','split','1081674jjLSbr','5875Ojjzsb','string','parse','\x20succeeded,\x20','generate','map','\x20failed','222629lkjqWC','\x0d\x20\x20[','Failed\x20to\x20fetch\x20datasets','2602JVNFbK','./docs','\x20dataset(s)','1842UnrgSL','params'];a14_0x9c1a=function(){return _0x2f1cc8;};return a14_0x9c1a();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export const apiGenerate={'service':a14_0x5c94bd(0x11a),'command':a14_0x5c94bd(0x10e),'description':'Generate\x20markdown\x20documentation\x20for\x20all\x20datasets','risk':'read','requiresAppCode':!![],'hasFormat':![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a14_0x5c94bd(0x11d),'type':a14_0x5c94bd(0x10b),'description':a14_0x5c94bd(0xef)},{'name':'datasetcode','type':'string','description':a14_0x5c94bd(0x11c)},{'name':a14_0x5c94bd(0x118),'type':'string','description':'Extra\x20params\x20passed\x20to\x20the\x20doc\x20generator\x20(JSON\x20object)'}],async 'execute'(_0x348afc){const _0xdbc7e7=a14_0x5c94bd,_0x380624=_0x348afc['str'](_0xdbc7e7(0x11d))||_0xdbc7e7(0x115),_0x156534=_0x348afc[_0xdbc7e7(0x11f)](_0xdbc7e7(0x11b)),_0x503471=_0x348afc[_0xdbc7e7(0x11f)]('params');let _0x57faa0;if(_0x503471)try{_0x57faa0=JSON[_0xdbc7e7(0x10c)](_0x503471);if(typeof _0x57faa0!==_0xdbc7e7(0xfb)||_0x57faa0===null||Array['isArray'](_0x57faa0))throw new Error('must\x20be\x20a\x20JSON\x20object');}catch(_0x5bf2d8){throw CliErrors[_0xdbc7e7(0x101)](_0xdbc7e7(0x123)+(_0x5bf2d8 instanceof Error?_0x5bf2d8[_0xdbc7e7(0xee)]:String(_0x5bf2d8)),_0xdbc7e7(0xf0));}let _0x2dd6ab;if(_0x156534){const _0x4625a1=_0x156534[_0xdbc7e7(0x108)](',')[_0xdbc7e7(0x10f)](_0x33f759=>_0x33f759[_0xdbc7e7(0x104)]())[_0xdbc7e7(0xec)](_0x212c5b=>_0x212c5b[_0xdbc7e7(0x103)]>0x0);if(_0x4625a1[_0xdbc7e7(0x103)]===0x0)throw CliErrors[_0xdbc7e7(0x101)]('--datasetcode\x20cannot\x20be\x20empty.');_0x2dd6ab=new Set(_0x4625a1),writeCliSideChannelLine('\x1b[90m*\x20Generating\x20docs\x20for:\x20'+_0x4625a1[_0xdbc7e7(0xf7)](',\x20')+_0xdbc7e7(0x107));}const _0x257fc9=a14_0x26387c(_0xdbc7e7(0xf6)+_0x348afc[_0xdbc7e7(0xf1)]+_0xdbc7e7(0x121))[_0xdbc7e7(0x102)]();let _0x3134b4;try{({configArray:_0x3134b4}=await fetchModelList(_0x348afc[_0xdbc7e7(0xf1)],_0x348afc[_0xdbc7e7(0xfc)]),_0x257fc9[_0xdbc7e7(0xeb)](_0xdbc7e7(0x105)+_0x3134b4['length']+_0xdbc7e7(0x116)));}catch(_0x4ea000){_0x257fc9[_0xdbc7e7(0xfd)](_0xdbc7e7(0x113));throw _0x4ea000;}if(_0x3134b4['length']===0x0)return writeCliSideChannelLine('!\x20No\x20datasets\x20found.'),{'ok':!![]};let _0x5302b0=_0x3134b4;if(_0x2dd6ab){_0x5302b0=_0x3134b4[_0xdbc7e7(0xec)](_0x4887db=>_0x2dd6ab['has'](_0x4887db[_0xdbc7e7(0x124)]));const _0x2ffa83=[..._0x2dd6ab]['filter'](_0x2f8a4e=>!_0x3134b4[_0xdbc7e7(0x120)](_0x465b9b=>_0x465b9b[_0xdbc7e7(0x124)]===_0x2f8a4e));_0x2ffa83['length']>0x0&&writeCliSideChannelLine(_0xdbc7e7(0x11e)+_0x2ffa83[_0xdbc7e7(0xf7)](',\x20')+_0xdbc7e7(0x107));if(_0x5302b0[_0xdbc7e7(0x103)]===0x0)throw CliErrors['validation']('None\x20of\x20the\x20specified\x20dataset\x20codes\x20exist:\x20'+[..._0x2dd6ab][_0xdbc7e7(0xf7)](',\x20'));writeCliSideChannelLine(_0xdbc7e7(0xe7)+_0x5302b0[_0xdbc7e7(0x103)]+_0xdbc7e7(0xfe)+_0x3134b4['length']+_0xdbc7e7(0xff));}let _0x35da28=0x0;const _0x1c5bbd=await generateDatasetDocs(_0x5302b0,_0x348afc['appCode'],_0x348afc[_0xdbc7e7(0xfc)],_0x380624,(_0x3ff315,_0x2e2842,_0x5792a0)=>{const _0x291969=_0xdbc7e7;_0x35da28=_0x3ff315,process[_0x291969(0xf9)][_0x291969(0xf5)](_0x291969(0x112)+String(_0x3ff315)[_0x291969(0xf4)](String(_0x2e2842)['length'])+'/'+_0x2e2842+']\x20'+_0x5792a0+_0x291969(0x125));},_0x57faa0);if(_0x35da28>0x0)process[_0xdbc7e7(0xf9)]['write']('\x0a');const _0x5ee5c5=_0x1c5bbd[_0xdbc7e7(0xec)](_0x21d02e=>_0x21d02e[_0xdbc7e7(0x106)])['length'],_0x29c799=_0x1c5bbd[_0xdbc7e7(0xec)](_0x31f0f7=>!_0x31f0f7[_0xdbc7e7(0x106)])[_0xdbc7e7(0x103)];writeCliSideChannelLine(''),writeCliSideChannelLine(_0xdbc7e7(0xf2)+_0x5ee5c5+'\x20doc(s)\x20in\x20'+_0x380624);if(_0x29c799>0x0){writeCliSideChannelLine('!\x20'+_0x29c799+'\x20doc(s)\x20failed');for(const _0x569cf4 of _0x1c5bbd[_0xdbc7e7(0xec)](_0x1eb717=>!_0x1eb717[_0xdbc7e7(0x106)])){writeCliSideChannelLine(_0xdbc7e7(0x122)+_0x569cf4[_0xdbc7e7(0x119)]+'\x20('+_0x569cf4[_0xdbc7e7(0x124)]+'):\x20'+_0x569cf4[_0xdbc7e7(0x100)]);}}return{'ok':_0x29c799===0x0,'message':_0x29c799>0x0?_0xdbc7e7(0xe9)+_0x5ee5c5+_0xdbc7e7(0x10d)+_0x29c799+_0xdbc7e7(0x110):_0xdbc7e7(0xf8)+_0x5ee5c5+'\x20file(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a15_0x36b4(_0x2c21ba,_0x1238a8){_0x2c21ba=_0x2c21ba-0x16d;const _0x302faf=a15_0x302f();let _0x36b4dd=_0x302faf[_0x2c21ba];return _0x36b4dd;}(function(_0xe2a3a7,_0x581cd2){const _0x4e40c4=a15_0x36b4,_0x2963bf=_0xe2a3a7();while(!![]){try{const _0x281301=-parseInt(_0x4e40c4(0x172))/0x1*(-parseInt(_0x4e40c4(0x174))/0x2)+-parseInt(_0x4e40c4(0x16e))/0x3*(-parseInt(_0x4e40c4(0x16d))/0x4)+-parseInt(_0x4e40c4(0x176))/0x5*(parseInt(_0x4e40c4(0x175))/0x6)+parseInt(_0x4e40c4(0x16f))/0x7+-parseInt(_0x4e40c4(0x173))/0x8+parseInt(_0x4e40c4(0x171))/0x9*(-parseInt(_0x4e40c4(0x170))/0xa)+parseInt(_0x4e40c4(0x177))/0xb;if(_0x281301===_0x581cd2)break;else _0x2963bf['push'](_0x2963bf['shift']());}catch(_0x1c03d4){_0x2963bf['push'](_0x2963bf['shift']());}}}(a15_0x302f,0x40ad6));import{apiList}from'../../commands/api/list.js';function a15_0x302f(){const _0x34756d=['2111283oZfzlm','27787qcUrlI','3226392mSwNkR','4dlDncw','3414knDKws','265UHlWxc','7542623NYpUDm','21580JWCwLv','195BMGhhP','529242JQFyyX','20scYSjN'];a15_0x302f=function(){return _0x34756d;};return a15_0x302f();}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 a16_0x1df0eb=a16_0x3f5d;(function(_0x1afc6d,_0xc5c086){const _0x398496=a16_0x3f5d,_0x169e9c=_0x1afc6d();while(!![]){try{const _0x55b0b5=-parseInt(_0x398496(0xa3))/0x1+-parseInt(_0x398496(0x92))/0x2+parseInt(_0x398496(0x98))/0x3+parseInt(_0x398496(0x9c))/0x4+-parseInt(_0x398496(0xa2))/0x5*(parseInt(_0x398496(0x96))/0x6)+-parseInt(_0x398496(0x9a))/0x7*(parseInt(_0x398496(0xa1))/0x8)+parseInt(_0x398496(0x9e))/0x9;if(_0x55b0b5===_0xc5c086)break;else _0x169e9c['push'](_0x169e9c['shift']());}catch(_0x134417){_0x169e9c['push'](_0x169e9c['shift']());}}}(a16_0x20d0,0xeea53));function a16_0x20d0(){const _0x17bffd=['env','read','6AvjFhY','list','351237GdaBPg','isDefault','9506AGvFnb','cookie','3069100bAEkRP','appcode','36270774LERZcd','List\x20all\x20datasets/models\x20for\x20the\x20configured\x20app(s)','push','5568VPJnfR','6924305adlYot','1073189TdPDXe','1067462SDoJBr','rawFlags'];a16_0x20d0=function(){return _0x17bffd;};return a16_0x20d0();}import{initEnv}from'../../constant/env.js';import{fetchModelList}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a16_0x3f5d(_0x91600d,_0x398850){_0x91600d=_0x91600d-0x92;const _0x20d0d8=a16_0x20d0();let _0x3f5d40=_0x20d0d8[_0x91600d];return _0x3f5d40;}import{resolveTargetApps}from'../../commands/api/shared.js';export const apiList={'service':'api','command':a16_0x1df0eb(0x97),'description':a16_0x1df0eb(0x9f),'risk':a16_0x1df0eb(0x95),'requiresAppCode':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':'global','type':'boolean','description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]}],async 'execute'(_0x13e9e8){const _0x259e37=a16_0x1df0eb,_0x2986a1=_0x13e9e8[_0x259e37(0x93)][_0x259e37(0x9d)]?String(_0x13e9e8[_0x259e37(0x93)]['appcode']):undefined,_0x49cd97=resolveTargetApps(_0x13e9e8,_0x2986a1);if(_0x49cd97){const _0x509dfe=[];for(const _0x4a0e93 of _0x49cd97){const _0x48f00d=_0x4a0e93[_0x259e37(0x9b)]||_0x13e9e8['cookie'],_0x10c6c1=_0x4a0e93[_0x259e37(0x94)]||'production';initEnv(_0x10c6c1);const {configArray:_0x2d23a5}=await fetchModelList(_0x4a0e93[_0x259e37(0x9d)],_0x48f00d);_0x509dfe[_0x259e37(0xa0)](..._0x2d23a5['map'](_0x3dfe12=>({..._0x3dfe12,'_appName':_0x4a0e93['name'],'_appCode':_0x4a0e93[_0x259e37(0x9d)],'_env':_0x10c6c1,'_isDefault':_0x4a0e93[_0x259e37(0x99)]})));}return{'ok':!![],'data':_0x509dfe};}const {configArray:_0x45b452}=await fetchModelList(_0x13e9e8['appCode'],_0x13e9e8['cookie']);return{'ok':!![],'data':_0x45b452};}};
|
package/lib/commands/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a17_0x5707d5=a17_0x5225;(function(_0x4dd1a0,_0x5a40f7){const _0x537b00=a17_0x5225,_0x10467f=_0x4dd1a0();while(!![]){try{const _0x5c4c66=-parseInt(_0x537b00(0x1b9))/0x1+parseInt(_0x537b00(0x1e1))/0x2*(parseInt(_0x537b00(0x1e8))/0x3)+-parseInt(_0x537b00(0x1dc))/0x4*(-parseInt(_0x537b00(0x1bf))/0x5)+-parseInt(_0x537b00(0x1e3))/0x6*(parseInt(_0x537b00(0x1de))/0x7)+-parseInt(_0x537b00(0x1ca))/0x8*(parseInt(_0x537b00(0x1d9))/0x9)+parseInt(_0x537b00(0x1c3))/0xa*(parseInt(_0x537b00(0x1d0))/0xb)+-parseInt(_0x537b00(0x1e6))/0xc;if(_0x5c4c66===_0x5a40f7)break;else _0x10467f['push'](_0x10467f['shift']());}catch(_0x5e77c3){_0x10467f['push'](_0x10467f['shift']());}}}(a17_0x2bfb,0xaf835));import a17_0x548c6e from'ora';import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../core/api-client.js';import{generateApiFile}from'../../api/generate-api-file.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a17_0x2bfb(){const _0x2144b1=['25pChDtI','start','appCode','env','10iINFWY','\x20failed','global','Failed:\x20','sdkConfigPath','fail','\x20\x20•\x20','461016hDsdbt','Merge\x20data.models\x20into\x20existing\x20TypeScript\x20(see\x20skills/rabetbase/guides/sdk-client-generation.md).\x20Do\x20not\x20treat\x20a\x20partial\x20scaffold\x20as\x20complete.','boolean','clientFilePath',')...','join','12665389VrGbPu','files','appcode','Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','isDefault','read','rawFlags','\x20dataset(s),\x20refreshed\x20sdk-config.ts.\x20','string','99FOEkFD','\x20succeeded,\x20','apiDir','621968zyXHbZ','apiFilePath','84JNpxlK','configName','Pulling\x20','42IVeuSf','Done:\x20','233562obbmQJ','Output\x20directory\x20(default:\x20','message','8997864dwsZCL','includes','166617dNzWIC','Pulled\x20','sdkRouting','str','name','production','cookie','needsAgentMerge','output','\x20dataset(s),\x20wrote\x20scaffold\x20with\x20','\x20app(s)\x20failed','525434RHdlGp','slice','pull','modelCount','succeed','isDefaultConfig'];a17_0x2bfb=function(){return _0x2144b1;};return a17_0x2bfb();}import{DEFAULT_API_DIR}from'../../constant/paths.js';import{resolveTargetApps}from'../../commands/api/shared.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getSdkClientRoutingConfig}from'../../constant/domain.js';const EXISTING_TS_HINT=a17_0x5707d5(0x1cb);function a17_0x5225(_0x2ec386,_0x1ed6fc){_0x2ec386=_0x2ec386-0x1b2;const _0x2bfba4=a17_0x2bfb();let _0x522529=_0x2bfba4[_0x2ec386];return _0x522529;}function toPullData(_0x16419e){const _0x30860a=a17_0x5707d5;return{'appCode':_0x16419e['appCode'],'configName':_0x16419e[_0x30860a(0x1df)],'isDefaultConfig':_0x16419e[_0x30860a(0x1be)],'models':_0x16419e['models'],'sdkRouting':_0x16419e[_0x30860a(0x1ea)],'files':_0x16419e[_0x30860a(0x1d1)],'needsAgentMerge':_0x16419e['needsAgentMerge'],'apiFilePath':_0x16419e[_0x30860a(0x1dd)],'clientFilePath':_0x16419e[_0x30860a(0x1cd)],'sdkConfigPath':_0x16419e['sdkConfigPath'],'datasetCount':_0x16419e[_0x30860a(0x1bc)],'modelCount':_0x16419e[_0x30860a(0x1bc)]};}function describePull(_0xab01d9){const _0x1c3e7b=a17_0x5707d5;if(_0xab01d9[_0x1c3e7b(0x1b5)])return _0x1c3e7b(0x1e9)+_0xab01d9['modelCount']+_0x1c3e7b(0x1d7)+EXISTING_TS_HINT;return _0x1c3e7b(0x1e9)+_0xab01d9[_0x1c3e7b(0x1bc)]+_0x1c3e7b(0x1b7)+_0xab01d9[_0x1c3e7b(0x1bc)]+'\x20model(s)';}export const apiPull={'service':'api','command':a17_0x5707d5(0x1bb),'description':'Pull\x20dataset\x20facts,\x20refresh\x20sdk-config.ts,\x20and\x20write\x20API\x20scaffold\x20if\x20missing\x20('+DEFAULT_API_DIR+'/)','risk':a17_0x5707d5(0x1d5),'requiresAppCode':!![],'hasFormat':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a17_0x5707d5(0x1b6),'type':a17_0x5707d5(0x1d8),'description':a17_0x5707d5(0x1e4)+DEFAULT_API_DIR+'/)'},{'name':a17_0x5707d5(0x1c5),'type':a17_0x5707d5(0x1cc),'description':a17_0x5707d5(0x1d3),'default':![]}],async 'execute'(_0x5d8230){const _0x354409=a17_0x5707d5,_0x4ca297=_0x5d8230[_0x354409(0x1d6)]['appcode']?String(_0x5d8230['rawFlags']['appcode']):undefined,_0x31a1d3=_0x5d8230[_0x354409(0x1eb)]('output')||undefined,_0x5d4f66=resolveTargetApps(_0x5d8230,_0x4ca297);if(_0x5d4f66){let _0x3be4bf=0x0,_0x3e723e=0x0;const _0x271ed9=[];for(const _0x2c38fb of _0x5d4f66){const _0x4d2f52=_0x2c38fb['cookie']||_0x5d8230[_0x354409(0x1b4)],_0xfc247f=_0x2c38fb[_0x354409(0x1c2)]||_0x354409(0x1b3);initEnv(_0xfc247f);const _0x25bd09=_0x2c38fb[_0x354409(0x1db)]||_0x31a1d3||_0x5d8230[_0x354409(0x1db)]||DEFAULT_API_DIR,_0x2050ee=_0x2c38fb[_0x354409(0x1d4)]?'':_0x2c38fb[_0x354409(0x1b2)]||_0x2c38fb[_0x354409(0x1d2)],_0x13133e=a17_0x548c6e(_0x354409(0x1e0)+_0x2c38fb['name']+'\x20('+_0x2c38fb[_0x354409(0x1d2)]+_0x354409(0x1ce))[_0x354409(0x1c0)]();try{const {configArray:_0x4f860a}=await fetchModelList(_0x2c38fb[_0x354409(0x1d2)],_0x4d2f52),_0x5aa200=await generateApiFile(_0x4f860a,_0x2050ee,_0x2c38fb[_0x354409(0x1d2)],_0x2c38fb[_0x354409(0x1d4)],_0xfc247f,_0x25bd09,_0x2c38fb[_0x354409(0x1b2)],getSdkClientRoutingConfig());_0x13133e[_0x354409(0x1bd)](_0x2c38fb[_0x354409(0x1b2)]+':\x20'+describePull(_0x5aa200)),writeCliSideChannelLine('\x20\x20•\x20'+_0x5aa200[_0x354409(0x1c7)]),writeCliSideChannelLine(_0x354409(0x1c9)+_0x5aa200[_0x354409(0x1dd)]),writeCliSideChannelLine('\x20\x20•\x20'+_0x5aa200[_0x354409(0x1cd)]),_0x271ed9['push'](toPullData(_0x5aa200)),_0x3be4bf++;}catch(_0x9cb4da){_0x13133e[_0x354409(0x1c8)](_0x2c38fb['name']+':\x20'+(_0x9cb4da instanceof Error?_0x9cb4da[_0x354409(0x1e5)]:String(_0x9cb4da))),_0x3e723e++;}}writeCliSideChannelLine('');if(_0x3e723e>0x0)writeCliSideChannelLine('!\x20'+_0x3e723e+_0x354409(0x1b8));return{'ok':_0x3e723e===0x0,'message':_0x354409(0x1e2)+_0x3be4bf+_0x354409(0x1da)+_0x3e723e+_0x354409(0x1c4),'data':{'apps':_0x271ed9,'succeeded':_0x3be4bf,'failed':_0x3e723e}};}const _0x5413b4=_0x4ca297&&_0x4ca297[_0x354409(0x1e7)]('-')?_0x4ca297['split']('-')[_0x354409(0x1ba)](0x1)[_0x354409(0x1cf)]('-'):'',_0x44607d=_0x31a1d3||_0x5d8230[_0x354409(0x1db)]||DEFAULT_API_DIR,_0x5de0ed=!_0x4ca297,_0x3f6aed=a17_0x548c6e('Pulling\x20API\x20config\x20for\x20'+_0x5d8230['appCode']+'...')[_0x354409(0x1c0)]();try{const {configArray:_0x1c8b9c}=await fetchModelList(_0x5d8230[_0x354409(0x1c1)],_0x5d8230[_0x354409(0x1b4)]),_0x5573cb=await generateApiFile(_0x1c8b9c,_0x5413b4,_0x5d8230['appCode'],_0x5de0ed,getEnv(),_0x44607d,undefined,getSdkClientRoutingConfig());return _0x3f6aed[_0x354409(0x1bd)](describePull(_0x5573cb)),writeCliSideChannelLine('\x20\x20•\x20'+_0x5573cb[_0x354409(0x1c7)]),writeCliSideChannelLine('\x20\x20•\x20'+_0x5573cb[_0x354409(0x1dd)]),writeCliSideChannelLine(_0x354409(0x1c9)+_0x5573cb['clientFilePath']),{'ok':!![],'message':describePull(_0x5573cb),'data':toPullData(_0x5573cb)};}catch(_0x450845){_0x3f6aed['fail'](_0x354409(0x1c6)+(_0x450845 instanceof Error?_0x450845[_0x354409(0x1e5)]:String(_0x450845)));throw _0x450845;}}};
|