@cparra/apexdocs 3.15.0-alpha.0 → 3.15.0-beta.0

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.
@@ -5,17 +5,14 @@ var TE = require('fp-ts/TaskEither');
5
5
  var E = require('fp-ts/Either');
6
6
  var yaml = require('js-yaml');
7
7
  var path = require('path');
8
+ var T = require('fp-ts/Task');
9
+ var A = require('fp-ts/lib/Array');
10
+ var apexReflection = require('@cparra/apex-reflection');
8
11
  var O = require('fp-ts/Option');
12
+ var fastXmlParser = require('fast-xml-parser');
9
13
  var Handlebars = require('handlebars');
10
14
  var boolean = require('fp-ts/boolean');
11
- var fastXmlParser = require('fast-xml-parser');
12
- var T = require('fp-ts/Task');
13
- var A = require('fp-ts/Array');
14
- var worker_threads = require('worker_threads');
15
- var os = require('os');
16
- var A$1 = require('fp-ts/lib/Array');
17
- var apexReflection = require('@cparra/apex-reflection');
18
- var uuid = require('uuid');
15
+ var A$1 = require('fp-ts/Array');
19
16
  var fs = require('fs');
20
17
  var TE$1 = require('fp-ts/lib/TaskEither');
21
18
  var minimatch = require('minimatch');
@@ -43,9 +40,9 @@ var TE__namespace = /*#__PURE__*/_interopNamespaceDefault(TE);
43
40
  var E__namespace = /*#__PURE__*/_interopNamespaceDefault(E);
44
41
  var yaml__namespace = /*#__PURE__*/_interopNamespaceDefault(yaml);
45
42
  var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
46
- var O__namespace = /*#__PURE__*/_interopNamespaceDefault(O);
47
43
  var T__namespace = /*#__PURE__*/_interopNamespaceDefault(T);
48
44
  var A__namespace = /*#__PURE__*/_interopNamespaceDefault(A);
45
+ var O__namespace = /*#__PURE__*/_interopNamespaceDefault(O);
49
46
  var A__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(A$1);
50
47
  var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
51
48
  var TE__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(TE$1);
@@ -172,23 +169,29 @@ const defaultTranslations = {
172
169
  inheritance: {
173
170
  inheritance: "Inheritance",
174
171
  implements: "Implements"
172
+ },
173
+ lwc: {
174
+ exposed: "Exposed",
175
+ targets: "Targets",
176
+ targetConfigs: "Target Configs",
177
+ properties: "Properties"
175
178
  }
176
179
  }
177
180
  };
178
181
 
179
- var __defProp$t = Object.defineProperty;
180
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
181
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
182
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
183
- var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
184
- var __spreadValues$t = (a, b) => {
182
+ var __defProp$r = Object.defineProperty;
183
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
184
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
185
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
186
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
187
+ var __spreadValues$r = (a, b) => {
185
188
  for (var prop in b || (b = {}))
186
- if (__hasOwnProp$t.call(b, prop))
187
- __defNormalProp$t(a, prop, b[prop]);
188
- if (__getOwnPropSymbols$t)
189
- for (var prop of __getOwnPropSymbols$t(b)) {
190
- if (__propIsEnum$t.call(b, prop))
191
- __defNormalProp$t(a, prop, b[prop]);
189
+ if (__hasOwnProp$r.call(b, prop))
190
+ __defNormalProp$r(a, prop, b[prop]);
191
+ if (__getOwnPropSymbols$r)
192
+ for (var prop of __getOwnPropSymbols$r(b)) {
193
+ if (__propIsEnum$r.call(b, prop))
194
+ __defNormalProp$r(a, prop, b[prop]);
192
195
  }
193
196
  return a;
194
197
  };
@@ -204,7 +207,7 @@ function isObjectWithStringKeys(value) {
204
207
  return value !== null && typeof value === "object" && !Array.isArray(value);
205
208
  }
206
209
  function deepMerge(target, source) {
207
- const result = __spreadValues$t({}, target);
210
+ const result = __spreadValues$r({}, target);
208
211
  for (const key in source) {
209
212
  if (Object.prototype.hasOwnProperty.call(source, key)) {
210
213
  const sourceValue = source[key];
@@ -318,25 +321,25 @@ function isInlineCode(content) {
318
321
  return Object.keys(content).includes("__type") && content.__type === "inline-code";
319
322
  }
320
323
 
321
- var __defProp$s = Object.defineProperty;
322
- var __defProps$r = Object.defineProperties;
323
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
324
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
325
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
326
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
327
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
328
- var __spreadValues$s = (a, b) => {
324
+ var __defProp$q = Object.defineProperty;
325
+ var __defProps$p = Object.defineProperties;
326
+ var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
327
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
328
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
329
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
330
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
331
+ var __spreadValues$q = (a, b) => {
329
332
  for (var prop in b || (b = {}))
330
- if (__hasOwnProp$s.call(b, prop))
331
- __defNormalProp$s(a, prop, b[prop]);
332
- if (__getOwnPropSymbols$s)
333
- for (var prop of __getOwnPropSymbols$s(b)) {
334
- if (__propIsEnum$s.call(b, prop))
335
- __defNormalProp$s(a, prop, b[prop]);
333
+ if (__hasOwnProp$q.call(b, prop))
334
+ __defNormalProp$q(a, prop, b[prop]);
335
+ if (__getOwnPropSymbols$q)
336
+ for (var prop of __getOwnPropSymbols$q(b)) {
337
+ if (__propIsEnum$q.call(b, prop))
338
+ __defNormalProp$q(a, prop, b[prop]);
336
339
  }
337
340
  return a;
338
341
  };
339
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
342
+ var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
340
343
  function adaptDescribable(describable, linkGenerator) {
341
344
  return {
342
345
  description: describableToRenderableContent(describable, linkGenerator)
@@ -388,7 +391,7 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
388
391
  function extractCustomTags(type) {
389
392
  var _a2, _b2;
390
393
  const baseTags = ["description", "group", "author", "date", "see", "example", "throws", "exception"];
391
- return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => __spreadProps$r(__spreadValues$s({}, adaptDescribable(currentAnnotation.bodyLines, linkGenerator)), {
394
+ return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => __spreadProps$p(__spreadValues$q({}, adaptDescribable(currentAnnotation.bodyLines, linkGenerator)), {
392
395
  name: currentAnnotation.name
393
396
  }))) != null ? _b2 : [];
394
397
  }
@@ -402,7 +405,7 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
402
405
  var _a2, _b2;
403
406
  return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === "see").map((currentAnnotation) => currentAnnotation.body)) != null ? _b2 : [];
404
407
  }
405
- return __spreadProps$r(__spreadValues$s({}, adaptDescribable((_a = documentable.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
408
+ return __spreadProps$p(__spreadValues$q({}, adaptDescribable((_a = documentable.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
406
409
  annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()),
407
410
  customTags: extractCustomTags(documentable),
408
411
  example: {
@@ -417,25 +420,25 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
417
420
  });
418
421
  }
419
422
 
420
- var __defProp$r = Object.defineProperty;
421
- var __defProps$q = Object.defineProperties;
422
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
423
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
424
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
425
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
426
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
427
- var __spreadValues$r = (a, b) => {
423
+ var __defProp$p = Object.defineProperty;
424
+ var __defProps$o = Object.defineProperties;
425
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
426
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
427
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
428
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
429
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
430
+ var __spreadValues$p = (a, b) => {
428
431
  for (var prop in b || (b = {}))
429
- if (__hasOwnProp$r.call(b, prop))
430
- __defNormalProp$r(a, prop, b[prop]);
431
- if (__getOwnPropSymbols$r)
432
- for (var prop of __getOwnPropSymbols$r(b)) {
433
- if (__propIsEnum$r.call(b, prop))
434
- __defNormalProp$r(a, prop, b[prop]);
432
+ if (__hasOwnProp$p.call(b, prop))
433
+ __defNormalProp$p(a, prop, b[prop]);
434
+ if (__getOwnPropSymbols$p)
435
+ for (var prop of __getOwnPropSymbols$p(b)) {
436
+ if (__propIsEnum$p.call(b, prop))
437
+ __defNormalProp$p(a, prop, b[prop]);
435
438
  }
436
439
  return a;
437
440
  };
438
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
441
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
439
442
  function adaptMethod(method, linkGenerator, baseHeadingLevel, translations) {
440
443
  var _a, _b, _c;
441
444
  function buildTitle(method2) {
@@ -465,7 +468,7 @@ function adaptMethod(method, linkGenerator, baseHeadingLevel, translations) {
465
468
  returnType: {
466
469
  headingLevel: baseHeadingLevel + 1,
467
470
  heading: translations.markdown.details.returnType,
468
- value: __spreadProps$q(__spreadValues$r({}, adaptDescribable((_b = (_a = method.docComment) == null ? void 0 : _a.returnAnnotation) == null ? void 0 : _b.bodyLines, linkGenerator)), {
471
+ value: __spreadProps$o(__spreadValues$p({}, adaptDescribable((_b = (_a = method.docComment) == null ? void 0 : _a.returnAnnotation) == null ? void 0 : _b.bodyLines, linkGenerator)), {
469
472
  type: linkGenerator(method.typeReference.rawDeclaration)
470
473
  })
471
474
  },
@@ -524,13 +527,13 @@ function mapParameters(documentable, param, linkGenerator) {
524
527
  const paramAnnotation = (_a = documentable.docComment) == null ? void 0 : _a.paramAnnotations.find(
525
528
  (pa) => pa.paramName.toLowerCase() === param.name.toLowerCase()
526
529
  );
527
- return __spreadProps$q(__spreadValues$r({}, adaptDescribable(paramAnnotation == null ? void 0 : paramAnnotation.bodyLines, linkGenerator)), {
530
+ return __spreadProps$o(__spreadValues$p({}, adaptDescribable(paramAnnotation == null ? void 0 : paramAnnotation.bodyLines, linkGenerator)), {
528
531
  name: param.name,
529
532
  type: linkGenerator(param.typeReference.rawDeclaration)
530
533
  });
531
534
  }
532
535
  function mapThrows(thrown, linkGenerator) {
533
- return __spreadProps$q(__spreadValues$r({}, adaptDescribable(thrown.bodyLines, linkGenerator)), {
536
+ return __spreadProps$o(__spreadValues$p({}, adaptDescribable(thrown.bodyLines, linkGenerator)), {
534
537
  type: linkGenerator(thrown.exceptionName)
535
538
  });
536
539
  }
@@ -577,11 +580,14 @@ function isObjectType(type) {
577
580
  return type.type_name === "customobject";
578
581
  }
579
582
  function isApexType(type) {
580
- return !isObjectType(type) && !isTriggerType(type);
583
+ return !isObjectType(type) && !isTriggerType(type) && !isLwcType(type);
581
584
  }
582
585
  function isTriggerType(type) {
583
586
  return type.type_name === "trigger";
584
587
  }
588
+ function isLwcType(type) {
589
+ return type.type_name === "lwc";
590
+ }
585
591
  function isInSource(source) {
586
592
  return "filePath" in source;
587
593
  }
@@ -598,6 +604,8 @@ function getTypeGroup(type, config) {
598
604
  return config.customObjectsGroupName;
599
605
  case "trigger":
600
606
  return config.triggersGroupName;
607
+ case "lwc":
608
+ return config.lwcGroupName;
601
609
  default:
602
610
  return getGroup(type, config);
603
611
  }
@@ -618,25 +626,25 @@ ${yamlString}---
618
626
  `;
619
627
  }
620
628
 
621
- var __defProp$q = Object.defineProperty;
622
- var __defProps$p = Object.defineProperties;
623
- var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
624
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
625
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
626
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
627
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
628
- var __spreadValues$q = (a, b) => {
629
+ var __defProp$o = Object.defineProperty;
630
+ var __defProps$n = Object.defineProperties;
631
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
632
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
633
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
634
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
635
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
636
+ var __spreadValues$o = (a, b) => {
629
637
  for (var prop in b || (b = {}))
630
- if (__hasOwnProp$q.call(b, prop))
631
- __defNormalProp$q(a, prop, b[prop]);
632
- if (__getOwnPropSymbols$q)
633
- for (var prop of __getOwnPropSymbols$q(b)) {
634
- if (__propIsEnum$q.call(b, prop))
635
- __defNormalProp$q(a, prop, b[prop]);
638
+ if (__hasOwnProp$o.call(b, prop))
639
+ __defNormalProp$o(a, prop, b[prop]);
640
+ if (__getOwnPropSymbols$o)
641
+ for (var prop of __getOwnPropSymbols$o(b)) {
642
+ if (__propIsEnum$o.call(b, prop))
643
+ __defNormalProp$o(a, prop, b[prop]);
636
644
  }
637
645
  return a;
638
646
  };
639
- var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
647
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
640
648
  function typeToRenderable$1(parsedFile, linkGenerator, config, translations) {
641
649
  function getRenderable() {
642
650
  const { type } = parsedFile;
@@ -651,9 +659,11 @@ function typeToRenderable$1(parsedFile, linkGenerator, config, translations) {
651
659
  return triggerMetadataToRenderable(type, linkGenerator, 1, translations);
652
660
  case "customobject":
653
661
  return objectMetadataToRenderable(type, config, translations);
662
+ case "lwc":
663
+ return lwcMetadataToRenderable(type, config, translations);
654
664
  }
655
665
  }
656
- return __spreadProps$p(__spreadValues$q({}, getRenderable()), {
666
+ return __spreadProps$n(__spreadValues$o({}, getRenderable()), {
657
667
  filePath: isInSource(parsedFile.source) ? parsedFile.source.filePath : void 0,
658
668
  namespace: config.namespace
659
669
  });
@@ -678,7 +688,7 @@ function baseTypeAdapter(type, linkGenerator, baseHeadingLevel, translations) {
678
688
  };
679
689
  }
680
690
  function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1, translations) {
681
- return __spreadProps$p(__spreadValues$q({
691
+ return __spreadProps$n(__spreadValues$o({
682
692
  type: "enum"
683
693
  }, baseTypeAdapter(enumType, linkGenerator, baseHeadingLevel, translations)), {
684
694
  values: {
@@ -686,7 +696,7 @@ function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1, tra
686
696
  heading: translations.markdown.sections.values,
687
697
  value: enumType.values.map((value) => {
688
698
  var _a;
689
- return __spreadProps$p(__spreadValues$q({}, adaptDescribable((_a = value.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
699
+ return __spreadProps$n(__spreadValues$o({}, adaptDescribable((_a = value.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
690
700
  value: value.name
691
701
  });
692
702
  })
@@ -694,7 +704,7 @@ function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1, tra
694
704
  });
695
705
  }
696
706
  function interfaceTypeToInterfaceSource(interfaceType, linkGenerator, baseHeadingLevel = 1, translations) {
697
- return __spreadProps$p(__spreadValues$q({
707
+ return __spreadProps$n(__spreadValues$o({
698
708
  type: "interface"
699
709
  }, baseTypeAdapter(interfaceType, linkGenerator, baseHeadingLevel, translations)), {
700
710
  extends: interfaceType.extended_interfaces.map(linkGenerator),
@@ -708,7 +718,7 @@ function interfaceTypeToInterfaceSource(interfaceType, linkGenerator, baseHeadin
708
718
  });
709
719
  }
710
720
  function classTypeToClassSource(classType, linkGenerator, baseHeadingLevel = 1, translations) {
711
- return __spreadProps$p(__spreadValues$q({
721
+ return __spreadProps$n(__spreadValues$o({
712
722
  type: "class"
713
723
  }, baseTypeAdapter(classType, linkGenerator, baseHeadingLevel, translations)), {
714
724
  classModifier: classType.classModifier,
@@ -752,7 +762,7 @@ function classTypeToClassSource(classType, linkGenerator, baseHeadingLevel = 1,
752
762
  heading: translations.markdown.sections.classes,
753
763
  value: classType.classes.map(
754
764
  (innerClass) => classTypeToClassSource(
755
- __spreadProps$p(__spreadValues$q({}, innerClass), { inheritanceChain: [] }),
765
+ __spreadProps$n(__spreadValues$o({}, innerClass), { inheritanceChain: [] }),
756
766
  linkGenerator,
757
767
  baseHeadingLevel + 2,
758
768
  translations
@@ -922,6 +932,45 @@ function customMetadataToRenderable(metadata, headingLevel) {
922
932
  protected: metadata.protected
923
933
  };
924
934
  }
935
+ function lwcMetadataToRenderable(metadata, config, translations) {
936
+ var _a, _b, _c, _d;
937
+ function toTargetConfigRenderable(targetConfig) {
938
+ return {
939
+ targetName: targetConfig["@_targets"],
940
+ properties: targetConfig.property.map((prop) => {
941
+ var _a2, _b2;
942
+ return {
943
+ description: prop["@_description"],
944
+ required: (_a2 = prop["@_required"]) != null ? _a2 : false,
945
+ type: prop["@_type"],
946
+ label: (_b2 = prop["@_label"]) != null ? _b2 : prop["@_name"],
947
+ name: prop["@_name"]
948
+ };
949
+ })
950
+ };
951
+ }
952
+ return {
953
+ type: "lwc",
954
+ headingLevel: 1,
955
+ heading: metadata.name,
956
+ name: metadata.name,
957
+ description: metadata.description,
958
+ exposed: metadata.isExposed,
959
+ targets: {
960
+ heading: translations.markdown.lwc.targets,
961
+ headingLevel: 2,
962
+ value: (_b = (_a = metadata.targets) == null ? void 0 : _a.target) != null ? _b : []
963
+ },
964
+ targetConfigs: {
965
+ heading: translations.markdown.lwc.targetConfigs,
966
+ headingLevel: 2,
967
+ value: (_d = (_c = metadata.targetConfigs) == null ? void 0 : _c.targetConfig.map(toTargetConfigRenderable)) != null ? _d : []
968
+ },
969
+ doc: {
970
+ group: getTypeGroup(metadata, config)
971
+ }
972
+ };
973
+ }
925
974
  function getApiName(currentName, config) {
926
975
  if (config.namespace) {
927
976
  const name = currentName.replace(/__c$/, "");
@@ -1042,112 +1091,272 @@ function getRenderableDescription(type, findLinkFromHome) {
1042
1091
  switch (type.type_name) {
1043
1092
  case "customobject":
1044
1093
  return type.description ? [type.description] : null;
1094
+ case "lwc":
1095
+ return type.description ? [type.description] : null;
1045
1096
  default:
1046
1097
  return (_b = adaptDescribable((_a = type.docComment) == null ? void 0 : _a.descriptionLines, findLinkFromHome).description) != null ? _b : null;
1047
1098
  }
1048
1099
  }
1049
1100
 
1050
- function createInheritanceChain(repository, classMirror) {
1051
- return _function.pipe(
1052
- O__namespace.fromNullable(classMirror.extended_class),
1053
- O__namespace.match(
1054
- () => [],
1055
- (extendedClassName) => inheritanceChainFromParentClassName(repository, extendedClassName)
1056
- )
1057
- );
1101
+ class ReflectionError {
1102
+ constructor(file, message) {
1103
+ this.file = file;
1104
+ this.message = message;
1105
+ }
1058
1106
  }
1059
- function inheritanceChainFromParentClassName(repository, className) {
1060
- return _function.pipe(
1061
- O__namespace.fromNullable(repository.find((type) => type.name.toLowerCase() === className.toLowerCase())),
1062
- O__namespace.match(
1063
- () => [className],
1064
- (extendedClass) => [className, ...createInheritanceChain(repository, extendedClass)]
1065
- )
1066
- );
1107
+ class ReflectionErrors {
1108
+ constructor(errors) {
1109
+ this.errors = errors;
1110
+ this._tag = "ReflectionErrors";
1111
+ }
1112
+ }
1113
+ class HookError {
1114
+ constructor(error) {
1115
+ this.error = error;
1116
+ this._tag = "HookError";
1117
+ }
1067
1118
  }
1068
1119
 
1069
- const parsedFilesToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => parsedFile.type);
1070
-
1071
- var __defProp$p = Object.defineProperty;
1072
- var __defProps$o = Object.defineProperties;
1073
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
1074
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
1075
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
1076
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
1077
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1078
- var __spreadValues$p = (a, b) => {
1079
- for (var prop in b || (b = {}))
1080
- if (__hasOwnProp$p.call(b, prop))
1081
- __defNormalProp$p(a, prop, b[prop]);
1082
- if (__getOwnPropSymbols$p)
1083
- for (var prop of __getOwnPropSymbols$p(b)) {
1084
- if (__propIsEnum$p.call(b, prop))
1085
- __defNormalProp$p(a, prop, b[prop]);
1086
- }
1087
- return a;
1088
- };
1089
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
1090
- const addInheritanceChainToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => __spreadProps$o(__spreadValues$p({}, parsedFile), {
1091
- type: addInheritanceChain(parsedFile.type, parsedFilesToTypes(parsedFiles))
1092
- }));
1093
- function addInheritanceChain(current, repository) {
1094
- if (current.type_name === "enum" || current.type_name === "interface") {
1095
- return current;
1096
- } else {
1097
- const inheritanceChain = createInheritanceChain(repository, current);
1098
- return __spreadProps$o(__spreadValues$p({}, current), {
1099
- inheritanceChain
1100
- });
1120
+ function parseApexMetadata(input) {
1121
+ return _function.pipe(input, parse, E__namespace.map(toMap));
1122
+ }
1123
+ function parse(input) {
1124
+ return E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(input), E__namespace.toError);
1125
+ }
1126
+ function toMap(metadata) {
1127
+ const map = /* @__PURE__ */ new Map();
1128
+ map.set("apiVersion", String(metadata.ApexClass.apiVersion));
1129
+ if (metadata.ApexClass.status) {
1130
+ map.set("status", String(metadata.ApexClass.status));
1101
1131
  }
1132
+ return map;
1102
1133
  }
1103
1134
 
1104
- var __defProp$o = Object.defineProperty;
1105
- var __defProps$n = Object.defineProperties;
1106
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
1107
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
1108
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
1109
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
1110
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1111
- var __spreadValues$o = (a, b) => {
1135
+ var __defProp$n = Object.defineProperty;
1136
+ var __defProps$m = Object.defineProperties;
1137
+ var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
1138
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1139
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1140
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1141
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1142
+ var __spreadValues$n = (a, b) => {
1112
1143
  for (var prop in b || (b = {}))
1113
- if (__hasOwnProp$o.call(b, prop))
1114
- __defNormalProp$o(a, prop, b[prop]);
1115
- if (__getOwnPropSymbols$o)
1116
- for (var prop of __getOwnPropSymbols$o(b)) {
1117
- if (__propIsEnum$o.call(b, prop))
1118
- __defNormalProp$o(a, prop, b[prop]);
1144
+ if (__hasOwnProp$n.call(b, prop))
1145
+ __defNormalProp$n(a, prop, b[prop]);
1146
+ if (__getOwnPropSymbols$n)
1147
+ for (var prop of __getOwnPropSymbols$n(b)) {
1148
+ if (__propIsEnum$n.call(b, prop))
1149
+ __defNormalProp$n(a, prop, b[prop]);
1119
1150
  }
1120
1151
  return a;
1121
1152
  };
1122
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
1123
- const addInheritedMembersToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => addInheritedMembers(parsedFilesToTypes(parsedFiles), parsedFile));
1124
- function addInheritedMembers(repository, parsedFile) {
1125
- function addInheritedMembersToType(repository2, current) {
1126
- if (current.type_name === "enum") {
1127
- return current;
1128
- } else if (current.type_name === "interface") {
1129
- return addInheritedInterfaceMethods(current, repository2);
1130
- } else {
1131
- return addInheritedClassMembers(current, repository2);
1132
- }
1133
- }
1134
- return __spreadProps$n(__spreadValues$o({}, parsedFile), {
1135
- type: addInheritedMembersToType(repository, parsedFile.type)
1153
+ var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
1154
+ var __async$5 = (__this, __arguments, generator) => {
1155
+ return new Promise((resolve, reject) => {
1156
+ var fulfilled = (value) => {
1157
+ try {
1158
+ step(generator.next(value));
1159
+ } catch (e) {
1160
+ reject(e);
1161
+ }
1162
+ };
1163
+ var rejected = (value) => {
1164
+ try {
1165
+ step(generator.throw(value));
1166
+ } catch (e) {
1167
+ reject(e);
1168
+ }
1169
+ };
1170
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1171
+ step((generator = generator.apply(__this, __arguments)).next());
1136
1172
  });
1137
- }
1138
- function addInheritedInterfaceMethods(interfaceMirror, repository) {
1139
- function methodAlreadyExists(memberName, members) {
1140
- return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
1141
- }
1142
- function parentExtractor(interfaceMirror2) {
1143
- return interfaceMirror2.extended_interfaces;
1144
- }
1145
- const parents = getParents(parentExtractor, interfaceMirror, repository);
1146
- return __spreadProps$n(__spreadValues$o({}, interfaceMirror), {
1147
- methods: parents.reduce(
1148
- (acc, currentValue) => [
1173
+ };
1174
+ function reflectAsync$1(rawSource) {
1175
+ return __async$5(this, null, function* () {
1176
+ return new Promise((resolve, reject) => {
1177
+ const result = apexReflection.reflect(rawSource);
1178
+ if (result.typeMirror) {
1179
+ return resolve(result.typeMirror);
1180
+ } else if (result.error) {
1181
+ return reject(result.error);
1182
+ } else {
1183
+ return reject(new Error("Unknown error"));
1184
+ }
1185
+ });
1186
+ });
1187
+ }
1188
+ function reflectApexSource(apexBundles) {
1189
+ const semiGroupReflectionError = {
1190
+ concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
1191
+ };
1192
+ const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
1193
+ return _function.pipe(apexBundles, A__namespace.traverse(Ap)(reflectBundle$2));
1194
+ }
1195
+ function reflectBundle$2(apexBundle) {
1196
+ const convertToParsedFile = apply(toParsedFile$5, apexBundle.filePath);
1197
+ const withMetadata = apply(addMetadata, apexBundle.metadataContent);
1198
+ return _function.pipe(apexBundle, reflectAsTask$1, TE__namespace.map(convertToParsedFile), TE__namespace.flatMap(withMetadata));
1199
+ }
1200
+ function reflectAsTask$1(apexBundle) {
1201
+ return TE__namespace.tryCatch(
1202
+ () => reflectAsync$1(apexBundle.content),
1203
+ (error) => new ReflectionErrors([new ReflectionError(apexBundle.filePath, error.message)])
1204
+ );
1205
+ }
1206
+ function toParsedFile$5(filePath, typeMirror) {
1207
+ return {
1208
+ source: {
1209
+ filePath,
1210
+ name: typeMirror.name,
1211
+ type: typeMirror.type_name
1212
+ },
1213
+ type: typeMirror
1214
+ };
1215
+ }
1216
+ function addMetadata(rawMetadataContent, parsedFile) {
1217
+ return TE__namespace.fromEither(
1218
+ _function.pipe(
1219
+ parsedFile.type,
1220
+ (type) => addFileMetadataToTypeAnnotation(type, rawMetadataContent),
1221
+ E__namespace.map((type) => __spreadProps$m(__spreadValues$n({}, parsedFile), { type })),
1222
+ E__namespace.mapLeft(
1223
+ (error) => errorToReflectionErrors(error, isInSource(parsedFile.source) ? parsedFile.source.filePath : "")
1224
+ )
1225
+ )
1226
+ );
1227
+ }
1228
+ function errorToReflectionErrors(error, filePath) {
1229
+ return new ReflectionErrors([new ReflectionError(filePath, error.message)]);
1230
+ }
1231
+ function addFileMetadataToTypeAnnotation(type, metadata) {
1232
+ const concatAnnotationToType = apply(concatAnnotations, type);
1233
+ return _function.pipe(
1234
+ O__namespace.fromNullable(metadata),
1235
+ O__namespace.map(concatAnnotationToType),
1236
+ O__namespace.getOrElse(() => E__namespace.right(type))
1237
+ );
1238
+ }
1239
+ function concatAnnotations(type, metadataInput) {
1240
+ return _function.pipe(
1241
+ metadataInput,
1242
+ parseApexMetadata,
1243
+ E__namespace.map((metadataMap) => __spreadProps$m(__spreadValues$n({}, type), {
1244
+ annotations: [...type.annotations, ...mapToAnnotations(metadataMap)]
1245
+ }))
1246
+ );
1247
+ }
1248
+ function mapToAnnotations(metadata) {
1249
+ return Array.from(metadata.entries()).map(([key, value]) => {
1250
+ const declaration = `${key}: ${value}`;
1251
+ return {
1252
+ name: declaration,
1253
+ type: declaration,
1254
+ rawDeclaration: declaration
1255
+ };
1256
+ });
1257
+ }
1258
+
1259
+ function createInheritanceChain(repository, classMirror) {
1260
+ return _function.pipe(
1261
+ O__namespace.fromNullable(classMirror.extended_class),
1262
+ O__namespace.match(
1263
+ () => [],
1264
+ (extendedClassName) => inheritanceChainFromParentClassName(repository, extendedClassName)
1265
+ )
1266
+ );
1267
+ }
1268
+ function inheritanceChainFromParentClassName(repository, className) {
1269
+ return _function.pipe(
1270
+ O__namespace.fromNullable(repository.find((type) => type.name.toLowerCase() === className.toLowerCase())),
1271
+ O__namespace.match(
1272
+ () => [className],
1273
+ (extendedClass) => [className, ...createInheritanceChain(repository, extendedClass)]
1274
+ )
1275
+ );
1276
+ }
1277
+
1278
+ const parsedFilesToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => parsedFile.type);
1279
+
1280
+ var __defProp$m = Object.defineProperty;
1281
+ var __defProps$l = Object.defineProperties;
1282
+ var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
1283
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
1284
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
1285
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
1286
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1287
+ var __spreadValues$m = (a, b) => {
1288
+ for (var prop in b || (b = {}))
1289
+ if (__hasOwnProp$m.call(b, prop))
1290
+ __defNormalProp$m(a, prop, b[prop]);
1291
+ if (__getOwnPropSymbols$m)
1292
+ for (var prop of __getOwnPropSymbols$m(b)) {
1293
+ if (__propIsEnum$m.call(b, prop))
1294
+ __defNormalProp$m(a, prop, b[prop]);
1295
+ }
1296
+ return a;
1297
+ };
1298
+ var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
1299
+ const addInheritanceChainToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => __spreadProps$l(__spreadValues$m({}, parsedFile), {
1300
+ type: addInheritanceChain(parsedFile.type, parsedFilesToTypes(parsedFiles))
1301
+ }));
1302
+ function addInheritanceChain(current, repository) {
1303
+ if (current.type_name === "enum" || current.type_name === "interface") {
1304
+ return current;
1305
+ } else {
1306
+ const inheritanceChain = createInheritanceChain(repository, current);
1307
+ return __spreadProps$l(__spreadValues$m({}, current), {
1308
+ inheritanceChain
1309
+ });
1310
+ }
1311
+ }
1312
+
1313
+ var __defProp$l = Object.defineProperty;
1314
+ var __defProps$k = Object.defineProperties;
1315
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
1316
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
1317
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
1318
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
1319
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1320
+ var __spreadValues$l = (a, b) => {
1321
+ for (var prop in b || (b = {}))
1322
+ if (__hasOwnProp$l.call(b, prop))
1323
+ __defNormalProp$l(a, prop, b[prop]);
1324
+ if (__getOwnPropSymbols$l)
1325
+ for (var prop of __getOwnPropSymbols$l(b)) {
1326
+ if (__propIsEnum$l.call(b, prop))
1327
+ __defNormalProp$l(a, prop, b[prop]);
1328
+ }
1329
+ return a;
1330
+ };
1331
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
1332
+ const addInheritedMembersToTypes = (parsedFiles) => parsedFiles.map((parsedFile) => addInheritedMembers(parsedFilesToTypes(parsedFiles), parsedFile));
1333
+ function addInheritedMembers(repository, parsedFile) {
1334
+ function addInheritedMembersToType(repository2, current) {
1335
+ if (current.type_name === "enum") {
1336
+ return current;
1337
+ } else if (current.type_name === "interface") {
1338
+ return addInheritedInterfaceMethods(current, repository2);
1339
+ } else {
1340
+ return addInheritedClassMembers(current, repository2);
1341
+ }
1342
+ }
1343
+ return __spreadProps$k(__spreadValues$l({}, parsedFile), {
1344
+ type: addInheritedMembersToType(repository, parsedFile.type)
1345
+ });
1346
+ }
1347
+ function addInheritedInterfaceMethods(interfaceMirror, repository) {
1348
+ function methodAlreadyExists(memberName, members) {
1349
+ return members.some((member) => member.name.toLowerCase() === memberName.toLowerCase());
1350
+ }
1351
+ function parentExtractor(interfaceMirror2) {
1352
+ return interfaceMirror2.extended_interfaces;
1353
+ }
1354
+ const parents = getParents(parentExtractor, interfaceMirror, repository);
1355
+ return __spreadProps$k(__spreadValues$l({}, interfaceMirror), {
1356
+ methods: parents.reduce(
1357
+ (acc, currentValue) => [
1149
1358
  ...acc,
1150
- ...currentValue.methods.filter((method) => !methodAlreadyExists(method.name, acc)).map((method) => __spreadProps$n(__spreadValues$o({}, method), {
1359
+ ...currentValue.methods.filter((method) => !methodAlreadyExists(method.name, acc)).map((method) => __spreadProps$k(__spreadValues$l({}, method), {
1151
1360
  inherited: true
1152
1361
  }))
1153
1362
  ],
@@ -1163,12 +1372,12 @@ function addInheritedClassMembers(classMirror, repository) {
1163
1372
  return classMirror2.extended_class ? [classMirror2.extended_class] : [];
1164
1373
  }
1165
1374
  function filterMember(members, existing) {
1166
- return members.filter((member) => member.access_modifier.toLowerCase() !== "private").filter((member) => !memberAlreadyExists(member.name, existing)).map((member) => __spreadProps$n(__spreadValues$o({}, member), {
1375
+ return members.filter((member) => member.access_modifier.toLowerCase() !== "private").filter((member) => !memberAlreadyExists(member.name, existing)).map((member) => __spreadProps$k(__spreadValues$l({}, member), {
1167
1376
  inherited: true
1168
1377
  }));
1169
1378
  }
1170
1379
  const parents = getParents(parentExtractor, classMirror, repository);
1171
- return __spreadProps$n(__spreadValues$o({}, classMirror), {
1380
+ return __spreadProps$k(__spreadValues$l({}, classMirror), {
1172
1381
  fields: parents.reduce(
1173
1382
  (acc, currentValue) => [...acc, ...filterMember(currentValue.fields, acc)],
1174
1383
  classMirror.fields
@@ -1231,7 +1440,7 @@ const documentablePartialTemplate = `
1231
1440
  {{{renderContent doc.description}}}
1232
1441
 
1233
1442
  {{#each doc.customTags}}
1234
- **{{splitAndCapitalize name}}**
1443
+ **{{splitAndCapitalize name}}**
1235
1444
 
1236
1445
  {{{renderContent description}}}
1237
1446
 
@@ -1481,6 +1690,12 @@ class Template {
1481
1690
  Handlebars.registerHelper("heading", heading);
1482
1691
  Handlebars.registerHelper("inlineCode", inlineCode);
1483
1692
  Handlebars.registerHelper("splitAndCapitalize", splitAndCapitalize);
1693
+ Handlebars.registerHelper("eq", eq);
1694
+ Handlebars.registerHelper("add", add);
1695
+ Handlebars.registerHelper("lookup", lookup);
1696
+ Handlebars.registerHelper("parseJSON", parseJSON);
1697
+ Handlebars.registerHelper("startsWith", startsWith);
1698
+ Handlebars.registerHelper("substring", substring);
1484
1699
  }
1485
1700
  static getInstance() {
1486
1701
  if (!Template.instance) {
@@ -1507,6 +1722,31 @@ const heading = (level, text) => {
1507
1722
  const inlineCode = (text) => {
1508
1723
  return new Handlebars.SafeString(`\`${text}\``);
1509
1724
  };
1725
+ const eq = (a, b) => {
1726
+ return a === b;
1727
+ };
1728
+ const add = (a, b) => {
1729
+ return a + b;
1730
+ };
1731
+ const lookup = (array, index) => {
1732
+ return array[index];
1733
+ };
1734
+ const parseJSON = (jsonString) => {
1735
+ try {
1736
+ return JSON.parse(jsonString);
1737
+ } catch (e) {
1738
+ return null;
1739
+ }
1740
+ };
1741
+ const startsWith = (str, prefix) => {
1742
+ return str.startsWith(prefix);
1743
+ };
1744
+ const substring = (str, start, length) => {
1745
+ if (length !== void 0) {
1746
+ return str.substring(start, start + length);
1747
+ }
1748
+ return str.substring(start);
1749
+ };
1510
1750
  const convertCodeBlock = (codeBlock) => {
1511
1751
  return new Handlebars.SafeString(
1512
1752
  `
@@ -1543,39 +1783,38 @@ const link = (source) => {
1543
1783
  }
1544
1784
  };
1545
1785
 
1546
- var __defProp$n = Object.defineProperty;
1547
- var __defProps$m = Object.defineProperties;
1548
- var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
1549
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
1550
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
1551
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
1552
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1553
- var __spreadValues$n = (a, b) => {
1786
+ var __defProp$k = Object.defineProperty;
1787
+ var __defProps$j = Object.defineProperties;
1788
+ var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
1789
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1790
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1791
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1792
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1793
+ var __spreadValues$k = (a, b) => {
1554
1794
  for (var prop in b || (b = {}))
1555
- if (__hasOwnProp$n.call(b, prop))
1556
- __defNormalProp$n(a, prop, b[prop]);
1557
- if (__getOwnPropSymbols$n)
1558
- for (var prop of __getOwnPropSymbols$n(b)) {
1559
- if (__propIsEnum$n.call(b, prop))
1560
- __defNormalProp$n(a, prop, b[prop]);
1795
+ if (__hasOwnProp$k.call(b, prop))
1796
+ __defNormalProp$k(a, prop, b[prop]);
1797
+ if (__getOwnPropSymbols$k)
1798
+ for (var prop of __getOwnPropSymbols$k(b)) {
1799
+ if (__propIsEnum$k.call(b, prop))
1800
+ __defNormalProp$k(a, prop, b[prop]);
1561
1801
  }
1562
1802
  return a;
1563
1803
  };
1564
- var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
1804
+ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
1565
1805
  const commonDefaults = {
1566
1806
  targetDir: "./docs/"
1567
1807
  };
1568
- const markdownAndChangelogDefaults = __spreadProps$m(__spreadValues$n({}, commonDefaults), {
1808
+ const markdownAndChangelogDefaults = __spreadProps$j(__spreadValues$k({}, commonDefaults), {
1569
1809
  scope: ["global"],
1570
1810
  customObjectVisibility: ["public"],
1571
- exclude: [],
1572
- parallelProcessing: process.env.NODE_ENV !== "test"
1573
- // Disable parallel processing during tests
1811
+ exclude: []
1574
1812
  });
1575
- const markdownDefaults = __spreadProps$m(__spreadValues$n({}, markdownAndChangelogDefaults), {
1813
+ const markdownDefaults = __spreadProps$j(__spreadValues$k({}, markdownAndChangelogDefaults), {
1576
1814
  defaultGroupName: "Miscellaneous",
1577
1815
  customObjectsGroupName: "Custom Objects",
1578
1816
  triggersGroupName: "Triggers",
1817
+ lwcGroupName: "Lightning Web Components",
1579
1818
  includeMetadata: false,
1580
1819
  sortAlphabetically: false,
1581
1820
  linkingStrategy: "relative",
@@ -1584,13 +1823,13 @@ const markdownDefaults = __spreadProps$m(__spreadValues$n({}, markdownAndChangel
1584
1823
  includeFieldSecurityMetadata: false,
1585
1824
  includeInlineHelpTextMetadata: false
1586
1825
  });
1587
- const openApiDefaults = __spreadProps$m(__spreadValues$n({}, commonDefaults), {
1826
+ const openApiDefaults = __spreadProps$j(__spreadValues$k({}, commonDefaults), {
1588
1827
  fileName: "openapi",
1589
1828
  title: "Apex REST API",
1590
1829
  apiVersion: "1.0.0",
1591
1830
  exclude: []
1592
1831
  });
1593
- const changeLogDefaults = __spreadProps$m(__spreadValues$n({}, markdownAndChangelogDefaults), {
1832
+ const changeLogDefaults = __spreadProps$j(__spreadValues$k({}, markdownAndChangelogDefaults), {
1594
1833
  fileName: "changelog",
1595
1834
  skipIfNoChanges: true
1596
1835
  });
@@ -1693,25 +1932,64 @@ const triggerMarkdownTemplate = `
1693
1932
  {{/each}}
1694
1933
  `.trim();
1695
1934
 
1696
- var __defProp$m = Object.defineProperty;
1697
- var __defProps$l = Object.defineProperties;
1698
- var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
1699
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
1700
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
1701
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
1702
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1703
- var __spreadValues$m = (a, b) => {
1935
+ const lwcBundleTemplate = `
1936
+ {{ heading headingLevel heading }}
1937
+
1938
+ {{#if exposed}}
1939
+ \`{{@root.translations.markdown.lwc.exposed}}\`
1940
+ {{/if}}
1941
+
1942
+ {{#if description}}
1943
+ {{description}}
1944
+ {{/if}}
1945
+
1946
+ {{#if targets.value.length}}
1947
+ {{ heading targets.headingLevel targets.heading }}
1948
+ {{#each targets.value}}
1949
+ - {{this}}
1950
+ {{/each}}
1951
+ {{/if}}
1952
+
1953
+ {{#if targetConfigs.value.length}}
1954
+ {{ heading targetConfigs.headingLevel targetConfigs.heading }}
1955
+
1956
+ {{#each targetConfigs.value}}
1957
+ ### {{ targetName }}
1958
+
1959
+ #### {{@root.translations.markdown.lwc.properties}}
1960
+
1961
+ {{#each properties}}
1962
+ **{{label}}** \`{{name}}\`
1963
+
1964
+ {{#if description}}{{description}}{{/if}}
1965
+
1966
+ - **{{@root.translations.markdown.details.type}}:** {{type}}
1967
+ - **{{@root.translations.markdown.details.required}}:** {{required}}
1968
+
1969
+ {{/each}}
1970
+ {{/each}}
1971
+ {{/if}}
1972
+ `.trim();
1973
+
1974
+ var __defProp$j = Object.defineProperty;
1975
+ var __defProps$i = Object.defineProperties;
1976
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
1977
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1978
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1979
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1980
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1981
+ var __spreadValues$j = (a, b) => {
1704
1982
  for (var prop in b || (b = {}))
1705
- if (__hasOwnProp$m.call(b, prop))
1706
- __defNormalProp$m(a, prop, b[prop]);
1707
- if (__getOwnPropSymbols$m)
1708
- for (var prop of __getOwnPropSymbols$m(b)) {
1709
- if (__propIsEnum$m.call(b, prop))
1710
- __defNormalProp$m(a, prop, b[prop]);
1983
+ if (__hasOwnProp$j.call(b, prop))
1984
+ __defNormalProp$j(a, prop, b[prop]);
1985
+ if (__getOwnPropSymbols$j)
1986
+ for (var prop of __getOwnPropSymbols$j(b)) {
1987
+ if (__propIsEnum$j.call(b, prop))
1988
+ __defNormalProp$j(a, prop, b[prop]);
1711
1989
  }
1712
1990
  return a;
1713
1991
  };
1714
- var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
1992
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
1715
1993
  const convertToDocumentationBundle = (referenceGuideTitle, referenceGuideTemplate, translations, { referencesByGroup, renderables }) => ({
1716
1994
  referenceGuide: {
1717
1995
  frontmatter: null,
@@ -1759,12 +2037,12 @@ function renderableToPageData(referenceGuideReference, renderable, translations)
1759
2037
  }
1760
2038
  return _function.pipe(
1761
2039
  renderable,
1762
- (r) => resolveApexTypeTemplate(r, translations),
2040
+ (r) => resolveTemplate(r, translations),
1763
2041
  compile$1,
1764
2042
  (docContents) => buildDocOutput(renderable, docContents)
1765
2043
  );
1766
2044
  }
1767
- function resolveApexTypeTemplate(renderable, translations) {
2045
+ function resolveTemplate(renderable, translations) {
1768
2046
  function getTemplate(renderable2) {
1769
2047
  switch (renderable2.type) {
1770
2048
  case "enum":
@@ -1777,11 +2055,13 @@ function resolveApexTypeTemplate(renderable, translations) {
1777
2055
  return customObjectTemplate;
1778
2056
  case "trigger":
1779
2057
  return triggerMarkdownTemplate;
2058
+ case "lwc":
2059
+ return lwcBundleTemplate;
1780
2060
  }
1781
2061
  }
1782
2062
  return {
1783
2063
  template: getTemplate(renderable),
1784
- source: __spreadProps$l(__spreadValues$m({}, renderable), {
2064
+ source: __spreadProps$i(__spreadValues$j({}, renderable), {
1785
2065
  translations
1786
2066
  })
1787
2067
  };
@@ -1790,25 +2070,25 @@ function compile$1(request) {
1790
2070
  return Template.getInstance().compile(request);
1791
2071
  }
1792
2072
 
1793
- var __defProp$l = Object.defineProperty;
1794
- var __defProps$k = Object.defineProperties;
1795
- var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
1796
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
1797
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
1798
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
1799
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1800
- var __spreadValues$l = (a, b) => {
2073
+ var __defProp$i = Object.defineProperty;
2074
+ var __defProps$h = Object.defineProperties;
2075
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
2076
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2077
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2078
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2079
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2080
+ var __spreadValues$i = (a, b) => {
1801
2081
  for (var prop in b || (b = {}))
1802
- if (__hasOwnProp$l.call(b, prop))
1803
- __defNormalProp$l(a, prop, b[prop]);
1804
- if (__getOwnPropSymbols$l)
1805
- for (var prop of __getOwnPropSymbols$l(b)) {
1806
- if (__propIsEnum$l.call(b, prop))
1807
- __defNormalProp$l(a, prop, b[prop]);
2082
+ if (__hasOwnProp$i.call(b, prop))
2083
+ __defNormalProp$i(a, prop, b[prop]);
2084
+ if (__getOwnPropSymbols$i)
2085
+ for (var prop of __getOwnPropSymbols$i(b)) {
2086
+ if (__propIsEnum$i.call(b, prop))
2087
+ __defNormalProp$i(a, prop, b[prop]);
1808
2088
  }
1809
2089
  return a;
1810
2090
  };
1811
- var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
2091
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
1812
2092
  class Manifest {
1813
2093
  /**
1814
2094
  * Constructs a new Manifest object.
@@ -1833,19 +2113,19 @@ class Manifest {
1833
2113
  }
1834
2114
  if (currentType.type_name === "interface") {
1835
2115
  const currentInterface = currentType;
1836
- return __spreadProps$k(__spreadValues$l({}, currentType), {
2116
+ return __spreadProps$h(__spreadValues$i({}, currentType), {
1837
2117
  methods: this.filterAccessibleModifier(currentInterface.methods, modifiers)
1838
2118
  });
1839
2119
  }
1840
2120
  const currentClass = currentType;
1841
- const filteredClass = __spreadProps$k(__spreadValues$l({}, currentType), {
2121
+ const filteredClass = __spreadProps$h(__spreadValues$i({}, currentType), {
1842
2122
  methods: this.filterAccessibleModifier(currentClass.methods, modifiers),
1843
2123
  properties: this.filterAccessibleModifier(currentClass.properties, modifiers),
1844
2124
  fields: this.filterAccessibleModifier(currentClass.fields, modifiers),
1845
2125
  constructors: this.filterAccessibleModifier(currentClass.constructors, modifiers)
1846
2126
  });
1847
2127
  if (!isForInnerTypes) {
1848
- return __spreadProps$k(__spreadValues$l({}, filteredClass), {
2128
+ return __spreadProps$h(__spreadValues$i({}, filteredClass), {
1849
2129
  enums: this.filterAccessibleModifier(currentClass.enums, modifiers),
1850
2130
  interfaces: this.filterAccessibleModifier(currentClass.interfaces, modifiers),
1851
2131
  classes: new Manifest(currentClass.classes, true).filteredByAccessModifierAndAnnotations(
@@ -1870,28 +2150,28 @@ class Manifest {
1870
2150
  }
1871
2151
  }
1872
2152
 
1873
- var __defProp$k = Object.defineProperty;
1874
- var __defProps$j = Object.defineProperties;
1875
- var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
1876
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
1877
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
1878
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
1879
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1880
- var __spreadValues$k = (a, b) => {
2153
+ var __defProp$h = Object.defineProperty;
2154
+ var __defProps$g = Object.defineProperties;
2155
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
2156
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2157
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2158
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2159
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2160
+ var __spreadValues$h = (a, b) => {
1881
2161
  for (var prop in b || (b = {}))
1882
- if (__hasOwnProp$k.call(b, prop))
1883
- __defNormalProp$k(a, prop, b[prop]);
1884
- if (__getOwnPropSymbols$k)
1885
- for (var prop of __getOwnPropSymbols$k(b)) {
1886
- if (__propIsEnum$k.call(b, prop))
1887
- __defNormalProp$k(a, prop, b[prop]);
2162
+ if (__hasOwnProp$h.call(b, prop))
2163
+ __defNormalProp$h(a, prop, b[prop]);
2164
+ if (__getOwnPropSymbols$h)
2165
+ for (var prop of __getOwnPropSymbols$h(b)) {
2166
+ if (__propIsEnum$h.call(b, prop))
2167
+ __defNormalProp$h(a, prop, b[prop]);
1888
2168
  }
1889
2169
  return a;
1890
2170
  };
1891
- var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
2171
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
1892
2172
  function filterScope(scopes, parsedFiles) {
1893
2173
  return parsedFiles.filter(({ type }) => Manifest.shouldFilterType(type, scopes)).map((parsedFile) => {
1894
- return __spreadProps$j(__spreadValues$k({}, parsedFile), {
2174
+ return __spreadProps$g(__spreadValues$h({}, parsedFile), {
1895
2175
  type: Manifest.filterSingleType(parsedFile.type, scopes, false)
1896
2176
  });
1897
2177
  });
@@ -1905,37 +2185,42 @@ const hookableTemplate = `
1905
2185
  {{{content}}}
1906
2186
  `.trim();
1907
2187
 
1908
- var __defProp$j = Object.defineProperty;
1909
- var __defProps$i = Object.defineProperties;
1910
- var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
1911
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
1912
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
1913
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
1914
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1915
- var __spreadValues$j = (a, b) => {
2188
+ var __defProp$g = Object.defineProperty;
2189
+ var __defProps$f = Object.defineProperties;
2190
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
2191
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2192
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2193
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2194
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2195
+ var __spreadValues$g = (a, b) => {
1916
2196
  for (var prop in b || (b = {}))
1917
- if (__hasOwnProp$j.call(b, prop))
1918
- __defNormalProp$j(a, prop, b[prop]);
1919
- if (__getOwnPropSymbols$j)
1920
- for (var prop of __getOwnPropSymbols$j(b)) {
1921
- if (__propIsEnum$j.call(b, prop))
1922
- __defNormalProp$j(a, prop, b[prop]);
2197
+ if (__hasOwnProp$g.call(b, prop))
2198
+ __defNormalProp$g(a, prop, b[prop]);
2199
+ if (__getOwnPropSymbols$g)
2200
+ for (var prop of __getOwnPropSymbols$g(b)) {
2201
+ if (__propIsEnum$g.call(b, prop))
2202
+ __defNormalProp$g(a, prop, b[prop]);
1923
2203
  }
1924
2204
  return a;
1925
2205
  };
1926
- var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
2206
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
1927
2207
  function sortTypesAndMembers(shouldSort, parsedFiles) {
1928
2208
  return parsedFiles.map((parsedFile) => {
1929
2209
  if (isApexType(parsedFile.type)) {
1930
- return __spreadProps$i(__spreadValues$j({}, parsedFile), {
2210
+ return __spreadProps$f(__spreadValues$g({}, parsedFile), {
1931
2211
  type: sortTypeMember(parsedFile.type, shouldSort)
1932
2212
  });
1933
2213
  }
1934
2214
  if (isObjectType(parsedFile.type)) {
1935
- return __spreadProps$i(__spreadValues$j({}, parsedFile), {
2215
+ return __spreadProps$f(__spreadValues$g({}, parsedFile), {
1936
2216
  type: sortCustomObjectFields(parsedFile.type, shouldSort)
1937
2217
  });
1938
2218
  }
2219
+ if (isLwcType(parsedFile.type)) {
2220
+ return __spreadProps$f(__spreadValues$g({}, parsedFile), {
2221
+ type: sortLwcMetadata(parsedFile.type, shouldSort)
2222
+ });
2223
+ }
1939
2224
  return parsedFile;
1940
2225
  }).sort((a, b) => sortByNames(shouldSort, a.type, b.type));
1941
2226
  }
@@ -1959,22 +2244,22 @@ function sortTypeMember(type, shouldSort) {
1959
2244
  }
1960
2245
  }
1961
2246
  function sortCustomObjectFields(type, shouldSort) {
1962
- return __spreadProps$i(__spreadValues$j({}, type), {
2247
+ return __spreadProps$f(__spreadValues$g({}, type), {
1963
2248
  fields: sortNamed(shouldSort, type.fields)
1964
2249
  });
1965
2250
  }
1966
2251
  function sortEnumValues(shouldSort, enumType) {
1967
- return __spreadProps$i(__spreadValues$j({}, enumType), {
2252
+ return __spreadProps$f(__spreadValues$g({}, enumType), {
1968
2253
  values: sortNamed(shouldSort, enumType.values)
1969
2254
  });
1970
2255
  }
1971
2256
  function sortInterfaceMethods(shouldSort, interfaceType) {
1972
- return __spreadProps$i(__spreadValues$j({}, interfaceType), {
2257
+ return __spreadProps$f(__spreadValues$g({}, interfaceType), {
1973
2258
  methods: sortNamed(shouldSort, interfaceType.methods)
1974
2259
  });
1975
2260
  }
1976
2261
  function sortClassMembers(shouldSort, classType) {
1977
- return __spreadProps$i(__spreadValues$j({}, classType), {
2262
+ return __spreadProps$f(__spreadValues$g({}, classType), {
1978
2263
  fields: sortNamed(shouldSort, classType.fields),
1979
2264
  classes: sortNamed(shouldSort, classType.classes),
1980
2265
  enums: sortNamed(shouldSort, classType.enums),
@@ -1983,6 +2268,31 @@ function sortClassMembers(shouldSort, classType) {
1983
2268
  properties: sortNamed(shouldSort, classType.properties)
1984
2269
  });
1985
2270
  }
2271
+ function sortLwcMetadata(type, shouldSort) {
2272
+ var _a, _b;
2273
+ if (!shouldSort) {
2274
+ return type;
2275
+ }
2276
+ const sortedType = __spreadValues$g({}, type);
2277
+ if ((_a = sortedType.targets) == null ? void 0 : _a.target) {
2278
+ sortedType.targets = __spreadProps$f(__spreadValues$g({}, sortedType.targets), {
2279
+ target: [...sortedType.targets.target].sort()
2280
+ });
2281
+ }
2282
+ if ((_b = sortedType.targetConfigs) == null ? void 0 : _b.targetConfig) {
2283
+ sortedType.targetConfigs = __spreadProps$f(__spreadValues$g({}, sortedType.targetConfigs), {
2284
+ targetConfig: sortedType.targetConfigs.targetConfig.map((config) => {
2285
+ if (config.property) {
2286
+ return __spreadProps$f(__spreadValues$g({}, config), {
2287
+ property: [...config.property].sort((a, b) => a["@_name"].localeCompare(b["@_name"]))
2288
+ });
2289
+ }
2290
+ return config;
2291
+ })
2292
+ });
2293
+ }
2294
+ return sortedType;
2295
+ }
1986
2296
 
1987
2297
  function parsedFilesToReferenceGuide(config, parsedFiles) {
1988
2298
  return parsedFiles.reduce((acc, parsedFile) => {
@@ -2003,34 +2313,34 @@ function slugify(text) {
2003
2313
  return text.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-").replace(/-+/g, "-");
2004
2314
  }
2005
2315
 
2006
- var __defProp$i = Object.defineProperty;
2007
- var __defProps$h = Object.defineProperties;
2008
- var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
2009
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
2010
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
2011
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
2012
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2013
- var __spreadValues$i = (a, b) => {
2316
+ var __defProp$f = Object.defineProperty;
2317
+ var __defProps$e = Object.defineProperties;
2318
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
2319
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
2320
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
2321
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
2322
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2323
+ var __spreadValues$f = (a, b) => {
2014
2324
  for (var prop in b || (b = {}))
2015
- if (__hasOwnProp$i.call(b, prop))
2016
- __defNormalProp$i(a, prop, b[prop]);
2017
- if (__getOwnPropSymbols$i)
2018
- for (var prop of __getOwnPropSymbols$i(b)) {
2019
- if (__propIsEnum$i.call(b, prop))
2020
- __defNormalProp$i(a, prop, b[prop]);
2325
+ if (__hasOwnProp$f.call(b, prop))
2326
+ __defNormalProp$f(a, prop, b[prop]);
2327
+ if (__getOwnPropSymbols$f)
2328
+ for (var prop of __getOwnPropSymbols$f(b)) {
2329
+ if (__propIsEnum$f.call(b, prop))
2330
+ __defNormalProp$f(a, prop, b[prop]);
2021
2331
  }
2022
2332
  return a;
2023
2333
  };
2024
- var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
2334
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
2025
2335
  const removeExcludedTags = (excludedTags, parsedFiles) => {
2026
2336
  return parsedFiles.map((parsedFile) => {
2027
- return __spreadProps$h(__spreadValues$i({}, parsedFile), {
2337
+ return __spreadProps$e(__spreadValues$f({}, parsedFile), {
2028
2338
  type: removeExcludedTagsFromType(excludedTags, parsedFile.type)
2029
2339
  });
2030
2340
  });
2031
2341
  };
2032
2342
  const removeExcludedTagsFromType = (excludedTags, type) => {
2033
- return __spreadProps$h(__spreadValues$i({}, handleType(excludedTags, type)), {
2343
+ return __spreadProps$e(__spreadValues$f({}, handleType(excludedTags, type)), {
2034
2344
  docComment: removeExcludedTagsFromDocComment(excludedTags, type.docComment)
2035
2345
  });
2036
2346
  };
@@ -2045,7 +2355,7 @@ const handleType = (excludedTags, type) => {
2045
2355
  }
2046
2356
  };
2047
2357
  const handleClass = (excludedTags, classMirror) => {
2048
- return __spreadProps$h(__spreadValues$i({}, classMirror), {
2358
+ return __spreadProps$e(__spreadValues$f({}, classMirror), {
2049
2359
  methods: classMirror.methods.map((method) => removeExcludedTagsFromDocumentable(excludedTags, method)),
2050
2360
  properties: classMirror.properties.map((property) => removeExcludedTagsFromDocumentable(excludedTags, property)),
2051
2361
  fields: classMirror.fields.map((field) => removeExcludedTagsFromDocumentable(excludedTags, field)),
@@ -2058,12 +2368,12 @@ const handleClass = (excludedTags, classMirror) => {
2058
2368
  });
2059
2369
  };
2060
2370
  const handleInterface = (excludedTags, interfaceMirror) => {
2061
- return __spreadProps$h(__spreadValues$i({}, interfaceMirror), {
2371
+ return __spreadProps$e(__spreadValues$f({}, interfaceMirror), {
2062
2372
  methods: interfaceMirror.methods.map((method) => removeExcludedTagsFromDocumentable(excludedTags, method))
2063
2373
  });
2064
2374
  };
2065
2375
  const removeExcludedTagsFromDocumentable = (excludedTags, documentable) => {
2066
- return __spreadProps$h(__spreadValues$i({}, documentable), {
2376
+ return __spreadProps$e(__spreadValues$f({}, documentable), {
2067
2377
  docComment: removeExcludedTagsFromDocComment(excludedTags, documentable.docComment)
2068
2378
  });
2069
2379
  };
@@ -2090,7 +2400,7 @@ const removeExcludedTagsFromAnnotations = (excludedTags, docComment) => {
2090
2400
  O__namespace.map((annotations) => annotations.filter((annotation) => !includesIgnoreCase(excludedTags, annotation.name))),
2091
2401
  O__namespace.fold(
2092
2402
  () => docComment,
2093
- (filteredAnnotations) => __spreadProps$h(__spreadValues$i({}, docComment), {
2403
+ (filteredAnnotations) => __spreadProps$e(__spreadValues$f({}, docComment), {
2094
2404
  annotations: filteredAnnotations
2095
2405
  })
2096
2406
  )
@@ -2098,42 +2408,42 @@ const removeExcludedTagsFromAnnotations = (excludedTags, docComment) => {
2098
2408
  };
2099
2409
  const removeExampleTag = (remover) => {
2100
2410
  return remover("example", (docComment) => {
2101
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2411
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2102
2412
  exampleAnnotation: null
2103
2413
  });
2104
2414
  });
2105
2415
  };
2106
2416
  const removeParamTags = (remover) => {
2107
2417
  return remover("param", (docComment) => {
2108
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2418
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2109
2419
  paramAnnotations: []
2110
2420
  });
2111
2421
  });
2112
2422
  };
2113
2423
  const removeReturnTag = (remover) => {
2114
2424
  return remover("return", (docComment) => {
2115
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2425
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2116
2426
  returnAnnotation: null
2117
2427
  });
2118
2428
  });
2119
2429
  };
2120
2430
  const removeThrowsTag = (remover) => {
2121
2431
  return remover("throws", (docComment) => {
2122
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2432
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2123
2433
  throwsAnnotations: []
2124
2434
  });
2125
2435
  });
2126
2436
  };
2127
2437
  const removeExceptionTag = (remover) => {
2128
2438
  return remover("exception", (docComment) => {
2129
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2439
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2130
2440
  throwsAnnotations: []
2131
2441
  });
2132
2442
  });
2133
2443
  };
2134
2444
  const removeDescription = (remover) => {
2135
2445
  return remover("description", (docComment) => {
2136
- return __spreadProps$h(__spreadValues$i({}, docComment), {
2446
+ return __spreadProps$e(__spreadValues$f({}, docComment), {
2137
2447
  description: "",
2138
2448
  descriptionLines: []
2139
2449
  });
@@ -2149,25 +2459,6 @@ const includesIgnoreCase = (excluded, value) => {
2149
2459
  return excluded.some((element) => element.toLowerCase() === value.toLowerCase());
2150
2460
  };
2151
2461
 
2152
- class ReflectionError {
2153
- constructor(file, message) {
2154
- this.file = file;
2155
- this.message = message;
2156
- }
2157
- }
2158
- class ReflectionErrors {
2159
- constructor(errors) {
2160
- this.errors = errors;
2161
- this._tag = "ReflectionErrors";
2162
- }
2163
- }
2164
- class HookError {
2165
- constructor(error) {
2166
- this.error = error;
2167
- this._tag = "HookError";
2168
- }
2169
- }
2170
-
2171
2462
  function getPickListValues(customField) {
2172
2463
  return hasType(customField) && isPicklist(customField) ? toPickListValues(customField) : void 0;
2173
2464
  }
@@ -2198,31 +2489,31 @@ function isArrayOfValues(value) {
2198
2489
  return Array.isArray(value);
2199
2490
  }
2200
2491
 
2201
- var __defProp$h = Object.defineProperty;
2202
- var __defProps$g = Object.defineProperties;
2203
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
2204
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
2205
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
2206
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
2207
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2208
- var __spreadValues$h = (a, b) => {
2492
+ var __defProp$e = Object.defineProperty;
2493
+ var __defProps$d = Object.defineProperties;
2494
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
2495
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2496
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2497
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
2498
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2499
+ var __spreadValues$e = (a, b) => {
2209
2500
  for (var prop in b || (b = {}))
2210
- if (__hasOwnProp$h.call(b, prop))
2211
- __defNormalProp$h(a, prop, b[prop]);
2212
- if (__getOwnPropSymbols$h)
2213
- for (var prop of __getOwnPropSymbols$h(b)) {
2214
- if (__propIsEnum$h.call(b, prop))
2215
- __defNormalProp$h(a, prop, b[prop]);
2501
+ if (__hasOwnProp$e.call(b, prop))
2502
+ __defNormalProp$e(a, prop, b[prop]);
2503
+ if (__getOwnPropSymbols$e)
2504
+ for (var prop of __getOwnPropSymbols$e(b)) {
2505
+ if (__propIsEnum$e.call(b, prop))
2506
+ __defNormalProp$e(a, prop, b[prop]);
2216
2507
  }
2217
2508
  return a;
2218
2509
  };
2219
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
2510
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
2220
2511
  function reflectCustomObjectSources(objectBundles) {
2221
2512
  const semiGroupReflectionError = {
2222
2513
  concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
2223
2514
  };
2224
2515
  const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
2225
- return _function.pipe(objectBundles, A__namespace.traverse(Ap)(reflectCustomObjectSource));
2516
+ return _function.pipe(objectBundles, A__namespace$1.traverse(Ap)(reflectCustomObjectSource));
2226
2517
  }
2227
2518
  function reflectCustomObjectSource(objectSource) {
2228
2519
  return _function.pipe(
@@ -2232,7 +2523,7 @@ function reflectCustomObjectSource(objectSource) {
2232
2523
  E__namespace.map((metadata) => addName$1(metadata, objectSource.name)),
2233
2524
  E__namespace.map(parseInlineFields),
2234
2525
  E__namespace.map(addTypeName),
2235
- E__namespace.map((metadata) => toParsedFile$6(objectSource.filePath, metadata)),
2526
+ E__namespace.map((metadata) => toParsedFile$4(objectSource.filePath, metadata)),
2236
2527
  E__namespace.mapLeft((error) => new ReflectionErrors([new ReflectionError(objectSource.filePath, error.message)])),
2237
2528
  TE__namespace.fromEither
2238
2529
  );
@@ -2256,10 +2547,10 @@ function toObjectMetadata(parserResult) {
2256
2547
  fields: [],
2257
2548
  metadataRecords: []
2258
2549
  };
2259
- return __spreadValues$h(__spreadValues$h({}, defaultValues), customObject);
2550
+ return __spreadValues$e(__spreadValues$e({}, defaultValues), customObject);
2260
2551
  }
2261
2552
  function addName$1(objectMetadata, name) {
2262
- return __spreadProps$g(__spreadValues$h({}, objectMetadata), {
2553
+ return __spreadProps$d(__spreadValues$e({}, objectMetadata), {
2263
2554
  name
2264
2555
  });
2265
2556
  }
@@ -2267,7 +2558,7 @@ function parseInlineFields(metadata) {
2267
2558
  if (!Array.isArray(metadata.fields)) {
2268
2559
  metadata.fields = [metadata.fields];
2269
2560
  }
2270
- return __spreadProps$g(__spreadValues$h({}, metadata), {
2561
+ return __spreadProps$d(__spreadValues$e({}, metadata), {
2271
2562
  fields: metadata.fields.map((field) => convertInlineFieldsToCustomFieldMetadata(field, metadata.name))
2272
2563
  });
2273
2564
  }
@@ -2295,11 +2586,11 @@ function convertInlineFieldsToCustomFieldMetadata(inlineField, parentName) {
2295
2586
  };
2296
2587
  }
2297
2588
  function addTypeName(objectMetadata) {
2298
- return __spreadProps$g(__spreadValues$h({}, objectMetadata), {
2589
+ return __spreadProps$d(__spreadValues$e({}, objectMetadata), {
2299
2590
  type_name: "customobject"
2300
2591
  });
2301
2592
  }
2302
- function toParsedFile$6(filePath, typeMirror) {
2593
+ function toParsedFile$4(filePath, typeMirror) {
2303
2594
  return {
2304
2595
  source: {
2305
2596
  filePath,
@@ -2310,31 +2601,31 @@ function toParsedFile$6(filePath, typeMirror) {
2310
2601
  };
2311
2602
  }
2312
2603
 
2313
- var __defProp$g = Object.defineProperty;
2314
- var __defProps$f = Object.defineProperties;
2315
- var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
2316
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
2317
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
2318
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
2319
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2320
- var __spreadValues$g = (a, b) => {
2604
+ var __defProp$d = Object.defineProperty;
2605
+ var __defProps$c = Object.defineProperties;
2606
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
2607
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2608
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2609
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
2610
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2611
+ var __spreadValues$d = (a, b) => {
2321
2612
  for (var prop in b || (b = {}))
2322
- if (__hasOwnProp$g.call(b, prop))
2323
- __defNormalProp$g(a, prop, b[prop]);
2324
- if (__getOwnPropSymbols$g)
2325
- for (var prop of __getOwnPropSymbols$g(b)) {
2326
- if (__propIsEnum$g.call(b, prop))
2327
- __defNormalProp$g(a, prop, b[prop]);
2613
+ if (__hasOwnProp$d.call(b, prop))
2614
+ __defNormalProp$d(a, prop, b[prop]);
2615
+ if (__getOwnPropSymbols$d)
2616
+ for (var prop of __getOwnPropSymbols$d(b)) {
2617
+ if (__propIsEnum$d.call(b, prop))
2618
+ __defNormalProp$d(a, prop, b[prop]);
2328
2619
  }
2329
2620
  return a;
2330
2621
  };
2331
- var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
2622
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
2332
2623
  function reflectCustomFieldSources(customFieldSources) {
2333
2624
  const semiGroupReflectionError = {
2334
2625
  concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
2335
2626
  };
2336
2627
  const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
2337
- return _function.pipe(customFieldSources, A__namespace.traverse(Ap)(reflectCustomFieldSource));
2628
+ return _function.pipe(customFieldSources, A__namespace$1.traverse(Ap)(reflectCustomFieldSource));
2338
2629
  }
2339
2630
  function reflectCustomFieldSource(customFieldSource) {
2340
2631
  return _function.pipe(
@@ -2343,7 +2634,7 @@ function reflectCustomFieldSource(customFieldSource) {
2343
2634
  E__namespace.map(toCustomFieldMetadata),
2344
2635
  E__namespace.map((metadata) => addName(metadata, customFieldSource.name)),
2345
2636
  E__namespace.map((metadata) => addParentName$1(metadata, customFieldSource.parentName)),
2346
- E__namespace.map((metadata) => toParsedFile$5(customFieldSource.filePath, metadata)),
2637
+ E__namespace.map((metadata) => toParsedFile$3(customFieldSource.filePath, metadata)),
2347
2638
  E__namespace.mapLeft((error) => new ReflectionErrors([new ReflectionError(customFieldSource.filePath, error.message)])),
2348
2639
  TE__namespace.fromEither
2349
2640
  );
@@ -2367,18 +2658,18 @@ function toCustomFieldMetadata(parserResult) {
2367
2658
  complianceGroup: null,
2368
2659
  inlineHelpText: null
2369
2660
  };
2370
- return __spreadProps$f(__spreadValues$g(__spreadValues$g({}, defaultValues), customField), {
2661
+ return __spreadProps$c(__spreadValues$d(__spreadValues$d({}, defaultValues), customField), {
2371
2662
  type_name: "customfield",
2372
2663
  pickListValues: getPickListValues(customField)
2373
2664
  });
2374
2665
  }
2375
2666
  function addName(metadata, name) {
2376
- return __spreadProps$f(__spreadValues$g({}, metadata), { name });
2667
+ return __spreadProps$c(__spreadValues$d({}, metadata), { name });
2377
2668
  }
2378
2669
  function addParentName$1(metadata, parentName) {
2379
- return __spreadProps$f(__spreadValues$g({}, metadata), { parentName });
2670
+ return __spreadProps$c(__spreadValues$d({}, metadata), { parentName });
2380
2671
  }
2381
- function toParsedFile$5(filePath, typeMirror) {
2672
+ function toParsedFile$3(filePath, typeMirror) {
2382
2673
  return {
2383
2674
  source: {
2384
2675
  filePath,
@@ -2389,27 +2680,27 @@ function toParsedFile$5(filePath, typeMirror) {
2389
2680
  };
2390
2681
  }
2391
2682
 
2392
- var __defProp$f = Object.defineProperty;
2393
- var __defProps$e = Object.defineProperties;
2394
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
2395
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
2396
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
2397
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
2398
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2399
- var __spreadValues$f = (a, b) => {
2683
+ var __defProp$c = Object.defineProperty;
2684
+ var __defProps$b = Object.defineProperties;
2685
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
2686
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2687
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2688
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2689
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2690
+ var __spreadValues$c = (a, b) => {
2400
2691
  for (var prop in b || (b = {}))
2401
- if (__hasOwnProp$f.call(b, prop))
2402
- __defNormalProp$f(a, prop, b[prop]);
2403
- if (__getOwnPropSymbols$f)
2404
- for (var prop of __getOwnPropSymbols$f(b)) {
2405
- if (__propIsEnum$f.call(b, prop))
2406
- __defNormalProp$f(a, prop, b[prop]);
2692
+ if (__hasOwnProp$c.call(b, prop))
2693
+ __defNormalProp$c(a, prop, b[prop]);
2694
+ if (__getOwnPropSymbols$c)
2695
+ for (var prop of __getOwnPropSymbols$c(b)) {
2696
+ if (__propIsEnum$c.call(b, prop))
2697
+ __defNormalProp$c(a, prop, b[prop]);
2407
2698
  }
2408
2699
  return a;
2409
2700
  };
2410
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
2701
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
2411
2702
  function reflectCustomMetadataSources(customMetadataSources) {
2412
- return _function.pipe(customMetadataSources, A__namespace.traverse(TE__namespace.ApplicativePar)(reflectCustomMetadataSource));
2703
+ return _function.pipe(customMetadataSources, A__namespace$1.traverse(TE__namespace.ApplicativePar)(reflectCustomMetadataSource));
2413
2704
  }
2414
2705
  function reflectCustomMetadataSource(customMetadataSource) {
2415
2706
  return _function.pipe(
@@ -2418,7 +2709,7 @@ function reflectCustomMetadataSource(customMetadataSource) {
2418
2709
  E__namespace.map(toCustomMetadataMetadata),
2419
2710
  E__namespace.map((metadata) => addNames(metadata, customMetadataSource.name, customMetadataSource.apiName)),
2420
2711
  E__namespace.map((metadata) => addParentName(metadata, customMetadataSource.parentName)),
2421
- E__namespace.map((metadata) => toParsedFile$4(customMetadataSource.filePath, metadata)),
2712
+ E__namespace.map((metadata) => toParsedFile$2(customMetadataSource.filePath, metadata)),
2422
2713
  E__namespace.mapLeft((error) => new ReflectionErrors([new ReflectionError(customMetadataSource.filePath, error.message)])),
2423
2714
  TE__namespace.fromEither
2424
2715
  );
@@ -2438,17 +2729,17 @@ function toCustomMetadataMetadata(parserResult) {
2438
2729
  const defaultValues = {
2439
2730
  label: null
2440
2731
  };
2441
- return __spreadProps$e(__spreadValues$f(__spreadValues$f({}, defaultValues), customMetadata), {
2732
+ return __spreadProps$b(__spreadValues$c(__spreadValues$c({}, defaultValues), customMetadata), {
2442
2733
  type_name: "custommetadata"
2443
2734
  });
2444
2735
  }
2445
2736
  function addNames(metadata, name, apiName) {
2446
- return __spreadProps$e(__spreadValues$f({}, metadata), { name, apiName });
2737
+ return __spreadProps$b(__spreadValues$c({}, metadata), { name, apiName });
2447
2738
  }
2448
2739
  function addParentName(metadata, parentName) {
2449
- return __spreadProps$e(__spreadValues$f({}, metadata), { parentName });
2740
+ return __spreadProps$b(__spreadValues$c({}, metadata), { parentName });
2450
2741
  }
2451
- function toParsedFile$4(filePath, typeMirror) {
2742
+ function toParsedFile$2(filePath, typeMirror) {
2452
2743
  return {
2453
2744
  source: {
2454
2745
  filePath,
@@ -2459,25 +2750,25 @@ function toParsedFile$4(filePath, typeMirror) {
2459
2750
  };
2460
2751
  }
2461
2752
 
2462
- var __defProp$e = Object.defineProperty;
2463
- var __defProps$d = Object.defineProperties;
2464
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
2465
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
2466
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
2467
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
2468
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2469
- var __spreadValues$e = (a, b) => {
2753
+ var __defProp$b = Object.defineProperty;
2754
+ var __defProps$a = Object.defineProperties;
2755
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
2756
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2757
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2758
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2759
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2760
+ var __spreadValues$b = (a, b) => {
2470
2761
  for (var prop in b || (b = {}))
2471
- if (__hasOwnProp$e.call(b, prop))
2472
- __defNormalProp$e(a, prop, b[prop]);
2473
- if (__getOwnPropSymbols$e)
2474
- for (var prop of __getOwnPropSymbols$e(b)) {
2475
- if (__propIsEnum$e.call(b, prop))
2476
- __defNormalProp$e(a, prop, b[prop]);
2762
+ if (__hasOwnProp$b.call(b, prop))
2763
+ __defNormalProp$b(a, prop, b[prop]);
2764
+ if (__getOwnPropSymbols$b)
2765
+ for (var prop of __getOwnPropSymbols$b(b)) {
2766
+ if (__propIsEnum$b.call(b, prop))
2767
+ __defNormalProp$b(a, prop, b[prop]);
2477
2768
  }
2478
2769
  return a;
2479
2770
  };
2480
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
2771
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
2481
2772
  function reflectCustomFieldsAndObjectsAndMetadataRecords(objectBundles, visibilitiesToDocument) {
2482
2773
  function filterNonPublished(parsedFiles) {
2483
2774
  return parsedFiles.filter((parsedFile) => parsedFile.type.deploymentStatus === "Deployed");
@@ -2522,8 +2813,8 @@ function mapFieldsAndMetadata(objects, fields, metadata) {
2522
2813
  return objects.map((object) => {
2523
2814
  const objectFields = fields.filter((field) => field.type.parentName === object.type.name);
2524
2815
  const objectMetadata = metadata.filter((meta) => `${meta.type.parentName}__mdt` === object.type.name);
2525
- return __spreadProps$d(__spreadValues$e({}, object), {
2526
- type: __spreadProps$d(__spreadValues$e({}, object.type), {
2816
+ return __spreadProps$a(__spreadValues$b({}, object), {
2817
+ type: __spreadProps$a(__spreadValues$b({}, object.type), {
2527
2818
  fields: [...object.type.fields, ...objectFields.map((field) => field.type)],
2528
2819
  metadataRecords: [...object.type.metadataRecords, ...objectMetadata.map((meta) => meta.type)]
2529
2820
  })
@@ -2553,373 +2844,55 @@ function mapExtensionFields(filterResult, fields) {
2553
2844
  name: key,
2554
2845
  type: "customobject"
2555
2846
  },
2556
- type: {
2557
- type_name: "customobject",
2558
- deploymentStatus: "Deployed",
2559
- visibility: "Public",
2560
- label: key,
2561
- name: key,
2562
- description: null,
2563
- fields: fields2,
2564
- metadataRecords: []
2565
- }
2566
- };
2567
- });
2568
- }
2569
-
2570
- function filterApexSourceFiles(sourceFiles) {
2571
- return sourceFiles.filter((sourceFile) => sourceFile.type === "apex");
2572
- }
2573
- function filterCustomObjectsFieldsAndMetadataRecords(sourceFiles) {
2574
- return sourceFiles.filter(
2575
- (sourceFile) => sourceFile.type === "customobject" || sourceFile.type === "customfield" || sourceFile.type === "custommetadata"
2576
- );
2577
- }
2578
- function filterTriggerFiles(sourceFiles) {
2579
- return sourceFiles.filter((sourceFile) => sourceFile.type === "trigger");
2580
- }
2581
-
2582
- var __async$9 = (__this, __arguments, generator) => {
2583
- return new Promise((resolve2, reject) => {
2584
- var fulfilled = (value) => {
2585
- try {
2586
- step(generator.next(value));
2587
- } catch (e) {
2588
- reject(e);
2589
- }
2590
- };
2591
- var rejected = (value) => {
2592
- try {
2593
- step(generator.throw(value));
2594
- } catch (e) {
2595
- reject(e);
2596
- }
2597
- };
2598
- var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2599
- step((generator = generator.apply(__this, __arguments)).next());
2600
- });
2601
- };
2602
- class WorkerPool {
2603
- constructor(poolSize) {
2604
- this.workers = [];
2605
- this.freeWorkers = [];
2606
- this.busyWorkers = /* @__PURE__ */ new Set();
2607
- this.taskQueue = [];
2608
- this.terminatingWorkers = /* @__PURE__ */ new Set();
2609
- const size = poolSize || os.cpus().length;
2610
- this.workerPath = this.getWorkerPath();
2611
- for (let i = 0; i < size; i++) {
2612
- this.createWorker();
2613
- }
2614
- }
2615
- getWorkerPath() {
2616
- if (__filename.endsWith(".ts")) {
2617
- const rootDir = path.resolve(__dirname, "../../../..");
2618
- return path.resolve(rootDir, "dist/core/reflection/worker-thread/reflection-worker.js");
2619
- } else {
2620
- return path.resolve(__dirname, "./reflection-worker.js");
2621
- }
2622
- }
2623
- createWorker() {
2624
- const worker = new worker_threads.Worker(this.workerPath);
2625
- worker.on("message", (result) => {
2626
- this.handleWorkerResult(worker, result);
2627
- });
2628
- worker.on("error", (error) => {
2629
- console.error("Worker error:", error);
2630
- this.handleWorkerError(worker);
2631
- });
2632
- worker.on("exit", (code) => {
2633
- if (code !== 0 && !this.terminatingWorkers.has(worker)) {
2634
- console.error(`Worker stopped with exit code ${code}`);
2635
- }
2636
- this.handleWorkerExit(worker);
2637
- });
2638
- this.workers.push(worker);
2639
- this.freeWorkers.push(worker);
2640
- return worker;
2641
- }
2642
- handleWorkerResult(worker, result) {
2643
- const taskIndex = this.taskQueue.findIndex(({ task }) => task.id === result.id);
2644
- if (taskIndex !== -1) {
2645
- const { resolve: resolve2 } = this.taskQueue[taskIndex];
2646
- this.taskQueue.splice(taskIndex, 1);
2647
- resolve2(result);
2648
- }
2649
- this.busyWorkers.delete(worker);
2650
- this.freeWorkers.push(worker);
2651
- this.processNextTask();
2652
- }
2653
- handleWorkerError(worker) {
2654
- this.busyWorkers.delete(worker);
2655
- const newWorker = this.createWorker();
2656
- const workerIndex = this.workers.indexOf(worker);
2657
- if (workerIndex !== -1) {
2658
- this.workers[workerIndex] = newWorker;
2659
- }
2660
- this.terminatingWorkers.add(worker);
2661
- worker.terminate();
2662
- this.processNextTask();
2663
- }
2664
- handleWorkerExit(worker) {
2665
- this.busyWorkers.delete(worker);
2666
- this.terminatingWorkers.delete(worker);
2667
- const freeIndex = this.freeWorkers.indexOf(worker);
2668
- if (freeIndex !== -1) {
2669
- this.freeWorkers.splice(freeIndex, 1);
2670
- }
2671
- const workerIndex = this.workers.indexOf(worker);
2672
- if (workerIndex !== -1) {
2673
- this.workers.splice(workerIndex, 1);
2674
- }
2675
- }
2676
- processNextTask() {
2677
- if (this.taskQueue.length === 0 || this.freeWorkers.length === 0) {
2678
- return;
2679
- }
2680
- const worker = this.freeWorkers.pop();
2681
- const { task } = this.taskQueue[0];
2682
- this.busyWorkers.add(worker);
2683
- worker.postMessage(task);
2684
- }
2685
- execute(task) {
2686
- return __async$9(this, null, function* () {
2687
- return new Promise((resolve2) => {
2688
- this.taskQueue.push({ task, resolve: resolve2 });
2689
- this.processNextTask();
2690
- });
2691
- });
2692
- }
2693
- executeAll(tasks) {
2694
- return __async$9(this, null, function* () {
2695
- const promises = tasks.map((task) => this.execute(task));
2696
- return Promise.all(promises);
2697
- });
2698
- }
2699
- terminate() {
2700
- return __async$9(this, null, function* () {
2701
- this.workers.forEach((worker) => this.terminatingWorkers.add(worker));
2702
- yield Promise.all(this.workers.map((worker) => worker.terminate()));
2703
- this.workers = [];
2704
- this.freeWorkers = [];
2705
- this.busyWorkers.clear();
2706
- this.terminatingWorkers.clear();
2707
- this.taskQueue = [];
2708
- });
2709
- }
2710
- }
2711
- let workerPool = null;
2712
- function getWorkerPool() {
2713
- if (!workerPool) {
2714
- workerPool = new WorkerPool();
2715
- }
2716
- return workerPool;
2717
- }
2718
- function terminateWorkerPool() {
2719
- if (workerPool) {
2720
- const pool = workerPool;
2721
- workerPool = null;
2722
- return pool.terminate();
2723
- }
2724
- return Promise.resolve();
2725
- }
2726
-
2727
- var workerPool$1 = /*#__PURE__*/Object.freeze({
2728
- __proto__: null,
2729
- WorkerPool: WorkerPool,
2730
- getWorkerPool: getWorkerPool,
2731
- terminateWorkerPool: terminateWorkerPool
2732
- });
2733
-
2734
- var __defProp$d = Object.defineProperty;
2735
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
2736
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
2737
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
2738
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2739
- var __spreadValues$d = (a, b) => {
2740
- for (var prop in b || (b = {}))
2741
- if (__hasOwnProp$d.call(b, prop))
2742
- __defNormalProp$d(a, prop, b[prop]);
2743
- if (__getOwnPropSymbols$d)
2744
- for (var prop of __getOwnPropSymbols$d(b)) {
2745
- if (__propIsEnum$d.call(b, prop))
2746
- __defNormalProp$d(a, prop, b[prop]);
2747
- }
2748
- return a;
2749
- };
2750
- const defaultReflectionConfig = {
2751
- parallel: process.env.NODE_ENV !== "test",
2752
- // Disable parallel processing during tests
2753
- workerThreads: void 0
2754
- // Will default to CPU cores
2755
- };
2756
- let globalReflectionConfig = __spreadValues$d({}, defaultReflectionConfig);
2757
- function setReflectionConfig(config) {
2758
- globalReflectionConfig = __spreadValues$d(__spreadValues$d({}, globalReflectionConfig), config);
2759
- }
2760
- function getReflectionConfig() {
2761
- return globalReflectionConfig;
2762
- }
2763
-
2764
- function parseApexMetadata(input) {
2765
- return _function.pipe(input, parse, E__namespace.map(toMap));
2766
- }
2767
- function parse(input) {
2768
- return E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(input), E__namespace.toError);
2769
- }
2770
- function toMap(metadata) {
2771
- const map = /* @__PURE__ */ new Map();
2772
- map.set("apiVersion", String(metadata.ApexClass.apiVersion));
2773
- if (metadata.ApexClass.status) {
2774
- map.set("status", String(metadata.ApexClass.status));
2775
- }
2776
- return map;
2777
- }
2778
-
2779
- var __defProp$c = Object.defineProperty;
2780
- var __defProps$c = Object.defineProperties;
2781
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
2782
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
2783
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
2784
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
2785
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2786
- var __spreadValues$c = (a, b) => {
2787
- for (var prop in b || (b = {}))
2788
- if (__hasOwnProp$c.call(b, prop))
2789
- __defNormalProp$c(a, prop, b[prop]);
2790
- if (__getOwnPropSymbols$c)
2791
- for (var prop of __getOwnPropSymbols$c(b)) {
2792
- if (__propIsEnum$c.call(b, prop))
2793
- __defNormalProp$c(a, prop, b[prop]);
2794
- }
2795
- return a;
2796
- };
2797
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
2798
- var __async$8 = (__this, __arguments, generator) => {
2799
- return new Promise((resolve, reject) => {
2800
- var fulfilled = (value) => {
2801
- try {
2802
- step(generator.next(value));
2803
- } catch (e) {
2804
- reject(e);
2805
- }
2806
- };
2807
- var rejected = (value) => {
2808
- try {
2809
- step(generator.throw(value));
2810
- } catch (e) {
2811
- reject(e);
2812
- }
2813
- };
2814
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
2815
- step((generator = generator.apply(__this, __arguments)).next());
2816
- });
2817
- };
2818
- function reflectAsync$1(rawSource) {
2819
- return __async$8(this, null, function* () {
2820
- return new Promise((resolve, reject) => {
2821
- const result = apexReflection.reflect(rawSource);
2822
- if (result.typeMirror) {
2823
- return resolve(result.typeMirror);
2824
- } else if (result.error) {
2825
- return reject(result.error);
2826
- } else {
2827
- return reject(new Error("Unknown error"));
2828
- }
2829
- });
2830
- });
2831
- }
2832
- function reflectApexSource(apexBundles) {
2833
- const semiGroupReflectionError = {
2834
- concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
2835
- };
2836
- const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
2837
- return _function.pipe(apexBundles, A__namespace$1.traverse(Ap)(reflectBundle$1));
2838
- }
2839
- function reflectBundle$1(apexBundle) {
2840
- const convertToParsedFile = apply(toParsedFile$3, apexBundle.filePath);
2841
- const withMetadata = apply(addMetadata$1, apexBundle.metadataContent);
2842
- return _function.pipe(apexBundle, reflectAsTask$1, TE__namespace.map(convertToParsedFile), TE__namespace.flatMap(withMetadata));
2843
- }
2844
- function reflectAsTask$1(apexBundle) {
2845
- return TE__namespace.tryCatch(
2846
- () => reflectAsync$1(apexBundle.content),
2847
- (error) => new ReflectionErrors([new ReflectionError(apexBundle.filePath, error.message)])
2848
- );
2849
- }
2850
- function toParsedFile$3(filePath, typeMirror) {
2851
- return {
2852
- source: {
2853
- filePath,
2854
- name: typeMirror.name,
2855
- type: typeMirror.type_name
2856
- },
2857
- type: typeMirror
2858
- };
2859
- }
2860
- function addMetadata$1(rawMetadataContent, parsedFile) {
2861
- return TE__namespace.fromEither(
2862
- _function.pipe(
2863
- parsedFile.type,
2864
- (type) => addFileMetadataToTypeAnnotation$1(type, rawMetadataContent),
2865
- E__namespace.map((type) => __spreadProps$c(__spreadValues$c({}, parsedFile), { type })),
2866
- E__namespace.mapLeft(
2867
- (error) => errorToReflectionErrors(error, isInSource(parsedFile.source) ? parsedFile.source.filePath : "")
2868
- )
2869
- )
2870
- );
2847
+ type: {
2848
+ type_name: "customobject",
2849
+ deploymentStatus: "Deployed",
2850
+ visibility: "Public",
2851
+ label: key,
2852
+ name: key,
2853
+ description: null,
2854
+ fields: fields2,
2855
+ metadataRecords: []
2856
+ }
2857
+ };
2858
+ });
2871
2859
  }
2872
- function errorToReflectionErrors(error, filePath) {
2873
- return new ReflectionErrors([new ReflectionError(filePath, error.message)]);
2860
+
2861
+ function filterApexSourceFiles(sourceFiles) {
2862
+ return sourceFiles.filter((sourceFile) => sourceFile.type === "apex");
2874
2863
  }
2875
- function addFileMetadataToTypeAnnotation$1(type, metadata) {
2876
- const concatAnnotationToType = apply(concatAnnotations$1, type);
2877
- return _function.pipe(
2878
- O__namespace.fromNullable(metadata),
2879
- O__namespace.map(concatAnnotationToType),
2880
- O__namespace.getOrElse(() => E__namespace.right(type))
2864
+ function filterCustomObjectsFieldsAndMetadataRecords(sourceFiles) {
2865
+ return sourceFiles.filter(
2866
+ (sourceFile) => sourceFile.type === "customobject" || sourceFile.type === "customfield" || sourceFile.type === "custommetadata"
2881
2867
  );
2882
2868
  }
2883
- function concatAnnotations$1(type, metadataInput) {
2884
- return _function.pipe(
2885
- metadataInput,
2886
- parseApexMetadata,
2887
- E__namespace.map((metadataMap) => __spreadProps$c(__spreadValues$c({}, type), {
2888
- annotations: [...type.annotations, ...mapToAnnotations$1(metadataMap)]
2889
- }))
2890
- );
2869
+ function filterTriggerFiles(sourceFiles) {
2870
+ return sourceFiles.filter((sourceFile) => sourceFile.type === "trigger");
2891
2871
  }
2892
- function mapToAnnotations$1(metadata) {
2893
- return Array.from(metadata.entries()).map(([key, value]) => {
2894
- const declaration = `${key}: ${value}`;
2895
- return {
2896
- name: declaration,
2897
- type: declaration,
2898
- rawDeclaration: declaration
2899
- };
2900
- });
2872
+ function filterLwcFiles(sourceFiles) {
2873
+ return sourceFiles.filter((sourceFile) => sourceFile.type === "lwc");
2901
2874
  }
2902
2875
 
2903
- var __defProp$b = Object.defineProperty;
2904
- var __defProps$b = Object.defineProperties;
2905
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
2906
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
2907
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
2908
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
2909
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2910
- var __spreadValues$b = (a, b) => {
2876
+ var __defProp$a = Object.defineProperty;
2877
+ var __defProps$9 = Object.defineProperties;
2878
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
2879
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2880
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2881
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
2882
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2883
+ var __spreadValues$a = (a, b) => {
2911
2884
  for (var prop in b || (b = {}))
2912
- if (__hasOwnProp$b.call(b, prop))
2913
- __defNormalProp$b(a, prop, b[prop]);
2914
- if (__getOwnPropSymbols$b)
2915
- for (var prop of __getOwnPropSymbols$b(b)) {
2916
- if (__propIsEnum$b.call(b, prop))
2917
- __defNormalProp$b(a, prop, b[prop]);
2885
+ if (__hasOwnProp$a.call(b, prop))
2886
+ __defNormalProp$a(a, prop, b[prop]);
2887
+ if (__getOwnPropSymbols$a)
2888
+ for (var prop of __getOwnPropSymbols$a(b)) {
2889
+ if (__propIsEnum$a.call(b, prop))
2890
+ __defNormalProp$a(a, prop, b[prop]);
2918
2891
  }
2919
2892
  return a;
2920
2893
  };
2921
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
2922
- var __async$7 = (__this, __arguments, generator) => {
2894
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
2895
+ var __async$4 = (__this, __arguments, generator) => {
2923
2896
  return new Promise((resolve, reject) => {
2924
2897
  var fulfilled = (value) => {
2925
2898
  try {
@@ -2944,23 +2917,23 @@ function reflectTriggerSource(triggerBundles) {
2944
2917
  concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
2945
2918
  };
2946
2919
  const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
2947
- return _function.pipe(triggerBundles, A__namespace$1.traverse(Ap)(reflectBundle));
2920
+ return _function.pipe(triggerBundles, A__namespace.traverse(Ap)(reflectBundle$1));
2948
2921
  }
2949
- function reflectBundle(triggerBundle) {
2922
+ function reflectBundle$1(triggerBundle) {
2950
2923
  const convertToParsedFile = apply(
2951
- toParsedFile$2,
2924
+ toParsedFile$1,
2952
2925
  triggerBundle.filePath
2953
2926
  );
2954
2927
  return _function.pipe(triggerBundle, reflectAsTask, TE__namespace.map(convertToParsedFile));
2955
2928
  }
2956
- function toParsedFile$2(filePath, triggerMirror) {
2929
+ function toParsedFile$1(filePath, triggerMirror) {
2957
2930
  return {
2958
2931
  source: {
2959
2932
  filePath,
2960
2933
  name: triggerMirror.name,
2961
2934
  type: "trigger"
2962
2935
  },
2963
- type: __spreadProps$b(__spreadValues$b({}, triggerMirror), {
2936
+ type: __spreadProps$9(__spreadValues$a({}, triggerMirror), {
2964
2937
  type_name: "trigger"
2965
2938
  })
2966
2939
  };
@@ -2972,7 +2945,7 @@ function reflectAsTask(triggerContent) {
2972
2945
  );
2973
2946
  }
2974
2947
  function reflectAsync(triggerContent) {
2975
- return __async$7(this, null, function* () {
2948
+ return __async$4(this, null, function* () {
2976
2949
  const reflectionResult = yield apexReflection.reflectTriggerAsync(triggerContent);
2977
2950
  if (reflectionResult.error) {
2978
2951
  throw reflectionResult.error;
@@ -2981,134 +2954,7 @@ function reflectAsync(triggerContent) {
2981
2954
  });
2982
2955
  }
2983
2956
 
2984
- var __defProp$a = Object.defineProperty;
2985
- var __defProps$a = Object.defineProperties;
2986
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
2987
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
2988
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
2989
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
2990
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2991
- var __spreadValues$a = (a, b) => {
2992
- for (var prop in b || (b = {}))
2993
- if (__hasOwnProp$a.call(b, prop))
2994
- __defNormalProp$a(a, prop, b[prop]);
2995
- if (__getOwnPropSymbols$a)
2996
- for (var prop of __getOwnPropSymbols$a(b)) {
2997
- if (__propIsEnum$a.call(b, prop))
2998
- __defNormalProp$a(a, prop, b[prop]);
2999
- }
3000
- return a;
3001
- };
3002
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
3003
- var __async$6 = (__this, __arguments, generator) => {
3004
- return new Promise((resolve, reject) => {
3005
- var fulfilled = (value) => {
3006
- try {
3007
- step(generator.next(value));
3008
- } catch (e) {
3009
- reject(e);
3010
- }
3011
- };
3012
- var rejected = (value) => {
3013
- try {
3014
- step(generator.throw(value));
3015
- } catch (e) {
3016
- reject(e);
3017
- }
3018
- };
3019
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3020
- step((generator = generator.apply(__this, __arguments)).next());
3021
- });
3022
- };
3023
- function reflectApexSourceParallel(apexBundles) {
3024
- return TE__namespace.tryCatch(
3025
- () => __async$6(null, null, function* () {
3026
- const workerPool = getWorkerPool();
3027
- const tasks = apexBundles.map((bundle) => ({
3028
- id: uuid.v4(),
3029
- type: "apex",
3030
- content: bundle.content,
3031
- filePath: bundle.filePath
3032
- }));
3033
- const results = yield workerPool.executeAll(tasks);
3034
- const parsedFiles = [];
3035
- const errors = [];
3036
- for (let i = 0; i < results.length; i++) {
3037
- const result = results[i];
3038
- const originalBundle = apexBundles[i];
3039
- if (result.success && result.result) {
3040
- const parsedFile = toParsedFile$1(originalBundle.filePath, result.result);
3041
- const withMetadataResult = addMetadata(originalBundle.metadataContent, parsedFile);
3042
- if (E__namespace.isRight(withMetadataResult)) {
3043
- parsedFiles.push(withMetadataResult.right);
3044
- } else {
3045
- errors.push(new ReflectionError(originalBundle.filePath, withMetadataResult.left.message));
3046
- }
3047
- } else if (result.error) {
3048
- errors.push(new ReflectionError(result.error.filePath, result.error.message));
3049
- }
3050
- }
3051
- if (errors.length > 0) {
3052
- throw new ReflectionErrors(errors);
3053
- }
3054
- return parsedFiles;
3055
- }),
3056
- (error) => {
3057
- if (error instanceof ReflectionErrors) {
3058
- return error;
3059
- }
3060
- return new ReflectionErrors([new ReflectionError("", error.message)]);
3061
- }
3062
- );
3063
- }
3064
- function toParsedFile$1(filePath, typeMirror) {
3065
- return {
3066
- source: {
3067
- filePath,
3068
- name: typeMirror.name,
3069
- type: typeMirror.type_name
3070
- },
3071
- type: typeMirror
3072
- };
3073
- }
3074
- function addMetadata(rawMetadataContent, parsedFile) {
3075
- return _function.pipe(
3076
- parsedFile.type,
3077
- (type) => addFileMetadataToTypeAnnotation(type, rawMetadataContent),
3078
- E__namespace.map((type) => __spreadProps$a(__spreadValues$a({}, parsedFile), { type }))
3079
- );
3080
- }
3081
- function addFileMetadataToTypeAnnotation(type, metadata) {
3082
- const concatAnnotationToType = apply(concatAnnotations, type);
3083
- return _function.pipe(
3084
- O__namespace.fromNullable(metadata),
3085
- O__namespace.map(concatAnnotationToType),
3086
- O__namespace.getOrElse(() => E__namespace.right(type))
3087
- );
3088
- }
3089
- function concatAnnotations(type, metadataInput) {
3090
- return _function.pipe(
3091
- metadataInput,
3092
- parseApexMetadata,
3093
- E__namespace.map((metadataMap) => __spreadProps$a(__spreadValues$a({}, type), {
3094
- annotations: [...type.annotations, ...mapToAnnotations(metadataMap)]
3095
- }))
3096
- );
3097
- }
3098
- function mapToAnnotations(metadata) {
3099
- return Array.from(metadata.entries()).map(([key, value]) => {
3100
- const declaration = `${key}: ${value}`;
3101
- return {
3102
- name: declaration,
3103
- type: declaration,
3104
- rawDeclaration: declaration
3105
- };
3106
- });
3107
- }
3108
-
3109
2957
  var __defProp$9 = Object.defineProperty;
3110
- var __defProps$9 = Object.defineProperties;
3111
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
3112
2958
  var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
3113
2959
  var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
3114
2960
  var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
@@ -3124,117 +2970,71 @@ var __spreadValues$9 = (a, b) => {
3124
2970
  }
3125
2971
  return a;
3126
2972
  };
3127
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
3128
- var __async$5 = (__this, __arguments, generator) => {
3129
- return new Promise((resolve, reject) => {
3130
- var fulfilled = (value) => {
3131
- try {
3132
- step(generator.next(value));
3133
- } catch (e) {
3134
- reject(e);
3135
- }
3136
- };
3137
- var rejected = (value) => {
3138
- try {
3139
- step(generator.throw(value));
3140
- } catch (e) {
3141
- reject(e);
3142
- }
3143
- };
3144
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3145
- step((generator = generator.apply(__this, __arguments)).next());
3146
- });
3147
- };
3148
- function reflectTriggerSourceParallel(triggerBundles) {
3149
- return TE__namespace.tryCatch(
3150
- () => __async$5(null, null, function* () {
3151
- const workerPool = getWorkerPool();
3152
- const tasks = triggerBundles.map((bundle) => ({
3153
- id: uuid.v4(),
3154
- type: "trigger",
3155
- content: bundle.content,
3156
- filePath: bundle.filePath
3157
- }));
3158
- const results = yield workerPool.executeAll(tasks);
3159
- const parsedFiles = [];
3160
- const errors = [];
3161
- for (let i = 0; i < results.length; i++) {
3162
- const result = results[i];
3163
- const originalBundle = triggerBundles[i];
3164
- if (result.success && result.result) {
3165
- const parsedFile = toParsedFile(originalBundle.filePath, result.result);
3166
- parsedFiles.push(parsedFile);
3167
- } else if (result.error) {
3168
- errors.push(new ReflectionError(result.error.filePath, result.error.message));
2973
+ function reflectLwcSource(triggerBundles) {
2974
+ const semiGroupReflectionError = {
2975
+ concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
2976
+ };
2977
+ const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
2978
+ return _function.pipe(triggerBundles, A__namespace.traverse(Ap)(reflectBundle));
2979
+ }
2980
+ function reflectBundle(lwcBundle) {
2981
+ return _function.pipe(
2982
+ E__namespace.tryCatch(() => {
2983
+ const alwaysArray = [
2984
+ "LightningComponentBundle.targets.target",
2985
+ "LightningComponentBundle.targetConfigs.targetConfig",
2986
+ "LightningComponentBundle.targetConfigs.targetConfig.property"
2987
+ ];
2988
+ const options = {
2989
+ ignoreAttributes: false,
2990
+ isArray: (_name, jpath) => {
2991
+ return alwaysArray.indexOf(jpath) !== -1;
3169
2992
  }
3170
- }
3171
- if (errors.length > 0) {
3172
- throw new ReflectionErrors(errors);
3173
- }
3174
- return parsedFiles;
3175
- }),
3176
- (error) => {
3177
- if (error instanceof ReflectionErrors) {
3178
- return error;
3179
- }
3180
- return new ReflectionErrors([new ReflectionError("", error.message)]);
3181
- }
2993
+ };
2994
+ const result = new fastXmlParser.XMLParser(options).parse(lwcBundle.metadataContent);
2995
+ const bundle = result["LightningComponentBundle"];
2996
+ return transformBooleanProperties(bundle);
2997
+ }, E__namespace.toError),
2998
+ E__namespace.map((parsed) => toParsedFile(lwcBundle.filePath, lwcBundle.name, parsed)),
2999
+ E__namespace.mapLeft((error) => new ReflectionErrors([new ReflectionError(lwcBundle.filePath, error.message)])),
3000
+ TE__namespace.fromEither
3182
3001
  );
3183
3002
  }
3184
- function toParsedFile(filePath, triggerMirror) {
3003
+ function transformBooleanProperties(bundle) {
3004
+ var _a;
3005
+ if ((_a = bundle.targetConfigs) == null ? void 0 : _a.targetConfig) {
3006
+ bundle.targetConfigs.targetConfig = bundle.targetConfigs.targetConfig.map((config) => {
3007
+ if (config.property) {
3008
+ config.property = config.property.map((prop) => {
3009
+ if (typeof prop["@_required"] === "string") {
3010
+ if (prop["@_required"] === "true") {
3011
+ prop["@_required"] = true;
3012
+ } else if (prop["@_required"] === "false") {
3013
+ prop["@_required"] = false;
3014
+ }
3015
+ }
3016
+ return prop;
3017
+ });
3018
+ }
3019
+ return config;
3020
+ });
3021
+ }
3022
+ return bundle;
3023
+ }
3024
+ function toParsedFile(filePath, name, bundle) {
3185
3025
  return {
3186
3026
  source: {
3187
3027
  filePath,
3188
- name: triggerMirror.name,
3189
- type: "trigger"
3028
+ name,
3029
+ type: "lwc"
3190
3030
  },
3191
- type: __spreadProps$9(__spreadValues$9({}, triggerMirror), {
3192
- type_name: "trigger"
3193
- })
3031
+ type: __spreadValues$9({
3032
+ name,
3033
+ type_name: "lwc"
3034
+ }, bundle)
3194
3035
  };
3195
3036
  }
3196
3037
 
3197
- var __async$4 = (__this, __arguments, generator) => {
3198
- return new Promise((resolve, reject) => {
3199
- var fulfilled = (value) => {
3200
- try {
3201
- step(generator.next(value));
3202
- } catch (e) {
3203
- reject(e);
3204
- }
3205
- };
3206
- var rejected = (value) => {
3207
- try {
3208
- step(generator.throw(value));
3209
- } catch (e) {
3210
- reject(e);
3211
- }
3212
- };
3213
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3214
- step((generator = generator.apply(__this, __arguments)).next());
3215
- });
3216
- };
3217
- function reflectApexSourceAdaptive(apexBundles) {
3218
- const config = getReflectionConfig();
3219
- if (config.parallel && apexBundles.length > 1 && process.env.NODE_ENV !== "test") {
3220
- return reflectApexSourceParallel(apexBundles);
3221
- }
3222
- return reflectApexSource(apexBundles);
3223
- }
3224
- function reflectTriggerSourceAdaptive(triggerBundles) {
3225
- const config = getReflectionConfig();
3226
- if (config.parallel && triggerBundles.length > 1 && process.env.NODE_ENV !== "test") {
3227
- return reflectTriggerSourceParallel(triggerBundles);
3228
- }
3229
- return reflectTriggerSource(triggerBundles);
3230
- }
3231
- function cleanupReflectionWorkers() {
3232
- return __async$4(this, null, function* () {
3233
- const { terminateWorkerPool } = yield Promise.resolve().then(function () { return workerPool$1; });
3234
- return terminateWorkerPool();
3235
- });
3236
- }
3237
-
3238
3038
  var __defProp$8 = Object.defineProperty;
3239
3039
  var __defProps$8 = Object.defineProperties;
3240
3040
  var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
@@ -3275,13 +3075,6 @@ var __async$3 = (__this, __arguments, generator) => {
3275
3075
  });
3276
3076
  };
3277
3077
  function generateDocs(unparsedBundles, config) {
3278
- var _a;
3279
- if (config.parallelProcessing !== void 0 || config.workerThreads !== void 0) {
3280
- setReflectionConfig({
3281
- parallel: (_a = config.parallelProcessing) != null ? _a : true,
3282
- workerThreads: config.workerThreads
3283
- });
3284
- }
3285
3078
  const translations = mergeTranslations({ markdown: config.translations });
3286
3079
  const convertToReferences = apply(parsedFilesToReferenceGuide, config);
3287
3080
  const convertToRenderableBundle = apply(parsedFilesToRenderableBundle, config);
@@ -3311,10 +3104,17 @@ function generateDocs(unparsedBundles, config) {
3311
3104
  }),
3312
3105
  TE__namespace.chain((parsedFiles) => {
3313
3106
  return _function.pipe(
3314
- reflectTriggerSourceAdaptive(filterTriggerFiles(unparsedBundles)),
3107
+ reflectTriggerSource(filterTriggerFiles(unparsedBundles)),
3315
3108
  TE__namespace.map((parsedTriggerFiles) => [...parsedFiles, ...parsedTriggerFiles])
3316
3109
  );
3317
3110
  }),
3111
+ TE__namespace.chain((parsedFiles) => {
3112
+ return _function.pipe(
3113
+ reflectLwcSource(filterLwcFiles(unparsedBundles)),
3114
+ TE__namespace.map((parsedFiles2) => parsedFiles2),
3115
+ TE__namespace.map((parsedLwcFiles) => [...parsedFiles, ...parsedLwcFiles])
3116
+ );
3117
+ }),
3318
3118
  TE__namespace.map((parsedFiles) => sort(filterOutCustomFieldsAndMetadata(parsedFiles))),
3319
3119
  TE__namespace.bindTo("parsedFiles"),
3320
3120
  TE__namespace.bind(
@@ -3357,7 +3157,7 @@ function generateForApex(apexBundles, config) {
3357
3157
  const removeExcluded = apply(removeExcludedTags, config.excludeTags);
3358
3158
  return _function.pipe(
3359
3159
  apexBundles,
3360
- reflectApexSourceAdaptive,
3160
+ reflectApexSource,
3361
3161
  TE__namespace.map(filterOutOfScope),
3362
3162
  TE__namespace.map(addInheritedMembersToTypes),
3363
3163
  TE__namespace.map(addInheritanceChainToTypes),
@@ -5180,13 +4980,6 @@ var __async$1 = (__this, __arguments, generator) => {
5180
4980
  });
5181
4981
  };
5182
4982
  function generateChangeLog(oldBundles, newBundles, config) {
5183
- var _a;
5184
- if (config.parallelProcessing !== void 0 || config.workerThreads !== void 0) {
5185
- setReflectionConfig({
5186
- parallel: (_a = config.parallelProcessing) != null ? _a : true,
5187
- workerThreads: config.workerThreads
5188
- });
5189
- }
5190
4983
  const convertToPageData = apply(toPageData, config.fileName);
5191
4984
  function handleConversion({ changelog, newManifest }) {
5192
4985
  if (config.skipIfNoChanges && !hasChanges(changelog)) {
@@ -5216,10 +5009,11 @@ function generateChangeLog(oldBundles, newBundles, config) {
5216
5009
  function reflect(bundles, config) {
5217
5010
  const filterOutOfScopeApex = apply(filterScope, config.scope);
5218
5011
  function reflectApexFiles(sourceFiles) {
5219
- return _function.pipe(reflectApexSourceAdaptive(sourceFiles), TE__namespace.map(filterOutOfScopeApex));
5012
+ return _function.pipe(reflectApexSource(sourceFiles), TE__namespace.map(filterOutOfScopeApex));
5220
5013
  }
5221
5014
  return _function.pipe(
5222
- reflectApexFiles(filterApexSourceFiles(bundles)),
5015
+ // Filter out LWC. These will be implemented at a later date
5016
+ reflectApexFiles(filterApexSourceFiles(bundles.filter((b) => b.type !== "lwc"))),
5223
5017
  TE__namespace.chain((parsedApexFiles) => {
5224
5018
  return _function.pipe(
5225
5019
  reflectCustomFieldsAndObjectsAndMetadataRecords(
@@ -5231,7 +5025,7 @@ function reflect(bundles, config) {
5231
5025
  }),
5232
5026
  TE__namespace.chain((parsedFiles) => {
5233
5027
  return _function.pipe(
5234
- reflectTriggerSourceAdaptive(filterTriggerFiles(bundles)),
5028
+ reflectTriggerSource(filterTriggerFiles(bundles)),
5235
5029
  TE__namespace.map((parsedTriggerFiles) => [...parsedFiles, ...parsedTriggerFiles])
5236
5030
  );
5237
5031
  })
@@ -5345,7 +5139,8 @@ const allComponentTypes = [
5345
5139
  "CustomObject",
5346
5140
  "CustomField",
5347
5141
  "CustomMetadata",
5348
- "ApexTrigger"
5142
+ "ApexTrigger",
5143
+ "LightningComponentBundle"
5349
5144
  ];
5350
5145
  function getApexSourceComponents(includeMetadata, sourceComponents) {
5351
5146
  return sourceComponents.filter((component) => component.type.name === "ApexClass").map((component) => ({
@@ -5355,6 +5150,16 @@ function getApexSourceComponents(includeMetadata, sourceComponents) {
5355
5150
  contentPath: component.content
5356
5151
  }));
5357
5152
  }
5153
+ function getLightningComponentBundleSourceComponents(sourceComponents) {
5154
+ return sourceComponents.filter((component) => component.type.name === "LightningComponentBundle").map((component) => ({
5155
+ type: "LightningComponentBundle",
5156
+ name: component.name,
5157
+ xmlPath: component.xml,
5158
+ // The content path for an LWC is the JS file, which will be the same path as
5159
+ // the xml but instead of ending in .js-meta.xml it will end in .js
5160
+ contentPath: component.xml.replace(".js-meta.xml", ".js")
5161
+ }));
5162
+ }
5358
5163
  function toUnparsedApexBundle(fileSystem, apexSourceComponents) {
5359
5164
  return apexSourceComponents.map((component) => {
5360
5165
  const apexComponentTuple = [
@@ -5442,6 +5247,15 @@ function toUnparsedCustomMetadataBundle(fileSystem, customMetadataSourceComponen
5442
5247
  parentName: component.parentName
5443
5248
  }));
5444
5249
  }
5250
+ function toUnparsedLWCBundle(fileSystem, lwcSourceComponents) {
5251
+ return lwcSourceComponents.map((component) => ({
5252
+ type: "lwc",
5253
+ name: component.name,
5254
+ filePath: component.contentPath,
5255
+ content: fileSystem.readFile(component.contentPath),
5256
+ metadataContent: fileSystem.readFile(component.xmlPath)
5257
+ }));
5258
+ }
5445
5259
  function processFiles(fileSystem) {
5446
5260
  return (componentTypesToRetrieve, options = { includeMetadata: false }) => {
5447
5261
  const converters = {
@@ -5464,6 +5278,10 @@ function processFiles(fileSystem) {
5464
5278
  ApexTrigger: _function.flow(
5465
5279
  getTriggerSourceComponents,
5466
5280
  (triggerSourceComponents) => toUnparsedTriggerBundle(fileSystem, triggerSourceComponents)
5281
+ ),
5282
+ LightningComponentBundle: _function.flow(
5283
+ getLightningComponentBundleSourceComponents,
5284
+ (lwcSourceComponents) => toUnparsedLWCBundle(fileSystem, lwcSourceComponents)
5467
5285
  )
5468
5286
  };
5469
5287
  const convertersToUse = componentTypesToRetrieve.map((componentType) => converters[componentType]);
@@ -5671,23 +5489,16 @@ class Apexdocs {
5671
5489
  return __async(this, null, function* () {
5672
5490
  logger.logSingle(`Generating ${config.targetGenerator} documentation...`);
5673
5491
  try {
5674
- let result;
5675
5492
  switch (config.targetGenerator) {
5676
5493
  case "markdown":
5677
- result = yield (yield processMarkdown(config))();
5678
- break;
5494
+ return (yield processMarkdown(config))();
5679
5495
  case "openapi":
5680
5496
  yield processOpenApi(config, logger);
5681
- result = E__namespace.right("\u2714\uFE0F Documentation generated successfully!");
5682
- break;
5497
+ return E__namespace.right("\u2714\uFE0F Documentation generated successfully!");
5683
5498
  case "changelog":
5684
- result = yield (yield processChangeLog(config))();
5685
- break;
5499
+ return (yield processChangeLog(config))();
5686
5500
  }
5687
- yield cleanupReflectionWorkers();
5688
- return result;
5689
5501
  } catch (error) {
5690
- yield cleanupReflectionWorkers();
5691
5502
  return E__namespace.left([error]);
5692
5503
  }
5693
5504
  });