@mondaydotcomorg/atp-server 0.20.6 → 0.20.7

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/dist/index.js CHANGED
@@ -10361,8 +10361,13 @@ var ExplorerService = class {
10361
10361
  }
10362
10362
  root;
10363
10363
  apiGroups;
10364
+ apiGroupMap;
10364
10365
  constructor(apiGroups) {
10365
10366
  this.apiGroups = apiGroups;
10367
+ this.apiGroupMap = new Map(apiGroups.map((group) => [
10368
+ group.name,
10369
+ group
10370
+ ]));
10366
10371
  this.root = {
10367
10372
  type: "directory",
10368
10373
  name: "/",
@@ -10422,7 +10427,13 @@ var ExplorerService = class {
10422
10427
  buildTree(apiGroups) {
10423
10428
  for (const group of apiGroups) {
10424
10429
  if (!group.functions || group.functions.length === 0) continue;
10425
- const groupFolder = group.type === "graphql" ? this.ensureDirectory(this.root, group.name, group.description) : this.ensureDirectory(this.ensureDirectory(this.root, group.type), group.name, group.description);
10430
+ let groupFolder;
10431
+ if (group.type === "graphql") {
10432
+ groupFolder = this.ensureDirectory(this.root, group.name, group.description);
10433
+ } else {
10434
+ groupFolder = this.ensureDirectory(this.ensureDirectory(this.root, group.type), group.name, group.description);
10435
+ }
10436
+ groupFolder.apiGroupName = group.name;
10426
10437
  for (const func of group.functions) {
10427
10438
  const segments = this.extractSegments(func, group);
10428
10439
  if (segments.length > 1) {
@@ -10584,11 +10595,18 @@ var ExplorerService = class {
10584
10595
  }
10585
10596
  return a.type === "directory" ? -1 : 1;
10586
10597
  });
10587
- return {
10598
+ const result = {
10588
10599
  type: "directory",
10589
10600
  path: currentPath,
10590
10601
  items
10591
10602
  };
10603
+ if (current.apiGroupName) {
10604
+ const apiGroup = this.apiGroupMap.get(current.apiGroupName);
10605
+ if (apiGroup?.documentation) {
10606
+ result.documentation = apiGroup.documentation;
10607
+ }
10608
+ }
10609
+ return result;
10592
10610
  } else {
10593
10611
  if (!current.functionDef) {
10594
10612
  return null;