@share-crm/sharedev-cli 0.0.4-rc.50-test.2 → 0.0.4-rc.50-test.3

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.
Files changed (2) hide show
  1. package/dist/sharedev.js +28 -7
  2. package/package.json +1 -1
package/dist/sharedev.js CHANGED
@@ -19517,7 +19517,19 @@ async function getFuncList(options = {}) {
19517
19517
  });
19518
19518
  return response.function ?? [];
19519
19519
  }
19520
+ /**
19521
+ * open API 通道的批量函数查询(sharecrm 登录态时替代 FHH biz/batchQuery)。
19522
+ * 响应结构 2026-10-21 实测:content.function 直接为数组(无 result 嵌套,
19523
+ * 与 get-by-apiname-and-binding-object-apiname 的 {result:{function}} 不同形)。
19524
+ */
19525
+ async function findFuncByApiNamesViaOpenApi(apiNames) {
19526
+ const content = await (0, openapi_request_ts_1.executeOpenApiCommand)('code-dev function query-by-apinames', { apiNames });
19527
+ return content?.function ?? [];
19528
+ }
19520
19529
  async function findFuncByApiNames(apiNames) {
19530
+ if ((0, request_channel_ts_1.resolveRequestChannel)() === 'openapi') {
19531
+ return findFuncByApiNamesViaOpenApi(apiNames);
19532
+ }
19521
19533
  const response = await request_ts_1.requestService.FHH({
19522
19534
  url: '/EM1HFUNC/biz/batchQuery',
19523
19535
  data: {
@@ -29391,6 +29403,7 @@ const node_path_1 = __importDefault(__webpack_require__(76760));
29391
29403
  const prompts_1 = __webpack_require__(53503);
29392
29404
  const logger_ts_1 = __webpack_require__(87562);
29393
29405
  const request_ts_1 = __webpack_require__(83733);
29406
+ const sharecrm_session_ts_1 = __webpack_require__(47166);
29394
29407
  const file_ts_1 = __webpack_require__(57452);
29395
29408
  const pkgMeta_ts_1 = __webpack_require__(48559);
29396
29409
  const apl_command_ts_1 = __webpack_require__(10508);
@@ -29720,22 +29733,28 @@ async function runInitMetadataDownload(context) {
29720
29733
  await (0, dev_metadata_workspace_ts_1.writeNamespaceMetadataFile)(namespacesDir, namespaceResult.raw);
29721
29734
  logger_ts_1.loggerService.success(`Metadata download complete: objects=${succeeded}${failed ? `, failed=${failed}` : ''}, namespaces=${namespaceResult.namespaces.length}`);
29722
29735
  }
29723
- async function runInitDownloadsConcurrently(context, options, pullSelections, agentName) {
29736
+ async function runInitDownloadsConcurrently(context, options, pullSelections, agentName, hasCredentials) {
29724
29737
  const tasks = [];
29738
+ if (!hasCredentials && (pullSelections.pullAllApl || pullSelections.pullAllPwc)) {
29739
+ // 凭证未就绪(certificate 未配置且工作区未登录):远端拉取类任务全部跳过,
29740
+ // 文档/spec 模板(公网资源)照常下载
29741
+ logger_ts_1.loggerService.warn('Credentials not ready (no certificate configured and not logged in). Skipping remote pulls.');
29742
+ logger_ts_1.loggerService.info('Run `sharedev auth login` first, then `sharedev apl pull --all` / `sharedev pwc pull --all --type <component|plugin>`.');
29743
+ }
29725
29744
  if (pullSelections.pullAllApl || pullSelections.pullAllPwc) {
29726
29745
  tasks.push(runInitDocsDownload(context, pullSelections));
29727
29746
  }
29728
29747
  if (pullSelections.pullAllApl || pullSelections.pullAllPwc) {
29729
29748
  tasks.push(runInitSpec(context, options, agentName));
29730
29749
  }
29731
- if (pullSelections.pullAllApl || pullSelections.pullAllPwc) {
29750
+ if (hasCredentials && (pullSelections.pullAllApl || pullSelections.pullAllPwc)) {
29732
29751
  request_ts_1.requestService.configure(context.settings);
29733
29752
  tasks.push(runInitMetadataDownload(context));
29734
29753
  }
29735
- if (pullSelections.pullAllApl) {
29754
+ if (hasCredentials && pullSelections.pullAllApl) {
29736
29755
  tasks.push(runInitAplPull(context));
29737
29756
  }
29738
- if (pullSelections.pullAllPwc) {
29757
+ if (hasCredentials && pullSelections.pullAllPwc) {
29739
29758
  tasks.push(runInitPwcPull(context));
29740
29759
  }
29741
29760
  const results = await Promise.allSettled(tasks);
@@ -29769,8 +29788,10 @@ async function initProjectCommand(runtimeContext, options) {
29769
29788
  await (0, file_ts_1.writeJsonFile)(settingsPath, payload);
29770
29789
  logger_ts_1.loggerService.success(`Initialization completed: ${settingsPath}`);
29771
29790
  logger_ts_1.loggerService.info(`Workspace folder created: ${workspaceDir}`);
29791
+ // 凭证就绪判定:本次配置了 certificate,或工作区已存在 sharecrm 登录态(--force 重建场景)
29792
+ const hasCredentials = Boolean(payload.certificate?.trim()) || Boolean((0, sharecrm_session_ts_1.readSharedevAuthSession)(settingsDir)?.accessToken);
29772
29793
  const initContext = createInitRuntimeContext(runtimeContext, workspaceDir, settingsDir, settingsPath, payload);
29773
- await runInitDownloadsConcurrently(initContext, options, pullSelections, agentName);
29794
+ await runInitDownloadsConcurrently(initContext, options, pullSelections, agentName, hasCredentials);
29774
29795
  }
29775
29796
 
29776
29797
 
@@ -51282,8 +51303,8 @@ async function readCliPackageMeta() {
51282
51303
  ? "@share-crm/sharedev-cli".trim()
51283
51304
  : '@share-crm/sharedev-cli';
51284
51305
  const debugEnabled = true && Boolean(false);
51285
- const rawVersion = ( true && "0.0.4-rc.50-test.2".trim())
51286
- ? "0.0.4-rc.50-test.2".trim()
51306
+ const rawVersion = ( true && "0.0.4-rc.50-test.3".trim())
51307
+ ? "0.0.4-rc.50-test.3".trim()
51287
51308
  : '0.0.0';
51288
51309
  const version = rawVersion + (debugEnabled ? '-debug' : '');
51289
51310
  return { name, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@share-crm/sharedev-cli",
3
- "version": "0.0.4-rc.50-test.2",
3
+ "version": "0.0.4-rc.50-test.3",
4
4
  "private": false,
5
5
  "description": "sharedev command line tool",
6
6
  "type": "module",