@lovrabet/lovrabet-cli 2.1.17 → 2.1.18-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.d.ts +21 -0
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.d.ts +38 -0
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.d.ts +61 -0
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.d.ts +26 -0
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.d.ts +16 -0
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.d.ts +41 -0
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.d.ts +66 -0
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.d.ts +38 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.d.ts +2 -0
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.d.ts +2 -0
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.d.ts +9 -0
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.d.ts +31 -0
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.d.ts +23 -0
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.d.ts +33 -0
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.d.ts +8 -0
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.d.ts +19 -0
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.d.ts +15 -0
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.d.ts +9 -0
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.d.ts +80 -0
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.d.ts +67 -0
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.d.ts +41 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.d.ts +6 -0
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.d.ts +21 -0
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.d.ts +17 -0
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.d.ts +27 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.d.ts +26 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.d.ts +10 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.d.ts +18 -0
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.d.ts +6 -0
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.d.ts +23 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.d.ts +2 -0
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.d.ts +32 -0
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.d.ts +8 -0
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.d.ts +20 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.d.ts +2 -0
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.d.ts +5 -0
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.d.ts +56 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.d.ts +2 -0
- package/lib/commands/schedule/index.js +1 -0
- package/lib/commands/schema.d.ts +18 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.d.ts +18 -0
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.d.ts +13 -0
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.d.ts +2 -0
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.d.ts +102 -0
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.d.ts +2 -0
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.d.ts +2 -0
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.d.ts +2 -0
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.d.ts +2 -0
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.d.ts +2 -0
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.d.ts +13 -0
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.d.ts +9 -0
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.d.ts +5 -0
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.d.ts +49 -0
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.d.ts +80 -0
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.d.ts +9 -0
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.d.ts +13 -0
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.d.ts +6 -0
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.d.ts +23 -0
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.d.ts +20 -0
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.d.ts +13 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.d.ts +21 -0
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.d.ts +9 -0
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.d.ts +10 -0
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.d.ts +10 -0
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.d.ts +108 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.d.ts +13 -0
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.d.ts +28 -0
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.d.ts +86 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.d.ts +45 -0
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.d.ts +12 -0
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +57 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +56 -0
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.d.ts +13 -0
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.d.ts +79 -0
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.d.ts +14 -0
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.d.ts +14 -0
- package/lib/constant/url.js +1 -1
- package/lib/context.d.ts +287 -0
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +451 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.d.ts +39 -0
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.d.ts +62 -0
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.d.ts +25 -0
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.d.ts +24 -0
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.d.ts +64 -0
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.d.ts +19 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.d.ts +21 -0
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.d.ts +10 -0
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.d.ts +10 -0
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.d.ts +64 -0
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.d.ts +10 -0
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/response.d.ts +10 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.d.ts +46 -0
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.d.ts +28 -0
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.d.ts +102 -0
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.d.ts +29 -0
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.d.ts +4 -0
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.d.ts +108 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -0
- package/lib/generated/build-info.js +1 -1
- package/lib/help.d.ts +25 -0
- package/lib/help.js +1 -1
- package/lib/runtime/event.d.ts +16 -0
- package/lib/runtime/event.js +1 -0
- package/lib/runtime/index.d.ts +13 -0
- package/lib/runtime/index.js +1 -0
- package/lib/runtime/queue.d.ts +6 -0
- package/lib/runtime/queue.js +1 -0
- package/lib/runtime/resolve.d.ts +14 -0
- package/lib/runtime/resolve.js +1 -0
- package/lib/runtime/types.d.ts +59 -0
- package/lib/runtime/types.js +1 -0
- package/lib/skills/npx-skills-add.d.ts +42 -0
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.d.ts +4 -0
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.d.ts +21 -0
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.d.ts +9 -0
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.d.ts +18 -0
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.d.ts +3 -0
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.d.ts +25 -0
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.d.ts +11 -0
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.d.ts +7 -0
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.d.ts +11 -0
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.d.ts +33 -0
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.d.ts +5 -0
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/types.d.ts +105 -0
- package/lib/skills/runtime-skill-sync/zip-codec.d.ts +9 -0
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.d.ts +15 -0
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.d.ts +15 -0
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.d.ts +25 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.d.ts +73 -0
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.d.ts +21 -0
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.d.ts +65 -0
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +17 -0
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.d.ts +10 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.d.ts +18 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.d.ts +6 -0
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x1f1529=a25_0x129e;(function(_0x3981f8,_0x4638e0){const _0x528b66=a25_0x129e,_0x4a2c21=_0x3981f8();while(!![]){try{const _0x4d507b=parseInt(_0x528b66(0x186))/0x1*(parseInt(_0x528b66(0x17d))/0x2)+parseInt(_0x528b66(0x18b))/0x3*(-parseInt(_0x528b66(0x190))/0x4)+parseInt(_0x528b66(0x191))/0x5*(-parseInt(_0x528b66(0x15e))/0x6)+-parseInt(_0x528b66(0x16c))/0x7+-parseInt(_0x528b66(0x14b))/0x8*(-parseInt(_0x528b66(0x176))/0x9)+-parseInt(_0x528b66(0x171))/0xa*(-parseInt(_0x528b66(0x179))/0xb)+parseInt(_0x528b66(0x189))/0xc*(parseInt(_0x528b66(0x18e))/0xd);if(_0x4d507b===_0x4638e0)break;else _0x4a2c21['push'](_0x4a2c21['shift']());}catch(_0x2fdc9b){_0x4a2c21['push'](_0x4a2c21['shift']());}}}(a25_0xdf2e,0x6210f));import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a25_0x129e(_0x39990d,_0x3e5e6b){_0x39990d=_0x39990d-0x149;const _0xdf2e50=a25_0xdf2e();let _0x129e75=_0xdf2e50[_0x39990d];return _0x129e75;}import{CODE_FLAG}from'../../commands/common/flags.js';function normalizeField(_0x34de00){const _0x16f76b=a25_0x129e;if(_0x34de00[_0x16f76b(0x150)])return null;const _0x137651=Boolean(_0x34de00['displayName']!==undefined||_0x34de00['doType']!==undefined);let _0x1d1dec={};if(!_0x137651&&typeof _0x34de00[_0x16f76b(0x177)]==='string')try{_0x1d1dec=JSON['parse'](_0x34de00[_0x16f76b(0x177)]);}catch{}const _0x4398da=_0x137651?_0x34de00[_0x16f76b(0x14c)]:_0x34de00['code'],_0x22041f=_0x137651?_0x34de00[_0x16f76b(0x18c)]:_0x34de00[_0x16f76b(0x14c)],_0x5178eb=_0x137651?_0x34de00['doType']:_0x34de00[_0x16f76b(0x188)]||_0x34de00[_0x16f76b(0x154)],_0x3c76c8=_0x137651?_0x34de00[_0x16f76b(0x17f)]===!![]:_0x1d1dec[_0x16f76b(0x17f)]===!![],_0x53babf=_0x137651?_0x34de00[_0x16f76b(0x169)]===!![]:_0x1d1dec['required']===!![],_0xf61336=_0x137651?_0x34de00['options']??null:_0x1d1dec[_0x16f76b(0x173)]??null,_0x4a2491={'name':_0x4398da,'displayName':_0x22041f||_0x4398da,'type':_0x5178eb,'dbType':_0x34de00[_0x16f76b(0x16f)],'pk':_0x3c76c8,'required':_0x53babf,'description':_0x34de00['description']||undefined};return Array[_0x16f76b(0x14a)](_0xf61336)&&_0xf61336[_0x16f76b(0x14d)]>0x0&&(_0x4a2491[_0x16f76b(0x173)]=_0xf61336),_0x4a2491;}function parseJsonMaybe(_0xf528c7){const _0x1d77cb=a25_0x129e;if(typeof _0xf528c7!==_0x1d77cb(0x152))return _0xf528c7;try{return JSON[_0x1d77cb(0x15b)](_0xf528c7);}catch{return _0xf528c7;}}function normalizeOperationEntry(_0x481bf6,_0x569811){const _0x19ba31=a25_0x129e;if(!_0x569811||typeof _0x569811!=='object')return null;if(!_0x569811[_0x19ba31(0x17e)]||!_0x569811['path'])return null;const _0x89ef3b={'name':_0x481bf6,'method':_0x569811[_0x19ba31(0x17e)],'path':_0x569811['path']};if(_0x569811['host'])_0x89ef3b[_0x19ba31(0x172)]=_0x569811[_0x19ba31(0x172)];if(_0x569811[_0x19ba31(0x18d)]!=null)_0x89ef3b[_0x19ba31(0x18d)]=parseJsonMaybe(_0x569811[_0x19ba31(0x18d)]);if(_0x569811[_0x19ba31(0x164)]!=null)_0x89ef3b[_0x19ba31(0x164)]=parseJsonMaybe(_0x569811['responseBody']);if(_0x569811['beforeScriptId']!=null)_0x89ef3b['beforeScriptId']=_0x569811[_0x19ba31(0x14e)];if(_0x569811[_0x19ba31(0x170)]!=null)_0x89ef3b['afterScriptId']=_0x569811['afterScriptId'];if(Array[_0x19ba31(0x14a)](_0x569811[_0x19ba31(0x184)]))_0x89ef3b['requestFields']=_0x569811[_0x19ba31(0x184)];if(Array['isArray'](_0x569811[_0x19ba31(0x160)]))_0x89ef3b['responseFields']=_0x569811[_0x19ba31(0x160)];return _0x89ef3b;}function a25_0xdf2e(){const _0x39f068=['formatRules','fields','56133PLINHt','extend','dbId','11bQmCoW','entries','Get\x20dataset\x20detail\x20including\x20fields,\x20relations,\x20and\x20operations','datasetKey','22StNNuX','method','pkField','source','validateRules','filter','split','requestFields','tableName','51751oAbfDU','allFieldNames','type','10333764eapHMS','doVersion','118299QFEXVN','displayName','requestBody','13LOHlQn','createTimeField','4dCjtaJ','1339165lDpNGJ','dbtableConfig','isArray','168ysdGEG','name','length','beforeScriptId','modelCode','deleted','str','string','tableComment','dataType','detail','logicField','map','indexes','read','relations','parse','operations','trim','12RSCIuX','columnCodeListWithDeleted','responseFields','code','properties','creatorNameField','responseBody','allFields','push','creatorIdField','dbName','required','relatedPageInfoList','appCode','5261326amxTGG','description','labelField','dbType','afterScriptId','1670110YltEbL','host','options'];a25_0xdf2e=function(){return _0x39f068;};return a25_0xdf2e();}function summarizeDbtable(_0x40d0cd){const _0x2da810=a25_0x129e,_0x4ee111={},_0x2adbcc=[_0x2da810(0x178),_0x2da810(0x168),_0x2da810(0x185),_0x2da810(0x17c),_0x2da810(0x17f),_0x2da810(0x165),_0x2da810(0x156),_0x2da810(0x18f),'updateTimeField',_0x2da810(0x167),_0x2da810(0x163),'modifierIdField','modifierNameField',_0x2da810(0x16e),'dblinkInfoDTO'];for(const _0x2d71a9 of _0x2adbcc){if(_0x40d0cd[_0x2d71a9]!==undefined)_0x4ee111[_0x2d71a9]=_0x40d0cd[_0x2d71a9];}return typeof _0x4ee111[_0x2da810(0x165)]===_0x2da810(0x152)&&_0x4ee111[_0x2da810(0x165)][_0x2da810(0x14d)]>0x0&&(_0x4ee111[_0x2da810(0x187)]=_0x4ee111[_0x2da810(0x165)][_0x2da810(0x183)](',')[_0x2da810(0x157)](_0x4f6a4f=>_0x4f6a4f[_0x2da810(0x15d)]())[_0x2da810(0x182)](Boolean)),_0x4ee111;}function normalizeRelatedPages(_0x151889){const _0x390279=a25_0x129e;if(!Array['isArray'](_0x151889))return[];return _0x151889[_0x390279(0x182)](_0x502c35=>_0x502c35&&typeof _0x502c35==='object')[_0x390279(0x157)](_0x104568=>({'id':_0x104568['id'],'type':_0x104568[_0x390279(0x188)],'code':_0x104568[_0x390279(0x161)],'title':_0x104568['title'],'deleted':_0x104568['deleted']===!![]}));}function normalizeFallbackFieldName(_0x402790,_0x30fb42){const _0x478c14=a25_0x129e,_0x25357f=_0x402790[_0x478c14(0x15d)]();if(!_0x25357f)return null;return{'name':_0x25357f,'displayName':_0x25357f,'type':undefined,'dbType':undefined,'pk':_0x25357f===_0x30fb42,'required':![],'description':undefined};}async function loadListFieldFallback(_0x5e8810,_0x470019){const _0xf9aec6=a25_0x129e;if(!_0x5e8810||!_0x470019)return[];try{const _0x186a27=await listDatasets(_0x5e8810,{'code':_0x470019}),_0x9f0b4a=_0x186a27['find'](_0x41960e=>_0x41960e['code']===_0x470019)??_0x186a27[0x0],_0x2de4d3=_0x9f0b4a?.[_0xf9aec6(0x149)]??{},_0x686dd8=typeof _0x2de4d3[_0xf9aec6(0x165)]==='string'?_0x2de4d3['allFields'][_0xf9aec6(0x183)](','):[];return _0x686dd8[_0xf9aec6(0x157)](_0x41082a=>normalizeFallbackFieldName(_0x41082a,_0x2de4d3[_0xf9aec6(0x17f)]))[_0xf9aec6(0x182)](_0x3f7fc5=>_0x3f7fc5!==null);}catch{return[];}}export const datasetDetail={'service':'dataset','command':a25_0x1f1529(0x155),'description':a25_0x1f1529(0x17b),'risk':a25_0x1f1529(0x159),'flags':[CODE_FLAG],async 'execute'(_0x3eb626){const _0x27ca82=a25_0x1f1529,_0x5b4165=await getDatasetDetail(_0x3eb626[_0x27ca82(0x151)]('code')),_0x4a0792=Array[_0x27ca82(0x14a)](_0x5b4165[_0x27ca82(0x175)])?_0x5b4165['fields']:Array[_0x27ca82(0x14a)](_0x5b4165[_0x27ca82(0x162)])?_0x5b4165['properties']:[];let _0x116e43=_0x4a0792[_0x27ca82(0x157)](_0x466c14=>normalizeField(_0x466c14))[_0x27ca82(0x182)](_0xc817fd=>_0xc817fd!==null);_0x116e43[_0x27ca82(0x14d)]===0x0&&(_0x116e43=await loadListFieldFallback(_0x3eb626[_0x27ca82(0x16b)],_0x3eb626[_0x27ca82(0x151)](_0x27ca82(0x161))));const _0x38c7c6=_0x5b4165[_0x27ca82(0x15c)]??{},_0x586bbc=[];for(const [_0x2d6047,_0x5999da]of Object[_0x27ca82(0x17a)](_0x38c7c6)){const _0x22dbf5=normalizeOperationEntry(_0x2d6047,_0x5999da);if(_0x22dbf5)_0x586bbc[_0x27ca82(0x166)](_0x22dbf5);}const _0x4c9c1b=_0x5b4165['dbtableConfig']??{},_0x3fe96e=_0x5b4165['dataset']??{},_0x2c9704=_0x4c9c1b[_0x27ca82(0x178)]!=null?{'id':_0x4c9c1b['dbId'],'name':_0x4c9c1b['dbName']??null}:undefined;let _0x5527c6;return typeof _0x5b4165[_0x27ca82(0x177)]===_0x27ca82(0x152)&&(_0x5527c6=parseJsonMaybe(_0x5b4165[_0x27ca82(0x177)])),{'ok':!![],'data':{'id':_0x5b4165['modelId']??_0x5b4165['id'],'name':_0x5b4165[_0x27ca82(0x14c)],'code':_0x5b4165[_0x27ca82(0x14f)]||_0x5b4165[_0x27ca82(0x161)],'doVersion':_0x5b4165[_0x27ca82(0x18a)],'description':_0x5b4165[_0x27ca82(0x16d)]||_0x3fe96e[_0x27ca82(0x153)]||undefined,'source':_0x5b4165[_0x27ca82(0x180)]||_0x3fe96e['sourceType'],'table':_0x4c9c1b['tableName']||_0x3fe96e[_0x27ca82(0x185)],'datasetKey':_0x4c9c1b[_0x27ca82(0x17c)],'pk':_0x4c9c1b[_0x27ca82(0x17f)],'db':_0x2c9704,'dbtable':summarizeDbtable(_0x4c9c1b),'fields':_0x116e43,'operations':_0x586bbc,'indexes':Array[_0x27ca82(0x14a)](_0x3fe96e[_0x27ca82(0x158)])?_0x3fe96e[_0x27ca82(0x158)]:[],'relations':_0x5b4165[_0x27ca82(0x15a)]??null,'relatedPages':normalizeRelatedPages(_0x5b4165[_0x27ca82(0x16a)]),...Array['isArray'](_0x5b4165[_0x27ca82(0x15f)])?{'columnCodeListWithDeleted':_0x5b4165[_0x27ca82(0x15f)]}:{},'formatRules':Array[_0x27ca82(0x14a)](_0x5b4165[_0x27ca82(0x174)])?_0x5b4165['formatRules']:[],'validateRules':Array['isArray'](_0x5b4165[_0x27ca82(0x181)])?_0x5b4165[_0x27ca82(0x181)]:[],..._0x5527c6!==undefined?{'extend':_0x5527c6}:{},'stats':{'fieldCount':_0x116e43['length'],'operationCount':_0x586bbc[_0x27ca82(0x14d)]}}};}};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `dataset` command group — exports the declarative definition list.
|
|
3
|
+
*
|
|
4
|
+
* Why this module exists: mirrors the `bff/` and `sql/` patterns. The runtime
|
|
5
|
+
* CLI provides `dataset list` (discover) and `dataset detail` (inspect),
|
|
6
|
+
* but not create/update/delete (those are Studio-only operations in the
|
|
7
|
+
* runtime context).
|
|
8
|
+
*/
|
|
9
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
10
|
+
export declare const datasetDefinitions: CommandDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a26_0x5734(){const _0x1b650d=['86rQYMqd','755715QoLVQh','773124DhIPpc','5760mPbLCe','328ccuLzH','3091830ZaOoqG','8400nbHUoC','4jheSwU','596608DEEwql','3329285ohWMHs'];a26_0x5734=function(){return _0x1b650d;};return a26_0x5734();}(function(_0xf4ce2e,_0x5c8d84){const _0x191e07=a26_0x256a,_0x2f2dd2=_0xf4ce2e();while(!![]){try{const _0x1530ab=parseInt(_0x191e07(0x64))/0x1*(-parseInt(_0x191e07(0x68))/0x2)+parseInt(_0x191e07(0x65))/0x3+parseInt(_0x191e07(0x6b))/0x4*(-parseInt(_0x191e07(0x6d))/0x5)+-parseInt(_0x191e07(0x66))/0x6+parseInt(_0x191e07(0x69))/0x7+-parseInt(_0x191e07(0x6c))/0x8+-parseInt(_0x191e07(0x67))/0x9*(-parseInt(_0x191e07(0x6a))/0xa);if(_0x1530ab===_0x5c8d84)break;else _0x2f2dd2['push'](_0x2f2dd2['shift']());}catch(_0x1be51e){_0x2f2dd2['push'](_0x2f2dd2['shift']());}}}(a26_0x5734,0x54e9c));import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';function a26_0x256a(_0x4d6e7d,_0xb838e3){_0x4d6e7d=_0x4d6e7d-0x64;const _0x57341b=a26_0x5734();let _0x256a6b=_0x57341b[_0x4d6e7d];return _0x256a6b;}import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `dataset list` command — discovers datasets by name or code.
|
|
3
|
+
*
|
|
4
|
+
* Why `--name` and `--code` are both optional: users often search by name
|
|
5
|
+
* when they don't remember the exact code. The API handles both cases server-side,
|
|
6
|
+
* so the CLI just passes the filters through without client-side pre-filtering.
|
|
7
|
+
*
|
|
8
|
+
* Why `CODE_FLAG` is reused (with `required: false`) for the `--code` filter:
|
|
9
|
+
* the same 32-char hex pattern applies to dataset codes. Adding a separate
|
|
10
|
+
* `CODECODE_FLAG` would duplicate the pattern. The `required: false` override
|
|
11
|
+
* is correct because this is an optional filter, not a mandatory lookup key.
|
|
12
|
+
*
|
|
13
|
+
* Why `db.allFields.split(",").map(...)` for the fields array: the API returns
|
|
14
|
+
* `allFields` as a comma-separated string, not a JSON array. We split it here
|
|
15
|
+
* so callers always get a consistent array type regardless of API shape.
|
|
16
|
+
*/
|
|
17
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
18
|
+
export declare const datasetList: CommandDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x5ca1(_0x4c144e,_0x52599e){_0x4c144e=_0x4c144e-0x6d;const _0x805cb7=a27_0x805c();let _0x5ca143=_0x805cb7[_0x4c144e];return _0x5ca143;}const a27_0x232138=a27_0x5ca1;(function(_0x3b115a,_0xd9d695){const _0x5dfa4d=a27_0x5ca1,_0x39382a=_0x3b115a();while(!![]){try{const _0x56b62a=parseInt(_0x5dfa4d(0x7b))/0x1*(-parseInt(_0x5dfa4d(0x74))/0x2)+parseInt(_0x5dfa4d(0x86))/0x3+-parseInt(_0x5dfa4d(0x6d))/0x4*(parseInt(_0x5dfa4d(0x89))/0x5)+parseInt(_0x5dfa4d(0x85))/0x6+parseInt(_0x5dfa4d(0x84))/0x7*(-parseInt(_0x5dfa4d(0x6f))/0x8)+parseInt(_0x5dfa4d(0x78))/0x9*(parseInt(_0x5dfa4d(0x79))/0xa)+parseInt(_0x5dfa4d(0x73))/0xb;if(_0x56b62a===_0xd9d695)break;else _0x39382a['push'](_0x39382a['shift']());}catch(_0x53ef13){_0x39382a['push'](_0x39382a['shift']());}}}(a27_0x805c,0xb0af4));import{listDatasets}from'../../core/api-client.js';function a27_0x805c(){const _0x75dad2=['length','24jMFpUw','dataset','read','pkField','3804361yBuJIb','12MnyqGS','allFields','trim','list','18aoHeAM','3107310WbKqyN','code','158854KDOUdC','description','map','string','str','name','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','dbtableConfig','split','611870VgcxsY','8121012rItrmg','2953440CXtsXD','source','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','5UDUxWX','tableName','5464964LZXWhw'];a27_0x805c=function(){return _0x75dad2;};return a27_0x805c();}import{CODE_FLAG}from'../../commands/common/flags.js';export const datasetList={'service':a27_0x232138(0x70),'command':a27_0x232138(0x77),'description':'List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','risk':a27_0x232138(0x71),'flags':[{'name':a27_0x232138(0x80),'type':a27_0x232138(0x7e),'description':a27_0x232138(0x81)},{...CODE_FLAG,'required':![],'description':a27_0x232138(0x88)}],async 'execute'(_0x16a606){const _0x464964=a27_0x232138,_0x327588=_0x16a606['str'](_0x464964(0x80)),_0x28705d=_0x16a606[_0x464964(0x7f)]('code'),_0x299371=await listDatasets(_0x16a606['appCode'],{..._0x327588&&{'name':_0x327588},..._0x28705d&&{'code':_0x28705d}});return{'ok':!![],'data':{'total':_0x299371[_0x464964(0x6e)],'datasets':_0x299371[_0x464964(0x7d)](_0x174ae6=>{const _0x4ad9d6=_0x464964,_0x1d8aa4=_0x174ae6[_0x4ad9d6(0x82)]??{};return{'id':_0x174ae6['id'],'code':_0x174ae6[_0x4ad9d6(0x7a)],'name':_0x174ae6['name'],'source':_0x174ae6[_0x4ad9d6(0x87)],'description':_0x174ae6[_0x4ad9d6(0x7c)],'table':_0x1d8aa4[_0x4ad9d6(0x8a)],'datasetKey':_0x1d8aa4['datasetKey'],'pk':_0x1d8aa4[_0x4ad9d6(0x72)],'fields':_0x1d8aa4[_0x4ad9d6(0x75)]?_0x1d8aa4[_0x4ad9d6(0x75)][_0x4ad9d6(0x83)](',')[_0x4ad9d6(0x7d)](_0x1abeb1=>_0x1abeb1[_0x4ad9d6(0x76)]()):[]};})}};}};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `dataset sdk-doc` command — fetch dataset SDK usage markdown.
|
|
3
|
+
*/
|
|
4
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
5
|
+
export declare function formatDatasetSdkMarkdown(markdown: string | undefined): string;
|
|
6
|
+
export declare const datasetSdkDoc: CommandDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x49fb40=a28_0x1aa4;(function(_0x46b2ba,_0x29d18b){const _0x34098a=a28_0x1aa4,_0x33588d=_0x46b2ba();while(!![]){try{const _0x5efc90=-parseInt(_0x34098a(0x74))/0x1*(-parseInt(_0x34098a(0x78))/0x2)+-parseInt(_0x34098a(0x7f))/0x3*(parseInt(_0x34098a(0x84))/0x4)+parseInt(_0x34098a(0x75))/0x5*(-parseInt(_0x34098a(0x80))/0x6)+parseInt(_0x34098a(0x83))/0x7*(parseInt(_0x34098a(0x7d))/0x8)+parseInt(_0x34098a(0x7a))/0x9*(-parseInt(_0x34098a(0x7c))/0xa)+parseInt(_0x34098a(0x7b))/0xb*(-parseInt(_0x34098a(0x86))/0xc)+-parseInt(_0x34098a(0x76))/0xd*(-parseInt(_0x34098a(0x81))/0xe);if(_0x5efc90===_0x29d18b)break;else _0x33588d['push'](_0x33588d['shift']());}catch(_0x822691){_0x33588d['push'](_0x33588d['shift']());}}}(a28_0x3180,0x4f8a6));function a28_0x3180(){const _0x2c4b90=['20lRYdFX','314327TmTTpY','read','797176lLQucY','string','1635597hzBeXp','5413199LKArnr','10gooBNS','1120EQXeFi','trim','3XXLbYe','435966XnxgPJ','854MhVdHc','appCode','917xegNeX','2406252oyccZT','str','12agEVGG','1RlhBld'];a28_0x3180=function(){return _0x2c4b90;};return a28_0x3180();}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a28_0x1aa4(_0x320134,_0x565bd7){_0x320134=_0x320134-0x74;const _0x31801c=a28_0x3180();let _0x1aa4fc=_0x31801c[_0x320134];return _0x1aa4fc;}const DEFAULT_MARKDOWN='#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档';export function formatDatasetSdkMarkdown(_0x5437e4){const _0x4cb725=a28_0x1aa4,_0x219fd4=typeof _0x5437e4===_0x4cb725(0x79)?_0x5437e4[_0x4cb725(0x7e)]():'';return _0x219fd4||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':'dataset','command':'sdk-doc','description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':a28_0x49fb40(0x77),'flags':[{...CODE_FLAG,'description':'Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.'}],async 'execute'(_0x442824){const _0x1ea663=a28_0x49fb40,_0x11f988=_0x442824[_0x1ea663(0x85)]('code'),_0x36d22c=await getDatasetSdkUsageDoc(_0x11f988,_0x442824[_0x1ea663(0x82)]);return{'ok':!![],'data':{'code':_0x11f988,'appCode':_0x442824[_0x1ea663(0x82)],'markdown':formatDatasetSdkMarkdown(_0x36d22c)}};}};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `doctor` command — CLI self-diagnostic tool.
|
|
3
|
+
*
|
|
4
|
+
* Why `hasFormat: false`: the doctor command directly uses `console.log` to
|
|
5
|
+
* emit a human-readable diagnostic report with chalk coloring. It does not
|
|
6
|
+
* use the framework's format pipeline because the output is inherently
|
|
7
|
+
* human-oriented (ASCII art, colored sections). Returning `data` through
|
|
8
|
+
* the pipeline would produce a JSON report with color codes stripped.
|
|
9
|
+
*
|
|
10
|
+
* Design decision: all config layers are checked (global + project) and
|
|
11
|
+
* reported separately. This helps users identify which layer a problem
|
|
12
|
+
* originates from (e.g. a missing project file vs an invalid global file).
|
|
13
|
+
*
|
|
14
|
+
* Why `inspectCliConfigJsonFile` is used for JSON validation: the doctor
|
|
15
|
+
* should surface JSON parse errors from config files, not just say "file not found".
|
|
16
|
+
* This helps users debug corrupt config files quickly.
|
|
17
|
+
*
|
|
18
|
+
* Auth section: shows `ClientAk` mode explicitly and notes that session
|
|
19
|
+
* cookie auth is removed. This is intentional — the runtime CLI only supports
|
|
20
|
+
* AccessKey auth, not the web-session flow.
|
|
21
|
+
*/
|
|
22
|
+
import type { CommandDefinition } from "../framework/types.js";
|
|
23
|
+
export declare const doctorDefinition: CommandDefinition;
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a29_0x3128(_0x469ed8,_0x11aef5){_0x469ed8=_0x469ed8-0x12a;const _0x349222=a29_0x3492();let _0x31288a=_0x349222[_0x469ed8];return _0x31288a;}const a29_0x319dea=a29_0x3128;(function(_0x52da8f,_0x8eadd2){const _0xc82967=a29_0x3128,_0x3a6b3b=_0x52da8f();while(!![]){try{const _0x5880e5=parseInt(_0xc82967(0x144))/0x1*(parseInt(_0xc82967(0x166))/0x2)+-parseInt(_0xc82967(0x14c))/0x3*(parseInt(_0xc82967(0x148))/0x4)+-parseInt(_0xc82967(0x164))/0x5+parseInt(_0xc82967(0x172))/0x6+parseInt(_0xc82967(0x173))/0x7*(-parseInt(_0xc82967(0x15f))/0x8)+parseInt(_0xc82967(0x168))/0x9+parseInt(_0xc82967(0x16a))/0xa;if(_0x5880e5===_0x8eadd2)break;else _0x3a6b3b['push'](_0x3a6b3b['shift']());}catch(_0xc0aa12){_0x3a6b3b['push'](_0x3a6b3b['shift']());}}}(a29_0x3492,0x9a2c7));import a29_0x47d0ac 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,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';function a29_0x3492(){const _0x41ff88=['\x20\x20auth\x20(effective):\x20','defaultApp','\x20\x20─','(unnamed)','2792400ayFjTl','padEnd','2bObodz','(no\x20file)','6098166igWPmQ','platform','7467350LoZeQX','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','(set,\x20length=','commandCount','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','empty','6003504CSTBJP','1496341WyiNpd','riskLevel','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','read','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','path','locale','log','(removed\x20—\x20cookie\x20auth\x20disabled)','(none)','(not\x20found)','serviceCode','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20doctor','\x20commands)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','(default:\x20','\x20\x20Service\x20Tree','\x20(accessKey)','(missing)','services','currentApp','yellow','pageSize','\x20\x20Merged\x20Config','doctor','version','gray','ClientAk','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','env','⚠\x20Empty','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','214421hGyvSd','\x20(legacy/compat\x20only)','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty\x20(treated\x20as\x20{})','32PlmTfz','source','\x20\x20Config\x20Files','(not\x20set)','463341yOXgOL','\x20Imported\x20from:\x20','✗\x20Invalid','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','length','green','status','(default)','red','✗\x20Invalid\x20JSON','message','Global','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','missing','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','8vKZSJD'];a29_0x3492=function(){return _0x41ff88;};return a29_0x3492();}import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x2daa24){const _0x5b4e20=a29_0x3128,_0x2f2fcb=getCliVersion(),_0x357307=buildConfigFromFlags({});await initGlobalEnvironment(_0x357307),console[_0x5b4e20(0x17f)](),console['log'](a29_0x47d0ac['bold'](CLI_BIN_NAME+_0x5b4e20(0x12e))),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x13d)]('─'[_0x5b4e20(0x177)](0x32))),console[_0x5b4e20(0x17f)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x2f2fcb),console[_0x5b4e20(0x17f)](_0x5b4e20(0x159)+process[_0x5b4e20(0x13c)]),console[_0x5b4e20(0x17f)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x5b4e20(0x169)]+'\x20'+process['arch']),console[_0x5b4e20(0x17f)](),console[_0x5b4e20(0x17f)](a29_0x47d0ac['bold'](_0x5b4e20(0x14a))),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)['repeat'](0x1e)));const _0xd2d6b1=getGlobalConfigPath(),_0x2b0d53=getProjectConfigPath();console[_0x5b4e20(0x17f)](_0x5b4e20(0x16f)+(_0xd2d6b1||a29_0x47d0ac[_0x5b4e20(0x13d)]('(not\x20found)'))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x15d)+(_0x2b0d53||a29_0x47d0ac[_0x5b4e20(0x13d)]('(not\x20found)'))),console[_0x5b4e20(0x17f)](),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x15e)]('\x20\x20Config\x20JSON')),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)['repeat'](0x1e)));const _0x2ff28b=(_0x52398f,_0x33ca5b)=>{const _0x25e5d6=_0x5b4e20;if(!_0x33ca5b){console['log']('\x20\x20'+_0x52398f[_0x25e5d6(0x165)](0x11)+'\x20'+a29_0x47d0ac[_0x25e5d6(0x13d)](_0x25e5d6(0x167)));return;}const _0x5d45c1=inspectCliConfigJsonFile(_0x33ca5b);if(_0x5d45c1[_0x25e5d6(0x153)]==='ok')console[_0x25e5d6(0x17f)]('\x20\x20'+_0x52398f[_0x25e5d6(0x165)](0x11)+'\x20'+a29_0x47d0ac[_0x25e5d6(0x152)](_0x25e5d6(0x131)));else{if(_0x5d45c1[_0x25e5d6(0x153)]===_0x25e5d6(0x171))console['log']('\x20\x20'+_0x52398f[_0x25e5d6(0x165)](0x11)+'\x20'+a29_0x47d0ac['yellow'](_0x25e5d6(0x147)));else _0x5d45c1[_0x25e5d6(0x153)]==='missing'?console[_0x25e5d6(0x17f)]('\x20\x20'+_0x52398f['padEnd'](0x11)+'\x20'+a29_0x47d0ac['gray'](_0x25e5d6(0x135))):(console[_0x25e5d6(0x17f)]('\x20\x20'+_0x52398f['padEnd'](0x11)+'\x20'+a29_0x47d0ac[_0x25e5d6(0x155)](_0x25e5d6(0x156))),console[_0x25e5d6(0x17f)]('\x20\x20'+''[_0x25e5d6(0x165)](0x11)+'\x20'+a29_0x47d0ac[_0x25e5d6(0x155)](_0x5d45c1[_0x25e5d6(0x157)])));}};_0x2ff28b(_0x5b4e20(0x158),_0xd2d6b1),_0x2ff28b('Project',_0x2b0d53),console['log'](),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x15e)](_0x5b4e20(0x13a))),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)[_0x5b4e20(0x177)](0x1e))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x176)+(_0x357307['appCode']||a29_0x47d0ac[_0x5b4e20(0x155)](_0x5b4e20(0x14b)))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x170)+_0x357307[_0x5b4e20(0x140)]);const _0x2a278a=isLegacyCompatConfigKey('locale')?a29_0x47d0ac['gray'](_0x357307[_0x5b4e20(0x17e)]+_0x5b4e20(0x145)):_0x357307[_0x5b4e20(0x17e)];console[_0x5b4e20(0x17f)](_0x5b4e20(0x179)+_0x2a278a),console[_0x5b4e20(0x17f)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x357307[_0x5b4e20(0x161)]||a29_0x47d0ac['gray'](_0x5b4e20(0x12a)))),console['log'](_0x5b4e20(0x15a)+(_0x357307[_0x5b4e20(0x137)]||a29_0x47d0ac[_0x5b4e20(0x13d)]('(none)'))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x130)+(_0x357307[_0x5b4e20(0x17a)]||a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x132)+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x16c)+(_0x357307[_0x5b4e20(0x139)]??a29_0x47d0ac['gray'](_0x5b4e20(0x154)))),console['log'](_0x5b4e20(0x142)+_0x357307[_0x5b4e20(0x174)]),console[_0x5b4e20(0x17f)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x357307['verbose']),console[_0x5b4e20(0x17f)](_0x5b4e20(0x160)+AUTH_MODE[_0x5b4e20(0x13e)]),console[_0x5b4e20(0x17f)](_0x5b4e20(0x16b)+(_0x357307['accessKey']?a29_0x47d0ac[_0x5b4e20(0x152)](_0x5b4e20(0x16d)+_0x357307[_0x5b4e20(0x150)][_0x5b4e20(0x151)]+')'):a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x12a)))),console[_0x5b4e20(0x17f)](),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x15e)]('\x20\x20API\x20Endpoints')),console['log'](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)[_0x5b4e20(0x177)](0x1e))),console[_0x5b4e20(0x17f)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x5b4e20(0x17f)](_0x5b4e20(0x143)+getUserDomain()),console[_0x5b4e20(0x17f)](_0x5b4e20(0x175)+getRuntimeDomain()),console[_0x5b4e20(0x17f)](),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x15e)](_0x5b4e20(0x133))),console['log'](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)[_0x5b4e20(0x177)](0x1e)));const _0x51826b=inspectServiceRegistry();console['log'](_0x5b4e20(0x13f)+_0x51826b['registryPath']),console[_0x5b4e20(0x17f)](_0x5b4e20(0x146)+formatServiceRegistryStatus(_0x51826b)),console['log'](_0x5b4e20(0x14f)+_0x51826b['serviceCount']),console['log'](_0x5b4e20(0x12d)+_0x51826b['commandCount']);for(const _0x321701 of _0x51826b[_0x5b4e20(0x136)]){console['log']('\x20\x20'+(_0x321701[_0x5b4e20(0x12c)]+':')[_0x5b4e20(0x165)](0x11)+'\x20'+(_0x321701['name']||a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x163)))+'\x20('+_0x321701[_0x5b4e20(0x16e)]+_0x5b4e20(0x12f)),console[_0x5b4e20(0x17f)]('\x20\x20'+''[_0x5b4e20(0x165)](0x11)+_0x5b4e20(0x14d)+_0x321701[_0x5b4e20(0x149)][_0x5b4e20(0x17d)]);}return console[_0x5b4e20(0x17f)](),console['log'](a29_0x47d0ac[_0x5b4e20(0x15e)](_0x5b4e20(0x17c))),console[_0x5b4e20(0x17f)](a29_0x47d0ac[_0x5b4e20(0x13d)](_0x5b4e20(0x162)[_0x5b4e20(0x177)](0x1e))),console[_0x5b4e20(0x17f)](_0x5b4e20(0x17b)+a29_0x47d0ac[_0x5b4e20(0x152)](AUTH_MODE['ClientAk']+_0x5b4e20(0x134))),console[_0x5b4e20(0x17f)]('\x20\x20Session\x20check:\x20\x20\x20'+a29_0x47d0ac['gray'](_0x5b4e20(0x180))),console[_0x5b4e20(0x17f)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3efd0b){const _0x4fe81a=a29_0x3128;if(_0x3efd0b[_0x4fe81a(0x153)]==='ok')return a29_0x47d0ac['green']('✓\x20Loaded');if(_0x3efd0b[_0x4fe81a(0x153)]===_0x4fe81a(0x15b))return a29_0x47d0ac[_0x4fe81a(0x13d)](_0x4fe81a(0x12b));if(_0x3efd0b['status']===_0x4fe81a(0x171))return a29_0x47d0ac[_0x4fe81a(0x138)](_0x4fe81a(0x141));return a29_0x47d0ac['red'](_0x4fe81a(0x14e)+(_0x3efd0b['message']?':\x20'+_0x3efd0b['message']:''));}export const doctorDefinition={'service':a29_0x319dea(0x13b),'command':'check','description':a29_0x319dea(0x15c),'risk':a29_0x319dea(0x178),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
1
|
+
const a29_0x107042=a29_0x5c3e;(function(_0x5e6f60,_0x3b232d){const _0x3f956c=a29_0x5c3e,_0x1016e3=_0x5e6f60();while(!![]){try{const _0x2352c7=parseInt(_0x3f956c(0x12d))/0x1*(-parseInt(_0x3f956c(0x11d))/0x2)+-parseInt(_0x3f956c(0x117))/0x3+parseInt(_0x3f956c(0x15b))/0x4+parseInt(_0x3f956c(0x123))/0x5*(parseInt(_0x3f956c(0x14b))/0x6)+-parseInt(_0x3f956c(0x10b))/0x7*(parseInt(_0x3f956c(0x10c))/0x8)+parseInt(_0x3f956c(0x124))/0x9*(parseInt(_0x3f956c(0x151))/0xa)+-parseInt(_0x3f956c(0x158))/0xb*(parseInt(_0x3f956c(0x11c))/0xc);if(_0x2352c7===_0x3b232d)break;else _0x1016e3['push'](_0x1016e3['shift']());}catch(_0x190a8e){_0x1016e3['push'](_0x1016e3['shift']());}}}(a29_0x1b02,0xd6522));import a29_0xdc8098 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,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x4001bf){const _0xa76164=a29_0x5c3e,_0x37dcb2=getCliVersion(),_0x57a4b2=buildConfigFromFlags({});await initGlobalEnvironment(_0x57a4b2),console[_0xa76164(0x141)](),console[_0xa76164(0x141)](a29_0xdc8098['bold'](CLI_BIN_NAME+_0xa76164(0x13a))),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)]('─'['repeat'](0x32))),console[_0xa76164(0x141)](_0xa76164(0x110)+_0x37dcb2),console[_0xa76164(0x141)]('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0xa76164(0x113)]),console['log'](_0xa76164(0x149)+process[_0xa76164(0x127)]+'\x20'+process['arch']),console['log'](),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x132)](_0xa76164(0x142))),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x11b)[_0xa76164(0x12e)](0x1e)));const _0xc8155a=getGlobalConfigPath(),_0x22b65b=getProjectConfigPath();console['log'](_0xa76164(0x14a)+(_0xc8155a||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x130)))),console['log'](_0xa76164(0x11f)+(_0x22b65b||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x130)))),console[_0xa76164(0x141)](),console['log'](a29_0xdc8098[_0xa76164(0x132)](_0xa76164(0x161))),console[_0xa76164(0x141)](a29_0xdc8098['gray']('\x20\x20─'[_0xa76164(0x12e)](0x1e)));const _0x5353a5=(_0x34cb71,_0x903433)=>{const _0x2afc0c=_0xa76164;if(!_0x903433){console['log']('\x20\x20'+_0x34cb71['padEnd'](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x13b)](_0x2afc0c(0x150)));return;}const _0x3fd1ce=inspectCliConfigJsonFile(_0x903433);if(_0x3fd1ce[_0x2afc0c(0x143)]==='ok')console[_0x2afc0c(0x141)]('\x20\x20'+_0x34cb71[_0x2afc0c(0x111)](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x145)](_0x2afc0c(0x163)));else{if(_0x3fd1ce[_0x2afc0c(0x143)]==='empty')console['log']('\x20\x20'+_0x34cb71[_0x2afc0c(0x111)](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x12a)](_0x2afc0c(0x152)));else _0x3fd1ce[_0x2afc0c(0x143)]==='missing'?console[_0x2afc0c(0x141)]('\x20\x20'+_0x34cb71[_0x2afc0c(0x111)](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x13b)]('(missing)')):(console[_0x2afc0c(0x141)]('\x20\x20'+_0x34cb71[_0x2afc0c(0x111)](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x13e)]('✗\x20Invalid\x20JSON')),console['log']('\x20\x20'+''[_0x2afc0c(0x111)](0x11)+'\x20'+a29_0xdc8098[_0x2afc0c(0x13e)](_0x3fd1ce['message'])));}};_0x5353a5('Global',_0xc8155a),_0x5353a5(_0xa76164(0x167),_0x22b65b),console[_0xa76164(0x141)](),console['log'](a29_0xdc8098['bold']('\x20\x20Merged\x20Config')),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x11b)[_0xa76164(0x12e)](0x1e))),console[_0xa76164(0x141)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x57a4b2[_0xa76164(0x10f)]||a29_0xdc8098['red'](_0xa76164(0x13f)))),console[_0xa76164(0x141)](_0xa76164(0x119)+_0x57a4b2[_0xa76164(0x138)]);const _0x43ef75=isLegacyCompatConfigKey('locale')?a29_0xdc8098[_0xa76164(0x13b)](_0x57a4b2[_0xa76164(0x165)]+_0xa76164(0x14d)):_0x57a4b2[_0xa76164(0x165)];console[_0xa76164(0x141)](_0xa76164(0x120)+_0x43ef75),console[_0xa76164(0x141)](_0xa76164(0x118)+(_0x57a4b2[_0xa76164(0x14c)]||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x14e)))),console[_0xa76164(0x141)](_0xa76164(0x12f)+(_0x57a4b2[_0xa76164(0x154)]||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x14e)))),console[_0xa76164(0x141)](_0xa76164(0x160)+(_0x57a4b2[_0xa76164(0x12c)]||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x13c)+DEFAULT_CONFIG_VALUES[_0xa76164(0x12c)]+')'))),console[_0xa76164(0x141)](_0xa76164(0x11a)+(_0x57a4b2[_0xa76164(0x129)]??a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x155)))),console[_0xa76164(0x141)](_0xa76164(0x15e)+_0x57a4b2[_0xa76164(0x156)]),console['log'](_0xa76164(0x166)+_0x57a4b2[_0xa76164(0x116)]),console['log'](_0xa76164(0x15a)+AUTH_MODE[_0xa76164(0x114)]),console[_0xa76164(0x141)](_0xa76164(0x140)+(_0x57a4b2[_0xa76164(0x12b)]?a29_0xdc8098[_0xa76164(0x145)](_0xa76164(0x128)+_0x57a4b2[_0xa76164(0x12b)][_0xa76164(0x15c)]+')'):a29_0xdc8098['gray'](_0xa76164(0x14e)))),console[_0xa76164(0x141)](),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x132)]('\x20\x20API\x20Endpoints')),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x11b)[_0xa76164(0x12e)](0x1e))),console[_0xa76164(0x141)](_0xa76164(0x126)+getApiDomain()),console['log'](_0xa76164(0x137)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console['log'](),console[_0xa76164(0x141)](a29_0xdc8098['bold'](_0xa76164(0x131))),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x11b)['repeat'](0x1e)));const _0x60e1dc=inspectServiceRegistry();console['log'](_0xa76164(0x135)+_0x60e1dc[_0xa76164(0x159)]),console[_0xa76164(0x141)](_0xa76164(0x168)+formatServiceRegistryStatus(_0x60e1dc)),console[_0xa76164(0x141)](_0xa76164(0x148)+_0x60e1dc[_0xa76164(0x157)]),console[_0xa76164(0x141)](_0xa76164(0x136)+_0x60e1dc['commandCount']);for(const _0x3460c5 of _0x60e1dc[_0xa76164(0x10d)]){console[_0xa76164(0x141)]('\x20\x20'+(_0x3460c5[_0xa76164(0x115)]+':')[_0xa76164(0x111)](0x11)+'\x20'+(_0x3460c5[_0xa76164(0x14f)]||a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x13d)))+'\x20('+_0x3460c5[_0xa76164(0x10e)]+_0xa76164(0x15f)),console['log']('\x20\x20'+''['padEnd'](0x11)+'\x20Imported\x20from:\x20'+_0x3460c5[_0xa76164(0x122)][_0xa76164(0x144)]);}return console['log'](),console['log'](a29_0xdc8098['bold'](_0xa76164(0x112))),console[_0xa76164(0x141)](a29_0xdc8098[_0xa76164(0x13b)](_0xa76164(0x11b)['repeat'](0x1e))),console[_0xa76164(0x141)](_0xa76164(0x164)+a29_0xdc8098[_0xa76164(0x145)](AUTH_MODE[_0xa76164(0x114)]+_0xa76164(0x133))),console[_0xa76164(0x141)](_0xa76164(0x146)+a29_0xdc8098[_0xa76164(0x13b)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0xa76164(0x141)](),{'ok':!![]};}function formatServiceRegistryStatus(_0xde5f3f){const _0x1a1d78=a29_0x5c3e;if(_0xde5f3f[_0x1a1d78(0x143)]==='ok')return a29_0xdc8098[_0x1a1d78(0x145)](_0x1a1d78(0x139));if(_0xde5f3f[_0x1a1d78(0x143)]===_0x1a1d78(0x134))return a29_0xdc8098[_0x1a1d78(0x13b)]('(not\x20found)');if(_0xde5f3f[_0x1a1d78(0x143)]===_0x1a1d78(0x153))return a29_0xdc8098[_0x1a1d78(0x12a)](_0x1a1d78(0x162));return a29_0xdc8098['red'](_0x1a1d78(0x169)+(_0xde5f3f[_0x1a1d78(0x15d)]?':\x20'+_0xde5f3f[_0x1a1d78(0x15d)]:''));}function a29_0x5c3e(_0x35854b,_0x4a8927){_0x35854b=_0x35854b-0x10b;const _0x1b0287=a29_0x1b02();let _0x5c3ef8=_0x1b0287[_0x35854b];return _0x5c3ef8;}function a29_0x1b02(){const _0x1f8006=['Project','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','14GEyJTQ','98152gIAMsa','services','commandCount','appCode','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','padEnd','\x20\x20Auth','version','ClientAk','serviceCode','verbose','1822632CJpIGj','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','73284cXTpJo','60020TyupFT','read','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','source','203045jfMQWy','6282mMUpjT','check','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','platform','(set,\x20length=','pageSize','yellow','accessKey','format','29iJPvfQ','repeat','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','(not\x20found)','\x20\x20Service\x20Tree','bold','\x20(accessKey)','missing','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','env','✓\x20Loaded','\x20doctor','gray','(default:\x20','(unnamed)','red','(not\x20set)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','log','\x20\x20Config\x20Files','status','path','green','\x20\x20Session\x20check:\x20\x20\x20','doctor','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','174dVEXko','defaultApp','\x20(legacy/compat\x20only)','(none)','name','(no\x20file)','15430LXBhfG','⚠\x20Empty\x20(treated\x20as\x20{})','empty','currentApp','(default)','riskLevel','serviceCount','2552XnhiTv','registryPath','\x20\x20auth\x20(effective):\x20','6169516rnHvfz','length','message','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20commands)','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','⚠\x20Empty','✓\x20Valid\x20JSON','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','locale','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x1b02=function(){return _0x1f8006;};return a29_0x1b02();}export const doctorDefinition={'service':a29_0x107042(0x147),'command':a29_0x107042(0x125),'description':a29_0x107042(0x121),'risk':a29_0x107042(0x11e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x534a6c=a30_0x5b88;(function(_0x17aa4d,_0x50c182){const _0x21b0a6=a30_0x5b88,_0x13512c=_0x17aa4d();while(!![]){try{const _0x26f597=-parseInt(_0x21b0a6(0xdc))/0x1*(-parseInt(_0x21b0a6(0xdf))/0x2)+-parseInt(_0x21b0a6(0xd8))/0x3+parseInt(_0x21b0a6(0xeb))/0x4*(parseInt(_0x21b0a6(0xef))/0x5)+-parseInt(_0x21b0a6(0xde))/0x6+-parseInt(_0x21b0a6(0xd0))/0x7*(parseInt(_0x21b0a6(0xcf))/0x8)+parseInt(_0x21b0a6(0xcb))/0x9*(-parseInt(_0x21b0a6(0xe4))/0xa)+parseInt(_0x21b0a6(0xea))/0xb;if(_0x26f597===_0x50c182)break;else _0x13512c['push'](_0x13512c['shift']());}catch(_0x5dcb0e){_0x13512c['push'](_0x13512c['shift']());}}}(a30_0x3064,0xd2e23));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x3064(){const _0xe82ecd=['Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','read','description','path','31712395ctCrAQ','4372CIhWWH','str','body','POST','755xpFlYo','boolean','appCode','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','36mFlBBr','long-term','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','write','16wvQTIF','2644838otUNkv','trim','build','filePath','Preview:\x20upload\x20','Path\x20to\x20the\x20local\x20file\x20to\x20upload','file','bool','1988085HhaCvi','upload','filepath','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','943HRFqCf','string','2296056xLzRJN','2036vvZWns','download','File','query-url','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','3357860lvlwPN','validation'];a30_0x3064=function(){return _0xe82ecd;};return a30_0x3064();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x534a6c(0xd6),'type':'string','required':!![],'description':a30_0x534a6c(0xd5)},FILEPATH_FLAG={'name':a30_0x534a6c(0xda),'type':a30_0x534a6c(0xdd),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':a30_0x534a6c(0xe0),'type':'boolean','description':a30_0x534a6c(0xe6)},LONG_TERM_FLAG={'name':a30_0x534a6c(0xcc),'type':a30_0x534a6c(0xf0),'description':a30_0x534a6c(0xdb)};function requireFilePath(_0x42c9b6){const _0x510429=a30_0x534a6c,_0x42905a=_0x42c9b6[_0x510429(0xd1)]();if(!_0x42905a)throw CliErrors[_0x510429(0xe5)]('filePath\x20is\x20required.');return _0x42905a;}function a30_0x5b88(_0x316a55,_0x35c8de){_0x316a55=_0x316a55-0xca;const _0x30649b=a30_0x3064();let _0x5b8896=_0x30649b[_0x316a55];return _0x5b8896;}const fileUpload={'service':'file','command':a30_0x534a6c(0xd9),'description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':a30_0x534a6c(0xce),'flags':[FILE_FLAG],async 'dryRun'(_0x317401){const _0x4463f6=a30_0x534a6c,_0x1923ee=requireRuntimeUploadFile(_0x317401[_0x4463f6(0xec)]('file'),'File');return dryRun(_0x4463f6(0xee),'/client/uploadFile')[_0x4463f6(0xed)]({'appCode':_0x317401[_0x4463f6(0xf1)],'multipart':{'file':_0x1923ee}})[_0x4463f6(0xe8)](_0x4463f6(0xd4)+_0x1923ee[_0x4463f6(0xe9)]+'\x20to\x20runtime\x20app\x20'+_0x317401[_0x4463f6(0xf1)])[_0x4463f6(0xd2)]();},async 'execute'(_0x56bd4c){const _0x22f5da=a30_0x534a6c,_0x5dad04=requireRuntimeUploadFile(_0x56bd4c[_0x22f5da(0xec)](_0x22f5da(0xd6)),_0x22f5da(0xe1)),_0x3b64ee=await uploadRuntimeFile(_0x56bd4c['appCode'],_0x5dad04[_0x22f5da(0xe9)]);return{'ok':!![],'data':_0x3b64ee,'message':_0x3b64ee['filePath']?'Uploaded\x20file:\x20'+_0x3b64ee[_0x22f5da(0xd3)]+_0x22f5da(0xca):_0x22f5da(0xe3)};}},fileQueryUrl={'service':a30_0x534a6c(0xd6),'command':a30_0x534a6c(0xe2),'description':a30_0x534a6c(0xcd),'risk':a30_0x534a6c(0xe7),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3df0c5){const _0xbed4ba=a30_0x534a6c,_0x3d77f4=requireFilePath(_0x3df0c5[_0xbed4ba(0xec)](_0xbed4ba(0xda))),_0x41c830=await queryRuntimeFileUrl(_0x3d77f4,{'download':_0x3df0c5[_0xbed4ba(0xd7)](_0xbed4ba(0xe0)),'longTerm':_0x3df0c5[_0xbed4ba(0xd7)]('long-term')});return{'ok':!![],'data':_0x41c830};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Internal helpers for `app init` / `app import`.
|
|
3
|
+
*
|
|
4
|
+
* Why a dedicated init module: project initialization is the first thing users do
|
|
5
|
+
* and must be rock-solid. The logic handles:
|
|
6
|
+
* - Non-interactive (CI): fully automated with required `--appcode`
|
|
7
|
+
* - Interactive: prompts for missing values with sensible defaults
|
|
8
|
+
* - Import from rabetbase: converts an existing `.rabetbase.json` to `.lovrabet.json`
|
|
9
|
+
*
|
|
10
|
+
* Design decision: `init` NEVER asks about environment. The default is always
|
|
11
|
+
* `production`. If users need `daily`, they pass `--env daily` on the command line.
|
|
12
|
+
* This keeps the interactive flow fast and avoids a confusing first question
|
|
13
|
+
* when most users want `production`.
|
|
14
|
+
*
|
|
15
|
+
* Why `AbortPrompt` is converted to `CliErrors.cancelled()` at the top level:
|
|
16
|
+
* Ctrl+C during any prompt should produce a clean exit with code 0, not a stack trace.
|
|
17
|
+
* By catching `AbortPrompt` at the `runInit` / `runInitImport` boundary, individual
|
|
18
|
+
* prompt functions don't need to know about the CLI's error taxonomy.
|
|
19
|
+
*
|
|
20
|
+
* Why atomic writes via `writeConfigFile`: `init` creates the project config.
|
|
21
|
+
* If the process crashes mid-write, we could leave a corrupt empty file.
|
|
22
|
+
* The atomic write (temp + rename) prevents this.
|
|
23
|
+
*/
|
|
24
|
+
import type { FlagDef } from "../framework/types.js";
|
|
25
|
+
/** Flags for `lovrabet app init` (non-import). */
|
|
26
|
+
export declare const initCreateFlagDefs: FlagDef[];
|
|
27
|
+
/** Flags for `lovrabet app import`. */
|
|
28
|
+
export declare const initImportFlagDefs: FlagDef[];
|
|
29
|
+
/** Handles `lovrabet app init` (non-import path). */
|
|
30
|
+
export declare function runInit(flags: Record<string, any>): Promise<void>;
|
|
31
|
+
/** Handles `lovrabet app import`. */
|
|
32
|
+
export declare function runInitImport(flags: Record<string, any>): Promise<void>;
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x108adc=a31_0x1b5f;(function(_0xb0e554,_0x14d13d){const _0x625e44=a31_0x1b5f,_0x229e10=_0xb0e554();while(!![]){try{const _0xf19a7e=parseInt(_0x625e44(0x99))/0x1*(parseInt(_0x625e44(0x98))/0x2)+parseInt(_0x625e44(0xa5))/0x3+parseInt(_0x625e44(0x82))/0x4*(parseInt(_0x625e44(0x8a))/0x5)+-parseInt(_0x625e44(0xa9))/0x6+parseInt(_0x625e44(0xb9))/0x7*(parseInt(_0x625e44(0x7d))/0x8)+parseInt(_0x625e44(0x7c))/0x9*(parseInt(_0x625e44(0x90))/0xa)+-parseInt(_0x625e44(0x7f))/0xb;if(_0xf19a7e===_0x14d13d)break;else _0x229e10['push'](_0x229e10['shift']());}catch(_0xc41b4e){_0x229e10['push'](_0x229e10['shift']());}}}(a31_0x6a2b,0x54f59));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';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';function a31_0x6a2b(){const _0x2953b3=['Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20already\x20exists.\x20Overwrite?','utf8','Usage:\x20','log',')\x20instead\x20of\x20project','parse','\x20\x20default:\x20','Skip\x20confirmation\x20when\x20overwriting','riskLevel','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x22.\x20Allowed:\x20','14lozjCH','\x20\x20appcode:\x20','Imported\x20from\x20','trim','apps','Aborted.','boolean','\x0aInitialized\x20','string','1359idOmNn','2181736jmJIDT','validation','12056935IcZJsI','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20config:\x20\x20','4724MBZPvh','removeListener','App\x20code\x20for\x20the\x20project','\x20\x20env:\x20\x20\x20\x20\x20','join','project','app','[y/N]','820nfrlqQ','cancelled','stdin','message','entries','Failed\x20to\x20parse\x20source\x20file:\x20','3810kSIwzn','Target\x20environment\x20(default\x20','Write\x20to\x20global\x20(~/','newConfigFileName','stdout','question','App\x20code','flagMissing','822226QSqIMV','1rgRdCM','global','env','close','Override\x20imported\x20default\x20env','file','Override\x20imported\x20default\x20appcode','name','appcode','race','yes','defaultApp','983202UrFDUT','apiDir','once','SIGINT','548508DLqaaX','Initialized\x20','\x20init\x20—\x20Create\x20','File\x20'];a31_0x6a2b=function(){return _0x2953b3;};return a31_0x6a2b();}import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x108adc(0x7b),'description':a31_0x108adc(0x84)},{'name':'env','type':a31_0x108adc(0x7b),'description':a31_0x108adc(0x91)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x108adc(0x79),'description':a31_0x108adc(0x92)+PRODUCT_CONFIG['newConfigFileName']+a31_0x108adc(0xb2),'default':![]},{'name':a31_0x108adc(0xa3),'type':'boolean','description':a31_0x108adc(0xb5),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':a31_0x108adc(0xad),'required':!![]},{'name':a31_0x108adc(0xa1),'type':a31_0x108adc(0x7b),'description':a31_0x108adc(0x9f)},{'name':'env','type':a31_0x108adc(0x7b),'description':a31_0x108adc(0x9d),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x108adc(0x9a),'type':a31_0x108adc(0x79),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x108adc(0x93)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x108adc(0xa3),'type':'boolean','description':a31_0x108adc(0xb5),'default':![]}];export async function runInit(_0x4059cb){const _0x595fa9=a31_0x108adc,_0x5db14f=isNonInteractiveMode(_0x4059cb),_0xed0e4f=_0x4059cb[_0x595fa9(0x9a)]?_0x595fa9(0x9a):_0x595fa9(0x87),_0x282435=resolveWriteConfigPath(_0xed0e4f);try{_0x5db14f?await runNonInteractive(_0x4059cb,_0x282435):await runInteractive(_0x4059cb,_0x282435);}catch(_0x25705d){if(_0x25705d instanceof AbortPrompt)throw CliErrors[_0x595fa9(0x8b)]();throw _0x25705d;}}export async function runInitImport(_0x1a75b3){const _0x550f19=a31_0x108adc,_0x20f1e9=_0x1a75b3[_0x550f19(0x9a)]?_0x550f19(0x9a):_0x550f19(0x87),_0x12bc34=resolveWriteConfigPath(_0x20f1e9);await runFromImport(_0x1a75b3,_0x12bc34);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x108adc(0xa6)]);async function runFromImport(_0xba423,_0x1a8aa2){const _0xd9ada9=a31_0x108adc,_0x123556=resolveFilePath(_0xba423[_0xd9ada9(0x9e)]);if(!existsSync(_0x123556))throw CliErrors[_0xd9ada9(0x7e)]('Source\x20file\x20not\x20found:\x20'+_0x123556);const _0x1c3e2a=readSourceFile(_0x123556),_0x48f513=convertToRuntimeConfig(_0x1c3e2a);_0xba423[_0xd9ada9(0xa1)]&&(_0x48f513['appcode']=String(_0xba423[_0xd9ada9(0xa1)]));_0xba423['env']&&(_0x48f513[_0xd9ada9(0x9b)]=resolveInitEnv(_0xba423));if(!_0x48f513[_0xd9ada9(0xa1)])throw CliErrors[_0xd9ada9(0x7e)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','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`.');await writeInitConfig(_0x1a8aa2,_0x48f513,_0xba423),console[_0xd9ada9(0xb1)](_0xd9ada9(0x75)+_0x123556),console['log'](_0xd9ada9(0x81)+_0x1a8aa2),console[_0xd9ada9(0xb1)](_0xd9ada9(0xba)+_0x48f513[_0xd9ada9(0xa1)]);if(_0x48f513['defaultApp'])console['log'](_0xd9ada9(0xb4)+_0x48f513[_0xd9ada9(0xa4)]);}function convertToRuntimeConfig(_0x105916){const _0x22b57b=a31_0x108adc;if(_0x105916['apps']&&typeof _0x105916[_0x22b57b(0x77)]==='object')throw CliErrors[_0x22b57b(0x7e)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x22b57b(0xb7));const _0x1e2b9f={};for(const _0x382574 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x105916[_0x382574]!==undefined&&(_0x1e2b9f[_0x382574]=_0x105916[_0x382574]);}return!_0x1e2b9f['riskLevel']&&(_0x1e2b9f[_0x22b57b(0xb6)]=DEFAULT_CONFIG_VALUES[_0x22b57b(0xb6)]),_0x1e2b9f;}async function runNonInteractive(_0xe9dfd3,_0x489536){const _0x2f6b01=a31_0x108adc,_0x20a9e2=_0xe9dfd3[_0x2f6b01(0xa1)];if(!_0x20a9e2)throw CliErrors[_0x2f6b01(0x97)](_0x2f6b01(0xa1),_0x2f6b01(0xb0)+CLI_BIN_NAME+_0x2f6b01(0x80));const _0x33f33a=resolveInitEnv(_0xe9dfd3);await writeInitConfig(_0x489536,{'appcode':_0x20a9e2,'env':_0x33f33a},_0xe9dfd3),console[_0x2f6b01(0xb1)](_0x2f6b01(0xaa)+_0x489536),console[_0x2f6b01(0xb1)](_0x2f6b01(0xba)+_0x20a9e2),console['log'](_0x2f6b01(0x85)+_0x33f33a);}async function runInteractive(_0x5a8891,_0x194a19){const _0x1dea01=a31_0x108adc,_0x1def74=loadExisting(_0x194a19),_0x232fff=typeof _0x1def74?.[_0x1dea01(0xa1)]===_0x1dea01(0x7b)?_0x1def74['appcode']:'',_0x4c89a7=resolveInitEnv(_0x5a8891);console[_0x1dea01(0xb1)](CLI_BIN_NAME+_0x1dea01(0xab)+PRODUCT_CONFIG[_0x1dea01(0x93)]+'\x0a');if(existsSync(_0x194a19)&&!_0x5a8891[_0x1dea01(0xa3)]){const _0x321473=await promptYesNo(_0x1dea01(0xac)+_0x194a19+_0x1dea01(0xae),![]);if(!_0x321473){console[_0x1dea01(0xb1)](_0x1dea01(0x78));return;}}const _0x1729e9=typeof _0x5a8891[_0x1dea01(0xa1)]===_0x1dea01(0x7b)?_0x5a8891[_0x1dea01(0xa1)][_0x1dea01(0x76)]():'';let _0x5839d0=_0x1729e9;!_0x5839d0&&(_0x5839d0=await promptInput(_0x1dea01(0x96),_0x232fff));if(!_0x5839d0[_0x1dea01(0x76)]())throw CliErrors[_0x1dea01(0x7e)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x194a19,{'appcode':_0x5839d0[_0x1dea01(0x76)](),'env':_0x4c89a7},_0x5a8891),console[_0x1dea01(0xb1)](_0x1dea01(0x7a)+_0x194a19),console['log'](_0x1dea01(0xba)+_0x5839d0[_0x1dea01(0x76)]()),console[_0x1dea01(0xb1)](_0x1dea01(0x85)+_0x4c89a7);}async function writeInitConfig(_0x21192c,_0x50b9fd,_0x507d4a){const _0x51d896=a31_0x108adc;let _0x569c19={};existsSync(_0x21192c)&&!_0x507d4a[_0x51d896(0xa3)]&&(_0x569c19=readConfigFile(_0x21192c));for(const [_0x3382c6,_0x2075ea]of Object[_0x51d896(0x8e)](_0x50b9fd)){_0x2075ea!==undefined&&(_0x569c19[_0x3382c6]=_0x2075ea);}if(_0x569c19[_0x51d896(0x88)])delete _0x569c19[_0x51d896(0x88)];writeConfigFile(_0x21192c,_0x569c19);}class AbortPrompt extends Error{constructor(){const _0x5848cb=a31_0x108adc;super('User\x20aborted\x20prompt'),this[_0x5848cb(0xa0)]='AbortPrompt';}}function createSafeRl(){const _0x19f512=a31_0x108adc,_0x3a9ef6=createInterface({'input':process[_0x19f512(0x8c)],'output':process[_0x19f512(0x94)]});let _0x58fcb3;const _0x1942a6=new Promise((_0x14db87,_0x38e030)=>{const _0x405919=_0x19f512;_0x58fcb3=()=>{const _0x290249=a31_0x1b5f;_0x58fcb3&&(_0x3a9ef6[_0x290249(0x83)](_0x290249(0xa8),_0x58fcb3),_0x58fcb3=undefined);try{_0x3a9ef6[_0x290249(0x9c)]();}catch{}_0x38e030(new AbortPrompt());},_0x3a9ef6[_0x405919(0xa7)](_0x405919(0xa8),_0x58fcb3);}),_0x529ca0=()=>{const _0xdca9b0=_0x19f512;_0x58fcb3&&(_0x3a9ef6[_0xdca9b0(0x83)]('SIGINT',_0x58fcb3),_0x58fcb3=undefined);try{_0x3a9ef6[_0xdca9b0(0x9c)]();}catch{}};return{'rl':_0x3a9ef6,'abortPromise':_0x1942a6,'disposeSuccess':_0x529ca0};}async function promptInput(_0x18096b,_0x313304){const _0x2e1cc3=a31_0x108adc,{rl:_0x372626,abortPromise:_0x155696,disposeSuccess:_0x15da1e}=createSafeRl(),_0x548151=new Promise(_0x2bceb6=>{const _0x48ce0a=a31_0x1b5f,_0x2e7087=_0x313304?'\x20\x20'+_0x18096b+'\x20('+_0x313304+'):\x20':'\x20\x20'+_0x18096b+':\x20';_0x372626[_0x48ce0a(0x95)](_0x2e7087,_0x292d91=>{const _0x44dac5=_0x48ce0a;_0x15da1e(),_0x2bceb6(_0x292d91[_0x44dac5(0x76)]()||_0x313304);});});return Promise[_0x2e1cc3(0xa2)]([_0x548151,_0x155696]);}function a31_0x1b5f(_0x329f16,_0x492ef3){_0x329f16=_0x329f16-0x75;const _0x6a2bd=a31_0x6a2b();let _0x1b5f6a=_0x6a2bd[_0x329f16];return _0x1b5f6a;}async function promptYesNo(_0xeb59ad,_0x49c9c7){const _0x47d415=a31_0x108adc,{rl:_0x24c5a8,abortPromise:_0x3b2374,disposeSuccess:_0x1127ff}=createSafeRl(),_0x31fe03=new Promise(_0x599f53=>{const _0x2c702d=a31_0x1b5f,_0xbdea35=_0x49c9c7?'[Y/n]':_0x2c702d(0x89);_0x24c5a8[_0x2c702d(0x95)]('\x20\x20'+_0xeb59ad+'\x20'+_0xbdea35+':\x20',_0x3e379b=>{const _0x409898=_0x2c702d;_0x1127ff();const _0x1c6721=_0x3e379b[_0x409898(0x76)]()['toLowerCase']();if(_0x1c6721==='y'||_0x1c6721===_0x409898(0xa3))_0x599f53(!![]);else{if(_0x1c6721==='n'||_0x1c6721==='no')_0x599f53(![]);else _0x599f53(_0x49c9c7);}});});return Promise[_0x47d415(0xa2)]([_0x31fe03,_0x3b2374]);}function loadExisting(_0x404071){if(!existsSync(_0x404071))return null;return readConfigFile(_0x404071);}function resolveFilePath(_0x1aa3d9){return isAbsolute(_0x1aa3d9)?_0x1aa3d9:resolve(process['cwd'](),_0x1aa3d9);}function readSourceFile(_0x425b6e){const _0x45455c=a31_0x108adc;try{const _0x321ea5=readFileSync(_0x425b6e,{'encoding':_0x45455c(0xaf)});return JSON[_0x45455c(0xb3)](_0x321ea5);}catch(_0x5269f9){throw CliErrors[_0x45455c(0x7e)](_0x45455c(0x8f)+_0x5269f9[_0x45455c(0x8d)]);}}function resolveInitEnv(_0x21580d){const _0x4859e4=a31_0x108adc,_0x1a0b7c=_0x21580d[_0x4859e4(0x9b)];if(_0x1a0b7c===undefined||_0x1a0b7c==='')return DEFAULT_CONFIG_VALUES[_0x4859e4(0x9b)];if(!RUNTIME_ENV_VALUES['includes'](_0x1a0b7c))throw CliErrors[_0x4859e4(0x7e)]('Invalid\x20env\x20\x22'+_0x1a0b7c+_0x4859e4(0xb8)+RUNTIME_ENV_VALUES[_0x4859e4(0x86)](',\x20'));return _0x1a0b7c;}
|
|
1
|
+
const a31_0x15c51d=a31_0x7e3d;(function(_0x1dd319,_0xe20ab6){const _0x32d632=a31_0x7e3d,_0x1e1583=_0x1dd319();while(!![]){try{const _0x12a135=parseInt(_0x32d632(0xfd))/0x1+-parseInt(_0x32d632(0xf7))/0x2*(-parseInt(_0x32d632(0xdc))/0x3)+parseInt(_0x32d632(0x110))/0x4+parseInt(_0x32d632(0xe4))/0x5*(-parseInt(_0x32d632(0xf0))/0x6)+-parseInt(_0x32d632(0xf8))/0x7+parseInt(_0x32d632(0x108))/0x8*(parseInt(_0x32d632(0x119))/0x9)+parseInt(_0x32d632(0x107))/0xa*(-parseInt(_0x32d632(0x11d))/0xb);if(_0x12a135===_0xe20ab6)break;else _0x1e1583['push'](_0x1e1583['shift']());}catch(_0x137545){_0x1e1583['push'](_0x1e1583['shift']());}}}(a31_0x1fa9,0x26daf));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';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,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a31_0x1fa9(){const _0x34f2d3=['trim','[Y/n]','validation','yes','Imported\x20from\x20','close','name','556188jDTKWe','\x20\x20appcode:\x20','\x20init\x20—\x20Create\x20','SIGINT','object','Aborted.','\x20\x20config:\x20\x20','21806jmmqve','736428rrxeut','\x20already\x20exists.\x20Overwrite?','boolean','stdout','file','43820arpicG','riskLevel','stdin','Source\x20file\x20not\x20found:\x20','once','Initialized\x20','question','flagMissing','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`.','newConfigFileName','2140DRskue','432wROLOL','cancelled','env','\x22.\x20Allowed:\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','utf8','\x0aInitialized\x20','defaultApp','398728piSNvO','project','message','\x20\x20default:\x20','):\x20','Override\x20imported\x20default\x20appcode',')\x20instead\x20of\x20project','removeListener','app','52722WAMPAI','entries','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','19294hDZIpE','race','Failed\x20to\x20parse\x20source\x20file:\x20','Write\x20to\x20global\x20(~/','cwd','Target\x20environment\x20(default\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','[y/N]','includes','75flYIVe','App\x20code\x20cannot\x20be\x20empty.','parse','App\x20code\x20for\x20the\x20project','File\x20','Skip\x20confirmation\x20when\x20overwriting','join','log','5WWGSgT','string','global','appcode','apps'];a31_0x1fa9=function(){return _0x34f2d3;};return a31_0x1fa9();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x15c51d(0xe5),'description':a31_0x15c51d(0xdf)},{'name':a31_0x15c51d(0x10a),'type':a31_0x15c51d(0xe5),'description':a31_0x15c51d(0x122)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x15c51d(0xe6),'type':a31_0x15c51d(0xfa),'description':a31_0x15c51d(0x120)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x15c51d(0xec),'type':a31_0x15c51d(0xfa),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x15c51d(0xfc),'type':a31_0x15c51d(0xe5),'description':a31_0x15c51d(0x11c),'required':!![]},{'name':'appcode','type':a31_0x15c51d(0xe5),'description':a31_0x15c51d(0x115)},{'name':a31_0x15c51d(0x10a),'type':a31_0x15c51d(0xe5),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x15c51d(0xe6),'type':a31_0x15c51d(0xfa),'description':a31_0x15c51d(0x120)+PRODUCT_CONFIG[a31_0x15c51d(0x106)]+a31_0x15c51d(0x116),'default':![]},{'name':a31_0x15c51d(0xec),'type':'boolean','description':a31_0x15c51d(0xe1),'default':![]}];export async function runInit(_0x482c89){const _0x4f3736=a31_0x15c51d,_0x2d36a2=isNonInteractiveMode(_0x482c89),_0x118192=_0x482c89[_0x4f3736(0xe6)]?'global':_0x4f3736(0x111),_0x79fee4=resolveWriteConfigPath(_0x118192);try{_0x2d36a2?await runNonInteractive(_0x482c89,_0x79fee4):await runInteractive(_0x482c89,_0x79fee4);}catch(_0x2a7d5a){if(_0x2a7d5a instanceof AbortPrompt)throw CliErrors[_0x4f3736(0x109)]();throw _0x2a7d5a;}}export async function runInitImport(_0x3120c0){const _0x2b0cb2=a31_0x15c51d,_0x55ecc1=_0x3120c0[_0x2b0cb2(0xe6)]?_0x2b0cb2(0xe6):'project',_0x2dd616=resolveWriteConfigPath(_0x55ecc1);await runFromImport(_0x3120c0,_0x2dd616);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x29f9bd,_0xbf17c2){const _0x1328e9=a31_0x15c51d,_0x207159=resolveFilePath(_0x29f9bd['file']);if(!existsSync(_0x207159))throw CliErrors[_0x1328e9(0xeb)](_0x1328e9(0x100)+_0x207159);const _0x194178=readSourceFile(_0x207159),_0x54ab8d=convertToRuntimeConfig(_0x194178);_0x29f9bd[_0x1328e9(0xe7)]&&(_0x54ab8d[_0x1328e9(0xe7)]=String(_0x29f9bd[_0x1328e9(0xe7)]));_0x29f9bd['env']&&(_0x54ab8d[_0x1328e9(0x10a)]=resolveInitEnv(_0x29f9bd));if(!_0x54ab8d[_0x1328e9(0xe7)])throw CliErrors[_0x1328e9(0xeb)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x1328e9(0x105));await writeInitConfig(_0xbf17c2,_0x54ab8d,_0x29f9bd),console[_0x1328e9(0xe3)](_0x1328e9(0xed)+_0x207159),console['log'](_0x1328e9(0xf6)+_0xbf17c2),console[_0x1328e9(0xe3)](_0x1328e9(0xf1)+_0x54ab8d[_0x1328e9(0xe7)]);if(_0x54ab8d[_0x1328e9(0x10f)])console['log'](_0x1328e9(0x113)+_0x54ab8d[_0x1328e9(0x10f)]);}function convertToRuntimeConfig(_0x583c47){const _0x5cbe20=a31_0x15c51d;if(_0x583c47[_0x5cbe20(0xe8)]&&typeof _0x583c47['apps']===_0x5cbe20(0xf4))throw CliErrors[_0x5cbe20(0xeb)](_0x5cbe20(0xd9),_0x5cbe20(0x10c));const _0x1f2be9={};for(const _0x2b1dfe of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x583c47[_0x2b1dfe]!==undefined&&(_0x1f2be9[_0x2b1dfe]=_0x583c47[_0x2b1dfe]);}return!_0x1f2be9[_0x5cbe20(0xfe)]&&(_0x1f2be9['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1f2be9;}async function runNonInteractive(_0x58769a,_0x16baea){const _0x2092b2=a31_0x15c51d,_0x35ed08=_0x58769a[_0x2092b2(0xe7)];if(!_0x35ed08)throw CliErrors[_0x2092b2(0x104)](_0x2092b2(0xe7),'Usage:\x20'+CLI_BIN_NAME+_0x2092b2(0x11b));const _0xbc4e73=resolveInitEnv(_0x58769a);await writeInitConfig(_0x16baea,{'appcode':_0x35ed08,'env':_0xbc4e73},_0x58769a),console['log'](_0x2092b2(0x102)+_0x16baea),console[_0x2092b2(0xe3)](_0x2092b2(0xf1)+_0x35ed08),console[_0x2092b2(0xe3)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0xbc4e73);}async function runInteractive(_0x9f4dba,_0x5cbecc){const _0x3f5d71=a31_0x15c51d,_0x594f36=loadExisting(_0x5cbecc),_0x3d71b5=typeof _0x594f36?.['appcode']==='string'?_0x594f36[_0x3f5d71(0xe7)]:'',_0x57d644=resolveInitEnv(_0x9f4dba);console[_0x3f5d71(0xe3)](CLI_BIN_NAME+_0x3f5d71(0xf2)+PRODUCT_CONFIG[_0x3f5d71(0x106)]+'\x0a');if(existsSync(_0x5cbecc)&&!_0x9f4dba[_0x3f5d71(0xec)]){const _0x443ba7=await promptYesNo(_0x3f5d71(0xe0)+_0x5cbecc+_0x3f5d71(0xf9),![]);if(!_0x443ba7){console[_0x3f5d71(0xe3)](_0x3f5d71(0xf5));return;}}const _0x4c08e1=typeof _0x9f4dba[_0x3f5d71(0xe7)]===_0x3f5d71(0xe5)?_0x9f4dba[_0x3f5d71(0xe7)][_0x3f5d71(0xe9)]():'';let _0x52dd12=_0x4c08e1;!_0x52dd12&&(_0x52dd12=await promptInput('App\x20code',_0x3d71b5));if(!_0x52dd12[_0x3f5d71(0xe9)]())throw CliErrors[_0x3f5d71(0xeb)](_0x3f5d71(0xdd));await writeInitConfig(_0x5cbecc,{'appcode':_0x52dd12[_0x3f5d71(0xe9)](),'env':_0x57d644},_0x9f4dba),console['log'](_0x3f5d71(0x10e)+_0x5cbecc),console['log'](_0x3f5d71(0xf1)+_0x52dd12[_0x3f5d71(0xe9)]()),console[_0x3f5d71(0xe3)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x57d644);}async function writeInitConfig(_0x23fa23,_0x219c7b,_0x7368ba){const _0x3a4331=a31_0x15c51d;let _0x1a5d27={};existsSync(_0x23fa23)&&!_0x7368ba[_0x3a4331(0xec)]&&(_0x1a5d27=readConfigFile(_0x23fa23));for(const [_0x4eaf1f,_0x378b48]of Object[_0x3a4331(0x11a)](_0x219c7b)){_0x378b48!==undefined&&(_0x1a5d27[_0x4eaf1f]=_0x378b48);}if(_0x1a5d27[_0x3a4331(0x118)])delete _0x1a5d27['app'];writeConfigFile(_0x23fa23,_0x1a5d27);}function a31_0x7e3d(_0x5e8637,_0x583328){_0x5e8637=_0x5e8637-0xd9;const _0x1fa928=a31_0x1fa9();let _0x7e3d4e=_0x1fa928[_0x5e8637];return _0x7e3d4e;}class AbortPrompt extends Error{constructor(){const _0x460e79=a31_0x15c51d;super('User\x20aborted\x20prompt'),this[_0x460e79(0xef)]='AbortPrompt';}}function createSafeRl(){const _0x2044fc=a31_0x15c51d,_0x38b319=createInterface({'input':process[_0x2044fc(0xff)],'output':process[_0x2044fc(0xfb)]});let _0x23d4ad;const _0x493276=new Promise((_0x314e0f,_0x23617e)=>{const _0x4e99cc=_0x2044fc;_0x23d4ad=()=>{const _0x187c6c=a31_0x7e3d;_0x23d4ad&&(_0x38b319[_0x187c6c(0x117)](_0x187c6c(0xf3),_0x23d4ad),_0x23d4ad=undefined);try{_0x38b319[_0x187c6c(0xee)]();}catch{}_0x23617e(new AbortPrompt());},_0x38b319[_0x4e99cc(0x101)](_0x4e99cc(0xf3),_0x23d4ad);}),_0x26c4a9=()=>{const _0x39ee83=_0x2044fc;_0x23d4ad&&(_0x38b319['removeListener'](_0x39ee83(0xf3),_0x23d4ad),_0x23d4ad=undefined);try{_0x38b319['close']();}catch{}};return{'rl':_0x38b319,'abortPromise':_0x493276,'disposeSuccess':_0x26c4a9};}async function promptInput(_0x4672b1,_0x499c85){const _0x2089a8=a31_0x15c51d,{rl:_0x45f6ae,abortPromise:_0x1f1c41,disposeSuccess:_0x11f867}=createSafeRl(),_0x28ede5=new Promise(_0xf8a6ca=>{const _0xa52c3e=a31_0x7e3d,_0x47749d=_0x499c85?'\x20\x20'+_0x4672b1+'\x20('+_0x499c85+_0xa52c3e(0x114):'\x20\x20'+_0x4672b1+':\x20';_0x45f6ae[_0xa52c3e(0x103)](_0x47749d,_0xc31b7a=>{_0x11f867(),_0xf8a6ca(_0xc31b7a['trim']()||_0x499c85);});});return Promise[_0x2089a8(0x11e)]([_0x28ede5,_0x1f1c41]);}async function promptYesNo(_0x9be02a,_0x23a9d8){const _0x2cb213=a31_0x15c51d,{rl:_0x5a6ca3,abortPromise:_0x41bdf3,disposeSuccess:_0x35e35e}=createSafeRl(),_0x215372=new Promise(_0x556f00=>{const _0x72ec85=a31_0x7e3d,_0x3ab6be=_0x23a9d8?_0x72ec85(0xea):_0x72ec85(0xda);_0x5a6ca3[_0x72ec85(0x103)]('\x20\x20'+_0x9be02a+'\x20'+_0x3ab6be+':\x20',_0x16582a=>{const _0xf14678=_0x72ec85;_0x35e35e();const _0x143edd=_0x16582a[_0xf14678(0xe9)]()['toLowerCase']();if(_0x143edd==='y'||_0x143edd===_0xf14678(0xec))_0x556f00(!![]);else{if(_0x143edd==='n'||_0x143edd==='no')_0x556f00(![]);else _0x556f00(_0x23a9d8);}});});return Promise[_0x2cb213(0x11e)]([_0x215372,_0x41bdf3]);}function loadExisting(_0x1bdd1f){if(!existsSync(_0x1bdd1f))return null;return readConfigFile(_0x1bdd1f);}function resolveFilePath(_0x1cc43a){const _0x149d63=a31_0x15c51d;return isAbsolute(_0x1cc43a)?_0x1cc43a:resolve(process[_0x149d63(0x121)](),_0x1cc43a);}function readSourceFile(_0x425b0a){const _0x26a9f3=a31_0x15c51d;try{const _0x4c855a=readFileSync(_0x425b0a,{'encoding':_0x26a9f3(0x10d)});return JSON[_0x26a9f3(0xde)](_0x4c855a);}catch(_0xc3402c){throw CliErrors['validation'](_0x26a9f3(0x11f)+_0xc3402c[_0x26a9f3(0x112)]);}}function resolveInitEnv(_0x26223d){const _0x4790ce=a31_0x15c51d,_0x58b3af=_0x26223d[_0x4790ce(0x10a)];if(_0x58b3af===undefined||_0x58b3af==='')return DEFAULT_CONFIG_VALUES[_0x4790ce(0x10a)];if(!RUNTIME_ENV_VALUES[_0x4790ce(0xdb)](_0x58b3af))throw CliErrors['validation']('Invalid\x20env\x20\x22'+_0x58b3af+_0x4790ce(0x10b)+RUNTIME_ENV_VALUES[_0x4790ce(0xe2)](',\x20'));return _0x58b3af;}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `kb` command group — personal knowledge base and visible search.
|
|
3
|
+
*
|
|
4
|
+
* Phase one intentionally exposes file-based create/update and read/search
|
|
5
|
+
* workflows only. Delete exists in the backend but is not registered here.
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
8
|
+
export declare const kbDefinitions: CommandDefinition[];
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x53bd02=a32_0x1753;(function(_0x46800a,_0xbc598e){const _0x486cb4=a32_0x1753,_0x1b5fd2=_0x46800a();while(!![]){try{const _0x4cac37=-parseInt(_0x486cb4(0xdf))/0x1+parseInt(_0x486cb4(0xb5))/0x2*(parseInt(_0x486cb4(0xb8))/0x3)+parseInt(_0x486cb4(0xca))/0x4+-parseInt(_0x486cb4(0xc3))/0x5*(parseInt(_0x486cb4(0xd4))/0x6)+-parseInt(_0x486cb4(0xda))/0x7+-parseInt(_0x486cb4(0xae))/0x8+parseInt(_0x486cb4(0xb4))/0x9;if(_0x4cac37===_0xbc598e)break;else _0x1b5fd2['push'](_0x1b5fd2['shift']());}catch(_0x8b82e8){_0x1b5fd2['push'](_0x1b5fd2['shift']());}}}(a32_0x39d4,0x7523a));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x1753(_0x3d467e,_0x52b024){_0x3d467e=_0x3d467e-0xa8;const _0x39d4b8=a32_0x39d4();let _0x1753d4=_0x39d4b8[_0x3d467e];return _0x1753d4;}import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0x39d4(){const _0x3c18f2=['query','Search\x20query\x20is\x20required.','write','verbose','69895PAHDgR','docId','/client/knowledge-base/personal/create','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Override\x20the\x20existing\x20entry\x20title','body','File\x20not\x20found:\x20','784428Tsvsoy','length','file','POST','appCode','content','read','ragErrorMessage','bool','create','84tbDKTO','str','string','update','ragStatus','detail','145824AZmZfs','/update','description','title','scope','263053WWEBCS','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','userId','updateTime','version','Personal\x20knowledge-base\x20entry\x20title','881256GDwToh','map','list','Personal\x20knowledge-base\x20entry\x20ID','topk','createTime','1530621CocVnL','4XWADTr','build','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','1055061ZktLid','trim','isFile','search','num','validation','isFinite'];a32_0x39d4=function(){return _0x3c18f2;};return a32_0x39d4();}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x53bd02(0xdd),'type':a32_0x53bd02(0xd6),'required':!![],'description':a32_0x53bd02(0xad)},FILE_FLAG={'name':a32_0x53bd02(0xcc),'type':'string','required':!![],'description':a32_0x53bd02(0xa9)},QUERY_FLAG={'name':a32_0x53bd02(0xbf),'type':a32_0x53bd02(0xd6),'required':!![],'description':a32_0x53bd02(0xc6)},TOPK_FLAG={'name':a32_0x53bd02(0xb2),'type':'number','description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x1c1128){const _0x15ba86=a32_0x53bd02;if(!_0x1c1128)throw CliErrors[_0x15ba86(0xbd)]('File\x20path\x20is\x20required.');if(!existsSync(_0x1c1128))throw CliErrors[_0x15ba86(0xbd)](_0x15ba86(0xc9)+_0x1c1128);if(!statSync(_0x1c1128)[_0x15ba86(0xba)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x1c1128);return readFileSync(_0x1c1128,'utf8');}function summarizePersonalItem(_0x5ac319){const _0xd1306=a32_0x53bd02;return{'id':_0x5ac319['id'],'title':_0x5ac319[_0xd1306(0xdd)],'version':_0x5ac319[_0xd1306(0xac)],'ragStatus':_0x5ac319[_0xd1306(0xd8)],'ragErrorMessage':_0x5ac319[_0xd1306(0xd1)],'updateTime':_0x5ac319[_0xd1306(0xab)]};}function detailPersonalItem(_0x15264f){const _0x236c6e=a32_0x53bd02;return{'id':_0x15264f['id'],'appCode':_0x15264f[_0x236c6e(0xce)],'scope':_0x15264f[_0x236c6e(0xde)],'userId':_0x15264f[_0x236c6e(0xaa)],'title':_0x15264f['title'],'content':_0x15264f[_0x236c6e(0xcf)]??'','version':_0x15264f[_0x236c6e(0xac)],'ragStatus':_0x15264f['ragStatus'],'ragErrorMessage':_0x15264f[_0x236c6e(0xd1)],'createTime':_0x15264f[_0x236c6e(0xb3)],'updateTime':_0x15264f[_0x236c6e(0xab)]};}function summarizeSearchHit(_0x24d2d2){const _0xb38db9=a32_0x53bd02;return{'scope':_0x24d2d2[_0xb38db9(0xde)],'title':_0x24d2d2[_0xb38db9(0xdd)],'docId':_0x24d2d2[_0xb38db9(0xc4)],'score':_0x24d2d2['score'],'weightedScore':_0x24d2d2['weightedScore'],'content':_0x24d2d2[_0xb38db9(0xcf)],'metadata':_0x24d2d2['metadata']};}function readTopK(_0x2e0794){const _0x22f8b7=a32_0x53bd02,_0x16cd9b=_0x2e0794['flag'](_0x22f8b7(0xb2));if(_0x16cd9b===undefined||_0x16cd9b===null||_0x16cd9b==='')return undefined;const _0x5d51b1=_0x2e0794[_0x22f8b7(0xbc)]('topk');if(!Number[_0x22f8b7(0xbe)](_0x5d51b1)||_0x5d51b1<0x1)throw CliErrors[_0x22f8b7(0xbd)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x5d51b1;}const kbList={'service':'kb','command':a32_0x53bd02(0xb0),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x53bd02(0xd0),'flags':[VERBOSE_FLAG],async 'execute'(_0x32cdb0){const _0x3124e8=a32_0x53bd02,_0x2a2cc9=await listPersonalKnowledgeBaseItems(_0x32cdb0[_0x3124e8(0xce)]);if(_0x32cdb0[_0x3124e8(0xd2)](_0x3124e8(0xc2)))return{'ok':!![],'data':{'total':_0x2a2cc9[_0x3124e8(0xcb)],'items':_0x2a2cc9}};return{'ok':!![],'data':{'total':_0x2a2cc9['length'],'items':_0x2a2cc9[_0x3124e8(0xaf)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x53bd02(0xd9),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a32_0x53bd02(0xb1)}],async 'execute'(_0x42c595){const _0x42ffac=a32_0x53bd02,_0x666ac1=await getPersonalKnowledgeBaseItem(_0x42c595[_0x42ffac(0xbc)]('id'),_0x42c595[_0x42ffac(0xce)]);return{'ok':!![],'data':detailPersonalItem(_0x666ac1)};}},kbCreate={'service':'kb','command':a32_0x53bd02(0xd3),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x53bd02(0xc1),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3889e2){const _0x55628d=a32_0x53bd02,_0x1475aa=_0x3889e2[_0x55628d(0xd5)](_0x55628d(0xdd)),_0x4c15cc=readKnowledgeFile(_0x3889e2[_0x55628d(0xd5)]('file')),_0x5cc0a3=await createPersonalKnowledgeBaseItem(_0x3889e2[_0x55628d(0xce)],{'title':_0x1475aa,'content':_0x4c15cc});return{'ok':!![],'data':summarizePersonalItem(_0x5cc0a3),'message':'Created\x20KB\x20entry\x20'+_0x5cc0a3['id']+'\x20('+_0x5cc0a3['title']+')'};},async 'dryRun'(_0x424cea){const _0x54d425=a32_0x53bd02,_0xd4956d=_0x424cea[_0x54d425(0xd5)](_0x54d425(0xdd)),_0x5d0085=readKnowledgeFile(_0x424cea['str'](_0x54d425(0xcc)));return dryRun(_0x54d425(0xcd),_0x54d425(0xc5))[_0x54d425(0xc8)]({'appCode':_0x424cea[_0x54d425(0xce)],'title':_0xd4956d,'content':_0x5d0085})[_0x54d425(0xdc)](_0x54d425(0xa8)+_0xd4956d+'\x22')[_0x54d425(0xb6)]();}},kbUpdate={'service':'kb','command':a32_0x53bd02(0xd7),'description':'Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x53bd02(0xc1),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a32_0x53bd02(0xc7)},FILE_FLAG],async 'execute'(_0x328997){const _0x2233ef=a32_0x53bd02,_0x328d52=_0x328997[_0x2233ef(0xbc)]('id'),_0x23732f=readKnowledgeFile(_0x328997[_0x2233ef(0xd5)]('file')),_0x4fd831=_0x328997[_0x2233ef(0xd5)](_0x2233ef(0xdd))||(await getPersonalKnowledgeBaseItem(_0x328d52,_0x328997['appCode']))['title'],_0x17d4d8=await updatePersonalKnowledgeBaseItem(_0x328d52,_0x328997['appCode'],{'title':_0x4fd831,'content':_0x23732f});return{'ok':!![],'data':summarizePersonalItem(_0x17d4d8),'message':'Updated\x20KB\x20entry\x20'+_0x17d4d8['id']+'\x20('+_0x17d4d8[_0x2233ef(0xdd)]+')'};},async 'dryRun'(_0x46a1ca){const _0x24cafe=a32_0x53bd02,_0x3a2b5d=_0x46a1ca[_0x24cafe(0xbc)]('id'),_0x4a74b4=readKnowledgeFile(_0x46a1ca[_0x24cafe(0xd5)]('file')),_0x400655=_0x46a1ca[_0x24cafe(0xd5)](_0x24cafe(0xdd))||(await getPersonalKnowledgeBaseItem(_0x3a2b5d,_0x46a1ca[_0x24cafe(0xce)]))[_0x24cafe(0xdd)];return dryRun(_0x24cafe(0xcd),'/client/knowledge-base/personal/'+_0x3a2b5d+_0x24cafe(0xdb))[_0x24cafe(0xc8)]({'appCode':_0x46a1ca[_0x24cafe(0xce)],'title':_0x400655,'content':_0x4a74b4})['description'](_0x24cafe(0xb7)+_0x3a2b5d)[_0x24cafe(0xb6)]();}},kbSearch={'service':'kb','command':a32_0x53bd02(0xbb),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x53bd02(0xd0),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x364b71){const _0x44933b=a32_0x53bd02;if(!_0x364b71[_0x44933b(0xd5)]('query')[_0x44933b(0xb9)]())throw CliErrors[_0x44933b(0xbd)](_0x44933b(0xc0));readTopK(_0x364b71);},async 'execute'(_0x575188){const _0x3a629c=a32_0x53bd02,_0x2391b7=_0x575188[_0x3a629c(0xd5)]('query')['trim'](),_0x5b569d=readTopK(_0x575188),_0x3752f7=await searchKnowledgeBase(_0x575188['appCode'],{'query':_0x2391b7,'topK':_0x5b569d});return{'ok':!![],'data':{'total':_0x3752f7[_0x3a629c(0xcb)],'hits':_0x3752f7[_0x3a629c(0xaf)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview `logs` command definitions — show and clear command history.
|
|
3
|
+
*
|
|
4
|
+
* Why a separate logger module: Lovrabet Runtime CLI uses Winston to write
|
|
5
|
+
* structured JSON logs to `.lovrabet-runtime.log`. The `logs` command provides
|
|
6
|
+
* a human-readable view of this file (formatted output with icons, timestamps)
|
|
7
|
+
* and a way to clear it.
|
|
8
|
+
*
|
|
9
|
+
* Why `printLogs` is a standalone function: it formats the raw log entries
|
|
10
|
+
* into a human-readable report. Keeping it separate from the command definition
|
|
11
|
+
* makes it easier to test the formatting logic independently.
|
|
12
|
+
*
|
|
13
|
+
* Design decision: `logs show` and `logs clear` both use `risk: "read"` and
|
|
14
|
+
* `"write"` respectively. `logs clear` is `"write"` because it modifies the
|
|
15
|
+
* log file on disk. However, it does NOT require `--yes` even in CI because
|
|
16
|
+
* clearing logs is not a data-modifying operation in the Lovrabet sense —
|
|
17
|
+
* it only affects the local diagnostic file.
|
|
18
|
+
*/
|
|
19
|
+
import type { CommandDefinition } from "../../framework/types.js";
|
|
20
|
+
export declare const logsDefinitions: CommandDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0x1951(_0x145ae5,_0x388942){_0x145ae5=_0x145ae5-0x1d1;const _0x261be4=a33_0x261b();let _0x195154=_0x261be4[_0x145ae5];return _0x195154;}const a33_0x26e11b=a33_0x1951;function a33_0x261b(){const _0xef3dfa=['logs','\x20\x20\x20Details:\x20','Clear\x20command\x20history\x20logs','length','12033076FkpwIJ','success','show','en-US','23nIkHmi','126ZMKpcz','timestamp','318906mykCSQ','155836OnfJiq','read','forEach','details','\x20\x20\x20Duration:\x20','*\x20No\x20logs\x20found','*\x20Logs\x20cleared','stringify','\x20logs:\x0a','warn','write','16suDgyf','level','clearLogs','896EqwdOV','\x20\x20\x20Time:\x20','clear','7600375nxiyyp','error','readLogs','toLocaleString','duration','keys','1352283eEuMot','View\x20command\x20history\x20logs','message','18176380Hgyeuf','log','114147WnqMIQ','command'];a33_0x261b=function(){return _0xef3dfa;};return a33_0x261b();}(function(_0xa9fef6,_0x23094a){const _0xfc7fe3=a33_0x1951,_0x4001b7=_0xa9fef6();while(!![]){try{const _0xd730af=parseInt(_0xfc7fe3(0x1f2))/0x1*(-parseInt(_0xfc7fe3(0x1f6))/0x2)+-parseInt(_0xfc7fe3(0x1e3))/0x3*(-parseInt(_0xfc7fe3(0x1d7))/0x4)+parseInt(_0xfc7fe3(0x1dd))/0x5+-parseInt(_0xfc7fe3(0x1f5))/0x6*(-parseInt(_0xfc7fe3(0x1f3))/0x7)+-parseInt(_0xfc7fe3(0x1da))/0x8*(-parseInt(_0xfc7fe3(0x1e8))/0x9)+-parseInt(_0xfc7fe3(0x1e6))/0xa+-parseInt(_0xfc7fe3(0x1ee))/0xb;if(_0xd730af===_0x23094a)break;else _0x4001b7['push'](_0x4001b7['shift']());}catch(_0x3ea89c){_0x4001b7['push'](_0x4001b7['shift']());}}}(a33_0x261b,0xf3539));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x498cb7){const _0xbb9adc=a33_0x1951;if(_0x498cb7['length']===0x0){console[_0xbb9adc(0x1e7)](_0xbb9adc(0x1d1));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0xbb9adc(0x1d4)),_0x498cb7[_0xbb9adc(0x1f8)]((_0x21b363,_0x3d2149)=>{const _0x167326=_0xbb9adc,_0x16d61d=new Date(_0x21b363[_0x167326(0x1f4)])[_0x167326(0x1e0)](_0x167326(0x1f1)),_0x3d9eb7=_0x21b363[_0x167326(0x1d8)]===_0x167326(0x1ef)?'√':_0x21b363[_0x167326(0x1d8)]===_0x167326(0x1de)?'×':_0x21b363[_0x167326(0x1d8)]===_0x167326(0x1d5)?'!':'i';console['log'](_0x3d2149+0x1+'.\x20'+_0x3d9eb7+'\x20['+_0x21b363[_0x167326(0x1e9)]+']\x20'+_0x21b363[_0x167326(0x1e5)]),console['log'](_0x167326(0x1db)+_0x16d61d),_0x21b363['duration']&&console['log'](_0x167326(0x1fa)+_0x21b363[_0x167326(0x1e1)]+'ms'),_0x21b363[_0x167326(0x1f9)]&&Object[_0x167326(0x1e2)](_0x21b363[_0x167326(0x1f9)])[_0x167326(0x1ed)]>0x0&&console[_0x167326(0x1e7)](_0x167326(0x1eb)+JSON[_0x167326(0x1d3)](_0x21b363[_0x167326(0x1f9)],null,0x2)),console[_0x167326(0x1e7)]('');});}export const logsDefinitions=[{'service':a33_0x26e11b(0x1ea),'command':a33_0x26e11b(0x1f0),'description':a33_0x26e11b(0x1e4),'risk':a33_0x26e11b(0x1f7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x305bec){const _0x104629=a33_0x26e11b;return printLogs(logger[_0x104629(0x1df)]()),{'ok':!![]};}},{'service':a33_0x26e11b(0x1ea),'command':a33_0x26e11b(0x1dc),'description':a33_0x26e11b(0x1ec),'risk':a33_0x26e11b(0x1d6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1bea37){const _0x2fec90=a33_0x26e11b;return logger[_0x2fec90(0x1d9)](),console[_0x2fec90(0x1e7)](_0x2fec90(0x1d2)),{'ok':!![]};}}];
|