@cparra/apexdocs 2.25.0-alpha.1 → 2.25.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/README.md +37 -0
  2. package/{lib → dist}/__spec__/core/expect-extensions.js +3 -2
  3. package/dist/__spec__/core/expect-extensions.js.map +1 -0
  4. package/{lib → dist}/__spec__/core/generating-class-docs.spec.js +54 -37
  5. package/dist/__spec__/core/generating-class-docs.spec.js.map +1 -0
  6. package/{lib → dist}/__spec__/core/generating-enum-docs.spec.js +25 -22
  7. package/dist/__spec__/core/generating-enum-docs.spec.js.map +1 -0
  8. package/{lib → dist}/__spec__/core/generating-interface-docs.spec.js +33 -30
  9. package/dist/__spec__/core/generating-interface-docs.spec.js.map +1 -0
  10. package/{lib → dist}/__spec__/core/generating-reference-guide.spec.js +8 -7
  11. package/dist/__spec__/core/generating-reference-guide.spec.js.map +1 -0
  12. package/dist/__spec__/core/test-helpers.d.ts +2 -0
  13. package/dist/__spec__/core/test-helpers.js +12 -0
  14. package/dist/__spec__/core/test-helpers.js.map +1 -0
  15. package/{lib → dist}/application/Apexdocs.d.ts +4 -2
  16. package/{lib → dist}/application/Apexdocs.js +49 -16
  17. package/dist/application/Apexdocs.js.map +1 -0
  18. package/dist/application/generators/generate-markdown-files.d.ts +3 -0
  19. package/dist/application/generators/generate-markdown-files.js +64 -0
  20. package/dist/application/generators/generate-markdown-files.js.map +1 -0
  21. package/dist/cli/args.d.ts +39 -0
  22. package/{lib/cli/generate.js → dist/cli/args.js} +37 -40
  23. package/dist/cli/args.js.map +1 -0
  24. package/dist/cli/generate.js +291 -0
  25. package/dist/cli/generate.js.map +1 -0
  26. package/dist/core/__test__/inheritance-chain.test.d.ts +1 -0
  27. package/dist/core/__test__/inheritance-chain.test.js +42 -0
  28. package/dist/core/__test__/inheritance-chain.test.js.map +1 -0
  29. package/dist/core/adapters/apex-types.d.ts +6 -0
  30. package/{lib → dist/core}/adapters/apex-types.js +18 -21
  31. package/dist/core/adapters/apex-types.js.map +1 -0
  32. package/{lib → dist/core}/adapters/documentables.d.ts +1 -1
  33. package/dist/core/adapters/documentables.js +154 -0
  34. package/dist/core/adapters/documentables.js.map +1 -0
  35. package/{lib → dist/core}/adapters/fields-and-properties.d.ts +1 -2
  36. package/{lib → dist/core}/adapters/fields-and-properties.js +11 -6
  37. package/dist/core/adapters/fields-and-properties.js.map +1 -0
  38. package/{lib → dist/core}/adapters/methods-and-constructors.d.ts +1 -1
  39. package/{lib → dist/core}/adapters/methods-and-constructors.js +24 -16
  40. package/dist/core/adapters/methods-and-constructors.js.map +1 -0
  41. package/{lib → dist/core}/adapters/references.d.ts +2 -3
  42. package/{lib → dist/core}/adapters/references.js +5 -9
  43. package/dist/core/adapters/references.js.map +1 -0
  44. package/dist/core/adapters/type-utils.d.ts +3 -0
  45. package/dist/core/adapters/type-utils.js +12 -0
  46. package/dist/core/adapters/type-utils.js.map +1 -0
  47. package/dist/core/apex-bundle.js.map +1 -0
  48. package/{lib → dist}/core/generate-docs.d.ts +8 -3
  49. package/{lib → dist}/core/generate-docs.js +79 -24
  50. package/dist/core/generate-docs.js.map +1 -0
  51. package/dist/core/inheritance-chain.d.ts +2 -0
  52. package/{lib/index.js → dist/core/inheritance-chain.js} +11 -4
  53. package/dist/core/inheritance-chain.js.map +1 -0
  54. package/dist/core/manifest.js.map +1 -0
  55. package/{lib → dist}/core/template.js +12 -7
  56. package/{lib → dist}/core/template.js.map +1 -1
  57. package/{lib → dist}/core/templates/reference-guide.js +1 -1
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.js +1 -0
  60. package/{lib → dist}/model/markdown-file.d.ts +1 -1
  61. package/{lib → dist}/model/markdown-file.js +1 -1
  62. package/dist/model/markdown-file.js.map +1 -0
  63. package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.js +3 -2
  64. package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -0
  65. package/{lib → dist}/model/markdown-generation-util/field-declaration-util.d.ts +1 -1
  66. package/{lib → dist}/model/markdown-generation-util/field-declaration-util.js +2 -1
  67. package/dist/model/markdown-generation-util/field-declaration-util.js.map +1 -0
  68. package/{lib → dist}/model/markdown-generation-util/method-declaration-util.d.ts +1 -1
  69. package/{lib → dist}/model/markdown-generation-util/method-declaration-util.js +2 -1
  70. package/dist/model/markdown-generation-util/method-declaration-util.js.map +1 -0
  71. package/{lib → dist}/model/markdown-generation-util/type-declaration-util.js +2 -1
  72. package/dist/model/markdown-generation-util/type-declaration-util.js.map +1 -0
  73. package/{lib → dist}/model/markdown-type-file.d.ts +1 -1
  74. package/dist/model/markdown-type-file.js.map +1 -0
  75. package/{lib → dist}/service/apex-file-reader.d.ts +1 -1
  76. package/{lib → dist}/service/apex-file-reader.js +1 -1
  77. package/{lib → dist}/service/apex-file-reader.js.map +1 -1
  78. package/{lib → dist}/service/manifest-factory.d.ts +2 -2
  79. package/{lib → dist}/service/manifest-factory.js +3 -2
  80. package/dist/service/manifest-factory.js.map +1 -0
  81. package/{lib → dist}/service/parser.d.ts +1 -1
  82. package/{lib → dist}/settings.d.ts +3 -0
  83. package/{lib → dist}/settings.js +3 -0
  84. package/{lib → dist}/settings.js.map +1 -1
  85. package/{lib → dist}/test-helpers/ClassMirrorBuilder.d.ts +4 -0
  86. package/{lib → dist}/test-helpers/ClassMirrorBuilder.js +11 -1
  87. package/dist/test-helpers/ClassMirrorBuilder.js.map +1 -0
  88. package/{lib → dist}/test-helpers/SettingsBuilder.js +1 -0
  89. package/{lib → dist}/test-helpers/SettingsBuilder.js.map +1 -1
  90. package/{lib → dist}/transpiler/factory.js +2 -4
  91. package/dist/transpiler/factory.js.map +1 -0
  92. package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.d.ts +0 -2
  93. package/{lib → dist}/transpiler/markdown/class-file-generatorHelper.js +1 -15
  94. package/dist/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
  95. package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js +3 -3
  96. package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js +1 -1
  97. package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js +6 -4
  98. package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -1
  99. package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +1 -1
  100. package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js +2 -2
  101. package/{lib → dist}/util/logger.js +1 -1
  102. package/{lib → dist}/util/logger.js.map +1 -1
  103. package/{lib → dist}/util/string-utils.js +2 -2
  104. package/{lib → dist}/util/string-utils.js.map +1 -1
  105. package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +73 -0
  106. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +19 -1
  107. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
  108. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
  109. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +2 -2
  110. package/examples/plain-markdown/docs/index.md +12 -13
  111. package/examples/plain-markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
  112. package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
  113. package/jest.config.js +1 -1
  114. package/package.json +13 -15
  115. package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
  116. package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
  117. package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
  118. package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
  119. package/src/__spec__/core/test-helpers.ts +9 -0
  120. package/src/application/Apexdocs.ts +56 -19
  121. package/src/application/generators/generate-markdown-files.ts +53 -0
  122. package/src/cli/args.ts +136 -0
  123. package/src/cli/generate.ts +11 -135
  124. package/src/core/__test__/inheritance-chain.test.ts +54 -0
  125. package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
  126. package/src/{adapters → core/adapters}/__tests__/references.spec.ts +11 -1
  127. package/src/{adapters → core/adapters}/apex-types.ts +54 -44
  128. package/src/core/adapters/documentables.ts +195 -0
  129. package/src/{adapters → core/adapters}/fields-and-properties.ts +13 -11
  130. package/src/{adapters → core/adapters}/methods-and-constructors.ts +31 -20
  131. package/src/{adapters → core/adapters}/references.ts +3 -6
  132. package/src/core/adapters/type-utils.ts +9 -0
  133. package/src/core/{renderable → adapters}/types.d.ts +36 -5
  134. package/src/core/generate-docs.ts +106 -31
  135. package/src/core/inheritance-chain.ts +23 -0
  136. package/src/core/template.ts +12 -9
  137. package/src/core/templates/reference-guide.ts +1 -1
  138. package/src/model/__tests__/manifest.spec.ts +1 -1
  139. package/src/model/markdown-file.ts +1 -1
  140. package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
  141. package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
  142. package/src/model/markdown-type-file.ts +5 -1
  143. package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
  144. package/src/service/apex-file-reader.ts +1 -1
  145. package/src/service/manifest-factory.ts +2 -2
  146. package/src/service/parser.ts +1 -1
  147. package/src/settings.ts +6 -0
  148. package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
  149. package/src/test-helpers/SettingsBuilder.ts +1 -0
  150. package/src/transpiler/factory.ts +2 -4
  151. package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
  152. package/src/transpiler/markdown/plain-markdown/class-template.ts +3 -3
  153. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +1 -1
  154. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
  155. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
  156. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
  157. package/src/util/logger.ts +1 -1
  158. package/tsconfig.json +1 -1
  159. package/docs/.nojekyll +0 -0
  160. package/docs/__old/README.md +0 -1
  161. package/docs/__old/index.html +0 -22
  162. package/docs/__old/restapi.json +0 -589
  163. package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
  164. package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
  165. package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
  166. package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
  167. package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
  168. package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
  169. package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
  170. package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
  171. package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
  172. package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
  173. package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
  174. package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
  175. package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
  176. package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
  177. package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
  178. package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
  179. package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
  180. package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
  181. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
  182. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
  183. package/docs/__old/types/README.md +0 -97
  184. package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
  185. package/examples/includes/header.md +0 -3
  186. package/lib/__spec__/core/expect-extensions.js.map +0 -1
  187. package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
  188. package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
  189. package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
  190. package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
  191. package/lib/adapters/apex-types.d.ts +0 -7
  192. package/lib/adapters/apex-types.js.map +0 -1
  193. package/lib/adapters/documentables.js +0 -56
  194. package/lib/adapters/documentables.js.map +0 -1
  195. package/lib/adapters/fields-and-properties.js.map +0 -1
  196. package/lib/adapters/methods-and-constructors.js.map +0 -1
  197. package/lib/adapters/references.js.map +0 -1
  198. package/lib/adapters/type-utils.d.ts +0 -2
  199. package/lib/adapters/type-utils.js +0 -7
  200. package/lib/adapters/type-utils.js.map +0 -1
  201. package/lib/application/Apexdocs.js.map +0 -1
  202. package/lib/cli/generate.js.map +0 -1
  203. package/lib/core/generate-docs.js.map +0 -1
  204. package/lib/index.d.ts +0 -2
  205. package/lib/model/apex-bundle.js.map +0 -1
  206. package/lib/model/inheritance.d.ts +0 -8
  207. package/lib/model/inheritance.js +0 -3
  208. package/lib/model/inheritance.js.map +0 -1
  209. package/lib/model/manifest.js.map +0 -1
  210. package/lib/model/markdown-file.js.map +0 -1
  211. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
  212. package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
  213. package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
  214. package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
  215. package/lib/model/markdown-type-file.js.map +0 -1
  216. package/lib/service/manifest-factory.js.map +0 -1
  217. package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
  218. package/lib/transpiler/factory.js.map +0 -1
  219. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
  220. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
  221. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
  222. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
  223. package/src/adapters/documentables.ts +0 -93
  224. package/src/adapters/type-utils.ts +0 -5
  225. package/src/adapters/types.d.ts +0 -8
  226. package/src/model/inheritance.ts +0 -7
  227. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
  228. /package/{lib → dist}/__spec__/core/expect-extensions.d.ts +0 -0
  229. /package/{lib → dist}/__spec__/core/generating-class-docs.spec.d.ts +0 -0
  230. /package/{lib → dist}/__spec__/core/generating-enum-docs.spec.d.ts +0 -0
  231. /package/{lib → dist}/__spec__/core/generating-interface-docs.spec.d.ts +0 -0
  232. /package/{lib → dist}/__spec__/core/generating-reference-guide.spec.d.ts +0 -0
  233. /package/{lib → dist}/cli/generate.d.ts +0 -0
  234. /package/{lib/model → dist/core}/apex-bundle.d.ts +0 -0
  235. /package/{lib/model → dist/core}/apex-bundle.js +0 -0
  236. /package/{lib/model → dist/core}/manifest.d.ts +0 -0
  237. /package/{lib/model → dist/core}/manifest.js +0 -0
  238. /package/{lib → dist}/core/template.d.ts +0 -0
  239. /package/{lib → dist}/core/templates/reference-guide.d.ts +0 -0
  240. /package/{lib → dist}/core/templates/reference-guide.js.map +0 -0
  241. /package/{lib → dist}/index.js.map +0 -0
  242. /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -0
  243. /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -0
  244. /package/{lib → dist}/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -0
  245. /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -0
  246. /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -0
  247. /package/{lib → dist}/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -0
  248. /package/{lib → dist}/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -0
  249. /package/{lib → dist}/model/markdown-generation-util/index.d.ts +0 -0
  250. /package/{lib → dist}/model/markdown-generation-util/index.js +0 -0
  251. /package/{lib → dist}/model/markdown-generation-util/index.js.map +0 -0
  252. /package/{lib → dist}/model/markdown-generation-util/type-declaration-util.d.ts +0 -0
  253. /package/{lib → dist}/model/markdown-home-file.d.ts +0 -0
  254. /package/{lib → dist}/model/markdown-home-file.js +0 -0
  255. /package/{lib → dist}/model/markdown-home-file.js.map +0 -0
  256. /package/{lib → dist}/model/markdown-type-file.js +0 -0
  257. /package/{lib → dist}/model/openapi/apex-doc-types.d.ts +0 -0
  258. /package/{lib → dist}/model/openapi/apex-doc-types.js +0 -0
  259. /package/{lib → dist}/model/openapi/apex-doc-types.js.map +0 -0
  260. /package/{lib → dist}/model/openapi/open-api-types.d.ts +0 -0
  261. /package/{lib → dist}/model/openapi/open-api-types.js +0 -0
  262. /package/{lib → dist}/model/openapi/open-api-types.js.map +0 -0
  263. /package/{lib → dist}/model/openapi/open-api.d.ts +0 -0
  264. /package/{lib → dist}/model/openapi/open-api.js +0 -0
  265. /package/{lib → dist}/model/openapi/open-api.js.map +0 -0
  266. /package/{lib → dist}/model/openapi/openapi-type-file.d.ts +0 -0
  267. /package/{lib → dist}/model/openapi/openapi-type-file.js +0 -0
  268. /package/{lib → dist}/model/openapi/openapi-type-file.js.map +0 -0
  269. /package/{lib → dist}/model/outputFile.d.ts +0 -0
  270. /package/{lib → dist}/model/outputFile.js +0 -0
  271. /package/{lib → dist}/model/outputFile.js.map +0 -0
  272. /package/{lib → dist}/model/types-repository.d.ts +0 -0
  273. /package/{lib → dist}/model/types-repository.js +0 -0
  274. /package/{lib → dist}/model/types-repository.js.map +0 -0
  275. /package/{lib → dist}/service/file-system.d.ts +0 -0
  276. /package/{lib → dist}/service/file-system.js +0 -0
  277. /package/{lib → dist}/service/file-system.js.map +0 -0
  278. /package/{lib → dist}/service/file-writer.d.ts +0 -0
  279. /package/{lib → dist}/service/file-writer.js +0 -0
  280. /package/{lib → dist}/service/file-writer.js.map +0 -0
  281. /package/{lib → dist}/service/metadata-processor.d.ts +0 -0
  282. /package/{lib → dist}/service/metadata-processor.js +0 -0
  283. /package/{lib → dist}/service/metadata-processor.js.map +0 -0
  284. /package/{lib → dist}/service/parser.js +0 -0
  285. /package/{lib → dist}/service/parser.js.map +0 -0
  286. /package/{lib → dist}/service/state.d.ts +0 -0
  287. /package/{lib → dist}/service/state.js +0 -0
  288. /package/{lib → dist}/service/state.js.map +0 -0
  289. /package/{lib → dist}/service/walkers/class-walker.d.ts +0 -0
  290. /package/{lib → dist}/service/walkers/class-walker.js +0 -0
  291. /package/{lib → dist}/service/walkers/class-walker.js.map +0 -0
  292. /package/{lib → dist}/service/walkers/enum-walker.d.ts +0 -0
  293. /package/{lib → dist}/service/walkers/enum-walker.js +0 -0
  294. /package/{lib → dist}/service/walkers/enum-walker.js.map +0 -0
  295. /package/{lib → dist}/service/walkers/interface-walker.d.ts +0 -0
  296. /package/{lib → dist}/service/walkers/interface-walker.js +0 -0
  297. /package/{lib → dist}/service/walkers/interface-walker.js.map +0 -0
  298. /package/{lib → dist}/service/walkers/walker-factory.d.ts +0 -0
  299. /package/{lib → dist}/service/walkers/walker-factory.js +0 -0
  300. /package/{lib → dist}/service/walkers/walker-factory.js.map +0 -0
  301. /package/{lib → dist}/service/walkers/walker.d.ts +0 -0
  302. /package/{lib → dist}/service/walkers/walker.js +0 -0
  303. /package/{lib → dist}/service/walkers/walker.js.map +0 -0
  304. /package/{lib → dist}/test-helpers/AnnotationBuilder.d.ts +0 -0
  305. /package/{lib → dist}/test-helpers/AnnotationBuilder.js +0 -0
  306. /package/{lib → dist}/test-helpers/AnnotationBuilder.js.map +0 -0
  307. /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -0
  308. /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js +0 -0
  309. /package/{lib → dist}/test-helpers/DocCommentAnnotationBuilder.js.map +0 -0
  310. /package/{lib → dist}/test-helpers/DocCommentBuilder.d.ts +0 -0
  311. /package/{lib → dist}/test-helpers/DocCommentBuilder.js +0 -0
  312. /package/{lib → dist}/test-helpers/DocCommentBuilder.js.map +0 -0
  313. /package/{lib → dist}/test-helpers/FieldMirrorBuilder.d.ts +0 -0
  314. /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js +0 -0
  315. /package/{lib → dist}/test-helpers/FieldMirrorBuilder.js.map +0 -0
  316. /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.d.ts +0 -0
  317. /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js +0 -0
  318. /package/{lib → dist}/test-helpers/InterfaceMirrorBuilder.js.map +0 -0
  319. /package/{lib → dist}/test-helpers/MethodMirrorBuilder.d.ts +0 -0
  320. /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js +0 -0
  321. /package/{lib → dist}/test-helpers/MethodMirrorBuilder.js.map +0 -0
  322. /package/{lib → dist}/test-helpers/SettingsBuilder.d.ts +0 -0
  323. /package/{lib → dist}/transpiler/factory.d.ts +0 -0
  324. /package/{lib → dist}/transpiler/file-container.d.ts +0 -0
  325. /package/{lib → dist}/transpiler/file-container.js +0 -0
  326. /package/{lib → dist}/transpiler/file-container.js.map +0 -0
  327. /package/{lib → dist}/transpiler/generator-choices.d.ts +0 -0
  328. /package/{lib → dist}/transpiler/generator-choices.js +0 -0
  329. /package/{lib → dist}/transpiler/generator-choices.js.map +0 -0
  330. /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -0
  331. /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js +0 -0
  332. /package/{lib → dist}/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -0
  333. /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -0
  334. /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -0
  335. /package/{lib → dist}/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -0
  336. /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.d.ts +0 -0
  337. /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js +0 -0
  338. /package/{lib → dist}/transpiler/markdown/markdown-transpiler-base.js.map +0 -0
  339. /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.d.ts +0 -0
  340. /package/{lib → dist}/transpiler/markdown/plain-markdown/class-template.js.map +0 -0
  341. /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -0
  342. /package/{lib → dist}/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -0
  343. /package/{lib → dist}/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -0
  344. /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -0
  345. /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js +0 -0
  346. /package/{lib → dist}/transpiler/markdown/plain-markdown/enum-template.js.map +0 -0
  347. /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -0
  348. /package/{lib → dist}/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -0
  349. /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -0
  350. /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -0
  351. /package/{lib → dist}/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -0
  352. /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -0
  353. /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js +0 -0
  354. /package/{lib → dist}/transpiler/markdown/plain-markdown/interface-template.js.map +0 -0
  355. /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -0
  356. /package/{lib → dist}/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -0
  357. /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -0
  358. /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -0
  359. /package/{lib → dist}/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -0
  360. /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.d.ts +0 -0
  361. /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js +0 -0
  362. /package/{lib → dist}/transpiler/openapi/open-api-docs-processor.js.map +0 -0
  363. /package/{lib → dist}/transpiler/openapi/parsers/Builder.d.ts +0 -0
  364. /package/{lib → dist}/transpiler/openapi/parsers/Builder.js +0 -0
  365. /package/{lib → dist}/transpiler/openapi/parsers/Builder.js.map +0 -0
  366. /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.d.ts +0 -0
  367. /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js +0 -0
  368. /package/{lib → dist}/transpiler/openapi/parsers/MethodParser.js.map +0 -0
  369. /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -0
  370. /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -0
  371. /package/{lib → dist}/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -0
  372. /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -0
  373. /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js +0 -0
  374. /package/{lib → dist}/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -0
  375. /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -0
  376. /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -0
  377. /package/{lib → dist}/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -0
  378. /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -0
  379. /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js +0 -0
  380. /package/{lib → dist}/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -0
  381. /package/{lib → dist}/transpiler/processor-type-transpiler.d.ts +0 -0
  382. /package/{lib → dist}/transpiler/processor-type-transpiler.js +0 -0
  383. /package/{lib → dist}/transpiler/processor-type-transpiler.js.map +0 -0
  384. /package/{lib → dist}/transpiler/transpiler.d.ts +0 -0
  385. /package/{lib → dist}/transpiler/transpiler.js +0 -0
  386. /package/{lib → dist}/transpiler/transpiler.js.map +0 -0
  387. /package/{lib → dist}/util/error-logger.d.ts +0 -0
  388. /package/{lib → dist}/util/error-logger.js +0 -0
  389. /package/{lib → dist}/util/error-logger.js.map +0 -0
  390. /package/{lib → dist}/util/logger.d.ts +0 -0
  391. /package/{lib → dist}/util/string-utils.d.ts +0 -0
  392. /package/src/{model → core}/apex-bundle.ts +0 -0
  393. /package/src/{model → core}/manifest.ts +0 -0
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adaptDocumentable = exports.adaptDescribable = void 0;
4
+ const references_1 = require("./references");
5
+ const type_utils_1 = require("./type-utils");
6
+ function adaptDescribable(describable, linkGenerator) {
7
+ function describableToRenderableContent(describable) {
8
+ if (!describable) {
9
+ return;
10
+ }
11
+ let content = [];
12
+ for (let i = 0; i < describable.length; i++) {
13
+ const line = describable[i];
14
+ // The language might or might not be present after ```
15
+ const codeBlockMatch = line.match(/^```([a-zA-Z]*)$/);
16
+ if (codeBlockMatch) {
17
+ // Check if the language is present, if not, fallback to "apex"
18
+ const language = codeBlockMatch[1] || 'apex';
19
+ const codeBlockLines = [];
20
+ i++;
21
+ while (i < describable.length) {
22
+ const currentLine = describable[i];
23
+ if (currentLine.trim() === '```') {
24
+ break;
25
+ }
26
+ codeBlockLines.push(currentLine);
27
+ i++;
28
+ }
29
+ console.log('codeBlockLines', codeBlockLines);
30
+ content = [
31
+ ...content,
32
+ {
33
+ __type: 'code-block',
34
+ language,
35
+ content: codeBlockLines,
36
+ },
37
+ { __type: 'empty-line' },
38
+ ];
39
+ continue;
40
+ }
41
+ content = [
42
+ ...content,
43
+ ...(0, references_1.replaceInlineReferences)(line, linkGenerator),
44
+ {
45
+ __type: 'empty-line',
46
+ },
47
+ ];
48
+ }
49
+ return (content
50
+ .flatMap((line) => line)
51
+ // If the last element is an empty line, remove it
52
+ .filter((line, index, lines) => !((0, type_utils_1.isEmptyLine)(line) && index === lines.length - 1)));
53
+ // TODO: Now we want to also extract code blocks if we encounter any line that starts with "```"
54
+ // return describable.reduce<RenderableContent[]>(
55
+ // (acc, line) => {
56
+ // if (line.trim() === '') {
57
+ // return [...acc, { __type: 'empty-line' }];
58
+ // }
59
+ //
60
+ // // The language might or might not be present after ```
61
+ // const codeBlockMatch = line.match(/^```([a-zA-Z]*)$/);
62
+ // if (codeBlockMatch) {
63
+ // console.log('codeBlockMatch', codeBlockMatch);
64
+ // // Check if the language is present, if not, fallback to "apex"
65
+ // const language = codeBlockMatch[1] || 'apex';
66
+ // const codeBlockLines: string[] = [];
67
+ // let index = acc.length + 1;
68
+ // while (index < describable.length) {
69
+ // const currentLine = describable[index];
70
+ // if (currentLine.trim() === '```') {
71
+ // break;
72
+ // }
73
+ // codeBlockLines.push(currentLine);
74
+ // index++;
75
+ // }
76
+ // return [
77
+ // ...acc,
78
+ // {
79
+ // __type: 'code-block',
80
+ // language,
81
+ // content: codeBlockLines,
82
+ // },
83
+ // ];
84
+ // }
85
+ //
86
+ // return [
87
+ // ...acc,
88
+ // ...replaceInlineReferences(line, linkGenerator),
89
+ // {
90
+ // __type: 'empty-line',
91
+ // },
92
+ // ];
93
+ // },
94
+ // <RenderableContent[]>[],
95
+ // );
96
+ // return (
97
+ // describable
98
+ // .map<RenderableContent[]>((line) => [
99
+ // ...replaceInlineReferences(line, linkGenerator),
100
+ // {
101
+ // __type: 'empty-line',
102
+ // },
103
+ // ])
104
+ // .flatMap((line) => line)
105
+ // // If the last element is an empty line, remove it
106
+ // .filter((line, index, lines) => !(isEmptyLine(line) && index === lines.length - 1))
107
+ // );
108
+ }
109
+ return {
110
+ description: describableToRenderableContent(describable),
111
+ };
112
+ }
113
+ exports.adaptDescribable = adaptDescribable;
114
+ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
115
+ var _a, _b, _c;
116
+ function extractCustomTags(type) {
117
+ var _a, _b;
118
+ const baseTags = ['description', 'group', 'author', 'date', 'see', 'example', 'mermaid', 'throws', 'exception'];
119
+ return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => (Object.assign(Object.assign({}, adaptDescribable(currentAnnotation.bodyLines, linkGenerator)), { name: currentAnnotation.name })))) !== null && _b !== void 0 ? _b : []);
120
+ }
121
+ function extractAnnotationBodyLines(type, annotationName) {
122
+ var _a, _b;
123
+ return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.bodyLines;
124
+ }
125
+ function extractAnnotationBody(type, annotationName) {
126
+ var _a, _b;
127
+ return (_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((currentAnnotation) => currentAnnotation.name.toLowerCase() === annotationName)) === null || _b === void 0 ? void 0 : _b.body;
128
+ }
129
+ function extractSeeAnnotations(type) {
130
+ var _a, _b;
131
+ return ((_b = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === 'see').map((currentAnnotation) => currentAnnotation.body)) !== null && _b !== void 0 ? _b : []);
132
+ }
133
+ function bodyLinesToCodeBlock(language, bodyLines) {
134
+ if (!bodyLines) {
135
+ return;
136
+ }
137
+ return {
138
+ __type: 'code-block',
139
+ language,
140
+ content: bodyLines,
141
+ };
142
+ }
143
+ return Object.assign(Object.assign({}, adaptDescribable((_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines, linkGenerator)), { annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()), customTags: extractCustomTags(documentable), mermaid: {
144
+ headingLevel: subHeadingLevel,
145
+ heading: 'Diagram',
146
+ value: bodyLinesToCodeBlock('mermaid', extractAnnotationBodyLines(documentable, 'mermaid')),
147
+ }, example: {
148
+ headingLevel: subHeadingLevel,
149
+ heading: 'Example',
150
+ value: bodyLinesToCodeBlock('apex', (_c = (_b = documentable.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) === null || _c === void 0 ? void 0 : _c.bodyLines),
151
+ }, group: extractAnnotationBody(documentable, 'group'), author: extractAnnotationBody(documentable, 'author'), date: extractAnnotationBody(documentable, 'date'), sees: extractSeeAnnotations(documentable).map(linkGenerator) });
152
+ }
153
+ exports.adaptDocumentable = adaptDocumentable;
154
+ //# sourceMappingURL=documentables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentables.js","sourceRoot":"","sources":["../../../src/core/adapters/documentables.ts"],"names":[],"mappings":";;;AAEA,6CAAuF;AACvF,6CAA2C;AAE3C,SAAgB,gBAAgB,CAC9B,WAAwB,EACxB,aAA6C;IAI7C,SAAS,8BAA8B,CAAC,WAAwB;QAC9D,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QAED,IAAI,OAAO,GAAwB,EAAE,CAAC;QACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5C,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5B,uDAAuD;YACvD,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACtD,IAAI,cAAc,EAAE,CAAC;gBACnB,+DAA+D;gBAC/D,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC;gBAC7C,MAAM,cAAc,GAAa,EAAE,CAAC;gBACpC,CAAC,EAAE,CAAC;gBACJ,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;oBAC9B,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;oBACnC,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;wBACjC,MAAM;oBAC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E;YACP,YAAY,EAAE,eAAe;YAC7B,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,oBAAoB,CAAC,MAAM,EAAE,MAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,iBAAiB,0CAAE,SAAS,CAAC;SAC3F,EACD,KAAK,EAAE,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,EACnD,MAAM,EAAE,qBAAqB,CAAC,YAAY,EAAE,QAAQ,CAAC,EACrD,IAAI,EAAE,qBAAqB,CAAC,YAAY,EAAE,MAAM,CAAC,EACjD,IAAI,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,IAC5D;AACJ,CAAC;AApED,8CAoEC"}
@@ -1,4 +1,3 @@
1
- import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance } from '../model/inheritance';
2
- import { RenderableField } from '../core/renderable/types';
1
+ import { FieldMirrorWithInheritance, PropertyMirrorWithInheritance, RenderableField } from './types';
3
2
  import { GetRenderableContentByTypeName } from './references';
4
3
  export declare function adaptFieldOrProperty(field: FieldMirrorWithInheritance | PropertyMirrorWithInheritance, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableField;
@@ -1,15 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adaptFieldOrProperty = adaptFieldOrProperty;
3
+ exports.adaptFieldOrProperty = void 0;
4
4
  const documentables_1 = require("./documentables");
5
- const references_1 = require("./references");
6
5
  function adaptFieldOrProperty(field, linkGenerator, baseHeadingLevel) {
7
6
  function buildSignature() {
8
7
  const { access_modifier, name } = field;
9
8
  const memberModifiers = field.memberModifiers.join(' ');
10
- return (`${access_modifier} ${memberModifiers} ${name}`
9
+ const codeContents = `${access_modifier} ${memberModifiers} ${name}`
11
10
  // remove double spaces
12
- .replace(/ {2}/g, ' '));
11
+ .replace(/ {2}/g, ' ');
12
+ return {
13
+ __type: 'code-block',
14
+ language: 'apex',
15
+ content: [codeContents],
16
+ };
13
17
  }
14
18
  return {
15
19
  headingLevel: baseHeadingLevel,
@@ -18,15 +22,16 @@ function adaptFieldOrProperty(field, linkGenerator, baseHeadingLevel) {
18
22
  type: {
19
23
  headingLevel: baseHeadingLevel + 1,
20
24
  heading: 'Type',
21
- value: (0, references_1.linkFromTypeNameGenerator)(field.typeReference.rawDeclaration),
25
+ value: linkGenerator(field.typeReference.rawDeclaration),
22
26
  },
23
27
  inherited: field.inherited,
24
28
  accessModifier: field.access_modifier,
25
29
  signature: {
26
30
  headingLevel: baseHeadingLevel + 1,
27
31
  heading: 'Signature',
28
- value: [buildSignature()],
32
+ value: buildSignature(),
29
33
  },
30
34
  };
31
35
  }
36
+ exports.adaptFieldOrProperty = adaptFieldOrProperty;
32
37
  //# sourceMappingURL=fields-and-properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields-and-properties.js","sourceRoot":"","sources":["../../../src/core/adapters/fields-and-properties.ts"],"names":[],"mappings":";;;AACA,mDAAoD;AAGpD,SAAgB,oBAAoB,CAClC,KAAiE,EACjE,aAA6C,EAC7C,gBAAwB;IAExB,SAAS,cAAc;QACrB,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACxC,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,YAAY,GAAG,GAAG,eAAe,IAAI,eAAe,IAAI,IAAI,EAAE;YAClE,uBAAuB;aACtB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QACzB,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,QAAQ,EAAE,MAAM;YAChB,OAAO,EAAE,CAAC,YAAY,CAAC;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,gBAAgB;QAC9B,GAAG,EAAE,IAAA,iCAAiB,EAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,GAAG,CAAC,CAAC;QAClE,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,IAAI,EAAE;YACJ,YAAY,EAAE,gBAAgB,GAAG,CAAC;YAClC,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;SACzD;QACD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,cAAc,EAAE,KAAK,CAAC,eAAe;QACrC,SAAS,EAAE;YACT,YAAY,EAAE,gBAAgB,GAAG,CAAC;YAClC,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,cAAc,EAAE;SACxB;KACF,CAAC;AACJ,CAAC;AAnCD,oDAmCC"}
@@ -1,5 +1,5 @@
1
1
  import { ConstructorMirror, MethodMirror } from '@cparra/apex-reflection';
2
- import { RenderableConstructor, RenderableMethod } from '../core/renderable/types';
2
+ import { RenderableConstructor, RenderableMethod } from './types';
3
3
  import { GetRenderableContentByTypeName } from './references';
4
4
  export declare function adaptMethod(method: MethodMirror, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableMethod;
5
5
  export declare function adaptConstructor(typeName: string, constructor: ConstructorMirror, linkGenerator: GetRenderableContentByTypeName, baseHeadingLevel: number): RenderableConstructor;
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adaptMethod = adaptMethod;
4
- exports.adaptConstructor = adaptConstructor;
3
+ exports.adaptConstructor = exports.adaptMethod = void 0;
5
4
  const documentables_1 = require("./documentables");
6
- const references_1 = require("./references");
7
5
  function adaptMethod(method, linkGenerator, baseHeadingLevel) {
8
6
  var _a, _b, _c;
9
7
  function buildTitle(method) {
@@ -17,7 +15,11 @@ function adaptMethod(method, linkGenerator, baseHeadingLevel) {
17
15
  .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
18
16
  .join(', ');
19
17
  const members = memberModifiers.length > 0 ? `${memberModifiers.join(' ')} ` : '';
20
- return `${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`;
18
+ return {
19
+ __type: 'code-block',
20
+ language: 'apex',
21
+ content: [`${access_modifier} ${members}${typeReference.rawDeclaration} ${name}(${parameters})`],
22
+ };
21
23
  }
22
24
  return {
23
25
  headingLevel: baseHeadingLevel,
@@ -26,26 +28,27 @@ function adaptMethod(method, linkGenerator, baseHeadingLevel) {
26
28
  signature: {
27
29
  headingLevel: baseHeadingLevel + 1,
28
30
  heading: 'Signature',
29
- value: [buildSignature(method)],
31
+ value: buildSignature(method),
30
32
  },
31
33
  returnType: {
32
34
  headingLevel: baseHeadingLevel + 1,
33
35
  heading: 'Return Type',
34
- value: Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_b = (_a = method.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation) === null || _b === void 0 ? void 0 : _b.bodyLines, linkGenerator)), { type: (0, references_1.linkFromTypeNameGenerator)(method.typeReference.rawDeclaration) }),
36
+ value: Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)((_b = (_a = method.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation) === null || _b === void 0 ? void 0 : _b.bodyLines, linkGenerator)), { type: linkGenerator(method.typeReference.rawDeclaration) }),
35
37
  },
36
38
  throws: {
37
39
  headingLevel: baseHeadingLevel + 1,
38
40
  heading: 'Throws',
39
- value: (_c = method.docComment) === null || _c === void 0 ? void 0 : _c.throwsAnnotations.map((thrown) => mapThrows(thrown)),
41
+ value: (_c = method.docComment) === null || _c === void 0 ? void 0 : _c.throwsAnnotations.map((thrown) => mapThrows(thrown, linkGenerator)),
40
42
  },
41
43
  parameters: {
42
44
  headingLevel: baseHeadingLevel + 1,
43
45
  heading: 'Parameters',
44
- value: method.parameters.map((param) => mapParameters(method, param)),
46
+ value: method.parameters.map((param) => mapParameters(method, param, linkGenerator)),
45
47
  },
46
48
  inherited: method.inherited,
47
49
  };
48
50
  }
51
+ exports.adaptMethod = adaptMethod;
49
52
  function adaptConstructor(typeName, constructor, linkGenerator, baseHeadingLevel) {
50
53
  var _a;
51
54
  function buildTitle(name, constructor) {
@@ -58,7 +61,11 @@ function adaptConstructor(typeName, constructor, linkGenerator, baseHeadingLevel
58
61
  const parameters = constructor.parameters
59
62
  .map((param) => `${param.typeReference.rawDeclaration} ${param.name}`)
60
63
  .join(', ');
61
- return `${access_modifier} ${name}(${parameters})`;
64
+ return {
65
+ __type: 'code-block',
66
+ language: 'apex',
67
+ content: [`${access_modifier} ${name}(${parameters})`],
68
+ };
62
69
  }
63
70
  return {
64
71
  doc: (0, documentables_1.adaptDocumentable)(constructor, linkGenerator, baseHeadingLevel + 1),
@@ -67,26 +74,27 @@ function adaptConstructor(typeName, constructor, linkGenerator, baseHeadingLevel
67
74
  signature: {
68
75
  headingLevel: baseHeadingLevel + 1,
69
76
  heading: 'Signature',
70
- value: [buildSignature(typeName, constructor)],
77
+ value: buildSignature(typeName, constructor),
71
78
  },
72
79
  parameters: {
73
80
  headingLevel: baseHeadingLevel + 1,
74
81
  heading: 'Parameters',
75
- value: constructor.parameters.map((param) => mapParameters(constructor, param)),
82
+ value: constructor.parameters.map((param) => mapParameters(constructor, param, linkGenerator)),
76
83
  },
77
84
  throws: {
78
85
  headingLevel: baseHeadingLevel + 1,
79
86
  heading: 'Throws',
80
- value: (_a = constructor.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.map((thrown) => mapThrows(thrown)),
87
+ value: (_a = constructor.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.map((thrown) => mapThrows(thrown, linkGenerator)),
81
88
  },
82
89
  };
83
90
  }
84
- function mapParameters(documentable, param) {
91
+ exports.adaptConstructor = adaptConstructor;
92
+ function mapParameters(documentable, param, linkGenerator) {
85
93
  var _a;
86
94
  const paramAnnotation = (_a = documentable.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.find((pa) => pa.paramName.toLowerCase() === param.name.toLowerCase());
87
- return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(paramAnnotation === null || paramAnnotation === void 0 ? void 0 : paramAnnotation.bodyLines, references_1.linkFromTypeNameGenerator)), { name: param.name, type: (0, references_1.linkFromTypeNameGenerator)(param.typeReference.rawDeclaration) });
95
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(paramAnnotation === null || paramAnnotation === void 0 ? void 0 : paramAnnotation.bodyLines, linkGenerator)), { name: param.name, type: linkGenerator(param.typeReference.rawDeclaration) });
88
96
  }
89
- function mapThrows(thrown) {
90
- return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(thrown.bodyLines, references_1.linkFromTypeNameGenerator)), { type: (0, references_1.linkFromTypeNameGenerator)(thrown.exceptionName) });
97
+ function mapThrows(thrown, linkGenerator) {
98
+ return Object.assign(Object.assign({}, (0, documentables_1.adaptDescribable)(thrown.bodyLines, linkGenerator)), { type: linkGenerator(thrown.exceptionName) });
91
99
  }
92
100
  //# sourceMappingURL=methods-and-constructors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods-and-constructors.js","sourceRoot":"","sources":["../../../src/core/adapters/methods-and-constructors.ts"],"names":[],"mappings":";;;AAEA,mDAAsE;AAItE,SAAgB,WAAW,CACzB,MAAoB,EACpB,aAA6C,EAC7C,gBAAwB;;IAExB,SAAS,UAAU,CAAC,MAAmC;QACrD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;QACpC,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO,GAAG,IAAI,IAAI,gBAAgB,GAAG,CAAC;IACxC,CAAC;IAED,SAAS,cAAc,CAAC,MAAmC;QACzD,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;QACzE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU;aACjC,GAAG,CAAC,CAAC,KAAK,E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AS,SAAS,CAAC,MAAwB,EAAE,aAA6C;IACxF,uCACK,IAAA,gCAAgB,EAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,KACpD,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,aAAa,CAAC,IACzC;AACJ,CAAC"}
@@ -1,5 +1,4 @@
1
- import { RenderableContent, StringOrLink } from '../core/renderable/types';
1
+ import { RenderableContent, StringOrLink } from './types';
2
2
  export type GetRenderableContentByTypeName = (typeName: string) => StringOrLink;
3
- export declare const linkFromTypeNameGenerator: GetRenderableContentByTypeName;
4
- export declare function replaceInlineReferences(text: string, linkReplacer?: GetRenderableContentByTypeName, emailReplacer?: GetRenderableContentByTypeName): RenderableContent[];
3
+ export declare function replaceInlineReferences(text: string, linkReplacer: GetRenderableContentByTypeName, emailReplacer?: GetRenderableContentByTypeName): RenderableContent[];
5
4
  export declare function replaceInlineEmails(renderableContents: RenderableContent[], getLinkByTypeName: GetRenderableContentByTypeName): RenderableContent[];
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.linkFromTypeNameGenerator = void 0;
7
- exports.replaceInlineReferences = replaceInlineReferences;
8
- exports.replaceInlineEmails = replaceInlineEmails;
9
- const class_file_generatorHelper_1 = __importDefault(require("../transpiler/markdown/class-file-generatorHelper"));
10
- exports.linkFromTypeNameGenerator = class_file_generatorHelper_1.default.getRenderableLinkByTypeName;
3
+ exports.replaceInlineEmails = exports.replaceInlineReferences = void 0;
11
4
  function defaultGetEmailByReference(email) {
12
5
  return {
6
+ __type: 'link',
13
7
  title: email,
14
8
  url: `mailto:${email}`,
15
9
  };
16
10
  }
17
- function replaceInlineReferences(text, linkReplacer = exports.linkFromTypeNameGenerator, emailReplacer = defaultGetEmailByReference) {
11
+ function replaceInlineReferences(text, linkReplacer, emailReplacer = defaultGetEmailByReference) {
18
12
  return replaceInlineEmails(replaceInlineLinks([text], linkReplacer), emailReplacer);
19
13
  }
14
+ exports.replaceInlineReferences = replaceInlineReferences;
20
15
  function replaceInlineLinks(renderableContents, getLinkByTypeName) {
21
16
  return renderableContents.flatMap((renderableContent) => inlineLinkContent(renderableContent, getLinkByTypeName));
22
17
  }
@@ -33,6 +28,7 @@ function inlineLinkContent(renderableContent, getLinkByTypeName) {
33
28
  function replaceInlineEmails(renderableContents, getLinkByTypeName) {
34
29
  return renderableContents.flatMap((renderableContent) => inlineEmailContent(renderableContent, getLinkByTypeName));
35
30
  }
31
+ exports.replaceInlineEmails = replaceInlineEmails;
36
32
  function inlineEmailContent(renderableContent, getLinkByTypeName) {
37
33
  if (typeof renderableContent !== 'string') {
38
34
  return [renderableContent];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"references.js","sourceRoot":"","sources":["../../../src/core/adapters/references.ts"],"names":[],"mappings":";;;AAIA,SAAS,0BAA0B,CAAC,KAAa;IAC/C,OAAO;QACL,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,KAAK;QACZ,GAAG,EAAE,UAAU,KAAK,EAAE;KACvB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CACrC,IAAY,EACZ,YAA4C,EAC5C,gBAAgD,0BAA0B;IAE1E,OAAO,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,EAAE,aAAa,CAAC,CAAC;AACtF,CAAC;AAND,0DAMC;AAED,SAAS,kBAAkB,CACzB,kBAAuC,EACvC,iBAAiD;IAEjD,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACpH,CAAC;AAED,SAAS,iBAAiB,CACxB,iBAAoC,EACpC,iBAAiD;IAEjD,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,C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AQ,KAAK,EAAE;IAEhB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,wBAAwB,CAAC,OAA0B,EAAE,IAAY,EAAE,MAAsC;IAChH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAE/B,yEAAyE;QACzE,2DAA2D;QAC3D,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAEnC,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7B,CAAC;IAED,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CodeBlock, EmptyLine, RenderableContent } from './types';
2
+ export declare function isEmptyLine(content: RenderableContent): content is EmptyLine;
3
+ export declare function isCodeBlock(content: RenderableContent): content is CodeBlock;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isCodeBlock = exports.isEmptyLine = void 0;
4
+ function isEmptyLine(content) {
5
+ return Object.keys(content).includes('__type') && content.__type === 'empty-line';
6
+ }
7
+ exports.isEmptyLine = isEmptyLine;
8
+ function isCodeBlock(content) {
9
+ return Object.keys(content).includes('__type') && content.__type === 'code-block';
10
+ }
11
+ exports.isCodeBlock = isCodeBlock;
12
+ //# sourceMappingURL=type-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-utils.js","sourceRoot":"","sources":["../../../src/core/adapters/type-utils.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAK,OAA8B,CAAC,MAAM,KAAK,YAAY,CAAC;AAC5G,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAC,OAA0B;IACpD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAK,OAA8B,CAAC,MAAM,KAAK,YAAY,CAAC;AAC5G,CAAC;AAFD,kCAEC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apex-bundle.js","sourceRoot":"","sources":["../../src/core/apex-bundle.ts"],"names":[],"mappings":";;AAAA,MAAqB,UAAU;IAC7B,YAAmB,QAAgB,EAAS,cAAsB,EAAS,kBAAiC;QAAzF,aAAQ,GAAR,QAAQ,CAAQ;QAAS,mBAAc,GAAd,cAAc,CAAQ;QAAS,uBAAkB,GAAlB,kBAAkB,CAAe;IAAG,CAAC;CACjH;AAFD,6BAEC"}
@@ -1,6 +1,5 @@
1
- import { Type } from '@cparra/apex-reflection';
2
1
  import * as E from 'fp-ts/Either';
3
- export declare const documentType: (type: Type, linkGenerator: import("../adapters/references").GetRenderableContentByTypeName, namespace?: string | undefined) => string;
2
+ import ApexBundle from './apex-bundle';
4
3
  export type DocumentationBundle = {
5
4
  format: 'markdown';
6
5
  referenceGuide: string;
@@ -15,9 +14,15 @@ type DocumentationConfig = {
15
14
  referenceGuideTemplate: string;
16
15
  };
17
16
  type DocOutput = {
17
+ directory: string;
18
18
  docContents: string;
19
19
  typeName: string;
20
20
  type: 'class' | 'interface' | 'enum';
21
21
  };
22
- export declare function generateDocs(input: string[], config?: Partial<DocumentationConfig>): E.Either<string[], DocumentationBundle>;
22
+ export declare function generateDocs(input: ApexBundle[], config?: Partial<DocumentationConfig>): E.Either<ReflectionError[], DocumentationBundle>;
23
+ export declare class ReflectionError {
24
+ file: string;
25
+ message: string;
26
+ constructor(file: string, message: string);
27
+ }
23
28
  export {};
@@ -26,20 +26,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.documentType = void 0;
30
- exports.generateDocs = generateDocs;
29
+ exports.ReflectionError = exports.generateDocs = void 0;
31
30
  const apex_reflection_1 = require("@cparra/apex-reflection");
32
- const apex_types_1 = require("../adapters/apex-types");
33
- const class_template_1 = require("../transpiler/markdown/plain-markdown/class-template");
34
- const enum_template_1 = require("../transpiler/markdown/plain-markdown/enum-template");
35
- const interface_template_1 = require("../transpiler/markdown/plain-markdown/interface-template");
36
- const E = __importStar(require("fp-ts/Either"));
31
+ const O = __importStar(require("fp-ts/Option"));
37
32
  const function_1 = require("fp-ts/function");
33
+ const E = __importStar(require("fp-ts/Either"));
34
+ const apex_types_1 = require("./adapters/apex-types");
38
35
  const template_1 = require("./template");
39
- const manifest_1 = __importDefault(require("../model/manifest"));
40
36
  const reference_guide_1 = require("./templates/reference-guide");
41
- const documentables_1 = require("../adapters/documentables");
42
- exports.documentType = (0, function_1.flow)(apex_types_1.typeToRenderableType, resolveApexTypeTemplate, compile);
37
+ const documentables_1 = require("./adapters/documentables");
38
+ const inheritance_chain_1 = require("./inheritance-chain");
39
+ const manifest_1 = __importDefault(require("./manifest"));
40
+ // TODO: The core should never depend on things from the outside, so it should never reference "back" (../)
41
+ const class_template_1 = require("../transpiler/markdown/plain-markdown/class-template");
42
+ const interface_template_1 = require("../transpiler/markdown/plain-markdown/interface-template");
43
+ const enum_template_1 = require("../transpiler/markdown/plain-markdown/enum-template");
44
+ const metadata_processor_1 = __importDefault(require("../service/metadata-processor"));
43
45
  const configDefaults = {
44
46
  scope: ['public'],
45
47
  outputDir: 'docs',
@@ -48,25 +50,25 @@ const configDefaults = {
48
50
  };
49
51
  function generateDocs(input, config) {
50
52
  const configWithDefaults = Object.assign(Object.assign({}, configDefaults), config);
51
- return (0, function_1.pipe)(input, (input) => input.map(reflectSourceBody), checkForReflectionErrors, E.map((types) => types.map((type) => addInheritedMembers(type, types))), E.map((types) => filterTypesOutOfScope(types, configWithDefaults.scope)), E.map((types) => typesToRenderableBundle(types, configWithDefaults)), E.map(({ references, renderables }) => ({
53
+ return (0, function_1.pipe)(input, (input) => input.map((bundle) => reflectSourceBody(bundle)), checkForReflectionErrors, E.map((types) => filterTypesOutOfScope(types, configWithDefaults.scope)), E.map((types) => types.map((type) => addInheritedMembers(type, types))), E.map((types) => types.map((type) => addInheritanceChain(type, types))), E.map((types) => typesToRenderableBundle(types, configWithDefaults)), E.map(({ references, renderables }) => ({
52
54
  referenceGuide: (0, function_1.pipe)(referencesToReferenceGuide(references, configWithDefaults.referenceGuideTemplate)),
53
- docs: renderables.map(renderableToOutputDoc),
55
+ docs: renderables.map((renderable) => renderableToOutputDoc(Object.values(references).flat(), renderable)),
54
56
  })), E.map(({ referenceGuide, docs }) => ({ format: 'markdown', referenceGuide: referenceGuide, docs })));
55
57
  }
58
+ exports.generateDocs = generateDocs;
56
59
  function typesToRenderableBundle(types, config) {
57
60
  return types.reduce((acc, type) => {
58
61
  var _a;
59
- const renderable = (0, apex_types_1.typeToRenderableType)(type, (referenceName) => {
62
+ const renderable = (0, apex_types_1.typeToRenderable)(type, (referenceName) => {
60
63
  return linkFromTypeNameGenerator(type, types, referenceName, config);
61
64
  }, config.namespace);
62
65
  acc.renderables.push(renderable);
63
66
  const descriptionLines = (_a = type.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines;
64
67
  const reference = {
68
+ typeName: type.name,
69
+ directory: getDirectoryFromRoot(config, type),
65
70
  title: getLinkFromRoot(config, type),
66
- description: (0, documentables_1.adaptDescribable)(descriptionLines, (referenceName) => {
67
- const type = findType(types, referenceName);
68
- return type ? getLinkFromRoot(config, type) : referenceName;
69
- }).description,
71
+ description: (0, documentables_1.adaptDescribable)(descriptionLines, (referenceName) => getPossibleLinkFromRoot(config, referenceName, findType(types, referenceName))).description,
70
72
  };
71
73
  const group = getTypeGroup(type, config);
72
74
  if (!acc.references[group]) {
@@ -79,9 +81,11 @@ function typesToRenderableBundle(types, config) {
79
81
  renderables: [],
80
82
  });
81
83
  }
82
- function renderableToOutputDoc(renderable) {
84
+ function renderableToOutputDoc(referenceGuideReference, renderable) {
83
85
  function buildDocOutput(renderable, docContents) {
86
+ const reference = referenceGuideReference.find((ref) => ref.typeName.toLowerCase() === renderable.name.toLowerCase());
84
87
  return {
88
+ directory: reference.directory,
85
89
  docContents,
86
90
  typeName: renderable.name,
87
91
  type: renderable.type,
@@ -118,10 +122,34 @@ function checkForReflectionErrors(reflectionResult) {
118
122
  }
119
123
  return (0, function_1.pipe)(reflectionResult, reduceReflectionResultIntoSingleEither, ({ errors, types }) => errors.length ? E.left(errors) : E.right(types));
120
124
  }
121
- function reflectSourceBody(input) {
125
+ function addFileMetadataToTypeAnnotation(type, metadata) {
126
+ return (0, function_1.pipe)(O.fromNullable(metadata), O.map((metadata) => {
127
+ const metadataParams = metadata_processor_1.default.process(metadata);
128
+ metadataParams.forEach((value, key) => {
129
+ const declaration = `${key}: ${value}`;
130
+ type.annotations.push({
131
+ rawDeclaration: declaration,
132
+ name: declaration,
133
+ type: declaration,
134
+ });
135
+ });
136
+ return type;
137
+ }), O.getOrElse(() => type));
138
+ }
139
+ class ReflectionError {
140
+ constructor(file, message) {
141
+ this.file = file;
142
+ this.message = message;
143
+ }
144
+ }
145
+ exports.ReflectionError = ReflectionError;
146
+ function reflectSourceBody(apexBundle) {
147
+ const { filePath, rawTypeContent: input, rawMetadataContent: metadata } = apexBundle;
122
148
  const result = (0, apex_reflection_1.reflect)(input);
123
149
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
124
- return result.error ? E.left(result.error.message) : E.right(result.typeMirror);
150
+ return result.error
151
+ ? E.left(new ReflectionError(filePath, result.error.message))
152
+ : E.right(addFileMetadataToTypeAnnotation(result.typeMirror, metadata));
125
153
  }
126
154
  function resolveApexTypeTemplate(renderable) {
127
155
  function getTemplate(renderable) {
@@ -156,6 +184,15 @@ function addInheritedMembers(current, repository) {
156
184
  return addInheritedClassMembers(current, repository);
157
185
  }
158
186
  }
187
+ function addInheritanceChain(current, repository) {
188
+ if (current.type_name === 'enum' || current.type_name === 'interface') {
189
+ return current;
190
+ }
191
+ else {
192
+ const inheritanceChain = (0, inheritance_chain_1.createInheritanceChain)(repository, current);
193
+ return Object.assign(Object.assign({}, current), { inheritanceChain });
194
+ }
195
+ }
159
196
  function getParents(extendedNamesExtractor, current, repository) {
160
197
  return (0, function_1.pipe)(extendedNamesExtractor(current), (interfaces) => interfaces.map((interfaceName) => repository.find((type) => type.name === interfaceName)), (interfaces = []) => interfaces.filter((type) => type !== undefined), (interfaces) => interfaces.reduce((acc, current) => [...acc, ...getParents(extendedNamesExtractor, current, repository)], interfaces));
161
198
  }
@@ -198,6 +235,7 @@ function linkFromTypeNameGenerator(typeBeingDocumented, repository, referenceNam
198
235
  }
199
236
  const [fullClassName, fileLink] = getFileLinkTuple(typeBeingDocumented, type, config);
200
237
  return {
238
+ __type: 'link',
201
239
  title: fullClassName,
202
240
  url: fileLink,
203
241
  };
@@ -210,14 +248,31 @@ function getFileLinkTuple(typeBeingDocumented, referencedType, config) {
210
248
  const fullClassName = `${namespacePrefix}${referencedType.name}`;
211
249
  return [fullClassName, `${directoryRoot}${fullClassName}.md`];
212
250
  }
213
- function getLinkFromRoot(config, type) {
251
+ function getDirectoryFromRoot(config, type) {
214
252
  if (!type) {
215
253
  return '';
216
254
  }
217
- const namespacePrefix = config.namespace ? `${config.namespace}./` : '';
255
+ return `./${getSanitizedGroup(type, config)}`;
256
+ }
257
+ function getPossibleLinkFromRoot(config, fallback, type) {
258
+ if (!type) {
259
+ return fallback;
260
+ }
261
+ const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
262
+ const title = `${namespacePrefix}${type.name}`;
263
+ return {
264
+ __type: 'link',
265
+ title: title,
266
+ url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
267
+ };
268
+ }
269
+ function getLinkFromRoot(config, type) {
270
+ const namespacePrefix = config.namespace ? `${config.namespace}.` : '';
271
+ const title = `${namespacePrefix}${type.name}`;
218
272
  return {
219
- title: `${namespacePrefix}${type.name}`,
220
- url: `./${namespacePrefix}${getSanitizedGroup(type, config)}/${type.name}.md`,
273
+ __type: 'link',
274
+ title: title,
275
+ url: `${getDirectoryFromRoot(config, type)}/${title}.md`,
221
276
  };
222
277
  }
223
278
  function getDirectoryRoot(typeBeingDocumented, referencedType, config) {