@lovrabet/lovrabet-cli 2.3.12-beta.1 → 2.3.13-beta.1
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 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/metric/contract.d.ts +8 -0
- package/lib/commands/metric/contract.js +1 -0
- package/lib/commands/metric/definition.d.ts +35 -0
- package/lib/commands/metric/definition.js +1 -0
- package/lib/commands/metric/detail.d.ts +2 -0
- package/lib/commands/metric/detail.js +1 -0
- package/lib/commands/metric/exec.d.ts +2 -0
- package/lib/commands/metric/exec.js +1 -0
- package/lib/commands/metric/index.d.ts +1 -0
- package/lib/commands/metric/index.js +1 -0
- package/lib/commands/metric/list.d.ts +2 -0
- package/lib/commands/metric/list.js +1 -0
- package/lib/commands/metric/shared.d.ts +17 -0
- package/lib/commands/metric/shared.js +1 -0
- package/lib/commands/notification/config-list.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/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.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/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +4 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.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/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.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/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +5 -2
- package/skills/lovrabet/SKILL.md +12 -4
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +2 -0
- package/skills/lovrabet/guides/development-intent-handoff.md +19 -3
- package/skills/lovrabet/guides/metric-consumption.md +134 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-auth.md +4 -0
- package/skills/lovrabet/references/lovrabet-schedule-workflow.md +16 -0
- package/skills/lovrabet/references/lovrabet-skill-authoring.md +27 -0
- package/skills/lovrabet-report-generation/SKILL.md +28 -0
- package/skills/lovrabet-report-generation/references/business-skill-reuse.md +19 -0
- package/skills/lovrabet-report-generation/references/quality-checks.md +16 -0
- package/skills/lovrabet-report-generation/references/report-workflow.md +42 -0
- package/skills/lovrabet-report-generation/templates/report-outline.md +10 -0
- package/skills/lovrabet.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x5722d3=a27_0x1be6;(function(_0x5d1ae5,_0x3f8851){const _0x3f6ecf=a27_0x1be6,_0x27701d=_0x5d1ae5();while(!![]){try{const _0x39e7f3=parseInt(_0x3f6ecf(0x12b))/0x1+parseInt(_0x3f6ecf(0x152))/0x2*(parseInt(_0x3f6ecf(0x13b))/0x3)+parseInt(_0x3f6ecf(0x13f))/0x4*(parseInt(_0x3f6ecf(0x14e))/0x5)+-parseInt(_0x3f6ecf(0x154))/0x6+-parseInt(_0x3f6ecf(0x18d))/0x7*(parseInt(_0x3f6ecf(0x141))/0x8)+parseInt(_0x3f6ecf(0x128))/0x9*(-parseInt(_0x3f6ecf(0x18a))/0xa)+-parseInt(_0x3f6ecf(0x171))/0xb;if(_0x39e7f3===_0x3f8851)break;else _0x27701d['push'](_0x27701d['shift']());}catch(_0x26c2ee){_0x27701d['push'](_0x27701d['shift']());}}}(a27_0x2a56,0x2d3ac));import{dataImportExcel}from'./import-excel.js';function a27_0x1be6(_0x4b6823,_0x2760b2){_0x4b6823=_0x4b6823-0x128;const _0x2a5618=a27_0x2a56();let _0x1be6ec=_0x2a5618[_0x4b6823];return _0x1be6ec;}import{executeData}from'../../core/sdk-client.js';function a27_0x2a56(){const _0x1c5bd2=['\x20\x20\x20\x20DB_TABLE:\x20inspect\x20dataset\x20detail,\x20validate\x20the\x20full\x20file\x20and\x20confirmed\x20unique\x20business\x20keys,','/api/{appCode}/','1507968gxwuRa','create','filter','Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27','now','\x20\x20AGGREGATE\x20TYPES','dryRun','Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','paramsHint','Update\x20an\x20existing\x20data\x20record','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','batch','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\x20\x20\x20\x20Non-Excel\x20batchCreate\x20remains\x20available\x20for\x20METADATA\x20and\x20DB_TABLE.','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20Built-in\x20Skill\x20guide:\x20references/lovrabet-db-table-excel-import.md','Create\x20one\x20record\x20in\x20the\x20dataset','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','30KspOgj','Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','625268Pcstes','\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','command','aggregate','\x20\x20WHERE\x20OPERATORS','\x20\x20DATASET\x20BOUNDARY','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','872766zJnmBC','\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','352056nRmexi','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','data','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','\x20\x20\x20\x20Stop\x20on\x20unknown\x20outcomes\x20or\x20conflicts;\x20reconcile\x20before\x20retrying,\x20never\x20blindly\x20resend\x20a\x20batch.','\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged','\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20then\x20convert\x20rows\x20to\x20JSON\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20and\x20local\x20argument\x20limits.','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','Filter\x20dataset\x20records\x20with\x20query\x20conditions','read','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','237lIfWaO','\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}','paramsRequired','4wYjJgJ','\x20\x20\x20\x20METADATA:\x20use\x20lovrabet\x20data\x20import-excel\x20with\x20checkpoint\x20recovery.','8dxlfEF','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','confirmationDescription','Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','update','\x20on\x20dataset\x20','write','risk','code','\x20\x20LOGICAL\x20COMBINATORS','delete','\x20\x20PAGINATION','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','575095FawlpR','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter','batchCreate','6782tskJuP','\x20\x20EXAMPLES','194220hHDoUX','length','Preview:\x20data\x20','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','body','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY','POST','helpExtra','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','data\x20','join','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','params','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','description','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','operation','str','\x20\x20\x20\x20--dry-run\x20previews\x20the\x20request\x20only;\x20it\x20does\x20not\x20validate\x20server\x20constraints\x20or\x20write\x20permissions.','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)'];a27_0x2a56=function(){return _0x1c5bd2;};return a27_0x2a56();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a27_0x5722d3(0x173),'operation':'filter','risk':a27_0x5722d3(0x138),'paramsRequired':![],'description':a27_0x5722d3(0x137),'paramsHint':a27_0x5722d3(0x135)+a27_0x5722d3(0x18c),'helpExtra':[a27_0x5722d3(0x191),a27_0x5722d3(0x13c),a27_0x5722d3(0x12a),a27_0x5722d3(0x13a),a27_0x5722d3(0x189),a27_0x5722d3(0x13d),a27_0x5722d3(0x15c),a27_0x5722d3(0x193),a27_0x5722d3(0x133),a27_0x5722d3(0x131),a27_0x5722d3(0x167),'',a27_0x5722d3(0x14a),a27_0x5722d3(0x194),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','',a27_0x5722d3(0x187),a27_0x5722d3(0x16e),a27_0x5722d3(0x16d),a27_0x5722d3(0x142),a27_0x5722d3(0x15f),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a27_0x5722d3(0x14c),'\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.','\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.',a27_0x5722d3(0x130),a27_0x5722d3(0x12c),a27_0x5722d3(0x18e),'\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.'][a27_0x5722d3(0x15e)]('\x0a')},{'command':'getOne','operation':'getOne','risk':'read','paramsRequired':!![],'description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsHint':a27_0x5722d3(0x163)},{'command':a27_0x5722d3(0x172),'operation':'create','risk':a27_0x5722d3(0x147),'paramsRequired':!![],'description':a27_0x5722d3(0x185),'confirmationDescription':a27_0x5722d3(0x18b),'paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a27_0x5722d3(0x151),'operation':'batchCreate','risk':a27_0x5722d3(0x147),'paramsRequired':!![],'description':'Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','helpExtra':['\x20\x20EXCEL\x20ROUTES',a27_0x5722d3(0x140),a27_0x5722d3(0x16f),a27_0x5722d3(0x134),'\x20\x20\x20\x20This\x20command\x20sends\x20one\x20prepared\x20batch;\x20it\x20does\x20not\x20read\x20XLSX\x20or\x20split\x20batches.',a27_0x5722d3(0x16c),'\x20\x20\x20\x20Record\x20each\x20batch\x20and\x20verify\x20its\x20IDs\x20or\x20unique\x20business\x20keys\x20before\x20continuing.',a27_0x5722d3(0x12f),'\x20\x20\x20\x20No\x20import\x20checkpoint,\x20--resume,\x20automatic\x20upsert,\x20or\x20atomic\x20rollback\x20guarantee.',a27_0x5722d3(0x184),a27_0x5722d3(0x180)][a27_0x5722d3(0x15e)]('\x0a'),'confirmationDescription':'Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':'JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27'},{'command':a27_0x5722d3(0x145),'operation':'update','risk':a27_0x5722d3(0x147),'paramsRequired':!![],'description':a27_0x5722d3(0x17b),'confirmationDescription':'Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':'JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20'+a27_0x5722d3(0x174)},{'command':a27_0x5722d3(0x14b),'operation':a27_0x5722d3(0x14b),'risk':'high-risk-write','paramsRequired':!![],'description':a27_0x5722d3(0x178),'confirmationDescription':'Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','paramsHint':a27_0x5722d3(0x163)},{'command':a27_0x5722d3(0x190),'operation':a27_0x5722d3(0x190),'risk':a27_0x5722d3(0x138),'paramsRequired':![],'description':a27_0x5722d3(0x144),'paramsHint':a27_0x5722d3(0x168)+a27_0x5722d3(0x136),'helpExtra':[a27_0x5722d3(0x176),a27_0x5722d3(0x17d),a27_0x5722d3(0x181),a27_0x5722d3(0x179),'\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a27_0x5722d3(0x188),a27_0x5722d3(0x12e),a27_0x5722d3(0x162),'',a27_0x5722d3(0x139),a27_0x5722d3(0x161),a27_0x5722d3(0x169),a27_0x5722d3(0x157),a27_0x5722d3(0x132),'\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}',a27_0x5722d3(0x186),'',a27_0x5722d3(0x159),a27_0x5722d3(0x166),a27_0x5722d3(0x14f),a27_0x5722d3(0x17c),'',a27_0x5722d3(0x192),a27_0x5722d3(0x129),'\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL',a27_0x5722d3(0x17f),'\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','',a27_0x5722d3(0x153),a27_0x5722d3(0x183),a27_0x5722d3(0x165),'',a27_0x5722d3(0x150),a27_0x5722d3(0x14d),'',a27_0x5722d3(0x182)][a27_0x5722d3(0x15e)]('\x0a')}];function makeDataCommand(_0x536467){const _0x57fad4=a27_0x5722d3,_0x34922c=_0x57fad4(0x15d)+_0x536467[_0x57fad4(0x18f)],_0x3c69e2={'service':_0x57fad4(0x12d),'command':_0x536467['command'],'description':_0x536467[_0x57fad4(0x164)],'risk':_0x536467[_0x57fad4(0x148)],..._0x536467[_0x57fad4(0x143)]?{'confirmationDescription':_0x536467[_0x57fad4(0x143)]}:{},'helpExtra':_0x536467[_0x57fad4(0x15b)],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x536467[_0x57fad4(0x17a)]}],'validate':async _0x22893a=>{const _0x45003f=_0x57fad4;_0x536467[_0x45003f(0x13e)]&&requireAnyOf(_0x22893a,['params'],_0x34922c),_0x536467['operation']===_0x45003f(0x151)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x22893a[_0x45003f(0x16b)](_0x45003f(0x160)))),_0x536467['operation']==='update'&&parseUpdateIdsFromParams(parseJsonParams(_0x22893a[_0x45003f(0x16b)]('params'))??{});},async 'execute'(_0x100a71){const _0x1fc6e4=_0x57fad4,_0x12d482=_0x100a71['str']('code'),_0x2b73f8=_0x536467[_0x1fc6e4(0x16a)]===_0x1fc6e4(0x151)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x100a71[_0x1fc6e4(0x16b)](_0x1fc6e4(0x160)))):parseJsonParams(_0x100a71[_0x1fc6e4(0x16b)](_0x1fc6e4(0x160)))??{},_0x5913de=_0x536467[_0x1fc6e4(0x16a)]===_0x1fc6e4(0x145)?parseUpdateIdsFromParams(_0x2b73f8):undefined,_0x6db3d7=_0x5913de?normalizeUpdateParamsForRuntime(_0x2b73f8,_0x5913de):_0x2b73f8,_0xfdaf8e=Date[_0x1fc6e4(0x175)](),_0x2e5d6d=await executeData(_0x12d482,_0x536467[_0x1fc6e4(0x16a)],_0x6db3d7),_0x2e58b1=Date[_0x1fc6e4(0x175)]()-_0xfdaf8e,_0x2feaad=_0x5913de&&_0x5913de['length']>0x1?buildBatchUpdateResult(_0x5913de,_0x2e5d6d):_0x2e5d6d;return{'ok':!![],'data':{'result':_0x2feaad,'elapsed':_0x2e58b1},'message':_0x1fc6e4(0x15d)+_0x536467[_0x1fc6e4(0x18f)]+'\x20completed\x20in\x20'+_0x2e58b1+'ms'};}};return _0x536467['risk']!==_0x57fad4(0x138)&&(_0x3c69e2[_0x57fad4(0x177)]=async _0x1bf82e=>{const _0x5a1268=_0x57fad4,_0x36d1ad=_0x1bf82e['str'](_0x5a1268(0x149)),_0x864e8c=_0x536467[_0x5a1268(0x16a)]===_0x5a1268(0x151)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x1bf82e['str'](_0x5a1268(0x160)))):parseJsonParams(_0x1bf82e[_0x5a1268(0x16b)]('params'))??{};let _0x12c3ec=_0x864e8c;if(_0x536467['operation']===_0x5a1268(0x145)){const _0x14ef1b=parseUpdateIdsFromParams(_0x864e8c);_0x12c3ec=normalizeUpdateParamsForRuntime(_0x864e8c,_0x14ef1b);}return dryRun(_0x5a1268(0x15a),_0x5a1268(0x170)+_0x36d1ad+'/'+_0x536467[_0x5a1268(0x16a)])[_0x5a1268(0x158)](_0x12c3ec)[_0x5a1268(0x164)](_0x5a1268(0x156)+_0x536467[_0x5a1268(0x18f)]+_0x5a1268(0x146)+_0x36d1ad)['build']();}),_0x3c69e2;}export const dataDefinitions=[...specs['map'](makeDataCommand),dataImportExcel];function buildBatchUpdateResult(_0x18d3c6,_0x47d469){const _0x27df6e=a27_0x5722d3;return{'operation':_0x27df6e(0x145),'mode':_0x27df6e(0x17e),'ids':_0x18d3c6,'total':_0x18d3c6[_0x27df6e(0x155)],'result':_0x47d469};}
|
|
1
|
+
const a27_0x12da9e=a27_0x3165;function a27_0x3165(_0x2be670,_0x78f1ec){_0x2be670=_0x2be670-0x89;const _0x202382=a27_0x2023();let _0x3165a4=_0x202382[_0x2be670];return _0x3165a4;}(function(_0x1b14c,_0x400200){const _0x46b275=a27_0x3165,_0x3d6ca0=_0x1b14c();while(!![]){try{const _0x49a9d5=parseInt(_0x46b275(0xca))/0x1*(-parseInt(_0x46b275(0x8f))/0x2)+-parseInt(_0x46b275(0xcf))/0x3+parseInt(_0x46b275(0xc9))/0x4+-parseInt(_0x46b275(0xc0))/0x5*(-parseInt(_0x46b275(0x90))/0x6)+parseInt(_0x46b275(0xbb))/0x7+-parseInt(_0x46b275(0xe9))/0x8+parseInt(_0x46b275(0xd1))/0x9*(parseInt(_0x46b275(0xd9))/0xa);if(_0x49a9d5===_0x400200)break;else _0x3d6ca0['push'](_0x3d6ca0['shift']());}catch(_0x2487de){_0x3d6ca0['push'](_0x3d6ca0['shift']());}}}(a27_0x2023,0x3caff));import{dataImportExcel}from'./import-excel.js';import{executeData}from'../../core/sdk-client.js';function a27_0x2023(){const _0x4e9174=['\x20\x20\x20\x20$and\x20\x20\x20\x20\x20\x20\x20\x20\x20All\x20conditions\x20match\x20\x20\x20{\x22$and\x22:[{\x22age\x22:{\x22$gte\x22:18}},{\x22status\x22:{\x22$eq\x22:\x22active\x22}}]}','\x20\x20\x20\x20aggregate[].alias\x20defines\x20the\x20output\x20field\x20name\x20only','/api/{appCode}/','\x20\x20\x20\x20Page\x201:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','confirmationDescription','\x20\x20\x20\x20Page\x202:\x20--params\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22orderBy\x22:[{\x22id\x22:\x22asc\x22}],\x22currentPage\x22:2,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20aggregate\x20supports\x20a\x20single\x20DB_TABLE\x20dataset\x20only','1306084QkzXIM','32777ihSmpE','create','\x20\x20\x20\x20#\x20Sum\x20amount\x20grouped\x20by\x20status','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Rounded\x20average\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg\x22,\x22round\x22:true,\x22precision\x22:2}','\x20\x20\x20\x20and\x20increment\x20only\x20currentPage.\x20Use\x20a\x20stable\x20unique\x20orderBy\x20field\x20to\x20avoid\x20duplicates\x20or\x20gaps.','568428JyUnoK','update','107253TlfuoM','Changes\x20an\x20existing\x20business\x20record\x20in\x20the\x20current\x20app\x20dataset.\x20The\x20new\x20values\x20are\x20saved\x20immediately\x20after\x20confirmation.','\x20\x20\x20\x20$contain\x20\x20\x20\x20\x20Substring\x20match\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$contain\x22:\x22test\x22}}','\x20\x20\x20\x20Record\x20each\x20batch\x20and\x20verify\x20its\x20IDs\x20or\x20unique\x20business\x20keys\x20before\x20continuing.','getOne','\x20\x20\x20\x20$lte\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20or\x20equal\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lte\x22:1000}}','Writes\x20multiple\x20new\x20business\x20records\x20to\x20the\x20current\x20app\x20dataset.\x20They\x20are\x20saved\x20immediately\x20after\x20confirmation.','code','380LyGUNG','\x20\x20\x20\x20JOIN\x20and\x20cross-table\x20aggregation\x20require\x20an\x20existing\x20trusted\x20Custom\x20SQL','\x20\x20\x20\x20This\x20command\x20sends\x20one\x20prepared\x20batch;\x20it\x20does\x20not\x20read\x20XLSX\x20or\x20split\x20batches.','Filter\x20dataset\x20records\x20with\x20query\x20conditions','JSON\x20array\x20of\x20record\x20objects,\x20or\x20{\x22items\x22:[...]}.\x20Example:\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','\x20\x20\x20\x20Built-in\x20Skill\x20guide:\x20references/lovrabet-db-table-excel-import.md','Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','Example:\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x20\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','operation','\x20\x20\x20\x20MAX\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Maximum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MAX\x22,\x22alias\x22:\x22max_price\x22}','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20','\x20\x20\x20\x20then\x20convert\x20rows\x20to\x20JSON\x20and\x20split\x20within\x20the\x20target\x20API\x20row/byte\x20and\x20local\x20argument\x20limits.','Preview:\x20data\x20','delete','\x20\x20\x20\x20METADATA:\x20use\x20lovrabet\x20data\x20import-excel\x20with\x20checkpoint\x20recovery.','batchCreate','2721704yRmOkm','\x20\x20\x20\x20$gt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$gt\x22:100}}','\x20\x20PAGINATION','\x20\x20\x20\x20groupBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Grouping\x20fields,\x20e.g.\x20[\x22status\x22,\x22region\x22]','\x20\x20\x20\x20Stop\x20on\x20unknown\x20outcomes\x20or\x20conflicts;\x20reconcile\x20before\x20retrying,\x20never\x20blindly\x20resend\x20a\x20batch.','\x20\x20\x20\x20select/where/having/groupBy\x20must\x20use\x20real\x20dataset\x20fields','write','JSON\x20with\x20id\x20+\x20fields\x20to\x20update.\x20id\x20may\x20be\x20a\x20single\x20value\x20or\x20array.\x20','\x20\x20\x20\x20Verify\x20the\x20response\x20paging.currentPage/pageSize\x20and\x20that\x20tableData\x20satisfies\x20where\x20before\x20drawing\x20conclusions.','join','\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20of\x20records\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}','description','params','\x20\x20\x20\x20choose\x20the\x20capability\x20before\x20execution;\x20never\x20fall\x20back\x20at\x20runtime','read','\x20\x20PARAMS\x20STRUCTURE','\x20\x20\x20\x20MIN\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Minimum\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22price\x22,\x22type\x22:\x22MIN\x22,\x22alias\x22:\x22min_price\x22}','\x20\x20\x20\x20Filtering\x20and\x20pagination\x20are\x20controlled\x20only\x20via\x20one\x20JSON\x20object\x20in\x20--params.','\x20\x20\x20\x20aggregate\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Aggregation\x20definitions\x20(see\x20AGGREGATE\x20TYPES\x20above)','\x20completed\x20in\x20','22iyPLam','183438USQSnR','\x20\x20WHERE\x20OPERATORS','aggregate','\x20\x20\x20\x20$ne\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Not\x20equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22status\x22:{\x22$ne\x22:\x22deleted\x22}}','data','filter','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','\x20\x20AGGREGATE\x20TYPES','\x20\x20\x20\x20having\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Post-aggregation\x20filters\x20using\x20real\x20dataset\x20fields,\x20e.g.\x20{\x22category_id\x22:{\x22$notNull\x22:true}}','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','build','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Pre-aggregation\x20filter\x20(same\x20operators\x20as\x20data\x20filter)','data\x20','Update\x20an\x20existing\x20data\x20record','\x20\x20\x20\x20$in\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Value\x20in\x20set\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22country\x22:{\x22$in\x22:[\x22CN\x22,\x22US\x22]}}','\x20\x20\x20\x20METADATA\x20datasets\x20do\x20not\x20support\x20aggregate\x20or\x20Custom\x20SQL','\x20\x20AGGREGATE\x20ALIAS\x20BOUNDARY','\x20\x20\x20\x20#\x20`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','\x20\x20\x20\x20--dry-run\x20previews\x20the\x20request\x20only;\x20it\x20does\x20not\x20validate\x20server\x20constraints\x20or\x20write\x20permissions.','Get\x20a\x20single\x20record\x20by\x20ID','\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[\x22region\x22],\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}}}\x27','\x20\x20\x20\x20Non-Excel\x20batchCreate\x20remains\x20available\x20for\x20METADATA\x20and\x20DB_TABLE.','\x20\x20\x20\x20SUM\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Sum\x20of\x20column\x20values\x20\x20\x20\x20\x20{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}','Deletes\x20business\x20records\x20from\x20the\x20current\x20app\x20dataset.\x20This\x20may\x20not\x20be\x20recoverable.','JSON\x20body\x20for\x20aggregate\x20API.\x20Fields:\x20select,\x20aggregate,\x20where,\x20groupBy,\x20having,\x20orderBy.\x20','Create\x20multiple\x20records\x20in\x20the\x20dataset\x20in\x20one\x20request','command','str','length','paramsRequired','\x20\x20\x20\x20Page\x20numbers\x20start\x20at\x201.\x20To\x20fetch\x20the\x20next\x20page,\x20keep\x20where/select/orderBy/pageSize\x20unchanged','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20orderBy\x20may\x20reference\x20aggregate\x20output\x20aliases','\x20\x20EXCEL\x20ROUTES','paramsHint','body','\x20\x20\x20\x20$gte\x20\x20\x20\x20\x20\x20\x20\x20\x20Greater\x20than\x20or\x20equal\x20\x20{\x22amount\x22:{\x22$gte\x22:100}}','\x20on\x20dataset\x20','dryRun','\x20\x20\x20\x20Do\x20NOT\x20use\x20--where,\x20--select,\x20--order-by,\x20--current-page,\x20--page,\x20or\x20--page-size\x20as\x20CLI\x20flags.','\x20\x20EXAMPLES','\x20\x20\x20\x20DB_TABLE:\x20inspect\x20dataset\x20detail,\x20validate\x20the\x20full\x20file\x20and\x20confirmed\x20unique\x20business\x20keys,','\x20\x20LOGICAL\x20COMBINATORS','1446053pnzjjZ','Create\x20one\x20record\x20in\x20the\x20dataset','batch','now','\x20\x20\x20\x20No\x20import\x20checkpoint,\x20--resume,\x20automatic\x20upsert,\x20or\x20atomic\x20rollback\x20guarantee.','25YQWbAW','\x20\x20\x20\x20$lt\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Less\x20than\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22amount\x22:{\x22$lt\x22:1000}}'];a27_0x2023=function(){return _0x4e9174;};return a27_0x2023();}import{CODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{requireAnyOf}from'../../commands/common/constraints.js';import{parseJsonParams,parseJsonParamsValue,parseBatchCreateItemsFromParams,parseUpdateIdsFromParams,normalizeUpdateParamsForRuntime}from'../../utils/params.js';import{dryRun}from'../../framework/dryrun.js';const specs=[{'command':a27_0x12da9e(0x95),'operation':a27_0x12da9e(0x95),'risk':a27_0x12da9e(0x89),'paramsRequired':![],'description':a27_0x12da9e(0xdc),'paramsHint':a27_0x12da9e(0xe3)+a27_0x12da9e(0xdf),'helpExtra':[a27_0x12da9e(0x91),'\x20\x20\x20\x20$eq\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Equals\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22age\x22:{\x22$eq\x22:18}}',a27_0x12da9e(0x93),a27_0x12da9e(0xea),a27_0x12da9e(0xb4),a27_0x12da9e(0xc1),a27_0x12da9e(0xd6),a27_0x12da9e(0x9e),a27_0x12da9e(0xd3),'\x20\x20\x20\x20$startWith\x20\x20\x20Starts\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22name\x22:{\x22$startWith\x22:\x22Mr.\x22}}','\x20\x20\x20\x20$endWith\x20\x20\x20\x20\x20Ends\x20with\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22email\x22:{\x22$endWith\x22:\x22@example.com\x22}}','',a27_0x12da9e(0xba),a27_0x12da9e(0xc2),'\x20\x20\x20\x20$or\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Any\x20condition\x20matches\x20\x20{\x22$or\x22:[{\x22status\x22:{\x22$eq\x22:\x22active\x22}},{\x22status\x22:{\x22$eq\x22:\x22pending\x22}}]}','','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions\x20(see\x20operators\x20above)',a27_0x12da9e(0xaf),a27_0x12da9e(0x96),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page\x20(default:\x2020)','',a27_0x12da9e(0xeb),a27_0x12da9e(0x8c),a27_0x12da9e(0xb7),a27_0x12da9e(0xae),a27_0x12da9e(0xce),a27_0x12da9e(0xc5),a27_0x12da9e(0xc7),a27_0x12da9e(0xf1)]['join']('\x0a')},{'command':a27_0x12da9e(0xd5),'operation':a27_0x12da9e(0xd5),'risk':a27_0x12da9e(0x89),'paramsRequired':!![],'description':a27_0x12da9e(0xa3),'paramsHint':a27_0x12da9e(0x99)},{'command':'create','operation':a27_0x12da9e(0xcb),'risk':a27_0x12da9e(0xef),'paramsRequired':!![],'description':a27_0x12da9e(0xbc),'confirmationDescription':'Writes\x20one\x20new\x20business\x20record\x20to\x20the\x20current\x20app\x20dataset.\x20It\x20is\x20saved\x20immediately\x20after\x20confirmation.','paramsHint':'JSON\x20with\x20field\x20values.\x20Example:\x20\x27{\x22name\x22:\x22test\x22,\x22amount\x22:100}\x27'},{'command':a27_0x12da9e(0xe8),'operation':a27_0x12da9e(0xe8),'risk':a27_0x12da9e(0xef),'paramsRequired':!![],'description':a27_0x12da9e(0xa9),'helpExtra':[a27_0x12da9e(0xb1),a27_0x12da9e(0xe7),a27_0x12da9e(0xb9),a27_0x12da9e(0xe4),a27_0x12da9e(0xdb),a27_0x12da9e(0xa2),a27_0x12da9e(0xd4),a27_0x12da9e(0xed),a27_0x12da9e(0xbf),a27_0x12da9e(0xde),a27_0x12da9e(0xa5)][a27_0x12da9e(0xf2)]('\x0a'),'confirmationDescription':a27_0x12da9e(0xd7),'paramsHint':a27_0x12da9e(0xdd)},{'command':a27_0x12da9e(0xd0),'operation':a27_0x12da9e(0xd0),'risk':'write','paramsRequired':!![],'description':a27_0x12da9e(0x9d),'confirmationDescription':a27_0x12da9e(0xd2),'paramsHint':a27_0x12da9e(0xf0)+'Examples:\x20\x27{\x22id\x22:123,\x22status\x22:\x22completed\x22}\x27,\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22completed\x22}\x27'},{'command':'delete','operation':a27_0x12da9e(0xe6),'risk':'high-risk-write','paramsRequired':!![],'description':'Delete\x20data\x20records\x20(non-interactive\x20mode\x20requires\x20--yes)','confirmationDescription':a27_0x12da9e(0xa7),'paramsHint':a27_0x12da9e(0x99)},{'command':a27_0x12da9e(0x92),'operation':a27_0x12da9e(0x92),'risk':a27_0x12da9e(0x89),'paramsRequired':![],'description':'Aggregate\x20dataset\x20records\x20(group\x20by,\x20sum,\x20count,\x20avg,\x20etc.)','paramsHint':a27_0x12da9e(0xa8)+a27_0x12da9e(0xe0),'helpExtra':[a27_0x12da9e(0x97),a27_0x12da9e(0xa6),a27_0x12da9e(0xf3),'\x20\x20\x20\x20COUNT\x20\x20\x20\x20\x20\x20\x20\x20Count\x20distinct\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22,\x22distinct\x22:true}','\x20\x20\x20\x20AVG\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Average\x20value\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{\x22column\x22:\x22score\x22,\x22type\x22:\x22AVG\x22,\x22alias\x22:\x22avg_score\x22}',a27_0x12da9e(0xcd),a27_0x12da9e(0xe2),a27_0x12da9e(0x8b),'',a27_0x12da9e(0x8a),'\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return\x20alongside\x20aggregates,\x20e.g.\x20[\x22status\x22,\x22region\x22]',a27_0x12da9e(0x8d),a27_0x12da9e(0x9b),a27_0x12da9e(0xec),a27_0x12da9e(0x98),'\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order;\x20may\x20reference\x20aggregate\x20output\x20aliases,\x20e.g.\x20[{\x22total\x22:\x22desc\x22}]','',a27_0x12da9e(0xa0),a27_0x12da9e(0xc3),a27_0x12da9e(0xee),a27_0x12da9e(0xb0),'','\x20\x20DATASET\x20BOUNDARY',a27_0x12da9e(0xc8),a27_0x12da9e(0x9f),a27_0x12da9e(0xda),a27_0x12da9e(0xf6),'',a27_0x12da9e(0xb8),a27_0x12da9e(0xcc),'\x20\x20\x20\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22amount\x22,\x22type\x22:\x22SUM\x22,\x22alias\x22:\x22total\x22}],\x22groupBy\x22:[\x22status\x22]}\x27','','\x20\x20\x20\x20#\x20Count\x20orders\x20per\x20region\x20with\x20filter',a27_0x12da9e(0xa4),'',a27_0x12da9e(0xa1)][a27_0x12da9e(0xf2)]('\x0a')}];function makeDataCommand(_0x13141d){const _0x45c8f4=a27_0x12da9e,_0x336e83=_0x45c8f4(0x9c)+_0x13141d[_0x45c8f4(0xaa)],_0x269125={'service':_0x45c8f4(0x94),'command':_0x13141d[_0x45c8f4(0xaa)],'description':_0x13141d[_0x45c8f4(0xf4)],'risk':_0x13141d['risk'],..._0x13141d[_0x45c8f4(0xc6)]?{'confirmationDescription':_0x13141d[_0x45c8f4(0xc6)]}:{},'helpExtra':_0x13141d['helpExtra'],'flags':[CODE_FLAG,{...PARAMS_FLAG,'description':_0x13141d[_0x45c8f4(0xb2)]}],'validate':async _0x496a6b=>{const _0x5d4cbe=_0x45c8f4;_0x13141d[_0x5d4cbe(0xad)]&&requireAnyOf(_0x496a6b,[_0x5d4cbe(0xf5)],_0x336e83),_0x13141d[_0x5d4cbe(0xe1)]===_0x5d4cbe(0xe8)&&parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x496a6b[_0x5d4cbe(0xab)]('params'))),_0x13141d[_0x5d4cbe(0xe1)]===_0x5d4cbe(0xd0)&&parseUpdateIdsFromParams(parseJsonParams(_0x496a6b[_0x5d4cbe(0xab)](_0x5d4cbe(0xf5)))??{});},async 'execute'(_0x3182c0){const _0x10eebc=_0x45c8f4,_0x3d33cf=_0x3182c0[_0x10eebc(0xab)](_0x10eebc(0xd8)),_0x2bc034=_0x13141d[_0x10eebc(0xe1)]===_0x10eebc(0xe8)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x3182c0[_0x10eebc(0xab)](_0x10eebc(0xf5)))):parseJsonParams(_0x3182c0[_0x10eebc(0xab)]('params'))??{},_0x1e8459=_0x13141d['operation']===_0x10eebc(0xd0)?parseUpdateIdsFromParams(_0x2bc034):undefined,_0x227035=_0x1e8459?normalizeUpdateParamsForRuntime(_0x2bc034,_0x1e8459):_0x2bc034,_0x4edbb8=Date[_0x10eebc(0xbe)](),_0x17eeb8=await executeData(_0x3d33cf,_0x13141d[_0x10eebc(0xe1)],_0x227035),_0x15dfe9=Date[_0x10eebc(0xbe)]()-_0x4edbb8,_0x1d2229=_0x1e8459&&_0x1e8459[_0x10eebc(0xac)]>0x1?buildBatchUpdateResult(_0x1e8459,_0x17eeb8):_0x17eeb8;return{'ok':!![],'data':{'result':_0x1d2229,'elapsed':_0x15dfe9},'message':_0x10eebc(0x9c)+_0x13141d[_0x10eebc(0xaa)]+_0x10eebc(0x8e)+_0x15dfe9+'ms'};}};return _0x13141d['risk']!==_0x45c8f4(0x89)&&(_0x269125[_0x45c8f4(0xb6)]=async _0x4ca1c7=>{const _0x501cd5=_0x45c8f4,_0x55570b=_0x4ca1c7[_0x501cd5(0xab)]('code'),_0x449e54=_0x13141d['operation']===_0x501cd5(0xe8)?parseBatchCreateItemsFromParams(parseJsonParamsValue(_0x4ca1c7['str'](_0x501cd5(0xf5)))):parseJsonParams(_0x4ca1c7['str'](_0x501cd5(0xf5)))??{};let _0x4e6390=_0x449e54;if(_0x13141d['operation']===_0x501cd5(0xd0)){const _0x57dad7=parseUpdateIdsFromParams(_0x449e54);_0x4e6390=normalizeUpdateParamsForRuntime(_0x449e54,_0x57dad7);}return dryRun('POST',_0x501cd5(0xc4)+_0x55570b+'/'+_0x13141d[_0x501cd5(0xe1)])[_0x501cd5(0xb3)](_0x4e6390)[_0x501cd5(0xf4)](_0x501cd5(0xe5)+_0x13141d[_0x501cd5(0xaa)]+_0x501cd5(0xb5)+_0x55570b)[_0x501cd5(0x9a)]();}),_0x269125;}export const dataDefinitions=[...specs['map'](makeDataCommand),dataImportExcel];function buildBatchUpdateResult(_0x4a6913,_0x395efe){const _0x159a83=a27_0x12da9e;return{'operation':_0x159a83(0xd0),'mode':_0x159a83(0xbd),'ids':_0x4a6913,'total':_0x4a6913[_0x159a83(0xac)],'result':_0x395efe};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2b4469=a28_0x3964;(function(_0x3e605a,_0x32706b){const _0x5eb466=a28_0x3964,_0x34b759=_0x3e605a();while(!![]){try{const _0x2d21c4=-parseInt(_0x5eb466(0x20b))/0x1+-parseInt(_0x5eb466(0x1f1))/0x2*(-parseInt(_0x5eb466(0x204))/0x3)+-parseInt(_0x5eb466(0x21d))/0x4+parseInt(_0x5eb466(0x21a))/0x5*(-parseInt(_0x5eb466(0x1f8))/0x6)+parseInt(_0x5eb466(0x21e))/0x7+parseInt(_0x5eb466(0x21f))/0x8*(-parseInt(_0x5eb466(0x1f6))/0x9)+parseInt(_0x5eb466(0x227))/0xa;if(_0x2d21c4===_0x32706b)break;else _0x34b759['push'](_0x34b759['shift']());}catch(_0x448d4e){_0x34b759['push'](_0x34b759['shift']());}}}(a28_0x7920,0x371fa));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function isRecord(_0x2d7e7b){const _0x3a030d=a28_0x3964;return _0x2d7e7b!==null&&typeof _0x2d7e7b===_0x3a030d(0x1ed)&&!Array[_0x3a030d(0x228)](_0x2d7e7b);}function normalizeField(_0x4d604f){const _0x54031d=a28_0x3964;if(_0x4d604f[_0x54031d(0x22a)])return null;const _0x1831cc=Boolean(_0x4d604f[_0x54031d(0x20c)]!==undefined||_0x4d604f[_0x54031d(0x201)]!==undefined);let _0x57f3f8={};if(!_0x1831cc&&typeof _0x4d604f['extend']===_0x54031d(0x1f3))try{_0x57f3f8=JSON['parse'](_0x4d604f[_0x54031d(0x22e)]);}catch{}const _0x449790=_0x1831cc?_0x4d604f[_0x54031d(0x214)]:_0x4d604f[_0x54031d(0x206)],_0x2d498b=_0x1831cc?_0x4d604f['displayName']:_0x4d604f['name'],_0x54ba81=_0x1831cc?_0x4d604f[_0x54031d(0x201)]:_0x4d604f[_0x54031d(0x208)]||_0x4d604f[_0x54031d(0x209)],_0xebb656=_0x1831cc?_0x4d604f[_0x54031d(0x218)]===!![]:_0x57f3f8[_0x54031d(0x218)]===!![],_0x1acb87=_0x1831cc?_0x4d604f[_0x54031d(0x1ff)]===!![]:_0x57f3f8['required']===!![],_0xa0f663=_0x1831cc?_0x4d604f[_0x54031d(0x22b)]??null:_0x57f3f8[_0x54031d(0x22b)]??null,_0x412523={'name':_0x449790,'displayName':_0x2d498b||_0x449790,'type':_0x54ba81,'dbType':_0x4d604f[_0x54031d(0x225)],'pk':_0xebb656,'required':_0x1acb87,'description':_0x4d604f[_0x54031d(0x1f5)]||undefined};return Array[_0x54031d(0x228)](_0xa0f663)&&_0xa0f663[_0x54031d(0x1fa)]>0x0&&(_0x412523[_0x54031d(0x22b)]=_0xa0f663),_0x412523;}function parseJsonMaybe(_0xff33db){const _0x537ea2=a28_0x3964;if(typeof _0xff33db!==_0x537ea2(0x1f3))return _0xff33db;try{return JSON[_0x537ea2(0x22f)](_0xff33db);}catch{return _0xff33db;}}function normalizeOperationEntry(_0x4e3ace,_0x5a7f85){const _0x538f4b=a28_0x3964;if(!_0x5a7f85||typeof _0x5a7f85!==_0x538f4b(0x1ed))return null;if(!_0x5a7f85[_0x538f4b(0x1f0)]||!_0x5a7f85[_0x538f4b(0x223)])return null;const _0x3f6f3b={'name':_0x4e3ace,'method':_0x5a7f85[_0x538f4b(0x1f0)],'path':_0x5a7f85['path']};if(_0x5a7f85[_0x538f4b(0x200)])_0x3f6f3b[_0x538f4b(0x200)]=_0x5a7f85[_0x538f4b(0x200)];if(_0x5a7f85[_0x538f4b(0x1f7)]!=null)_0x3f6f3b[_0x538f4b(0x1f7)]=parseJsonMaybe(_0x5a7f85[_0x538f4b(0x1f7)]);if(_0x5a7f85[_0x538f4b(0x215)]!=null)_0x3f6f3b[_0x538f4b(0x215)]=parseJsonMaybe(_0x5a7f85['responseBody']);if(_0x5a7f85[_0x538f4b(0x224)]!=null)_0x3f6f3b[_0x538f4b(0x224)]=_0x5a7f85[_0x538f4b(0x224)];if(_0x5a7f85[_0x538f4b(0x231)]!=null)_0x3f6f3b[_0x538f4b(0x231)]=_0x5a7f85[_0x538f4b(0x231)];if(Array['isArray'](_0x5a7f85['requestFields']))_0x3f6f3b[_0x538f4b(0x1ef)]=_0x5a7f85[_0x538f4b(0x1ef)];if(Array[_0x538f4b(0x228)](_0x5a7f85[_0x538f4b(0x233)]))_0x3f6f3b[_0x538f4b(0x233)]=_0x5a7f85[_0x538f4b(0x233)];return _0x3f6f3b;}function summarizeDbtable(_0x283308){const _0x47bfa6=a28_0x3964,_0x209461={},_0x2fc350=[_0x47bfa6(0x1f9),'dbName',_0x47bfa6(0x212),_0x47bfa6(0x20d),_0x47bfa6(0x218),_0x47bfa6(0x1f2),_0x47bfa6(0x20f),_0x47bfa6(0x216),'updateTimeField','creatorIdField','creatorNameField','modifierIdField',_0x47bfa6(0x226),_0x47bfa6(0x21c),_0x47bfa6(0x229)];for(const _0x22140 of _0x2fc350){if(_0x283308[_0x22140]!==undefined)_0x209461[_0x22140]=_0x283308[_0x22140];}return typeof _0x209461['allFields']===_0x47bfa6(0x1f3)&&_0x209461[_0x47bfa6(0x1f2)][_0x47bfa6(0x1fa)]>0x0&&(_0x209461[_0x47bfa6(0x1fb)]=_0x209461[_0x47bfa6(0x1f2)][_0x47bfa6(0x1fe)](',')[_0x47bfa6(0x21b)](_0x3363a4=>_0x3363a4[_0x47bfa6(0x202)]())[_0x47bfa6(0x20e)](Boolean)),_0x209461;}function normalizeRelatedPages(_0x2540b1){const _0x53afc0=a28_0x3964;if(!Array[_0x53afc0(0x228)](_0x2540b1))return[];return _0x2540b1['filter'](_0x246a43=>_0x246a43&&typeof _0x246a43===_0x53afc0(0x1ed))[_0x53afc0(0x21b)](_0x5d2cf7=>({'id':_0x5d2cf7['id'],'type':_0x5d2cf7[_0x53afc0(0x208)],'code':_0x5d2cf7[_0x53afc0(0x206)],'title':_0x5d2cf7[_0x53afc0(0x220)],'deleted':_0x5d2cf7['deleted']===!![]}));}function normalizeFallbackFieldName(_0x513417,_0x4f466f){const _0x4e7501=a28_0x3964,_0x63d164=_0x513417[_0x4e7501(0x202)]();if(!_0x63d164)return null;return{'name':_0x63d164,'displayName':_0x63d164,'type':undefined,'dbType':undefined,'pk':_0x63d164===_0x4f466f,'required':![],'description':undefined};}function a28_0x3964(_0xbbdc5d,_0x263f44){_0xbbdc5d=_0xbbdc5d-0x1ec;const _0x792009=a28_0x7920();let _0x396445=_0x792009[_0xbbdc5d];return _0x396445;}async function loadListFieldFallback(_0x590e44,_0xdb47b0){const _0x4470b6=a28_0x3964;if(!_0x590e44||!_0xdb47b0)return[];try{const _0x2cf73a=await listDatasets(_0x590e44,{'code':_0xdb47b0}),_0x94c879=_0x2cf73a['find'](_0x5c4bba=>_0x5c4bba[_0x4470b6(0x206)]===_0xdb47b0)??_0x2cf73a[0x0],_0x824a6b=_0x94c879?.['dbtableConfig']??{},_0x3707cf=typeof _0x824a6b[_0x4470b6(0x1f2)]===_0x4470b6(0x1f3)?_0x824a6b[_0x4470b6(0x1f2)]['split'](','):[];return _0x3707cf[_0x4470b6(0x21b)](_0x1bb2c7=>normalizeFallbackFieldName(_0x1bb2c7,_0x824a6b['pkField']))['filter'](_0x424385=>_0x424385!==null);}catch{return[];}}function a28_0x7920(){const _0x4f4549=['columnCodeListWithDeleted','tableName','doVersion','name','responseBody','createTimeField','relatedPageInfoList','pkField','str','445gyzbtW','map','labelField','1613268NnjsQi','2596538LFDyyZ','8DSZKHf','title','detail','validateRules','path','beforeScriptId','dbType','modifierNameField','4961850NrNerI','isArray','dblinkInfoDTO','deleted','options','Get\x20dataset\x20detail\x20including\x20fields,\x20relations,\x20and\x20operations','source','extend','parse','properties','afterScriptId','push','responseFields','modelId','object','appCode','requestFields','method','2390IwRNlv','allFields','string','fields','description','3194019mJUcEK','requestBody','11484vXKFbM','dbId','length','allFieldNames','modelCode','formatRules','split','required','host','doType','trim','tableComment','1029jJSkyP','operations','code','dataset','type','dataType','dbtableConfig','122664qVyMjs','displayName','datasetKey','filter','logicField','relations'];a28_0x7920=function(){return _0x4f4549;};return a28_0x7920();}export const datasetDetail={'service':a28_0x2b4469(0x207),'command':a28_0x2b4469(0x221),'description':a28_0x2b4469(0x22c),'risk':'read','flags':[CODE_FLAG],async 'execute'(_0x528113){const _0x1268fc=a28_0x2b4469,_0x102543=await getDatasetDetail(_0x528113[_0x1268fc(0x219)](_0x1268fc(0x206)));if(!isRecord(_0x102543))throw CliErrors['apiError']('Dataset\x20detail\x20must\x20be\x20an\x20object.');const _0x516818=Array[_0x1268fc(0x228)](_0x102543[_0x1268fc(0x1f4)])?_0x102543[_0x1268fc(0x1f4)]:Array[_0x1268fc(0x228)](_0x102543[_0x1268fc(0x230)])?_0x102543['properties']:[];let _0x21ebd5=_0x516818[_0x1268fc(0x21b)](_0x500f4a=>normalizeField(_0x500f4a))[_0x1268fc(0x20e)](_0x3ce28b=>_0x3ce28b!==null);_0x21ebd5['length']===0x0&&(_0x21ebd5=await loadListFieldFallback(_0x528113[_0x1268fc(0x1ee)],_0x528113[_0x1268fc(0x219)](_0x1268fc(0x206))));const _0x48d64e=_0x102543[_0x1268fc(0x205)]??{},_0x58ec6a=[];for(const [_0xa0a387,_0x2b0522]of Object['entries'](_0x48d64e)){const _0x111f69=normalizeOperationEntry(_0xa0a387,_0x2b0522);if(_0x111f69)_0x58ec6a[_0x1268fc(0x232)](_0x111f69);}const _0x413f93=isRecord(_0x102543[_0x1268fc(0x20a)])?_0x102543[_0x1268fc(0x20a)]:{},_0x50eed0=isRecord(_0x102543[_0x1268fc(0x207)])?_0x102543['dataset']:{},_0x87f445=_0x413f93[_0x1268fc(0x1f9)]!=null?{'id':_0x413f93[_0x1268fc(0x1f9)],'name':_0x413f93['dbName']??null}:undefined;let _0x36a25c;return typeof _0x102543[_0x1268fc(0x22e)]==='string'&&(_0x36a25c=parseJsonMaybe(_0x102543[_0x1268fc(0x22e)])),{'ok':!![],'data':{'id':_0x102543[_0x1268fc(0x1ec)]??_0x102543['id'],'name':_0x102543[_0x1268fc(0x214)],'code':_0x102543[_0x1268fc(0x1fc)]||_0x102543[_0x1268fc(0x206)],'doVersion':_0x102543[_0x1268fc(0x213)],'description':_0x102543[_0x1268fc(0x1f5)]||_0x50eed0[_0x1268fc(0x203)]||undefined,'source':_0x102543[_0x1268fc(0x22d)]||_0x50eed0['sourceType'],'table':_0x413f93[_0x1268fc(0x212)]||_0x50eed0[_0x1268fc(0x212)],'datasetKey':_0x413f93[_0x1268fc(0x20d)],'pk':_0x413f93[_0x1268fc(0x218)],'db':_0x87f445,'dbtable':summarizeDbtable(_0x413f93),'fields':_0x21ebd5,'operations':_0x58ec6a,'indexes':Array[_0x1268fc(0x228)](_0x50eed0['indexes'])?_0x50eed0['indexes']:[],'relations':_0x102543[_0x1268fc(0x210)]??null,'relatedPages':normalizeRelatedPages(_0x102543[_0x1268fc(0x217)]),...Array[_0x1268fc(0x228)](_0x102543[_0x1268fc(0x211)])?{'columnCodeListWithDeleted':_0x102543[_0x1268fc(0x211)]}:{},'formatRules':Array[_0x1268fc(0x228)](_0x102543['formatRules'])?_0x102543[_0x1268fc(0x1fd)]:[],'validateRules':Array[_0x1268fc(0x228)](_0x102543[_0x1268fc(0x222)])?_0x102543[_0x1268fc(0x222)]:[],..._0x36a25c!==undefined?{'extend':_0x36a25c}:{},'stats':{'fieldCount':_0x21ebd5['length'],'operationCount':_0x58ec6a['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x57f5b0,_0x593a55){const _0x109ef8=a29_0xb21c,_0x732eca=_0x57f5b0();while(!![]){try{const _0x17cbd2=parseInt(_0x109ef8(0xb7))/0x1*(parseInt(_0x109ef8(0xbd))/0x2)+-parseInt(_0x109ef8(0xb9))/0x3*(-parseInt(_0x109ef8(0xb8))/0x4)+-parseInt(_0x109ef8(0xbe))/0x5*(-parseInt(_0x109ef8(0xba))/0x6)+-parseInt(_0x109ef8(0xc0))/0x7*(parseInt(_0x109ef8(0xb6))/0x8)+-parseInt(_0x109ef8(0xbb))/0x9+parseInt(_0x109ef8(0xbf))/0xa*(-parseInt(_0x109ef8(0xb5))/0xb)+parseInt(_0x109ef8(0xc1))/0xc*(parseInt(_0x109ef8(0xbc))/0xd);if(_0x17cbd2===_0x593a55)break;else _0x732eca['push'](_0x732eca['shift']());}catch(_0x52d50f){_0x732eca['push'](_0x732eca['shift']());}}}(a29_0x591a,0x6ed63));function a29_0xb21c(_0x1d774c,_0x4e4bbf){_0x1d774c=_0x1d774c-0xb5;const _0x591a0e=a29_0x591a();let _0xb21cf6=_0x591a0e[_0x1d774c];return _0xb21cf6;}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';function a29_0x591a(){const _0xb7be0f=['90444VeWWqQ','762552yLKjNd','144209TjpLdp','32XFWNdU','265wgofUH','150eIpjjl','94899dMivFu','288ihKRAS','396099pMDisV','344oJMAAy','24979YHKSIu','262644NPMEte','9vOxWJp'];a29_0x591a=function(){return _0xb7be0f;};return a29_0x591a();}export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a30_0x4e69(_0x5d74e4,_0x4636fc){_0x5d74e4=_0x5d74e4-0x134;const _0x5a33d4=a30_0x5a33();let _0x4e6969=_0x5a33d4[_0x5d74e4];return _0x4e6969;}const a30_0x26fb65=a30_0x4e69;(function(_0x4c1a2b,_0x7616bf){const _0x128636=a30_0x4e69,_0x5ac6c2=_0x4c1a2b();while(!![]){try{const _0x2fd7f3=parseInt(_0x128636(0x146))/0x1*(-parseInt(_0x128636(0x150))/0x2)+-parseInt(_0x128636(0x144))/0x3*(parseInt(_0x128636(0x152))/0x4)+-parseInt(_0x128636(0x14f))/0x5+-parseInt(_0x128636(0x14c))/0x6+-parseInt(_0x128636(0x142))/0x7*(-parseInt(_0x128636(0x149))/0x8)+parseInt(_0x128636(0x148))/0x9+parseInt(_0x128636(0x138))/0xa;if(_0x2fd7f3===_0x7616bf)break;else _0x5ac6c2['push'](_0x5ac6c2['shift']());}catch(_0x2a455e){_0x5ac6c2['push'](_0x5ac6c2['shift']());}}}(a30_0x5a33,0xd0dea));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a30_0x5a33(){const _0x59750d=['Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','6140742uKFWBv','List\x20datasets\x20in\x20the\x20app\x20(server-side\x20name/code/table-name\x20filters\x20combine\x20with\x20AND)','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','7618190ChjxJJ','2diVoTT','list','61516UmxxzI','allFields','Filter\x20by\x20physical\x20table\x20name\x20(server-side\x20prefix\x20match;\x20SQL\x20LIKE\x20wildcards\x20%\x20and\x20_\x20apply)','datasetKey','description','34045400sltHzP','tableName','trim','map','name','appCode','dbtableConfig','dataset','pkField','split','7595273LluJDE','string','99dYcwLy','str','1034858OnerKt','code','4098699mmWwoI','8lJrYlv','table-name'];a30_0x5a33=function(){return _0x59750d;};return a30_0x5a33();}export const datasetList={'service':a30_0x26fb65(0x13f),'command':a30_0x26fb65(0x151),'description':a30_0x26fb65(0x14d),'risk':'read','flags':[{'name':'name','type':'string','description':a30_0x26fb65(0x14e)},{'name':a30_0x26fb65(0x14a),'type':a30_0x26fb65(0x143),'description':a30_0x26fb65(0x135)},{...CODE_FLAG,'required':![],'description':a30_0x26fb65(0x14b)}],async 'execute'(_0x248af6){const _0xc1cf16=a30_0x26fb65,_0x307391=_0x248af6[_0xc1cf16(0x145)](_0xc1cf16(0x13c)),_0x2c47fe=_0x248af6[_0xc1cf16(0x145)](_0xc1cf16(0x147)),_0x175e21=_0x248af6['str'](_0xc1cf16(0x14a)),_0x17b89e=await listDatasets(_0x248af6[_0xc1cf16(0x13d)],{..._0x307391&&{'name':_0x307391},..._0x2c47fe&&{'code':_0x2c47fe},..._0x175e21&&{'tableName':_0x175e21}});return{'ok':!![],'data':{'total':_0x17b89e['length'],'datasets':_0x17b89e['map'](_0x3782a6=>{const _0x16f90b=_0xc1cf16,_0x56b5ef=_0x3782a6[_0x16f90b(0x13e)]??{};return{'id':_0x3782a6['id'],'code':_0x3782a6[_0x16f90b(0x147)],'name':_0x3782a6[_0x16f90b(0x13c)],'source':_0x3782a6['source'],'description':_0x3782a6[_0x16f90b(0x137)],'table':_0x56b5ef[_0x16f90b(0x139)],'datasetKey':_0x56b5ef[_0x16f90b(0x136)],'pk':_0x56b5ef[_0x16f90b(0x140)],'fields':_0x56b5ef[_0x16f90b(0x134)]?_0x56b5ef[_0x16f90b(0x134)][_0x16f90b(0x141)](',')[_0x16f90b(0x13b)](_0x4c62ab=>_0x4c62ab[_0x16f90b(0x13a)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x23e1(_0x5aa071,_0x269e0d){_0x5aa071=_0x5aa071-0x6f;const _0x4189ac=a31_0x4189();let _0x23e1d3=_0x4189ac[_0x5aa071];return _0x23e1d3;}const a31_0x10785c=a31_0x23e1;(function(_0x457043,_0x33c0ad){const _0x526042=a31_0x23e1,_0x253ca3=_0x457043();while(!![]){try{const _0x4394e5=-parseInt(_0x526042(0x7f))/0x1*(parseInt(_0x526042(0x75))/0x2)+parseInt(_0x526042(0x70))/0x3+parseInt(_0x526042(0x78))/0x4*(parseInt(_0x526042(0x7e))/0x5)+-parseInt(_0x526042(0x77))/0x6+-parseInt(_0x526042(0x7c))/0x7+parseInt(_0x526042(0x76))/0x8+parseInt(_0x526042(0x71))/0x9*(parseInt(_0x526042(0x7d))/0xa);if(_0x4394e5===_0x33c0ad)break;else _0x253ca3['push'](_0x253ca3['shift']());}catch(_0x4d2837){_0x253ca3['push'](_0x253ca3['shift']());}}}(a31_0x4189,0x5cd56));function a31_0x4189(){const _0x30dc25=['code','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','1535534tVwIWm','10gPJhpv','25oUvVRk','66SrQVcL','dataset','564309BaFjue','2791566mguNKA','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','read','appCode','10102hfIaFn','5984584JvuQJs','2577066KAiPfc','92908KcFZvE','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0aNo\x20SDK\x20usage\x20documentation\x20is\x20available.'];a31_0x4189=function(){return _0x30dc25;};return a31_0x4189();}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a31_0x10785c(0x79);export function formatDatasetSdkMarkdown(_0xfcddf4){const _0x3f2b8e=typeof _0xfcddf4==='string'?_0xfcddf4['trim']():'';return _0x3f2b8e||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a31_0x10785c(0x6f),'command':'sdk-doc','description':a31_0x10785c(0x7b),'risk':a31_0x10785c(0x73),'flags':[{...CODE_FLAG,'description':a31_0x10785c(0x72)}],async 'execute'(_0x131c93){const _0x3b3159=a31_0x10785c,_0x214c04=_0x131c93['str'](_0x3b3159(0x7a)),_0x129b83=await getDatasetSdkUsageDoc(_0x214c04,_0x131c93[_0x3b3159(0x74)]);return{'ok':!![],'data':{'code':_0x214c04,'appCode':_0x131c93[_0x3b3159(0x74)],'markdown':formatDatasetSdkMarkdown(_0x129b83)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a32_0x233a(){const _0xcfc05=['\x20\x20Legacy\x20inherit:\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','str','\x20\x20API\x20Endpoints','reason','(missing)','projectConfig','status','repeat','\x20\x20region:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','services','bold','\x20\x20AK\x20source:\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','check','✓\x20current','\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','arch','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','7465710rGgIHH','Project','\x20+\x20','currentApp','repairCommand','log','(none)','locale','env','\x20\x20Merged\x20Config','globalConfig','verbose','accessKey','region','read','82556BFXpGj','\x20config\x20delete\x20inherit','\x20\x20Routing\x20Configuration','\x20\x20Installed\x20Path:\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','✓\x20Loaded','routing','packageVersion','yellow','app','accessKeySource','\x20\x20kbServiceDomain:\x20','includes','call','\x20\x20Repair\x20project:\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','(not\x20set)','padEnd','commandCount','current','doctor','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','928765uHltYm','global','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','5048830reAIJY','\x20config','⚠\x20Empty\x20(treated\x20as\x20{})','message','join','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','(default:\x20','not\x20configured','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','format','\x20config\x20delete\x20region','\x20Imported\x20from:\x20','(not\x20found)','empty','\x20\x20Repair\x20project:\x20\x20','defaultApp','\x20\x20Skill\x20Version:\x20\x20\x20','\x20\x20auth\x20(effective):\x20','gray','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','state','\x20\x20─','raw','\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','6965938zqvZLr','(invalid)','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','2KflSBT','red','length','missing','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','2779971eEtFDQ','\x20config\x20init','\x20config\x20delete\x20inherit\x20--global','inherit','⚠\x20Empty','hasOwnProperty','filter','Unavailable\x20until\x20routing\x20configuration\x20is\x20repaired','\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','path','\x20\x20Repair\x20global:\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Built-in\x20Skill','project','skillVersion','green','\x20doctor','prototype','\x20config\x20delete\x20routing\x20--global','\x20\x20Config\x20Files','registryPath','18076720UYeKsn','\x20commands)','(no\x20file)','\x20\x20Service\x20Tree','(default)','ClientAk','\x20\x20Package\x20Version:\x20'];a32_0x233a=function(){return _0xcfc05;};return a32_0x233a();}const a32_0x38096d=a32_0x2dde;(function(_0x1fba49,_0x5ae0fc){const _0x472ab6=a32_0x2dde,_0x42720d=_0x1fba49();while(!![]){try{const _0x4c5f71=parseInt(_0x472ab6(0x18b))/0x1+-parseInt(_0x472ab6(0x1a9))/0x2*(-parseInt(_0x472ab6(0x1ae))/0x3)+-parseInt(_0x472ab6(0x174))/0x4+-parseInt(_0x472ab6(0x18e))/0x5+parseInt(_0x472ab6(0x165))/0x6+parseInt(_0x472ab6(0x1a6))/0x7+-parseInt(_0x472ab6(0x1c3))/0x8;if(_0x4c5f71===_0x5ae0fc)break;else _0x42720d['push'](_0x42720d['shift']());}catch(_0x2dcb6a){_0x42720d['push'](_0x42720d['shift']());}}}(a32_0x233a,0xc47ee));import a32_0x54adbc from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getKbServiceDomain,getRuntimeDomain,getSkillDomain,getUserDomain}from'../constant/domain.js';import{normalizeLovrabetRegion}from'../constant/region.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile,loadRawConfigLayers}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{inspectServiceRegistry}from'../commands/service/registry.js';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';function a32_0x2dde(_0x45a368,_0x5014f5){_0x45a368=_0x45a368-0x151;const _0x233af9=a32_0x233a();let _0x2ddeae=_0x233af9[_0x45a368];return _0x2ddeae;}async function execute(_0x1b8cca){const _0x570434=a32_0x2dde,_0x2c182f=getCliVersion(),_0x315825=buildConfigFromFlags({'app':_0x1b8cca['str']?.(_0x570434(0x17d)),'appcode':_0x1b8cca[_0x570434(0x1cd)]?.('appcode'),'env':_0x1b8cca[_0x570434(0x1cd)]?.(_0x570434(0x16d))});let _0x15a528,_0x908a83;try{_0x15a528=normalizeLovrabetRegion(_0x315825[_0x570434(0x1a4)][_0x570434(0x172)]);}catch(_0x17e1f9){_0x908a83=_0x17e1f9 instanceof Error?_0x17e1f9:new Error(String(_0x17e1f9));}let _0x5992bb;if(!_0x908a83)try{await initGlobalEnvironment(_0x315825);}catch(_0x1cb29d){_0x5992bb=_0x1cb29d instanceof Error?_0x1cb29d:new Error(String(_0x1cb29d));}console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)](CLI_BIN_NAME+_0x570434(0x1be))),console[_0x570434(0x16a)](a32_0x54adbc['gray']('─'[_0x570434(0x152)](0x32))),console['log'](_0x570434(0x193)+_0x2c182f),console[_0x570434(0x16a)](_0x570434(0x1cc)+process['version']),console['log'](_0x570434(0x1b9)+process['platform']+'\x20'+process[_0x570434(0x162)]);const _0x169b95=inspectBuiltinSkill();console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)](_0x570434(0x1ba))),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)['repeat'](0x1e))),console[_0x570434(0x16a)](_0x570434(0x1b6)+(_0x169b95[_0x570434(0x1a2)]===_0x570434(0x187)?a32_0x54adbc[_0x570434(0x1bd)](_0x570434(0x160)):a32_0x54adbc[_0x570434(0x1aa)]('✗\x20'+_0x169b95['state']))),console[_0x570434(0x16a)](_0x570434(0x1c9)+_0x169b95[_0x570434(0x17b)]),console[_0x570434(0x16a)](_0x570434(0x19e)+(_0x169b95[_0x570434(0x1bc)]||a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1d0)))),console[_0x570434(0x16a)](_0x570434(0x177)+(_0x169b95['installedPath']||a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x19a))));_0x169b95[_0x570434(0x1a2)]!==_0x570434(0x187)&&console[_0x570434(0x16a)](_0x570434(0x161)+_0x169b95[_0x570434(0x169)]);_0x169b95[_0x570434(0x1cf)]&&console['log']('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x169b95[_0x570434(0x1cf)]);console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)](_0x570434(0x1c1))),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)['repeat'](0x1e)));const _0xa22c3b=getGlobalConfigPath(),_0x205988=getProjectConfigPath();console[_0x570434(0x16a)]('\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0xa22c3b||a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x19a)))),console[_0x570434(0x16a)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x205988||a32_0x54adbc['gray']('(not\x20found)'))),console['log'](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)]('\x20\x20Config\x20JSON')),console['log'](a32_0x54adbc['gray'](_0x570434(0x1a3)[_0x570434(0x152)](0x1e)));const _0x9796d7=(_0x16cb73,_0x19efc1)=>{const _0x50a969=_0x570434;if(!_0x19efc1){console[_0x50a969(0x16a)]('\x20\x20'+_0x16cb73[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x1a0)](_0x50a969(0x1c5)));return;}const _0x1263d8=inspectCliConfigJsonFile(_0x19efc1);if(_0x1263d8['status']==='ok')console[_0x50a969(0x16a)]('\x20\x20'+_0x16cb73[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x1bd)]('✓\x20Valid\x20JSON'));else{if(_0x1263d8[_0x50a969(0x151)]===_0x50a969(0x19b))console[_0x50a969(0x16a)]('\x20\x20'+_0x16cb73[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x17c)](_0x50a969(0x190)));else _0x1263d8['status']===_0x50a969(0x1ac)?console[_0x50a969(0x16a)]('\x20\x20'+_0x16cb73[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x1a0)]('(missing)')):(console[_0x50a969(0x16a)]('\x20\x20'+_0x16cb73[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x1aa)]('✗\x20Invalid\x20JSON')),console[_0x50a969(0x16a)]('\x20\x20'+''[_0x50a969(0x185)](0x11)+'\x20'+a32_0x54adbc[_0x50a969(0x1aa)](_0x1263d8['message'])));}};_0x9796d7('Global',_0xa22c3b),_0x9796d7(_0x570434(0x166),_0x205988);const _0xaafb4c=loadRawConfigLayers(),_0x5b26fa=[Object[_0x570434(0x1bf)]['hasOwnProperty']['call'](_0xaafb4c['globalConfig'],'inherit')?_0x570434(0x18c):null,Object[_0x570434(0x1bf)][_0x570434(0x1b3)]['call'](_0xaafb4c[_0x570434(0x1d1)],_0x570434(0x1b1))?_0x570434(0x1bb):null][_0x570434(0x1b4)](Boolean);_0x5b26fa['length']>0x0&&(console['log'](_0x570434(0x1ca)+a32_0x54adbc[_0x570434(0x17c)]('ignored\x20in\x20'+_0x5b26fa[_0x570434(0x192)](_0x570434(0x167))+_0x570434(0x18f))),_0x5b26fa[_0x570434(0x180)](_0x570434(0x1bb))&&console[_0x570434(0x16a)](_0x570434(0x182)+CLI_BIN_NAME+_0x570434(0x175)),_0x5b26fa[_0x570434(0x180)](_0x570434(0x18c))&&console[_0x570434(0x16a)]('\x20\x20Repair\x20global:\x20\x20\x20\x20'+CLI_BIN_NAME+_0x570434(0x1b0)));_0x5992bb&&(console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc['bold'](_0x570434(0x176))),console['log'](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)[_0x570434(0x152)](0x1e))),console[_0x570434(0x16a)](_0x570434(0x156)+a32_0x54adbc[_0x570434(0x1aa)](_0x570434(0x15a))),console[_0x570434(0x16a)](_0x570434(0x1a5)+_0x5992bb['message']),Object[_0x570434(0x1bf)][_0x570434(0x1b3)][_0x570434(0x181)](_0xaafb4c[_0x570434(0x1d1)],'routing')&&console[_0x570434(0x16a)](_0x570434(0x19c)+CLI_BIN_NAME+'\x20config\x20delete\x20routing'),Object['prototype'][_0x570434(0x1b3)][_0x570434(0x181)](_0xaafb4c['globalConfig'],_0x570434(0x17a))&&console[_0x570434(0x16a)](_0x570434(0x1b8)+CLI_BIN_NAME+_0x570434(0x1c0)));_0x908a83&&(console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)]('\x20\x20Country/Region\x20Configuration')),console['log'](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)[_0x570434(0x152)](0x1e))),console[_0x570434(0x16a)](_0x570434(0x156)+a32_0x54adbc['red'](_0x570434(0x15a))),console[_0x570434(0x16a)]('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x908a83[_0x570434(0x191)]),Object[_0x570434(0x1bf)][_0x570434(0x1b3)][_0x570434(0x181)](_0xaafb4c[_0x570434(0x1d1)],_0x570434(0x172))&&console[_0x570434(0x16a)](_0x570434(0x19c)+CLI_BIN_NAME+_0x570434(0x198)),Object[_0x570434(0x1bf)][_0x570434(0x1b3)]['call'](_0xaafb4c[_0x570434(0x16f)],'region')&&console['log'](_0x570434(0x1b8)+CLI_BIN_NAME+_0x570434(0x1af)));console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc['bold'](_0x570434(0x16e))),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x1a0)]('\x20\x20─'['repeat'](0x1e))),console[_0x570434(0x16a)](_0x570434(0x1ad)+(_0x315825['appCode']||a32_0x54adbc[_0x570434(0x1aa)](_0x570434(0x184)))),console[_0x570434(0x16a)](_0x570434(0x153)+(_0x15a528??a32_0x54adbc['red'](_0x570434(0x1a7)))),console[_0x570434(0x16a)]('\x20\x20app\x20locale:\x20\x20\x20\x20\x20\x20'+_0x315825[_0x570434(0x16c)]),console['log'](_0x570434(0x178)+(_0x315825[_0x570434(0x19d)]||a32_0x54adbc['gray']('(none)'))),console[_0x570434(0x16a)](_0x570434(0x1a1)+(_0x315825[_0x570434(0x168)]||a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x16b)))),console['log'](_0x570434(0x15b)+(_0x315825[_0x570434(0x197)]||a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x194)+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x570434(0x16a)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x315825['pageSize']??a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1c7)))),console[_0x570434(0x16a)](_0x570434(0x196)+_0x315825['riskLevel']),console[_0x570434(0x16a)](_0x570434(0x1a8)+_0x315825[_0x570434(0x170)]),console[_0x570434(0x16a)](_0x570434(0x19f)+AUTH_MODE[_0x570434(0x1c8)]);if(_0x315825[_0x570434(0x17e)])console[_0x570434(0x16a)](_0x570434(0x159)+_0x315825['accessKeySource']);console[_0x570434(0x16a)](_0x570434(0x15d)+(_0x315825[_0x570434(0x171)]?a32_0x54adbc[_0x570434(0x1bd)](_0x570434(0x154)+_0x315825[_0x570434(0x171)][_0x570434(0x1ab)]+')'):a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x16b)))),console['log'](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)](_0x570434(0x1ce))),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)[_0x570434(0x152)](0x1e)));_0x5992bb||_0x908a83?console['log'](_0x570434(0x156)+a32_0x54adbc[_0x570434(0x1aa)](_0x570434(0x1b5))):(console[_0x570434(0x16a)](_0x570434(0x18d)+getApiDomain()),console[_0x570434(0x16a)](_0x570434(0x155)+getUserDomain()),console[_0x570434(0x16a)](_0x570434(0x1cb)+getRuntimeDomain()),console[_0x570434(0x16a)]('\x20\x20skillDomain:\x20\x20\x20\x20\x20'+getSkillDomain()),console[_0x570434(0x16a)](_0x570434(0x17f)+(getKbServiceDomain()??_0x570434(0x195))));console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc['bold'](_0x570434(0x1c6))),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)[_0x570434(0x152)](0x1e)));const _0x3a8ae2=inspectServiceRegistry();console[_0x570434(0x16a)](_0x570434(0x15e)+_0x3a8ae2[_0x570434(0x1c2)]),console[_0x570434(0x16a)](_0x570434(0x156)+formatServiceRegistryStatus(_0x3a8ae2)),console[_0x570434(0x16a)](_0x570434(0x163)+_0x3a8ae2['serviceCount']),console[_0x570434(0x16a)](_0x570434(0x18a)+_0x3a8ae2[_0x570434(0x186)]);for(const _0x1deed8 of _0x3a8ae2[_0x570434(0x157)]){console[_0x570434(0x16a)]('\x20\x20'+(_0x1deed8['serviceCode']+':')['padEnd'](0x11)+'\x20'+(_0x1deed8['name']||a32_0x54adbc[_0x570434(0x1a0)]('(unnamed)'))+'\x20('+_0x1deed8[_0x570434(0x186)]+_0x570434(0x1c4)),console['log']('\x20\x20'+''[_0x570434(0x185)](0x11)+_0x570434(0x199)+_0x1deed8['source'][_0x570434(0x1b7)]);}return console[_0x570434(0x16a)](),console[_0x570434(0x16a)](a32_0x54adbc[_0x570434(0x158)](_0x570434(0x164))),console['log'](a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x1a3)[_0x570434(0x152)](0x1e))),console[_0x570434(0x16a)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a32_0x54adbc[_0x570434(0x1bd)](AUTH_MODE['ClientAk']+_0x570434(0x15c))),console[_0x570434(0x16a)](_0x570434(0x183)+a32_0x54adbc[_0x570434(0x1a0)](_0x570434(0x189))),console[_0x570434(0x16a)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x1490cc){const _0x45a4e0=a32_0x2dde;if(_0x1490cc[_0x45a4e0(0x151)]==='ok')return a32_0x54adbc[_0x45a4e0(0x1bd)](_0x45a4e0(0x179));if(_0x1490cc['status']===_0x45a4e0(0x1ac))return a32_0x54adbc['gray']('(not\x20found)');if(_0x1490cc['status']===_0x45a4e0(0x19b))return a32_0x54adbc[_0x45a4e0(0x17c)](_0x45a4e0(0x1b2));return a32_0x54adbc['red']('✗\x20Invalid'+(_0x1490cc[_0x45a4e0(0x191)]?':\x20'+_0x1490cc[_0x45a4e0(0x191)]:''));}export const doctorDefinition={'service':a32_0x38096d(0x188),'command':a32_0x38096d(0x15f),'description':'Diagnose\x20CLI\x20configuration\x20and\x20environment','risk':a32_0x38096d(0x173),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
1
|
+
const a32_0x29b9d1=a32_0x39a5;(function(_0x3784a2,_0xa3afce){const _0x450ff5=a32_0x39a5,_0x519abb=_0x3784a2();while(!![]){try{const _0x2fa887=-parseInt(_0x450ff5(0x1de))/0x1+parseInt(_0x450ff5(0x203))/0x2+parseInt(_0x450ff5(0x21f))/0x3+parseInt(_0x450ff5(0x1cd))/0x4*(parseInt(_0x450ff5(0x219))/0x5)+parseInt(_0x450ff5(0x1d9))/0x6*(-parseInt(_0x450ff5(0x231))/0x7)+-parseInt(_0x450ff5(0x1f7))/0x8+-parseInt(_0x450ff5(0x1f9))/0x9*(parseInt(_0x450ff5(0x1eb))/0xa);if(_0x2fa887===_0xa3afce)break;else _0x519abb['push'](_0x519abb['shift']());}catch(_0x571d0f){_0x519abb['push'](_0x519abb['shift']());}}}(a32_0x38ab,0xdd1fe));import a32_0x1af0eb from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getKbServiceDomain,getRuntimeDomain,getSkillDomain,getUserDomain}from'../constant/domain.js';import{normalizeLovrabetRegion}from'../constant/region.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile,loadRawConfigLayers}from'../context.js';function a32_0x38ab(){const _0x51198b=['repairCommand','pageSize','region','raw','red','current','verbose','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Package\x20Version:\x20','path','\x20\x20─','filter','(unnamed)','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','accessKeySource','\x20\x20Repair\x20global:\x20\x20\x20','\x20config\x20delete\x20inherit\x20--global','✗\x20Invalid','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20Files','✓\x20Valid\x20JSON','\x20\x20Installed\x20Path:\x20\x20','appcode','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','✓\x20current','repeat','231432JavHwW','riskLevel','\x20\x20Repair\x20project:\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','bold','installedPath','Project','state','(set,\x20length=','(default:\x20','check','str','588pCJrln','log','\x20config\x20delete\x20inherit','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','not\x20configured','805214KeDtoJ','includes','registryPath','prototype','\x20(accessKey)','ClientAk','(default)','call','\x20\x20kbServiceDomain:\x20','(none)','app','status','(removed\x20—\x20cookie\x20auth\x20disabled)','3290XtjGkS','\x20doctor','platform','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Country/Region\x20Configuration','\x20config\x20delete\x20routing','project','locale','Unavailable\x20until\x20routing\x20configuration\x20is\x20repaired','\x20\x20Service\x20Tree','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','⚠\x20Empty\x20(treated\x20as\x20{})','12944656KyaFfd','\x20\x20Merged\x20Config','13473wzWApp','Diagnose\x20CLI\x20configuration\x20and\x20environment','padEnd','\x20Imported\x20from:\x20','(invalid)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','format','appCode','gray','\x20\x20Repair\x20project:\x20\x20\x20','2158744hVAJak','arch','green','\x20commands)','\x20config','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','globalConfig','(not\x20found)','read','inherit','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Skill\x20Version:\x20\x20\x20','join','\x20\x20app\x20locale:\x20\x20\x20\x20\x20\x20','\x20\x20State:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','ignored\x20in\x20','reason','yellow','\x20config\x20delete\x20region','\x20+\x20','commandCount','110YnYgON','(no\x20file)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','serviceCount','empty','accessKey','5000271QXxyJn','routing','services','\x20\x20Auth','\x20\x20App\x20selection\x20does\x20not\x20switch\x20credentials\x20or\x20identity.','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','message','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','projectConfig','\x20\x20Local\x20configuration\x20does\x20not\x20verify\x20identity\x20or\x20operation\x20permissions;\x20the\x20server\x20enforces\x20access.','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','hasOwnProperty','\x20\x20Routing\x20Configuration','(missing)','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','global','\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','14105pOWcQy','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20skillDomain:\x20\x20\x20\x20\x20','doctor','skillVersion'];a32_0x38ab=function(){return _0x51198b;};return a32_0x38ab();}function a32_0x39a5(_0x3b64c7,_0x49474f){_0x3b64c7=_0x3b64c7-0x1b3;const _0x38abdb=a32_0x38ab();let _0x39a52e=_0x38abdb[_0x3b64c7];return _0x39a52e;}import{AUTH_MODE}from'../constant/auth-mode.js';import{inspectServiceRegistry}from'../commands/service/registry.js';import{inspectBuiltinSkill}from'../skills/builtin-skill.js';async function execute(_0x529919){const _0x1d9e52=a32_0x39a5,_0x54cf2a=getCliVersion(),_0x382ac2=buildConfigFromFlags({'app':_0x529919[_0x1d9e52(0x1d8)]?.(_0x1d9e52(0x1e8)),'appcode':_0x529919[_0x1d9e52(0x1d8)]?.(_0x1d9e52(0x1c8)),'env':_0x529919['str']?.('env')});let _0x434795,_0x19d669;try{_0x434795=normalizeLovrabetRegion(_0x382ac2[_0x1d9e52(0x1b5)][_0x1d9e52(0x1b4)]);}catch(_0x58a276){_0x19d669=_0x58a276 instanceof Error?_0x58a276:new Error(String(_0x58a276));}let _0xb106ee;if(!_0x19d669)try{await initGlobalEnvironment(_0x382ac2);}catch(_0x3db6a8){_0xb106ee=_0x3db6a8 instanceof Error?_0x3db6a8:new Error(String(_0x3db6a8));}console[_0x1d9e52(0x1da)](),console['log'](a32_0x1af0eb['bold'](CLI_BIN_NAME+_0x1d9e52(0x1ec))),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)]('─'[_0x1d9e52(0x1cc)](0x32))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x208)+_0x54cf2a),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1ee)+process['version']),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1c4)+process[_0x1d9e52(0x1ed)]+'\x20'+process[_0x1d9e52(0x204)]);const _0x127fe7=inspectBuiltinSkill();console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)]('\x20\x20Built-in\x20Skill')),console['log'](a32_0x1af0eb['gray'](_0x1d9e52(0x1bc)[_0x1d9e52(0x1cc)](0x1e))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x212)+(_0x127fe7[_0x1d9e52(0x1d4)]===_0x1d9e52(0x1b7)?a32_0x1af0eb[_0x1d9e52(0x205)](_0x1d9e52(0x1cb)):a32_0x1af0eb[_0x1d9e52(0x1b6)]('✗\x20'+_0x127fe7[_0x1d9e52(0x1d4)]))),console['log'](_0x1d9e52(0x1ba)+_0x127fe7['packageVersion']),console['log'](_0x1d9e52(0x20f)+(_0x127fe7[_0x1d9e52(0x235)]||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x22c)))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1c7)+(_0x127fe7[_0x1d9e52(0x1d2)]||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x20a))));_0x127fe7['state']!==_0x1d9e52(0x1b7)&&console[_0x1d9e52(0x1da)]('\x20\x20Repair:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x127fe7[_0x1d9e52(0x236)]);_0x127fe7[_0x1d9e52(0x214)]&&console[_0x1d9e52(0x1da)](_0x1d9e52(0x230)+_0x127fe7[_0x1d9e52(0x214)]);console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x1c5))),console['log'](a32_0x1af0eb['gray'](_0x1d9e52(0x1bc)['repeat'](0x1e)));const _0x204ed4=getGlobalConfigPath(),_0x19a0e3=getProjectConfigPath();console[_0x1d9e52(0x1da)](_0x1d9e52(0x229)+(_0x204ed4||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x20a)))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x22d)+(_0x19a0e3||a32_0x1af0eb['gray'](_0x1d9e52(0x20a)))),console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x1ca))),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)]('\x20\x20─'[_0x1d9e52(0x1cc)](0x1e)));const _0xd7ec36=(_0x574db1,_0x34d124)=>{const _0x4c3cb5=_0x1d9e52;if(!_0x34d124){console[_0x4c3cb5(0x1da)]('\x20\x20'+_0x574db1[_0x4c3cb5(0x1fb)](0x11)+'\x20'+a32_0x1af0eb[_0x4c3cb5(0x201)](_0x4c3cb5(0x21a)));return;}const _0x17a154=inspectCliConfigJsonFile(_0x34d124);if(_0x17a154['status']==='ok')console['log']('\x20\x20'+_0x574db1['padEnd'](0x11)+'\x20'+a32_0x1af0eb[_0x4c3cb5(0x205)](_0x4c3cb5(0x1c6)));else{if(_0x17a154[_0x4c3cb5(0x1e9)]===_0x4c3cb5(0x21d))console[_0x4c3cb5(0x1da)]('\x20\x20'+_0x574db1[_0x4c3cb5(0x1fb)](0x11)+'\x20'+a32_0x1af0eb[_0x4c3cb5(0x215)](_0x4c3cb5(0x1f6)));else _0x17a154['status']===_0x4c3cb5(0x22e)?console[_0x4c3cb5(0x1da)]('\x20\x20'+_0x574db1[_0x4c3cb5(0x1fb)](0x11)+'\x20'+a32_0x1af0eb[_0x4c3cb5(0x201)](_0x4c3cb5(0x22c))):(console[_0x4c3cb5(0x1da)]('\x20\x20'+_0x574db1[_0x4c3cb5(0x1fb)](0x11)+'\x20'+a32_0x1af0eb[_0x4c3cb5(0x1b6)]('✗\x20Invalid\x20JSON')),console['log']('\x20\x20'+''[_0x4c3cb5(0x1fb)](0x11)+'\x20'+a32_0x1af0eb['red'](_0x17a154['message'])));}};_0xd7ec36('Global',_0x204ed4),_0xd7ec36(_0x1d9e52(0x1d3),_0x19a0e3);const _0x17aaf6=loadRawConfigLayers(),_0x133b3e=[Object['prototype']['hasOwnProperty'][_0x1d9e52(0x1e5)](_0x17aaf6['globalConfig'],_0x1d9e52(0x20c))?_0x1d9e52(0x22f):null,Object['prototype'][_0x1d9e52(0x22a)][_0x1d9e52(0x1e5)](_0x17aaf6[_0x1d9e52(0x227)],_0x1d9e52(0x20c))?_0x1d9e52(0x1f1):null][_0x1d9e52(0x1bd)](Boolean);_0x133b3e['length']>0x0&&(console['log']('\x20\x20Legacy\x20inherit:\x20\x20\x20'+a32_0x1af0eb['yellow'](_0x1d9e52(0x213)+_0x133b3e[_0x1d9e52(0x210)](_0x1d9e52(0x217))+_0x1d9e52(0x207))),_0x133b3e['includes'](_0x1d9e52(0x1f1))&&console[_0x1d9e52(0x1da)](_0x1d9e52(0x202)+CLI_BIN_NAME+_0x1d9e52(0x1db)),_0x133b3e[_0x1d9e52(0x1df)](_0x1d9e52(0x22f))&&console[_0x1d9e52(0x1da)]('\x20\x20Repair\x20global:\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1d9e52(0x1c2)));_0xb106ee&&(console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x22b))),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1bc)['repeat'](0x1e))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x224)+a32_0x1af0eb['red'](_0x1d9e52(0x1c3))),console[_0x1d9e52(0x1da)]('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xb106ee[_0x1d9e52(0x225)]),Object['prototype'][_0x1d9e52(0x22a)][_0x1d9e52(0x1e5)](_0x17aaf6['projectConfig'],'routing')&&console[_0x1d9e52(0x1da)](_0x1d9e52(0x1cf)+CLI_BIN_NAME+_0x1d9e52(0x1f0)),Object[_0x1d9e52(0x1e1)][_0x1d9e52(0x22a)][_0x1d9e52(0x1e5)](_0x17aaf6[_0x1d9e52(0x209)],_0x1d9e52(0x220))&&console[_0x1d9e52(0x1da)](_0x1d9e52(0x1c1)+CLI_BIN_NAME+'\x20config\x20delete\x20routing\x20--global'));_0x19d669&&(console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x1ef))),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1bc)['repeat'](0x1e))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x224)+a32_0x1af0eb['red'](_0x1d9e52(0x1c3))),console['log']('\x20\x20Reason:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x19d669['message']),Object['prototype']['hasOwnProperty'][_0x1d9e52(0x1e5)](_0x17aaf6['projectConfig'],_0x1d9e52(0x1b4))&&console[_0x1d9e52(0x1da)]('\x20\x20Repair\x20project:\x20\x20'+CLI_BIN_NAME+_0x1d9e52(0x216)),Object[_0x1d9e52(0x1e1)]['hasOwnProperty'][_0x1d9e52(0x1e5)](_0x17aaf6[_0x1d9e52(0x209)],_0x1d9e52(0x1b4))&&console['log']('\x20\x20Repair\x20global:\x20\x20\x20'+CLI_BIN_NAME+'\x20config\x20init'));console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x1f8))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x223)),console[_0x1d9e52(0x1da)](_0x1d9e52(0x228)),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)]('\x20\x20─'[_0x1d9e52(0x1cc)](0x1e))),console['log'](_0x1d9e52(0x1bf)+(_0x382ac2[_0x1d9e52(0x200)]||a32_0x1af0eb[_0x1d9e52(0x1b6)]('(not\x20set)'))),console[_0x1d9e52(0x1da)]('\x20\x20region:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x434795??a32_0x1af0eb['red'](_0x1d9e52(0x1fd)))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x211)+_0x382ac2[_0x1d9e52(0x1f2)]),console['log'](_0x1d9e52(0x1f5)+(_0x382ac2['defaultApp']||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1e7)))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1d0)+(_0x382ac2['currentApp']||a32_0x1af0eb['gray'](_0x1d9e52(0x1e7)))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x21b)+(_0x382ac2[_0x1d9e52(0x1ff)]||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1d6)+DEFAULT_CONFIG_VALUES[_0x1d9e52(0x1ff)]+')'))),console[_0x1d9e52(0x1da)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x382ac2[_0x1d9e52(0x1b3)]??a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1e4)))),console[_0x1d9e52(0x1da)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x382ac2[_0x1d9e52(0x1ce)]),console[_0x1d9e52(0x1da)](_0x1d9e52(0x232)+_0x382ac2[_0x1d9e52(0x1b8)]),console[_0x1d9e52(0x1da)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x1d9e52(0x1e3)]);if(_0x382ac2[_0x1d9e52(0x1c0)])console[_0x1d9e52(0x1da)]('\x20\x20AK\x20source:\x20\x20\x20\x20\x20\x20\x20'+_0x382ac2[_0x1d9e52(0x1c0)]);console[_0x1d9e52(0x1da)](_0x1d9e52(0x1fe)+(_0x382ac2[_0x1d9e52(0x21e)]?a32_0x1af0eb['green'](_0x1d9e52(0x1d5)+_0x382ac2[_0x1d9e52(0x21e)]['length']+')'):a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1e7)))),console[_0x1d9e52(0x1da)](),console['log'](a32_0x1af0eb[_0x1d9e52(0x1d1)]('\x20\x20API\x20Endpoints')),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1bc)['repeat'](0x1e)));_0xb106ee||_0x19d669?console[_0x1d9e52(0x1da)](_0x1d9e52(0x224)+a32_0x1af0eb[_0x1d9e52(0x1b6)](_0x1d9e52(0x1f3))):(console[_0x1d9e52(0x1da)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console['log'](_0x1d9e52(0x1dc)+getUserDomain()),console[_0x1d9e52(0x1da)]('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x1d9e52(0x1da)](_0x1d9e52(0x233)+getSkillDomain()),console['log'](_0x1d9e52(0x1e6)+(getKbServiceDomain()??_0x1d9e52(0x1dd))));console[_0x1d9e52(0x1da)](),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x1d1)](_0x1d9e52(0x1f4))),console['log'](a32_0x1af0eb['gray'](_0x1d9e52(0x1bc)[_0x1d9e52(0x1cc)](0x1e)));const _0xc9372e=inspectServiceRegistry();console[_0x1d9e52(0x1da)](_0x1d9e52(0x226)+_0xc9372e[_0x1d9e52(0x1e0)]),console[_0x1d9e52(0x1da)]('\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+formatServiceRegistryStatus(_0xc9372e)),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1c9)+_0xc9372e[_0x1d9e52(0x21c)]),console[_0x1d9e52(0x1da)](_0x1d9e52(0x20e)+_0xc9372e['commandCount']);for(const _0x6bd7f6 of _0xc9372e[_0x1d9e52(0x221)]){console[_0x1d9e52(0x1da)]('\x20\x20'+(_0x6bd7f6['serviceCode']+':')[_0x1d9e52(0x1fb)](0x11)+'\x20'+(_0x6bd7f6['name']||a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1be)))+'\x20('+_0x6bd7f6[_0x1d9e52(0x218)]+_0x1d9e52(0x206)),console[_0x1d9e52(0x1da)]('\x20\x20'+''[_0x1d9e52(0x1fb)](0x11)+_0x1d9e52(0x1fc)+_0x6bd7f6['source'][_0x1d9e52(0x1bb)]);}return console[_0x1d9e52(0x1da)](),console['log'](a32_0x1af0eb['bold'](_0x1d9e52(0x222))),console[_0x1d9e52(0x1da)](a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1bc)[_0x1d9e52(0x1cc)](0x1e))),console[_0x1d9e52(0x1da)](_0x1d9e52(0x1b9)+a32_0x1af0eb[_0x1d9e52(0x205)](AUTH_MODE['ClientAk']+_0x1d9e52(0x1e2))),console['log'](_0x1d9e52(0x20d)+a32_0x1af0eb[_0x1d9e52(0x201)](_0x1d9e52(0x1ea))),console[_0x1d9e52(0x1da)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x446be2){const _0x5a6075=a32_0x39a5;if(_0x446be2[_0x5a6075(0x1e9)]==='ok')return a32_0x1af0eb[_0x5a6075(0x205)]('✓\x20Loaded');if(_0x446be2['status']==='missing')return a32_0x1af0eb[_0x5a6075(0x201)](_0x5a6075(0x20a));if(_0x446be2[_0x5a6075(0x1e9)]===_0x5a6075(0x21d))return a32_0x1af0eb[_0x5a6075(0x215)]('⚠\x20Empty');return a32_0x1af0eb[_0x5a6075(0x1b6)]('✗\x20Invalid'+(_0x446be2[_0x5a6075(0x225)]?':\x20'+_0x446be2[_0x5a6075(0x225)]:''));}export const doctorDefinition={'service':a32_0x29b9d1(0x234),'command':a32_0x29b9d1(0x1d7),'description':a32_0x29b9d1(0x1fa),'risk':a32_0x29b9d1(0x20b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x24aa68=a33_0x18b5;(function(_0x27da27,_0xb2a756){const _0x24e7fa=a33_0x18b5,_0x503735=_0x27da27();while(!![]){try{const _0x5a0f49=-parseInt(_0x24e7fa(0xf9))/0x1+parseInt(_0x24e7fa(0xf0))/0x2*(-parseInt(_0x24e7fa(0xeb))/0x3)+parseInt(_0x24e7fa(0xde))/0x4+parseInt(_0x24e7fa(0xdf))/0x5+-parseInt(_0x24e7fa(0xfe))/0x6+-parseInt(_0x24e7fa(0xe2))/0x7*(-parseInt(_0x24e7fa(0xf3))/0x8)+parseInt(_0x24e7fa(0xfc))/0x9;if(_0x5a0f49===_0xb2a756)break;else _0x503735['push'](_0x503735['shift']());}catch(_0x6f3e20){_0x503735['push'](_0x503735['shift']());}}}(a33_0x30e7,0x3ab44));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a33_0x18b5(_0x466de5,_0x5a8f9f){_0x466de5=_0x466de5-0xdc;const _0x30e796=a33_0x30e7();let _0x18b560=_0x30e796[_0x466de5];return _0x18b560;}import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a33_0x24aa68(0xe0),'type':'string','required':!![],'description':'Path\x20to\x20the\x20local\x20file\x20to\x20upload'},FILEPATH_FLAG={'name':a33_0x24aa68(0xea),'type':a33_0x24aa68(0xe4),'required':!![],'description':a33_0x24aa68(0xf5)},DOWNLOAD_FLAG={'name':a33_0x24aa68(0xec),'type':'boolean','description':a33_0x24aa68(0xe9)},LONG_TERM_FLAG={'name':a33_0x24aa68(0xff),'type':a33_0x24aa68(0xe8),'description':a33_0x24aa68(0xe5)};function requireFilePath(_0x545745){const _0x8f2601=a33_0x24aa68,_0x261486=_0x545745[_0x8f2601(0xfa)]();if(!_0x261486)throw CliErrors['validation']('filePath\x20is\x20required.');return _0x261486;}const fileUpload={'service':a33_0x24aa68(0xe0),'command':a33_0x24aa68(0xf6),'description':a33_0x24aa68(0xfd),'risk':a33_0x24aa68(0xe1),'flags':[FILE_FLAG],async 'dryRun'(_0x2cfef1){const _0xb50123=a33_0x24aa68,_0x57f10b=requireRuntimeUploadFile(_0x2cfef1[_0xb50123(0xdd)](_0xb50123(0xe0)),_0xb50123(0xf7));return dryRun(_0xb50123(0xed),'/client/uploadFile')[_0xb50123(0xf2)]({'appCode':_0x2cfef1[_0xb50123(0xfb)],'multipart':{'file':_0x57f10b}})[_0xb50123(0x100)]('Preview:\x20upload\x20'+_0x57f10b[_0xb50123(0xe3)]+_0xb50123(0xe7)+_0x2cfef1[_0xb50123(0xfb)])[_0xb50123(0xee)]();},async 'execute'(_0x1303ae){const _0x427ddd=a33_0x24aa68,_0x5c24db=requireRuntimeUploadFile(_0x1303ae[_0x427ddd(0xdd)](_0x427ddd(0xe0)),_0x427ddd(0xf7)),_0x509a31=await uploadRuntimeFile(_0x1303ae[_0x427ddd(0xfb)],_0x5c24db[_0x427ddd(0xe3)]);return{'ok':!![],'data':_0x509a31,'message':_0x509a31[_0x427ddd(0xf4)]?_0x427ddd(0xef)+_0x509a31[_0x427ddd(0xf4)]+'.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.':_0x427ddd(0xf8)};}},fileQueryUrl={'service':a33_0x24aa68(0xe0),'command':a33_0x24aa68(0xdc),'description':a33_0x24aa68(0xe6),'risk':a33_0x24aa68(0xe1),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x29371c){const _0x2c69d3=a33_0x24aa68,_0x323d3d=requireFilePath(_0x29371c['str'](_0x2c69d3(0xea))),_0x3f9b21=await queryRuntimeFileUrl(_0x323d3d,{'download':_0x29371c[_0x2c69d3(0xf1)]('download'),'longTerm':_0x29371c[_0x2c69d3(0xf1)](_0x2c69d3(0xff))});return{'ok':!![],'data':_0x3f9b21};}};function a33_0x30e7(){const _0x52680d=['string','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','\x20to\x20runtime\x20app\x20','boolean','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','filepath','26511xicNoJ','download','POST','build','Uploaded\x20file:\x20','26nEsebI','bool','body','2233432rdUhXs','filePath','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','upload','File','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','265972heiKOB','trim','appCode','3839832Lpwnam','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','1924044FKWstj','long-term','description','query-url','str','513672oKTuyp','538670YmyQfK','file','read','7cIStdP','path'];a33_0x30e7=function(){return _0x52680d;};return a33_0x30e7();}export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0xf279d3=a34_0x5ce1;(function(_0x210922,_0x5e3106){const _0x16fd6d=a34_0x5ce1,_0x50ebf1=_0x210922();while(!![]){try{const _0x2e21e2=-parseInt(_0x16fd6d(0x165))/0x1+parseInt(_0x16fd6d(0x14e))/0x2*(-parseInt(_0x16fd6d(0x153))/0x3)+parseInt(_0x16fd6d(0x159))/0x4*(-parseInt(_0x16fd6d(0x158))/0x5)+parseInt(_0x16fd6d(0x164))/0x6+-parseInt(_0x16fd6d(0x150))/0x7*(-parseInt(_0x16fd6d(0x142))/0x8)+-parseInt(_0x16fd6d(0x15c))/0x9*(-parseInt(_0x16fd6d(0x15d))/0xa)+parseInt(_0x16fd6d(0x162))/0xb*(parseInt(_0x16fd6d(0x168))/0xc);if(_0x2e21e2===_0x5e3106)break;else _0x50ebf1['push'](_0x50ebf1['shift']());}catch(_0x1ce993){_0x50ebf1['push'](_0x50ebf1['shift']());}}}(a34_0x4f63,0x78ec3));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a34_0x5ce1(_0x426736,_0x4db0f6){_0x426736=_0x426736-0x13c;const _0x4f63f2=a34_0x4f63();let _0x5ce14c=_0x4f63f2[_0x426736];return _0x5ce14c;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':a34_0xf279d3(0x156),'type':a34_0xf279d3(0x15a),'description':a34_0xf279d3(0x14a),'required':!![]},{'name':a34_0xf279d3(0x13e),'type':a34_0xf279d3(0x15a),'description':a34_0xf279d3(0x15f)},{'name':'env','type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a34_0xf279d3(0x148),'description':a34_0xf279d3(0x13d)+PRODUCT_CONFIG[a34_0xf279d3(0x15e)]+')\x20instead\x20of\x20project','default':![]},{'name':a34_0xf279d3(0x14f),'type':a34_0xf279d3(0x148),'description':a34_0xf279d3(0x160),'default':![]}];export async function runAppImport(_0x49664a){const _0x53fde9=a34_0xf279d3,_0x1c9cc5=_0x49664a['global']?_0x53fde9(0x14b):_0x53fde9(0x14d),_0x3b523d=resolveWriteConfigPath(_0x1c9cc5);await runFromImport(_0x49664a,_0x3b523d);}async function runFromImport(_0x1308b0,_0x3b0e80){const _0x4630ce=a34_0xf279d3,_0x2eceb3=resolveFilePath(_0x1308b0[_0x4630ce(0x156)]);if(!existsSync(_0x2eceb3))throw CliErrors[_0x4630ce(0x140)](_0x4630ce(0x152)+_0x2eceb3);const _0x2d3ee8=readSourceFile(_0x2eceb3),_0x1a2120=convertToRuntimeConfig(_0x2d3ee8);_0x1308b0[_0x4630ce(0x13e)]&&(_0x1a2120[_0x4630ce(0x13e)]=String(_0x1308b0['appcode']));_0x1308b0[_0x4630ce(0x167)]&&(_0x1a2120[_0x4630ce(0x167)]=resolveImportEnv(_0x1308b0));if(!_0x1a2120[_0x4630ce(0x13e)])throw CliErrors[_0x4630ce(0x140)](_0x4630ce(0x155),_0x4630ce(0x166));await writeImportConfig(_0x3b0e80,_0x1a2120,_0x1308b0),console['log'](_0x4630ce(0x141)+_0x2eceb3),console[_0x4630ce(0x147)](_0x4630ce(0x13f)+_0x3b0e80),console[_0x4630ce(0x147)](_0x4630ce(0x157)+_0x1a2120[_0x4630ce(0x13e)]);if(_0x1a2120[_0x4630ce(0x143)])console[_0x4630ce(0x147)]('\x20\x20default:\x20'+_0x1a2120['defaultApp']);}function convertToRuntimeConfig(_0x1afef4){const _0xbe4ef9=a34_0xf279d3;if(_0x1afef4['apps']&&typeof _0x1afef4[_0xbe4ef9(0x151)]===_0xbe4ef9(0x149))throw CliErrors[_0xbe4ef9(0x140)](_0xbe4ef9(0x161),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x3dcf7b={};for(const _0x260819 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x1afef4[_0x260819]!==undefined&&(_0x3dcf7b[_0x260819]=_0x1afef4[_0x260819]);}return!_0x3dcf7b[_0xbe4ef9(0x145)]&&(_0x3dcf7b[_0xbe4ef9(0x145)]=DEFAULT_CONFIG_VALUES[_0xbe4ef9(0x145)]),_0x3dcf7b;}async function writeImportConfig(_0x2648ee,_0x1dc0f9,_0x465036){const _0x34f218=a34_0xf279d3;let _0xc55ec1={};existsSync(_0x2648ee)&&!_0x465036[_0x34f218(0x14f)]&&(_0xc55ec1=readConfigFile(_0x2648ee));for(const [_0x5ed4b6,_0x4dc6af]of Object[_0x34f218(0x15b)](_0x1dc0f9)){_0x4dc6af!==undefined&&(_0xc55ec1[_0x5ed4b6]=_0x4dc6af);}if(_0xc55ec1['app'])delete _0xc55ec1[_0x34f218(0x14c)];writeConfigFile(_0x2648ee,_0xc55ec1);}function a34_0x4f63(){const _0x15d5df=['Skip\x20confirmation\x20when\x20overwriting','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','1326116EBBqnT','Invalid\x20env\x20\x22','3807192OYrJRq','30174EBWDWD','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','env','144zbJjTF','Failed\x20to\x20parse\x20source\x20file:\x20','parse','Write\x20to\x20global\x20(~/','appcode','\x20\x20config:\x20\x20','validation','Imported\x20from\x20','53488QLhKWD','defaultApp','includes','riskLevel','cwd','log','boolean','object','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','global','app','project','82imWoGX','yes','70fTSVcy','apps','Source\x20file\x20not\x20found:\x20','71877oNsuaB','join','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','file','\x20\x20appcode:\x20','706295ZGhSeR','28otFdNm','string','entries','9FUQlci','3485410GHcpNA','newConfigFileName','Override\x20imported\x20default\x20appcode'];a34_0x4f63=function(){return _0x15d5df;};return a34_0x4f63();}function resolveFilePath(_0x44c300){const _0x3b292c=a34_0xf279d3;return isAbsolute(_0x44c300)?_0x44c300:resolve(process[_0x3b292c(0x146)](),_0x44c300);}function readSourceFile(_0x3fda2d){const _0x3eddf5=a34_0xf279d3;try{const _0x253018=readFileSync(_0x3fda2d,{'encoding':'utf8'});return JSON[_0x3eddf5(0x13c)](_0x253018);}catch(_0x588842){throw CliErrors['validation'](_0x3eddf5(0x169)+_0x588842['message']);}}function resolveImportEnv(_0x4ad34c){const _0x258395=a34_0xf279d3,_0x1f1611=_0x4ad34c['env'];if(_0x1f1611===undefined||_0x1f1611==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x258395(0x144)](_0x1f1611))throw CliErrors['validation'](_0x258395(0x163)+_0x1f1611+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x258395(0x154)](',\x20'));return _0x1f1611;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58f06b,_0x598713){const _0x357d04=a35_0x14eb,_0x2ae1f7=_0x58f06b();while(!![]){try{const _0x45446c=-parseInt(_0x357d04(0xb8))/0x1*(-parseInt(_0x357d04(0xc5))/0x2)+-parseInt(_0x357d04(0xc3))/0x3+-parseInt(_0x357d04(0xbc))/0x4+parseInt(_0x357d04(0xc4))/0x5+-parseInt(_0x357d04(0xb9))/0x6*(parseInt(_0x357d04(0xb3))/0x7)+parseInt(_0x357d04(0xbb))/0x8+parseInt(_0x357d04(0xc2))/0x9;if(_0x45446c===_0x598713)break;else _0x2ae1f7['push'](_0x2ae1f7['shift']());}catch(_0x4d9539){_0x2ae1f7['push'](_0x2ae1f7['shift']());}}}(a35_0x3dfa,0x8ef40));import{platform,release,arch}from'node:os';function a35_0x3dfa(){const _0x34e975=['username','userId','nickname','mergedCli','appCode','14728455JZBZZh','1921308gvIlWk','3676645FqLDxZ','572714mLBQGm','userName','1050yEKDrq','envName','nickName','@lovrabet/lovrabet-cli','email','1NOBkBt','39168qUUNEq','tenantCode','1998808CkedOd','2811440ymMOwD'];a35_0x3dfa=function(){return _0x34e975;};return a35_0x3dfa();}import{getLoginUserInfo}from'../../core/api-client.js';import{getCliVersion}from'../../utils/version.js';function a35_0x14eb(_0x56f2e6,_0x5785ab){_0x56f2e6=_0x56f2e6-0xb3;const _0x3dfa7c=a35_0x3dfa();let _0x14ebd8=_0x3dfa7c[_0x56f2e6];return _0x14ebd8;}export async function getIssueReportContext(_0x38d649,_0x232bf4){const _0x25e993=a35_0x14eb,_0x5193dc=_0x232bf4?undefined:await getLoginUserInfo();return{'serviceName':_0x25e993(0xb6),'serviceVersion':getCliVersion(),'environment':_0x38d649[_0x25e993(0xb4)]??'production','appCode':_0x38d649[_0x25e993(0xc1)]||_0x38d649[_0x25e993(0xc0)]?.['appCode'],'os':platform()+'\x20'+release()+'\x20'+arch(),'terminal':process.env.TERM,'user':_0x5193dc?{'id':String(_0x5193dc['id']??_0x5193dc[_0x25e993(0xbe)]??''),'username':_0x5193dc[_0x25e993(0xbd)]??_0x5193dc[_0x25e993(0xc6)]??_0x5193dc['loginName'],'nickname':_0x5193dc[_0x25e993(0xbf)]??_0x5193dc[_0x25e993(0xb5)]??_0x5193dc['name']??undefined,'email':_0x5193dc[_0x25e993(0xb7)]??undefined,'tenantCode':_0x5193dc[_0x25e993(0xba)]}:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1338f0,_0x3879c0){const _0x2ccfab=a36_0x1813,_0x41fb48=_0x1338f0();while(!![]){try{const _0x1e0eb1=-parseInt(_0x2ccfab(0x1c4))/0x1*(-parseInt(_0x2ccfab(0x1c9))/0x2)+parseInt(_0x2ccfab(0x1ca))/0x3*(-parseInt(_0x2ccfab(0x1d0))/0x4)+parseInt(_0x2ccfab(0x1cd))/0x5*(parseInt(_0x2ccfab(0x1cf))/0x6)+-parseInt(_0x2ccfab(0x1c6))/0x7*(parseInt(_0x2ccfab(0x1c5))/0x8)+parseInt(_0x2ccfab(0x1c8))/0x9+parseInt(_0x2ccfab(0x1c7))/0xa*(-parseInt(_0x2ccfab(0x1cc))/0xb)+parseInt(_0x2ccfab(0x1cb))/0xc*(-parseInt(_0x2ccfab(0x1ce))/0xd);if(_0x1e0eb1===_0x3879c0)break;else _0x41fb48['push'](_0x41fb48['shift']());}catch(_0x3336de){_0x41fb48['push'](_0x41fb48['shift']());}}}(a36_0x14e7,0x43a82));import{issueReport}from'./report.js';function a36_0x1813(_0x44506e,_0x1f668d){_0x44506e=_0x44506e-0x1c4;const _0x14e76b=a36_0x14e7();let _0x181321=_0x14e76b[_0x44506e];return _0x181321;}function a36_0x14e7(){const _0x2e512d=['1792jIhUaH','3tbwkzu','384HddGoF','33gnpcwU','10tMbhQa','28639BXugmE','414462nuSLTt','302564CSTGnr','10RYWDBL','24oxlaam','267043QVaJwU','98740DokbWi','3781926nNHxLY'];a36_0x14e7=function(){return _0x2e512d;};return a36_0x14e7();}export const issueDefinitions=[issueReport];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x5a7c44=a37_0x5e11;(function(_0xaed07a,_0x2befb2){const _0x748d44=a37_0x5e11,_0x411ade=_0xaed07a();while(!![]){try{const _0x24ce7a=-parseInt(_0x748d44(0x139))/0x1*(-parseInt(_0x748d44(0x122))/0x2)+parseInt(_0x748d44(0x13e))/0x3*(-parseInt(_0x748d44(0x135))/0x4)+-parseInt(_0x748d44(0x144))/0x5*(-parseInt(_0x748d44(0x11c))/0x6)+parseInt(_0x748d44(0x128))/0x7*(-parseInt(_0x748d44(0x13b))/0x8)+parseInt(_0x748d44(0x126))/0x9+parseInt(_0x748d44(0x11a))/0xa*(-parseInt(_0x748d44(0x11e))/0xb)+parseInt(_0x748d44(0x110))/0xc;if(_0x24ce7a===_0x2befb2)break;else _0x411ade['push'](_0x411ade['shift']());}catch(_0x19f6ae){_0x411ade['push'](_0x411ade['shift']());}}}(a37_0x41c5,0xd86ec));import{existsSync}from'node:fs';import{readFile}from'node:fs/promises';import{resolve}from'node:path';function a37_0x5e11(_0x1113e6,_0x1325bf){_0x1113e6=_0x1113e6-0x10d;const _0x41c53a=a37_0x41c5();let _0x5e11bd=_0x41c53a[_0x1113e6];return _0x5e11bd;}import{CliErrors}from'../../errors.js';import{reportIssue}from'@lovrabet/cli-framework';import{getIssueReportContext}from'./context.js';const DESCRIPTION_FILE_FLAG=a37_0x5a7c44(0x12a);export const issueReport={'service':a37_0x5a7c44(0x12b),'command':a37_0x5a7c44(0x120),'description':a37_0x5a7c44(0x12e),'risk':a37_0x5a7c44(0x113),'confirmationDescription':a37_0x5a7c44(0x13a),'requiresAuth':!![],'requiresAppCode':![],'defaultOutputFormat':a37_0x5a7c44(0x123),'flags':[{'name':a37_0x5a7c44(0x13d),'type':a37_0x5a7c44(0x129),'required':!![],'description':a37_0x5a7c44(0x138)},{'name':a37_0x5a7c44(0x10f),'type':'string','description':'Inline\x20markdown\x20issue\x20description\x20(alternative\x20to\x20--description-file)'},{'name':DESCRIPTION_FILE_FLAG,'type':'string','description':a37_0x5a7c44(0x127)}],async 'validate'(_0x553146){const _0x18dc10=a37_0x5a7c44,_0x2b848d=_0x553146[_0x18dc10(0x137)](_0x18dc10(0x13d))['trim'](),_0x3c52bb=_0x553146['str'](_0x18dc10(0x10f))[_0x18dc10(0x142)](),_0x10e477=_0x553146[_0x18dc10(0x137)](DESCRIPTION_FILE_FLAG)[_0x18dc10(0x142)]();if(!_0x2b848d)throw CliErrors['flagMissing'](_0x18dc10(0x13d),'Provide\x20--title\x20with\x20a\x20one-line\x20issue\x20summary.');const _0x45f1cf=_0x3c52bb[_0x18dc10(0x12f)]>0x0,_0x523fd4=_0x10e477[_0x18dc10(0x12f)]>0x0;if(_0x45f1cf===_0x523fd4)throw CliErrors[_0x18dc10(0x124)](_0x18dc10(0x118),_0x18dc10(0x11d));if(_0x523fd4){const _0x7b2e09=resolve(process[_0x18dc10(0x133)](),_0x10e477);if(!existsSync(_0x7b2e09))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x7b2e09);}},async 'dryRun'(_0xb75fb2){const _0x4f95b2=a37_0x5a7c44,_0x3c2bc6=await prepareIssueReport(_0xb75fb2,!![]);return{'method':_0x4f95b2(0x112),'url':_0x4f95b2(0x13f)+_0x3c2bc6[_0x4f95b2(0x116)]+'/'+_0x3c2bc6['spanName'],'body':{'traceName':_0x3c2bc6[_0x4f95b2(0x116)],'spanName':_0x3c2bc6[_0x4f95b2(0x117)],'logData':_0x3c2bc6['logData']},'description':[_0x4f95b2(0x111),'descriptionSource:\x20'+_0x3c2bc6[_0x4f95b2(0x132)],_0x3c2bc6[_0x4f95b2(0x10e)]?_0x4f95b2(0x114)+_0x3c2bc6[_0x4f95b2(0x10e)]:null,_0x3c2bc6[_0x4f95b2(0x12c)][_0x4f95b2(0x125)]?'truncated:\x20original\x20'+_0x3c2bc6[_0x4f95b2(0x12c)][_0x4f95b2(0x140)]+_0x4f95b2(0x134):null,_0x3c2bc6[_0x4f95b2(0x12c)][_0x4f95b2(0x13c)]>0x0?_0x4f95b2(0x130)+_0x3c2bc6[_0x4f95b2(0x12c)]['redactionCount']+'\x20('+_0x3c2bc6[_0x4f95b2(0x12c)][_0x4f95b2(0x10d)]['join'](',\x20')+')':null]['filter'](Boolean)[_0x4f95b2(0x136)]('\x0a')};},async 'execute'(_0xb81255){const _0x4d39d5=a37_0x5a7c44,_0x34e5dc=await prepareIssueReport(_0xb81255,![]);return{'ok':!![],'message':_0x34e5dc[_0x4d39d5(0x12c)][_0x4d39d5(0x13c)]||_0x34e5dc[_0x4d39d5(0x12c)][_0x4d39d5(0x125)]?_0x4d39d5(0x131):_0x4d39d5(0x11f),'data':{'traceName':_0x34e5dc[_0x4d39d5(0x116)],'spanName':_0x34e5dc[_0x4d39d5(0x117)],'logDataKeys':Object[_0x4d39d5(0x11b)](_0x34e5dc[_0x4d39d5(0x115)]),'issue':{'title':_0x34e5dc[_0x4d39d5(0x13d)],'descriptionLength':_0x34e5dc[_0x4d39d5(0x10f)][_0x4d39d5(0x12f)],'descriptionSource':_0x34e5dc[_0x4d39d5(0x132)],..._0x34e5dc[_0x4d39d5(0x10e)]?{'descriptionFile':_0x34e5dc[_0x4d39d5(0x10e)]}:{},'sanitize':{'originalBytes':_0x34e5dc[_0x4d39d5(0x12c)][_0x4d39d5(0x140)],'truncated':_0x34e5dc[_0x4d39d5(0x12c)][_0x4d39d5(0x125)],'redactions':_0x34e5dc[_0x4d39d5(0x12c)][_0x4d39d5(0x13c)],'redactionKinds':_0x34e5dc['sanitize'][_0x4d39d5(0x10d)]}}}};}};function a37_0x41c5(){const _0x41d364=['sanitize','Issue\x20description\x20cannot\x20be\x20empty.','Report\x20a\x20problem\x20log\x20with\x20title\x20and\x20markdown\x20context','length','redactions:\x20','Issue\x20log\x20submitted\x20(content\x20redacted\x20or\x20truncated)','descriptionSource','cwd','\x20bytes','24bixlKR','join','str','One-line\x20issue\x20summary','31TGjYeb','Submit\x20the\x20issue\x20description\x20and\x20diagnostic\x20context\x20as\x20a\x20problem\x20log.','266696LfeBrS','redactionCount','title','330996VjLuse','otel://','originalBytes','Check\x20your\x20login\x20and\x20network\x20connectivity.','trim','inline','5387365kLbYbu','Cannot\x20read\x20issue\x20description\x20file:\x20','redactionKinds','descriptionFilePath','description','5547360ztIzYb','Submit\x20a\x20problem\x20log','POST','read','descriptionFile:\x20','logData','traceName','spanName','Provide\x20exactly\x20one\x20of\x20--description\x20or\x20--description-file.','Failed\x20to\x20submit\x20issue\x20log:\x20','70AuZKHB','keys','6JYJbZQ','Use\x20--description\x20for\x20short\x20markdown\x20text,\x20or\x20--description-file\x20for\x20full\x20issue\x20context.','1697531BzzFNz','Issue\x20log\x20submitted','report','file','112786QzSrOq','compress','validation','truncated','968058qAWTRF','Path\x20to\x20a\x20markdown\x20file\x20whose\x20contents\x20become\x20issue.description','161MNKnJf','string','description-file','issue'];a37_0x41c5=function(){return _0x41d364;};return a37_0x41c5();}async function prepareIssueReport(_0x33088c,_0x42abe3){const _0x3a2cd8=a37_0x5a7c44;await issueReport['validate'](_0x33088c);const _0x4f3616=_0x33088c[_0x3a2cd8(0x137)](DESCRIPTION_FILE_FLAG)[_0x3a2cd8(0x142)](),_0x3332b2=_0x4f3616?resolve(process[_0x3a2cd8(0x133)](),_0x4f3616):undefined;let _0x1f43da=_0x33088c[_0x3a2cd8(0x137)]('description');if(_0x3332b2)try{_0x1f43da=await readFile(_0x3332b2,'utf8');}catch{throw CliErrors[_0x3a2cd8(0x124)](_0x3a2cd8(0x145)+_0x3332b2);}if(!_0x1f43da['trim']())throw CliErrors['validation'](_0x3a2cd8(0x12d));const _0x368d85=await getIssueReportContext(_0x33088c,_0x42abe3);try{const _0x101fc5=await reportIssue({'title':_0x33088c['str']('title'),'description':_0x1f43da,'context':_0x368d85,'dryRun':_0x42abe3});return{..._0x101fc5,'descriptionSource':_0x3332b2?_0x3a2cd8(0x121):_0x3a2cd8(0x143),'descriptionFilePath':_0x3332b2};}catch(_0x219443){throw CliErrors['apiError'](_0x3a2cd8(0x119)+(_0x219443 instanceof Error?_0x219443['message']:String(_0x219443)),_0x3a2cd8(0x141));}}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x4ae2b2=a38_0x1bd5;(function(_0x47dc80,_0xf39894){const _0x438766=a38_0x1bd5,_0x5d3601=_0x47dc80();while(!![]){try{const _0x5a6b5e=parseInt(_0x438766(0x130))/0x1+parseInt(_0x438766(0x143))/0x2+-parseInt(_0x438766(0x157))/0x3+parseInt(_0x438766(0x13e))/0x4*(-parseInt(_0x438766(0x15b))/0x5)+-parseInt(_0x438766(0x120))/0x6+parseInt(_0x438766(0x142))/0x7*(parseInt(_0x438766(0x159))/0x8)+-parseInt(_0x438766(0x128))/0x9*(parseInt(_0x438766(0x126))/0xa);if(_0x5a6b5e===_0xf39894)break;else _0x5d3601['push'](_0x5d3601['shift']());}catch(_0x1e144e){_0x5d3601['push'](_0x5d3601['shift']());}}}(a38_0x7697,0xd4795));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{searchDirectKnowledge,normalizeKbServiceOrigin}from'../../core/kb-search-client.js';import{planPersonalKnowledgeWrite,withKbManagementOrigin}from'../../core/kb-management-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{getKbServiceDomain}from'../../constant/domain.js';import{dryRun}from'../../framework/dryrun.js';function a38_0x1bd5(_0x2edd7b,_0x1f1acb){_0x2edd7b=_0x2edd7b-0x11b;const _0x7697b9=a38_0x7697();let _0x1bd576=_0x7697b9[_0x2edd7b];return _0x1bd576;}const TITLE_FLAG={'name':'title','type':a38_0x4ae2b2(0x12b),'required':!![],'description':a38_0x4ae2b2(0x121)},FILE_FLAG={'name':'file','type':a38_0x4ae2b2(0x12b),'required':!![],'description':a38_0x4ae2b2(0x12f)},QUERY_FLAG={'name':a38_0x4ae2b2(0x12c),'type':a38_0x4ae2b2(0x12b),'required':!![],'description':'Search\x20query\x20for\x20visible\x20public,\x20company,\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a38_0x4ae2b2(0x131),'type':a38_0x4ae2b2(0x11e),'description':a38_0x4ae2b2(0x129)};function readKnowledgeFile(_0x3f065c){const _0x559e9c=a38_0x4ae2b2;if(!_0x3f065c)throw CliErrors[_0x559e9c(0x14c)](_0x559e9c(0x149));if(!existsSync(_0x3f065c))throw CliErrors['validation'](_0x559e9c(0x15d)+_0x3f065c);if(!statSync(_0x3f065c)[_0x559e9c(0x139)]())throw CliErrors[_0x559e9c(0x14c)](_0x559e9c(0x141)+_0x3f065c);return readFileSync(_0x3f065c,_0x559e9c(0x15e));}function summarizePersonalItem(_0x436930){const _0x5a0bf8=a38_0x4ae2b2;return{'id':_0x436930['id'],'title':_0x436930['title'],'version':_0x436930['version'],'ragStatus':_0x436930[_0x5a0bf8(0x13c)],'ragErrorMessage':_0x436930['ragErrorMessage'],'updateTime':_0x436930[_0x5a0bf8(0x148)]};}function a38_0x7697(){const _0x5e1be1=['update','5YzJXHK','scope','File\x20not\x20found:\x20','utf8','write','trim','Saves\x20local\x20file\x20content\x20as\x20a\x20personal\x20knowledge-base\x20entry\x20and\x20starts\x20retrieval\x20sync.','search','number','jsonBody','5378052ZabCMj','Personal\x20knowledge-base\x20entry\x20title','read','createTime','file','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','30510ZFEJXF','appCode','927QgbilP','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','version','string','query','description','kb-service-url','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','593955nhiyQM','topk','execute','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','content','str','flag','accessKey','signal','isFile','path','title','ragStatus','userId','728084ilQCTV','parse','method','File\x20is\x20not\x20a\x20regular\x20file:\x20','56LPafLO','3276446JjDdGv','create','list','map','build','updateTime','File\x20path\x20is\x20required.','bool','Configure\x20kbServiceDomain\x20in\x20the\x20connection\x20settings,\x20or\x20pass\x20`--kb-service-url\x20<https-origin>`\x20for\x20this\x20request.','validation','verbose','Replaces\x20the\x20personal\x20knowledge-base\x20entry\x20body\x20with\x20local\x20file\x20content\x20and\x20triggers\x20retrieval\x20sync.','num','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','dryRun','Search\x20query\x20is\x20required.','body','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','length','Override\x20the\x20existing\x20entry\x20title','3793599tjaXTO','Created\x20KB\x20entry\x20','1295264etdPTN'];a38_0x7697=function(){return _0x5e1be1;};return a38_0x7697();}function detailPersonalItem(_0x560015){const _0x5eb03c=a38_0x4ae2b2;return{'id':_0x560015['id'],'appCode':_0x560015[_0x5eb03c(0x127)],'scope':_0x560015[_0x5eb03c(0x15c)],'userId':_0x560015[_0x5eb03c(0x13d)],'title':_0x560015['title'],'content':_0x560015[_0x5eb03c(0x134)],'version':_0x560015['version'],'ragStatus':_0x560015[_0x5eb03c(0x13c)],'ragErrorMessage':_0x560015['ragErrorMessage'],'createTime':_0x560015[_0x5eb03c(0x123)],'updateTime':_0x560015[_0x5eb03c(0x148)]};}function readTopK(_0x377955){const _0x57e3bd=a38_0x4ae2b2,_0x306ae7=_0x377955[_0x57e3bd(0x136)](_0x57e3bd(0x131));if(_0x306ae7===undefined||_0x306ae7===null||_0x306ae7==='')return undefined;const _0x57cfab=_0x377955[_0x57e3bd(0x14f)]('topk');if(!Number['isSafeInteger'](_0x57cfab)||_0x57cfab<0x1||_0x57cfab>0x32)throw CliErrors['validation']('--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.');return _0x57cfab;}const kbList={'service':'kb','command':a38_0x4ae2b2(0x145),'description':a38_0x4ae2b2(0x125),'risk':a38_0x4ae2b2(0x122),'flags':[VERBOSE_FLAG],async 'execute'(_0x27b148){const _0x3d9afc=a38_0x4ae2b2,_0x4703be=await listPersonalKnowledgeBaseItems(_0x27b148[_0x3d9afc(0x127)],_0x27b148['signal']);if(_0x27b148[_0x3d9afc(0x14a)](_0x3d9afc(0x14d)))return{'ok':!![],'data':{'total':_0x4703be[_0x3d9afc(0x155)],'items':_0x4703be}};return{'ok':!![],'data':{'total':_0x4703be[_0x3d9afc(0x155)],'items':_0x4703be[_0x3d9afc(0x146)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a38_0x4ae2b2(0x122),'flags':[{...ID_FLAG,'type':'string','description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x443324){const _0x5255bd=a38_0x4ae2b2,_0x4bd3f5=await getPersonalKnowledgeBaseItem(_0x443324[_0x5255bd(0x135)]('id'),_0x443324['appCode'],_0x443324['signal']);return{'ok':!![],'data':detailPersonalItem(_0x4bd3f5)};}},kbCreate={'service':'kb','command':a38_0x4ae2b2(0x144),'description':a38_0x4ae2b2(0x154),'risk':'write','confirmationDescription':a38_0x4ae2b2(0x11c),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x42f925){const _0x23a64d=a38_0x4ae2b2,_0x31a000=_0x42f925[_0x23a64d(0x135)]('title'),_0x1261df=readKnowledgeFile(_0x42f925[_0x23a64d(0x135)](_0x23a64d(0x124))),_0x4c7470=await createPersonalKnowledgeBaseItem(_0x42f925['appCode'],{'title':_0x31a000,'content':_0x1261df},_0x42f925[_0x23a64d(0x138)]);return{'ok':!![],'data':summarizePersonalItem(_0x4c7470),'message':_0x23a64d(0x158)+_0x4c7470['id']+'\x20('+_0x4c7470[_0x23a64d(0x13b)]+')'};},async 'dryRun'(_0x1b6317){const _0x4edece=a38_0x4ae2b2,_0x25d967=_0x1b6317[_0x4edece(0x135)](_0x4edece(0x13b)),_0x5b4aea=readKnowledgeFile(_0x1b6317['str']('file')),_0x57bf33=planPersonalKnowledgeWrite(_0x1b6317[_0x4edece(0x127)],{'title':_0x25d967,'content':_0x5b4aea});return dryRun(_0x57bf33[_0x4edece(0x140)],_0x57bf33[_0x4edece(0x13a)])[_0x4edece(0x153)](JSON[_0x4edece(0x13f)](_0x57bf33[_0x4edece(0x11f)]))[_0x4edece(0x12d)](_0x4edece(0x150)+_0x25d967+'\x22')['build']();}},kbUpdate={'service':'kb','command':a38_0x4ae2b2(0x15a),'description':a38_0x4ae2b2(0x133),'risk':a38_0x4ae2b2(0x15f),'confirmationDescription':a38_0x4ae2b2(0x14e),'flags':[{...ID_FLAG,'type':a38_0x4ae2b2(0x12b),'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a38_0x4ae2b2(0x156)},FILE_FLAG],async 'execute'(_0x551818){const _0x4e0f44=a38_0x4ae2b2,_0x4408b2=_0x551818[_0x4e0f44(0x135)]('id'),_0x319468=readKnowledgeFile(_0x551818['str'](_0x4e0f44(0x124))),_0x11a104=_0x551818[_0x4e0f44(0x135)](_0x4e0f44(0x13b))||undefined,_0x3f0c95=await updatePersonalKnowledgeBaseItem(_0x4408b2,_0x551818[_0x4e0f44(0x127)],{'title':_0x11a104,'content':_0x319468},_0x551818[_0x4e0f44(0x138)]);return{'ok':!![],'data':summarizePersonalItem(_0x3f0c95),'message':'Updated\x20KB\x20entry\x20'+_0x3f0c95['id']+'\x20('+_0x3f0c95[_0x4e0f44(0x13b)]+')'};},async 'dryRun'(_0x5021b9){const _0x1e6abb=a38_0x4ae2b2,_0x1fe110=_0x5021b9[_0x1e6abb(0x135)]('id'),_0x338047=readKnowledgeFile(_0x5021b9[_0x1e6abb(0x135)](_0x1e6abb(0x124))),_0x3fc5ea=await getPersonalKnowledgeBaseItem(_0x1fe110,_0x5021b9[_0x1e6abb(0x127)],_0x5021b9[_0x1e6abb(0x138)]),_0x18586d=_0x5021b9[_0x1e6abb(0x135)]('title')||_0x3fc5ea['title'],_0x267a30=planPersonalKnowledgeWrite(_0x5021b9['appCode'],{'title':_0x18586d,'content':_0x338047},_0x1fe110,_0x3fc5ea[_0x1e6abb(0x12a)]);return dryRun(_0x267a30[_0x1e6abb(0x140)],_0x267a30['path'])[_0x1e6abb(0x153)](JSON[_0x1e6abb(0x13f)](_0x267a30['jsonBody']))['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x1fe110)[_0x1e6abb(0x147)]();}};function readSearchServiceUrl(_0x24b330){const _0x2e1003=a38_0x4ae2b2;if(_0x24b330['flag'](_0x2e1003(0x12e))!==undefined)return normalizeKbServiceOrigin(_0x24b330['str'](_0x2e1003(0x12e)));const _0x18e412=getKbServiceDomain();if(!_0x18e412)throw CliErrors[_0x2e1003(0x14c)]('KB\x20Service\x20is\x20not\x20configured\x20for\x20knowledge\x20search.',_0x2e1003(0x14b));return normalizeKbServiceOrigin(_0x18e412);}const kbSearch={'service':'kb','command':a38_0x4ae2b2(0x11d),'description':'Search\x20visible\x20public,\x20company,\x20and\x20personal\x20knowledge','risk':a38_0x4ae2b2(0x122),'flags':[QUERY_FLAG,TOPK_FLAG,{'name':a38_0x4ae2b2(0x12e),'type':'string','required':![],'description':'Optional\x20trusted\x20KB\x20Service\x20HTTPS\x20origin\x20for\x20this\x20request\x20only'}],async 'validate'(_0x4d1253){const _0x11619e=a38_0x4ae2b2;if(!_0x4d1253[_0x11619e(0x135)](_0x11619e(0x12c))[_0x11619e(0x11b)]())throw CliErrors[_0x11619e(0x14c)](_0x11619e(0x152));readTopK(_0x4d1253),readSearchServiceUrl(_0x4d1253);},async 'execute'(_0x44e5d1){const _0x547c4e=a38_0x4ae2b2,_0x295a5f=_0x44e5d1['str'](_0x547c4e(0x12c))['trim'](),_0x44a400=readTopK(_0x44e5d1),_0x283c72=readSearchServiceUrl(_0x44e5d1),_0x5babf6={'appCode':_0x44e5d1[_0x547c4e(0x127)],'accessKey':_0x44e5d1[_0x547c4e(0x137)]??'','query':_0x295a5f,..._0x44a400!==undefined?{'topK':_0x44a400}:{},'signal':_0x44e5d1[_0x547c4e(0x138)]},_0x2238f0=await searchDirectKnowledge({..._0x5babf6,'serviceUrl':_0x283c72});return{'ok':!![],'data':_0x2238f0};}};function managementCommand(_0x31290e){const _0x41c1f5=a38_0x4ae2b2;return{..._0x31290e,'execute':_0x24c365=>withKbManagementOrigin(()=>_0x31290e[_0x41c1f5(0x132)](_0x24c365)),..._0x31290e[_0x41c1f5(0x151)]?{'dryRun':_0x16fc95=>withKbManagementOrigin(()=>_0x31290e['dryRun'](_0x16fc95))}:{}};}export const kbDefinitions=[...[kbList,kbDetail,kbCreate,kbUpdate][a38_0x4ae2b2(0x146)](managementCommand),kbSearch];
|
|
1
|
+
const a38_0x48d3ee=a38_0x3884;(function(_0x2e0667,_0x5841dd){const _0x32466c=a38_0x3884,_0x2d43b8=_0x2e0667();while(!![]){try{const _0x4546cd=-parseInt(_0x32466c(0x137))/0x1*(parseInt(_0x32466c(0x130))/0x2)+-parseInt(_0x32466c(0xfd))/0x3*(parseInt(_0x32466c(0x13f))/0x4)+parseInt(_0x32466c(0x11f))/0x5*(parseInt(_0x32466c(0x115))/0x6)+parseInt(_0x32466c(0x10d))/0x7*(parseInt(_0x32466c(0x12c))/0x8)+-parseInt(_0x32466c(0x121))/0x9+parseInt(_0x32466c(0x113))/0xa*(parseInt(_0x32466c(0x12b))/0xb)+parseInt(_0x32466c(0x108))/0xc*(-parseInt(_0x32466c(0x100))/0xd);if(_0x4546cd===_0x5841dd)break;else _0x2d43b8['push'](_0x2d43b8['shift']());}catch(_0x3e6abf){_0x2d43b8['push'](_0x2d43b8['shift']());}}}(a38_0x3042,0x34e67));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{searchDirectKnowledge,normalizeKbServiceOrigin}from'../../core/kb-search-client.js';function a38_0x3042(){const _0x2a9155=['scope','Updated\x20KB\x20entry\x20','execute','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','10LUPzio','Created\x20KB\x20entry\x20','378639JPHbGJ','build','method','File\x20not\x20found:\x20','Personal\x20knowledge-base\x20entry\x20title','--topk\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','num','Saves\x20local\x20file\x20content\x20as\x20a\x20personal\x20knowledge-base\x20entry\x20and\x20starts\x20retrieval\x20sync.','Configure\x20kbServiceDomain\x20in\x20the\x20connection\x20settings,\x20or\x20pass\x20`--kb-service-url\x20<https-origin>`\x20for\x20this\x20request.','2155307OAvFQm','2440SIkIJv','userId','str','isSafeInteger','2284VeWlOt','body','Personal\x20knowledge-base\x20entry\x20ID','Search\x20query\x20for\x20visible\x20public,\x20company,\x20and\x20personal\x20knowledge','read','flag','verbose','94pjtSIb','kb-service-url','Override\x20the\x20existing\x20entry\x20title','length','dryRun','write','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','createTime','673036ykAaMw','number','Search\x20visible\x20public,\x20company,\x20and\x20personal\x20knowledge','content','updateTime','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','3rSmSsU','title','appCode','13JoyHiL','string','version','detail','search','ragStatus','description','accessKey','4771956rIQkNr','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','signal','utf8','query','9219syjFBJ','topk','validation','file','path','trim','10VXxpMr','jsonBody','1003194XQILHn','Optional\x20trusted\x20KB\x20Service\x20HTTPS\x20origin\x20for\x20this\x20request\x20only','parse','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','create','bool'];a38_0x3042=function(){return _0x2a9155;};return a38_0x3042();}import{planPersonalKnowledgeWrite,withKbManagementOrigin}from'../../core/kb-management-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{getKbServiceDomain}from'../../constant/domain.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a38_0x48d3ee(0xfe),'type':'string','required':!![],'description':a38_0x48d3ee(0x125)},FILE_FLAG={'name':a38_0x48d3ee(0x110),'type':'string','required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a38_0x48d3ee(0x10c),'type':a38_0x48d3ee(0x101),'required':!![],'description':a38_0x48d3ee(0x133)},TOPK_FLAG={'name':'topk','type':a38_0x48d3ee(0xf8),'description':a38_0x48d3ee(0x118)};function readKnowledgeFile(_0x77a0a4){const _0x1fcb2e=a38_0x48d3ee;if(!_0x77a0a4)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x77a0a4))throw CliErrors[_0x1fcb2e(0x10f)](_0x1fcb2e(0x124)+_0x77a0a4);if(!statSync(_0x77a0a4)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x77a0a4);return readFileSync(_0x77a0a4,_0x1fcb2e(0x10b));}function a38_0x3884(_0x5ace70,_0x494b5b){_0x5ace70=_0x5ace70-0xf8;const _0x304208=a38_0x3042();let _0x388486=_0x304208[_0x5ace70];return _0x388486;}function summarizePersonalItem(_0x1b2550){const _0x5f5a6d=a38_0x48d3ee;return{'id':_0x1b2550['id'],'title':_0x1b2550[_0x5f5a6d(0xfe)],'version':_0x1b2550['version'],'ragStatus':_0x1b2550[_0x5f5a6d(0x105)],'ragErrorMessage':_0x1b2550['ragErrorMessage'],'updateTime':_0x1b2550['updateTime']};}function detailPersonalItem(_0x316d33){const _0x1a2bdc=a38_0x48d3ee;return{'id':_0x316d33['id'],'appCode':_0x316d33[_0x1a2bdc(0xff)],'scope':_0x316d33[_0x1a2bdc(0x11b)],'userId':_0x316d33[_0x1a2bdc(0x12d)],'title':_0x316d33[_0x1a2bdc(0xfe)],'content':_0x316d33[_0x1a2bdc(0xfa)],'version':_0x316d33[_0x1a2bdc(0x102)],'ragStatus':_0x316d33[_0x1a2bdc(0x105)],'ragErrorMessage':_0x316d33['ragErrorMessage'],'createTime':_0x316d33[_0x1a2bdc(0x13e)],'updateTime':_0x316d33[_0x1a2bdc(0xfb)]};}function readTopK(_0x53f90a){const _0xa8ba2f=a38_0x48d3ee,_0x25e4aa=_0x53f90a[_0xa8ba2f(0x135)](_0xa8ba2f(0x10e));if(_0x25e4aa===undefined||_0x25e4aa===null||_0x25e4aa==='')return undefined;const _0x1ca564=_0x53f90a[_0xa8ba2f(0x128)](_0xa8ba2f(0x10e));if(!Number[_0xa8ba2f(0x12f)](_0x1ca564)||_0x1ca564<0x1||_0x1ca564>0x32)throw CliErrors[_0xa8ba2f(0x10f)](_0xa8ba2f(0x126));return _0x1ca564;}const kbList={'service':'kb','command':'list','description':a38_0x48d3ee(0x127),'risk':a38_0x48d3ee(0x134),'flags':[VERBOSE_FLAG],async 'execute'(_0x4e0e88){const _0x130228=a38_0x48d3ee,_0xbc025d=await listPersonalKnowledgeBaseItems(_0x4e0e88[_0x130228(0xff)],_0x4e0e88[_0x130228(0x10a)]);if(_0x4e0e88[_0x130228(0x11a)](_0x130228(0x136)))return{'ok':!![],'data':{'total':_0xbc025d[_0x130228(0x13a)],'items':_0xbc025d}};return{'ok':!![],'data':{'total':_0xbc025d['length'],'items':_0xbc025d['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a38_0x48d3ee(0x103),'description':a38_0x48d3ee(0x13d),'risk':'read','flags':[{...ID_FLAG,'type':a38_0x48d3ee(0x101),'description':a38_0x48d3ee(0x132)}],async 'execute'(_0x7513a7){const _0x1d7fa0=a38_0x48d3ee,_0x4e19da=await getPersonalKnowledgeBaseItem(_0x7513a7['str']('id'),_0x7513a7[_0x1d7fa0(0xff)],_0x7513a7[_0x1d7fa0(0x10a)]);return{'ok':!![],'data':detailPersonalItem(_0x4e19da)};}},kbCreate={'service':'kb','command':a38_0x48d3ee(0x119),'description':a38_0x48d3ee(0x11e),'risk':a38_0x48d3ee(0x13c),'confirmationDescription':a38_0x48d3ee(0x129),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x232477){const _0x1ecbfe=a38_0x48d3ee,_0x5ecfdf=_0x232477[_0x1ecbfe(0x12e)](_0x1ecbfe(0xfe)),_0x3d7242=readKnowledgeFile(_0x232477['str'](_0x1ecbfe(0x110))),_0x17f726=await createPersonalKnowledgeBaseItem(_0x232477['appCode'],{'title':_0x5ecfdf,'content':_0x3d7242},_0x232477['signal']);return{'ok':!![],'data':summarizePersonalItem(_0x17f726),'message':_0x1ecbfe(0x120)+_0x17f726['id']+'\x20('+_0x17f726[_0x1ecbfe(0xfe)]+')'};},async 'dryRun'(_0x345a5a){const _0x3981ac=a38_0x48d3ee,_0x15e2f3=_0x345a5a['str']('title'),_0x51303b=readKnowledgeFile(_0x345a5a[_0x3981ac(0x12e)](_0x3981ac(0x110))),_0x797191=planPersonalKnowledgeWrite(_0x345a5a[_0x3981ac(0xff)],{'title':_0x15e2f3,'content':_0x51303b});return dryRun(_0x797191['method'],_0x797191[_0x3981ac(0x111)])[_0x3981ac(0x131)](JSON[_0x3981ac(0x117)](_0x797191[_0x3981ac(0x114)]))[_0x3981ac(0x106)](_0x3981ac(0xfc)+_0x15e2f3+'\x22')[_0x3981ac(0x122)]();}},kbUpdate={'service':'kb','command':'update','description':a38_0x48d3ee(0x109),'risk':a38_0x48d3ee(0x13c),'confirmationDescription':'Replaces\x20the\x20personal\x20knowledge-base\x20entry\x20body\x20with\x20local\x20file\x20content\x20and\x20triggers\x20retrieval\x20sync.','flags':[{...ID_FLAG,'type':'string','description':a38_0x48d3ee(0x132)},{...TITLE_FLAG,'required':![],'description':a38_0x48d3ee(0x139)},FILE_FLAG],async 'execute'(_0xe930fd){const _0x3faee7=a38_0x48d3ee,_0xde226a=_0xe930fd[_0x3faee7(0x12e)]('id'),_0x41ab3b=readKnowledgeFile(_0xe930fd['str'](_0x3faee7(0x110))),_0x30dc97=_0xe930fd[_0x3faee7(0x12e)]('title')||undefined,_0x2dbf56=await updatePersonalKnowledgeBaseItem(_0xde226a,_0xe930fd[_0x3faee7(0xff)],{'title':_0x30dc97,'content':_0x41ab3b},_0xe930fd[_0x3faee7(0x10a)]);return{'ok':!![],'data':summarizePersonalItem(_0x2dbf56),'message':_0x3faee7(0x11c)+_0x2dbf56['id']+'\x20('+_0x2dbf56[_0x3faee7(0xfe)]+')'};},async 'dryRun'(_0x338394){const _0x2c9539=a38_0x48d3ee,_0x1c2393=_0x338394[_0x2c9539(0x12e)]('id'),_0x31b531=readKnowledgeFile(_0x338394[_0x2c9539(0x12e)]('file')),_0x36d3f6=await getPersonalKnowledgeBaseItem(_0x1c2393,_0x338394[_0x2c9539(0xff)],_0x338394[_0x2c9539(0x10a)]),_0x2b3ab8=_0x338394[_0x2c9539(0x12e)](_0x2c9539(0xfe))||_0x36d3f6[_0x2c9539(0xfe)],_0x46b270=planPersonalKnowledgeWrite(_0x338394[_0x2c9539(0xff)],{'title':_0x2b3ab8,'content':_0x31b531},_0x1c2393,_0x36d3f6['version']);return dryRun(_0x46b270[_0x2c9539(0x123)],_0x46b270[_0x2c9539(0x111)])[_0x2c9539(0x131)](JSON[_0x2c9539(0x117)](_0x46b270[_0x2c9539(0x114)]))[_0x2c9539(0x106)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x1c2393)[_0x2c9539(0x122)]();}};function readSearchServiceUrl(_0x34a8dd){const _0x2a44f9=a38_0x48d3ee;if(_0x34a8dd['flag'](_0x2a44f9(0x138))!==undefined)return normalizeKbServiceOrigin(_0x34a8dd[_0x2a44f9(0x12e)]('kb-service-url'));const _0x489520=getKbServiceDomain();if(!_0x489520)throw CliErrors[_0x2a44f9(0x10f)]('KB\x20Service\x20is\x20not\x20configured\x20for\x20knowledge\x20search.',_0x2a44f9(0x12a));return normalizeKbServiceOrigin(_0x489520);}const kbSearch={'service':'kb','command':a38_0x48d3ee(0x104),'description':a38_0x48d3ee(0xf9),'risk':a38_0x48d3ee(0x134),'flags':[QUERY_FLAG,TOPK_FLAG,{'name':a38_0x48d3ee(0x138),'type':a38_0x48d3ee(0x101),'required':![],'description':a38_0x48d3ee(0x116)}],async 'validate'(_0x5a2aa1){const _0x19922d=a38_0x48d3ee;if(!_0x5a2aa1['str'](_0x19922d(0x10c))[_0x19922d(0x112)]())throw CliErrors['validation']('Search\x20query\x20is\x20required.');readTopK(_0x5a2aa1),readSearchServiceUrl(_0x5a2aa1);},async 'execute'(_0x2ca1f7){const _0x1b05b5=a38_0x48d3ee,_0x498732=_0x2ca1f7[_0x1b05b5(0x12e)]('query')[_0x1b05b5(0x112)](),_0x4186f6=readTopK(_0x2ca1f7),_0x456e26=readSearchServiceUrl(_0x2ca1f7),_0x375f50={'appCode':_0x2ca1f7['appCode'],'accessKey':_0x2ca1f7[_0x1b05b5(0x107)]??'','query':_0x498732,..._0x4186f6!==undefined?{'topK':_0x4186f6}:{},'signal':_0x2ca1f7[_0x1b05b5(0x10a)]},_0x4e8766=await searchDirectKnowledge({..._0x375f50,'serviceUrl':_0x456e26});return{'ok':!![],'data':_0x4e8766};}};function managementCommand(_0x436d82){const _0xee4042=a38_0x48d3ee;return{..._0x436d82,'execute':_0x5c5a94=>withKbManagementOrigin(()=>_0x436d82[_0xee4042(0x11d)](_0x5c5a94)),..._0x436d82[_0xee4042(0x13b)]?{'dryRun':_0x4fe5fd=>withKbManagementOrigin(()=>_0x436d82['dryRun'](_0x4fe5fd))}:{}};}export const kbDefinitions=[...[kbList,kbDetail,kbCreate,kbUpdate]['map'](managementCommand),kbSearch];
|