@cparra/apexdocs 2.24.0 → 2.25.0-alpha.1

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 (375) hide show
  1. package/.github/workflows/ci.yaml +22 -0
  2. package/.github/workflows/close_stale.yml +22 -22
  3. package/.prettierrc.js +7 -7
  4. package/LICENSE +21 -21
  5. package/README.md +742 -718
  6. package/__mocks__/chalk.js +12 -0
  7. package/__mocks__/log-update.js +6 -0
  8. package/apexdocs.config.ts +13 -13
  9. package/docs/{README.md → __old/README.md} +1 -1
  10. package/docs/{restapi.json → __old/restapi.json} +589 -589
  11. package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
  12. package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
  13. package/eslint.config.mjs +10 -0
  14. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  15. package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
  16. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  17. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  18. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  19. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  20. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  21. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  22. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  23. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  24. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  25. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  26. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  27. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  28. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  29. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  30. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  31. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  32. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  33. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  34. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  35. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  36. package/examples/includes/header.md +3 -3
  37. package/examples/plain-markdown/.forceignore +12 -0
  38. package/examples/plain-markdown/config/project-scratch-def.json +5 -0
  39. package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +16 -0
  40. package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +15 -0
  41. package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +8 -0
  42. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +7 -0
  43. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +115 -0
  44. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +36 -0
  45. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +173 -0
  46. package/examples/plain-markdown/docs/index.md +36 -0
  47. package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
  48. package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
  49. package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
  50. package/examples/plain-markdown/force-app/classes/SampleClass.cls +72 -0
  51. package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
  52. package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
  53. package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
  54. package/examples/plain-markdown/package-lock.json +665 -0
  55. package/examples/plain-markdown/package.json +20 -0
  56. package/examples/plain-markdown/sfdx-project.json +12 -0
  57. package/examples/plain-markdown/template.md +3 -0
  58. package/jest.config.js +9 -5
  59. package/jest.d.ts +7 -0
  60. package/lib/__spec__/core/expect-extensions.d.ts +3 -0
  61. package/lib/__spec__/core/expect-extensions.js +54 -0
  62. package/lib/__spec__/core/expect-extensions.js.map +1 -0
  63. package/lib/__spec__/core/generating-class-docs.spec.d.ts +1 -0
  64. package/lib/__spec__/core/generating-class-docs.spec.js +427 -0
  65. package/lib/__spec__/core/generating-class-docs.spec.js.map +1 -0
  66. package/lib/__spec__/core/generating-enum-docs.spec.d.ts +1 -0
  67. package/lib/__spec__/core/generating-enum-docs.spec.js +303 -0
  68. package/lib/__spec__/core/generating-enum-docs.spec.js.map +1 -0
  69. package/lib/__spec__/core/generating-interface-docs.spec.d.ts +1 -0
  70. package/lib/__spec__/core/generating-interface-docs.spec.js +361 -0
  71. package/lib/__spec__/core/generating-interface-docs.spec.js.map +1 -0
  72. package/lib/__spec__/core/generating-reference-guide.spec.d.ts +1 -0
  73. package/lib/__spec__/core/generating-reference-guide.spec.js +161 -0
  74. package/lib/__spec__/core/generating-reference-guide.spec.js.map +1 -0
  75. package/lib/adapters/apex-types.d.ts +7 -0
  76. package/lib/adapters/apex-types.js +112 -0
  77. package/lib/adapters/apex-types.js.map +1 -0
  78. package/lib/adapters/documentables.d.ts +7 -0
  79. package/lib/adapters/documentables.js +56 -0
  80. package/lib/adapters/documentables.js.map +1 -0
  81. package/lib/adapters/fields-and-properties.d.ts +4 -0
  82. package/lib/adapters/fields-and-properties.js +32 -0
  83. package/lib/adapters/fields-and-properties.js.map +1 -0
  84. package/lib/adapters/methods-and-constructors.d.ts +5 -0
  85. package/lib/adapters/methods-and-constructors.js +92 -0
  86. package/lib/adapters/methods-and-constructors.js.map +1 -0
  87. package/lib/adapters/references.d.ts +5 -0
  88. package/lib/adapters/references.js +82 -0
  89. package/lib/adapters/references.js.map +1 -0
  90. package/lib/adapters/type-utils.d.ts +2 -0
  91. package/lib/adapters/type-utils.js +7 -0
  92. package/lib/adapters/type-utils.js.map +1 -0
  93. package/lib/application/Apexdocs.d.ts +13 -13
  94. package/lib/application/Apexdocs.js +79 -76
  95. package/lib/application/Apexdocs.js.map +1 -1
  96. package/lib/cli/generate.d.ts +2 -2
  97. package/lib/cli/generate.js +156 -130
  98. package/lib/cli/generate.js.map +1 -1
  99. package/lib/core/generate-docs.d.ts +23 -0
  100. package/lib/core/generate-docs.js +241 -0
  101. package/lib/core/generate-docs.js.map +1 -0
  102. package/lib/core/template.d.ts +10 -0
  103. package/lib/core/template.js +92 -0
  104. package/lib/core/template.js.map +1 -0
  105. package/lib/core/templates/reference-guide.d.ts +1 -0
  106. package/lib/core/templates/reference-guide.js +18 -0
  107. package/lib/core/templates/reference-guide.js.map +1 -0
  108. package/lib/index.d.ts +2 -1
  109. package/lib/index.js +28 -17
  110. package/lib/index.js.map +1 -1
  111. package/lib/model/apex-bundle.d.ts +6 -6
  112. package/lib/model/apex-bundle.js +10 -10
  113. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  114. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  115. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  116. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  117. package/lib/model/inheritance.d.ts +8 -8
  118. package/lib/model/inheritance.js +2 -2
  119. package/lib/model/manifest.d.ts +22 -22
  120. package/lib/model/manifest.js +52 -46
  121. package/lib/model/manifest.js.map +1 -1
  122. package/lib/model/markdown-file.d.ts +16 -16
  123. package/lib/model/markdown-file.js +110 -106
  124. package/lib/model/markdown-file.js.map +1 -1
  125. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  126. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +45 -43
  127. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  128. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  129. package/lib/model/markdown-generation-util/field-declaration-util.js +53 -54
  130. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
  131. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  132. package/lib/model/markdown-generation-util/index.js +19 -19
  133. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  134. package/lib/model/markdown-generation-util/method-declaration-util.js +113 -114
  135. package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
  136. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  137. package/lib/model/markdown-generation-util/type-declaration-util.js +80 -81
  138. package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
  139. package/lib/model/markdown-home-file.d.ts +11 -11
  140. package/lib/model/markdown-home-file.js +56 -53
  141. package/lib/model/markdown-home-file.js.map +1 -1
  142. package/lib/model/markdown-type-file.d.ts +26 -26
  143. package/lib/model/markdown-type-file.js +136 -133
  144. package/lib/model/markdown-type-file.js.map +1 -1
  145. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  146. package/lib/model/openapi/apex-doc-types.js +4 -4
  147. package/lib/model/openapi/open-api-types.d.ts +93 -93
  148. package/lib/model/openapi/open-api-types.js +2 -2
  149. package/lib/model/openapi/open-api.d.ts +16 -16
  150. package/lib/model/openapi/open-api.js +33 -33
  151. package/lib/model/openapi/open-api.js.map +1 -1
  152. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  153. package/lib/model/openapi/openapi-type-file.js +16 -16
  154. package/lib/model/outputFile.d.ts +10 -10
  155. package/lib/model/outputFile.js +21 -28
  156. package/lib/model/outputFile.js.map +1 -1
  157. package/lib/model/types-repository.d.ts +16 -16
  158. package/lib/model/types-repository.js +53 -53
  159. package/lib/model/types-repository.js.map +1 -1
  160. package/lib/service/apex-file-reader.d.ts +14 -14
  161. package/lib/service/apex-file-reader.js +48 -45
  162. package/lib/service/apex-file-reader.js.map +1 -1
  163. package/lib/service/file-system.d.ts +14 -14
  164. package/lib/service/file-system.js +47 -24
  165. package/lib/service/file-system.js.map +1 -1
  166. package/lib/service/file-writer.d.ts +6 -6
  167. package/lib/service/file-writer.js +56 -33
  168. package/lib/service/file-writer.js.map +1 -1
  169. package/lib/service/manifest-factory.d.ts +10 -10
  170. package/lib/service/manifest-factory.js +15 -13
  171. package/lib/service/manifest-factory.js.map +1 -1
  172. package/lib/service/metadata-processor.d.ts +3 -3
  173. package/lib/service/metadata-processor.js +16 -16
  174. package/lib/service/metadata-processor.js.map +1 -1
  175. package/lib/service/parser.d.ts +21 -21
  176. package/lib/service/parser.js +137 -134
  177. package/lib/service/parser.js.map +1 -1
  178. package/lib/service/state.d.ts +9 -9
  179. package/lib/service/state.js +19 -19
  180. package/lib/service/state.js.map +1 -1
  181. package/lib/service/walkers/class-walker.d.ts +4 -4
  182. package/lib/service/walkers/class-walker.js +32 -32
  183. package/lib/service/walkers/class-walker.js.map +1 -1
  184. package/lib/service/walkers/enum-walker.d.ts +4 -4
  185. package/lib/service/walkers/enum-walker.js +10 -10
  186. package/lib/service/walkers/interface-walker.d.ts +4 -4
  187. package/lib/service/walkers/interface-walker.js +14 -14
  188. package/lib/service/walkers/interface-walker.js.map +1 -1
  189. package/lib/service/walkers/walker-factory.d.ts +5 -5
  190. package/lib/service/walkers/walker-factory.js +20 -20
  191. package/lib/service/walkers/walker-factory.js.map +1 -1
  192. package/lib/service/walkers/walker.d.ts +19 -19
  193. package/lib/service/walkers/walker.js +16 -16
  194. package/lib/service/walkers/walker.js.map +1 -1
  195. package/lib/settings.d.ts +64 -64
  196. package/lib/settings.js +88 -88
  197. package/lib/settings.js.map +1 -1
  198. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  199. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  200. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  201. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  202. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  203. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  204. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  205. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  206. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  207. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  208. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
  209. package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
  210. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
  211. package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
  212. package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
  213. package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
  214. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  215. package/lib/test-helpers/SettingsBuilder.js +26 -26
  216. package/lib/transpiler/factory.d.ts +6 -6
  217. package/lib/transpiler/factory.js +34 -31
  218. package/lib/transpiler/factory.js.map +1 -1
  219. package/lib/transpiler/file-container.d.ts +6 -6
  220. package/lib/transpiler/file-container.js +15 -15
  221. package/lib/transpiler/generator-choices.d.ts +1 -1
  222. package/lib/transpiler/generator-choices.js +2 -2
  223. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
  224. package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
  225. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  226. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  227. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  228. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
  229. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
  230. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
  231. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  232. package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
  233. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
  234. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
  235. package/lib/transpiler/markdown/plain-markdown/class-template.js +77 -0
  236. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
  237. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
  238. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +36 -0
  239. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
  240. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
  241. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +28 -0
  242. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
  243. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
  244. package/lib/transpiler/markdown/plain-markdown/enum-template.js +16 -0
  245. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
  246. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
  247. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +27 -0
  248. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
  249. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +1 -0
  250. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +10 -0
  251. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +1 -0
  252. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
  253. package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
  254. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
  255. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
  256. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +47 -0
  257. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
  258. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +9 -6
  259. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +41 -13
  260. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  261. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +1 -0
  262. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +31 -0
  263. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +1 -0
  264. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  265. package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
  266. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  267. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  268. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  269. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  270. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  271. package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
  272. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  273. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  274. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  275. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  276. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +249 -225
  277. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  278. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  279. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  280. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  281. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  282. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -1
  283. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  284. package/lib/transpiler/processor-type-transpiler.js +8 -8
  285. package/lib/transpiler/transpiler.d.ts +5 -5
  286. package/lib/transpiler/transpiler.js +29 -26
  287. package/lib/transpiler/transpiler.js.map +1 -1
  288. package/lib/util/error-logger.d.ts +8 -8
  289. package/lib/util/error-logger.js +89 -89
  290. package/lib/util/error-logger.js.map +1 -1
  291. package/lib/util/logger.d.ts +21 -21
  292. package/lib/util/logger.js +60 -57
  293. package/lib/util/logger.js.map +1 -1
  294. package/lib/util/string-utils.d.ts +2 -2
  295. package/lib/util/string-utils.js +14 -14
  296. package/lib/util/string-utils.js.map +1 -1
  297. package/package.json +79 -78
  298. package/src/__spec__/core/expect-extensions.ts +32 -0
  299. package/src/__spec__/core/generating-class-docs.spec.ts +511 -0
  300. package/src/__spec__/core/generating-enum-docs.spec.ts +355 -0
  301. package/src/__spec__/core/generating-interface-docs.spec.ts +431 -0
  302. package/src/__spec__/core/generating-reference-guide.spec.ts +163 -0
  303. package/src/adapters/__tests__/interface-adapter.spec.ts +80 -0
  304. package/src/adapters/__tests__/references.spec.ts +115 -0
  305. package/src/adapters/apex-types.ts +224 -0
  306. package/src/adapters/documentables.ts +93 -0
  307. package/src/adapters/fields-and-properties.ts +38 -0
  308. package/src/adapters/methods-and-constructors.ts +117 -0
  309. package/src/adapters/references.ts +113 -0
  310. package/src/adapters/type-utils.ts +5 -0
  311. package/src/adapters/types.d.ts +8 -0
  312. package/src/cli/generate.ts +96 -93
  313. package/src/core/generate-docs.ts +357 -0
  314. package/src/core/renderable/types.d.ts +131 -0
  315. package/src/core/template.ts +108 -0
  316. package/src/core/templates/reference-guide.ts +14 -0
  317. package/src/index.ts +3 -1
  318. package/src/model/__tests__/manifest.spec.ts +1 -0
  319. package/src/model/manifest.ts +15 -5
  320. package/src/model/markdown-file.ts +6 -5
  321. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +1 -1
  322. package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
  323. package/src/model/openapi/open-api-types.ts +2 -2
  324. package/src/model/outputFile.ts +2 -11
  325. package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
  326. package/src/service/__tests__/manifest-factory.spec.ts +1 -2
  327. package/src/service/parser.ts +1 -1
  328. package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
  329. package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
  330. package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
  331. package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
  332. package/src/transpiler/markdown/plain-markdown/class-template.ts +73 -0
  333. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +32 -0
  334. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +24 -0
  335. package/src/transpiler/markdown/plain-markdown/enum-template.ts +12 -0
  336. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +23 -0
  337. package/src/transpiler/markdown/plain-markdown/grouped-members-partial-template.ts +6 -0
  338. package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
  339. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +43 -0
  340. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +30 -0
  341. package/src/transpiler/markdown/plain-markdown/type-doc-partial.ts +27 -0
  342. package/src/transpiler/openapi/parsers/Builder.ts +1 -1
  343. package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
  344. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +4 -3
  345. package/src/util/error-logger.ts +4 -4
  346. package/src/util/logger.ts +3 -3
  347. package/tsconfig.json +21 -20
  348. package/tslint.json +5 -5
  349. package/.eslintrc.js +0 -12
  350. package/lib/model/manifest-diff.d.ts +0 -27
  351. package/lib/model/manifest-diff.js +0 -69
  352. package/lib/model/manifest-diff.js.map +0 -1
  353. package/src/model/__tests__/manifest-diff.spec.ts +0 -139
  354. package/src/model/manifest-diff.ts +0 -94
  355. /package/docs/{index.html → __old/index.html} +0 -0
  356. /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
  357. /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
  358. /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
  359. /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
  360. /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
  361. /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
  362. /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
  363. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
  364. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
  365. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
  366. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
  367. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
  368. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
  369. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
  370. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
  371. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
  372. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
  373. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
  374. /package/docs/{types → __old/types}/README.md +0 -0
  375. /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
@@ -1,39 +1,39 @@
1
- import { ReferenceObject, SchemaObject, SchemaObjectArray, SchemaObjectObject } from '../../../model/openapi/open-api-types';
2
- import { ReferencedType } from '@cparra/apex-reflection';
3
- export declare class ReferenceBuilder {
4
- build(referencedTypeName: string): Reference;
5
- /**
6
- * Returns a tuple where the first value is the name of the reference without any collection related values
7
- * and the second is a boolean representing if we are dealing with a collection or not.
8
- * @param referencedTypeName The received raw type name.
9
- * @private
10
- */
11
- private handlePossibleCollectionReference;
12
- private buildReferenceFromType;
13
- private handleOverriddenSchema;
14
- private getReferenceName;
15
- private buildMainReferenceComponent;
16
- getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair;
17
- private buildCollectionPair;
18
- private isReferenceString;
19
- }
20
- type SchemaObjectReferencePair = {
21
- schema: SchemaObject;
22
- referenceComponents: ReferenceComponent[];
23
- };
24
- /**
25
- * In case where the Request Body contains a reference, this contains information about the handled reference
26
- */
27
- export type Reference = {
28
- /** OpenApi style reference object for the parent caller */
29
- entrypointReferenceObject: ReferenceObject;
30
- /** List of objects that contain all component references identified by a call to this builder **/
31
- referenceComponents: ReferenceComponent[];
32
- };
33
- export type ReferenceComponent = {
34
- /** Name of the class being referenced */
35
- referencedClass: string;
36
- /** Parsed representation of the referenced object as an OpenApi Schema object */
37
- schema: SchemaObjectObject | SchemaObjectArray;
38
- };
39
- export {};
1
+ import { ReferenceObject, SchemaObject, SchemaObjectArray, SchemaObjectObject } from '../../../model/openapi/open-api-types';
2
+ import { ReferencedType } from '@cparra/apex-reflection';
3
+ export declare class ReferenceBuilder {
4
+ build(referencedTypeName: string): Reference;
5
+ /**
6
+ * Returns a tuple where the first value is the name of the reference without any collection related values
7
+ * and the second is a boolean representing if we are dealing with a collection or not.
8
+ * @param referencedTypeName The received raw type name.
9
+ * @private
10
+ */
11
+ private handlePossibleCollectionReference;
12
+ private buildReferenceFromType;
13
+ private handleOverriddenSchema;
14
+ private getReferenceName;
15
+ private buildMainReferenceComponent;
16
+ getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair;
17
+ private buildCollectionPair;
18
+ private isReferenceString;
19
+ }
20
+ type SchemaObjectReferencePair = {
21
+ schema: SchemaObject;
22
+ referenceComponents: ReferenceComponent[];
23
+ };
24
+ /**
25
+ * In case where the Request Body contains a reference, this contains information about the handled reference
26
+ */
27
+ export type Reference = {
28
+ /** OpenApi style reference object for the parent caller */
29
+ entrypointReferenceObject: ReferenceObject;
30
+ /** List of objects that contain all component references identified by a call to this builder **/
31
+ referenceComponents: ReferenceComponent[];
32
+ };
33
+ export type ReferenceComponent = {
34
+ /** Name of the class being referenced */
35
+ referencedClass: string;
36
+ /** Parsed representation of the referenced object as an OpenApi Schema object */
37
+ schema: SchemaObjectObject | SchemaObjectArray;
38
+ };
39
+ export {};
@@ -1,226 +1,250 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReferenceBuilder = void 0;
4
- const yaml = require("js-yaml");
5
- const types_repository_1 = require("../../../model/types-repository");
6
- class ReferenceBuilder {
7
- constructor() {
8
- this.isReferenceString = (targetObject) => {
9
- return typeof targetObject === 'string' || targetObject instanceof String;
10
- };
11
- }
12
- build(referencedTypeName) {
13
- const originalTypeName = referencedTypeName;
14
- // Checking for inline overrides of the type: [memberName:ClassOverrideName]
15
- const regexForSchemaOverrides = /\[(.*?)]/g;
16
- const schemaOverrides = referencedTypeName.match(regexForSchemaOverrides);
17
- let referenceOverrides = [];
18
- if (schemaOverrides && schemaOverrides.length > 0) {
19
- referenceOverrides = ReferenceOverrides.build(schemaOverrides[0]);
20
- referencedTypeName = referencedTypeName.replace(regexForSchemaOverrides, '');
21
- }
22
- const [parsedReferencedType, isCollection] = this.handlePossibleCollectionReference(referencedTypeName);
23
- const referencedTypeBundle = types_repository_1.TypesRepository.getInstance().getFromAllByName(parsedReferencedType);
24
- if (!referencedTypeBundle) {
25
- throw new Error(`The referenced type ${referencedTypeName} was not found.`);
26
- }
27
- if (referencedTypeBundle.type.type_name !== 'class') {
28
- throw new Error(`Expected the referenced type to be a class, but found a ${referencedTypeBundle.type.type_name}.`);
29
- }
30
- const typeBundleWithIsCollection = Object.assign(Object.assign({}, referencedTypeBundle), { originalTypeName: originalTypeName, isCollection: isCollection, referenceOverrides: referenceOverrides });
31
- return this.buildReferenceFromType(typeBundleWithIsCollection);
32
- }
33
- /**
34
- * Returns a tuple where the first value is the name of the reference without any collection related values
35
- * and the second is a boolean representing if we are dealing with a collection or not.
36
- * @param referencedTypeName The received raw type name.
37
- * @private
38
- */
39
- handlePossibleCollectionReference(referencedTypeName) {
40
- referencedTypeName = referencedTypeName.toLowerCase();
41
- if (referencedTypeName.startsWith('list<') && referencedTypeName.endsWith('>')) {
42
- referencedTypeName = referencedTypeName.replace('list<', '');
43
- referencedTypeName = referencedTypeName.replace('>', '');
44
- return [referencedTypeName, true];
45
- }
46
- if (referencedTypeName.startsWith('set<') && referencedTypeName.endsWith('>')) {
47
- referencedTypeName = referencedTypeName.replace('set<', '');
48
- referencedTypeName = referencedTypeName.replace('>', '');
49
- return [referencedTypeName, true];
50
- }
51
- return [referencedTypeName, false];
52
- }
53
- buildReferenceFromType(typeBundle) {
54
- // Filtering based on Salesforce's documentation:
55
- // https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm#ApexRESTUserDefinedTypes
56
- // We assume that the class only contains object types allowed by Apex Rest:
57
- // "Note that the public, private, or global class member variables must be types allowed by Apex REST"
58
- const propertiesAndFields = [
59
- ...typeBundle.type.properties,
60
- ...typeBundle.type.fields,
61
- ]
62
- .filter((current) => !current.memberModifiers.includes('static'))
63
- .filter((current) => !current.memberModifiers.includes('transient'));
64
- const properties = {};
65
- let referencedComponents = [];
66
- propertiesAndFields.forEach((current) => {
67
- var _a, _b;
68
- // Check if there are reference overrides for the current property, this takes priority over anything else.
69
- const referenceOverride = typeBundle.referenceOverrides.find((currentOverride) => {
70
- return currentOverride.propertyName.toLowerCase() === current.name.toLowerCase();
71
- });
72
- if (referenceOverride) {
73
- const reference = this.build(referenceOverride.referenceName);
74
- properties[current.name] = reference.entrypointReferenceObject;
75
- reference.referenceComponents.forEach((current) => referencedComponents.push(current));
76
- }
77
- else {
78
- // Check for "@http-schema" annotations within properties themselves. If these are specified they
79
- // take precedence over the property type itself.
80
- const manuallyDefinedHttpSchema = (_a = current.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'http-schema');
81
- if (manuallyDefinedHttpSchema) {
82
- this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
83
- }
84
- else {
85
- const pair = this.getReferenceType(current.typeReference);
86
- properties[current.name] = pair.schema;
87
- referencedComponents.push(...pair.referenceComponents);
88
- }
89
- }
90
- properties[current.name].description = (_b = current.docComment) === null || _b === void 0 ? void 0 : _b.description;
91
- });
92
- const mainReferenceComponents = this.buildMainReferenceComponent(typeBundle, properties);
93
- // Make sure to add the "main" reference first
94
- referencedComponents = [...mainReferenceComponents, ...referencedComponents];
95
- return {
96
- entrypointReferenceObject: {
97
- $ref: `#/components/schemas/${this.getReferenceName(typeBundle)}`,
98
- },
99
- referenceComponents: referencedComponents,
100
- };
101
- }
102
- handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents) {
103
- // This can be of type ApexDocSchemaObject
104
- const inYaml = manuallyDefinedHttpSchema === null || manuallyDefinedHttpSchema === void 0 ? void 0 : manuallyDefinedHttpSchema.bodyLines.reduce((prev, current, _) => prev + '\n' + current);
105
- const asJson = yaml.load(inYaml);
106
- const isReferenceString = this.isReferenceString(asJson);
107
- if (isReferenceString) {
108
- const reference = this.build(asJson);
109
- properties[current.name] = reference.entrypointReferenceObject;
110
- reference.referenceComponents.forEach((current) => referencedComponents.push(current));
111
- }
112
- else {
113
- // If we are dealing with a manually defined schema object, we can add it directly to the "properties" map,
114
- // because we don't need to add a reference component.
115
- properties[current.name] = asJson;
116
- }
117
- }
118
- getReferenceName(typeBundle) {
119
- var _a;
120
- let referenceName = typeBundle.type.name;
121
- if (typeBundle.isChild) {
122
- referenceName = `${(_a = typeBundle.parentType) === null || _a === void 0 ? void 0 : _a.name}.${typeBundle.type.name}`;
123
- }
124
- if (typeBundle.isCollection) {
125
- referenceName = `${referenceName}_array`;
126
- }
127
- if (typeBundle.referenceOverrides.length) {
128
- referenceName = `${referenceName}_${typeBundle.originalTypeName}`;
129
- }
130
- return referenceName;
131
- }
132
- buildMainReferenceComponent(typeBundle, properties) {
133
- // For the main reference, we always want to get the reference of the object without the collection part,
134
- // so we pass the typeBundle to `getReferenceName` but with the isCollection flag set to false.
135
- const mainReferenceName = this.getReferenceName(Object.assign(Object.assign({}, typeBundle), { isCollection: false }));
136
- const mainReference = {
137
- referencedClass: mainReferenceName,
138
- schema: {
139
- type: 'object',
140
- properties: properties,
141
- },
142
- };
143
- const referencedComponents = [mainReference];
144
- if (!typeBundle.isCollection) {
145
- return referencedComponents;
146
- }
147
- return [
148
- {
149
- referencedClass: this.getReferenceName(typeBundle),
150
- schema: {
151
- type: 'array',
152
- items: {
153
- $ref: `#/components/schemas/${mainReferenceName}`,
154
- },
155
- },
156
- },
157
- ...referencedComponents,
158
- ];
159
- }
160
- getReferenceType(typeInMirror) {
161
- // Returns a valid type supported by OpenApi from a received Apex type.
162
- const typeName = typeInMirror.type.toLowerCase();
163
- switch (typeName) {
164
- case 'boolean':
165
- return { schema: { type: 'boolean' }, referenceComponents: [] };
166
- case 'date':
167
- return { schema: { type: 'string', format: 'date' }, referenceComponents: [] };
168
- case 'datetime':
169
- return { schema: { type: 'string', format: 'date-time' }, referenceComponents: [] };
170
- case 'decimal':
171
- return { schema: { type: 'number' }, referenceComponents: [] };
172
- case 'double':
173
- return { schema: { type: 'number' }, referenceComponents: [] };
174
- case 'id':
175
- return { schema: { type: 'string' }, referenceComponents: [] };
176
- case 'integer':
177
- return { schema: { type: 'integer' }, referenceComponents: [] };
178
- case 'long':
179
- return { schema: { type: 'integer', format: 'int64' }, referenceComponents: [] };
180
- case 'string':
181
- return { schema: { type: 'string' }, referenceComponents: [] };
182
- case 'time':
183
- return { schema: { type: 'string', format: 'time' }, referenceComponents: [] };
184
- case 'list':
185
- return this.buildCollectionPair(typeInMirror);
186
- case 'set':
187
- return this.buildCollectionPair(typeInMirror);
188
- case 'map':
189
- // For Maps, we treat them as objects but do not try to define their shape, because their keys can vary
190
- // at runtime.
191
- return { schema: { type: 'object' }, referenceComponents: [] };
192
- case 'object':
193
- return { schema: { type: 'object' }, referenceComponents: [] };
194
- default:
195
- // If we got here we are dealing with a non-primitive (most likely a custom class or an SObject).
196
- const referencedType = types_repository_1.TypesRepository.getInstance().getFromAllByName(typeName);
197
- if (!referencedType) {
198
- return { schema: { type: 'object' }, referenceComponents: [] };
199
- }
200
- const reference = this.buildReferenceFromType(Object.assign(Object.assign({}, referencedType), { isCollection: false, referenceOverrides: [], originalTypeName: typeName }));
201
- return {
202
- schema: reference.entrypointReferenceObject,
203
- referenceComponents: [...reference.referenceComponents],
204
- };
205
- }
206
- }
207
- buildCollectionPair(typeInMirror) {
208
- const innerReference = this.getReferenceType(typeInMirror.ofType);
209
- return {
210
- schema: { type: 'array', items: innerReference.schema },
211
- referenceComponents: [...innerReference.referenceComponents],
212
- };
213
- }
214
- }
215
- exports.ReferenceBuilder = ReferenceBuilder;
216
- class ReferenceOverrides {
217
- static build(referenceAsString) {
218
- const cleanedUpReference = referenceAsString.replace(/[\[\]]/g, '');
219
- const referenceStrings = cleanedUpReference.split(',').map((item) => item.replace(/\s/g, ''));
220
- return referenceStrings.map((item) => {
221
- const [propertyName, referenceName] = item.split(':');
222
- return { propertyName, referenceName };
223
- });
224
- }
225
- }
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.ReferenceBuilder = void 0;
27
+ const yaml = __importStar(require("js-yaml"));
28
+ const types_repository_1 = require("../../../model/types-repository");
29
+ class ReferenceBuilder {
30
+ constructor() {
31
+ this.isReferenceString = (targetObject) => {
32
+ return typeof targetObject === 'string' || targetObject instanceof String;
33
+ };
34
+ }
35
+ build(referencedTypeName) {
36
+ const originalTypeName = referencedTypeName;
37
+ // Checking for inline overrides of the type: [memberName:ClassOverrideName]
38
+ const regexForSchemaOverrides = /\[(.*?)]/g;
39
+ const schemaOverrides = referencedTypeName.match(regexForSchemaOverrides);
40
+ let referenceOverrides = [];
41
+ if (schemaOverrides && schemaOverrides.length > 0) {
42
+ referenceOverrides = ReferenceOverrides.build(schemaOverrides[0]);
43
+ referencedTypeName = referencedTypeName.replace(regexForSchemaOverrides, '');
44
+ }
45
+ const [parsedReferencedType, isCollection] = this.handlePossibleCollectionReference(referencedTypeName);
46
+ const referencedTypeBundle = types_repository_1.TypesRepository.getInstance().getFromAllByName(parsedReferencedType);
47
+ if (!referencedTypeBundle) {
48
+ throw new Error(`The referenced type ${referencedTypeName} was not found.`);
49
+ }
50
+ if (referencedTypeBundle.type.type_name !== 'class') {
51
+ throw new Error(`Expected the referenced type to be a class, but found a ${referencedTypeBundle.type.type_name}.`);
52
+ }
53
+ const typeBundleWithIsCollection = Object.assign(Object.assign({}, referencedTypeBundle), { originalTypeName: originalTypeName, isCollection: isCollection, referenceOverrides: referenceOverrides });
54
+ return this.buildReferenceFromType(typeBundleWithIsCollection);
55
+ }
56
+ /**
57
+ * Returns a tuple where the first value is the name of the reference without any collection related values
58
+ * and the second is a boolean representing if we are dealing with a collection or not.
59
+ * @param referencedTypeName The received raw type name.
60
+ * @private
61
+ */
62
+ handlePossibleCollectionReference(referencedTypeName) {
63
+ referencedTypeName = referencedTypeName.toLowerCase();
64
+ if (referencedTypeName.startsWith('list<') && referencedTypeName.endsWith('>')) {
65
+ referencedTypeName = referencedTypeName.replace('list<', '');
66
+ referencedTypeName = referencedTypeName.replace('>', '');
67
+ return [referencedTypeName, true];
68
+ }
69
+ if (referencedTypeName.startsWith('set<') && referencedTypeName.endsWith('>')) {
70
+ referencedTypeName = referencedTypeName.replace('set<', '');
71
+ referencedTypeName = referencedTypeName.replace('>', '');
72
+ return [referencedTypeName, true];
73
+ }
74
+ return [referencedTypeName, false];
75
+ }
76
+ buildReferenceFromType(typeBundle) {
77
+ // Filtering based on Salesforce's documentation:
78
+ // https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm#ApexRESTUserDefinedTypes
79
+ // We assume that the class only contains object types allowed by Apex Rest:
80
+ // "Note that the public, private, or global class member variables must be types allowed by Apex REST"
81
+ const propertiesAndFields = [
82
+ ...typeBundle.type.properties,
83
+ ...typeBundle.type.fields,
84
+ ]
85
+ .filter((current) => !current.memberModifiers.includes('static'))
86
+ .filter((current) => !current.memberModifiers.includes('transient'));
87
+ const properties = {};
88
+ let referencedComponents = [];
89
+ propertiesAndFields.forEach((current) => {
90
+ var _a, _b;
91
+ // Check if there are reference overrides for the current property, this takes priority over anything else.
92
+ const referenceOverride = typeBundle.referenceOverrides.find((currentOverride) => {
93
+ return currentOverride.propertyName.toLowerCase() === current.name.toLowerCase();
94
+ });
95
+ if (referenceOverride) {
96
+ const reference = this.build(referenceOverride.referenceName);
97
+ properties[current.name] = reference.entrypointReferenceObject;
98
+ reference.referenceComponents.forEach((current) => referencedComponents.push(current));
99
+ }
100
+ else {
101
+ // Check for "@http-schema" annotations within properties themselves. If these are specified they
102
+ // take precedence over the property type itself.
103
+ const manuallyDefinedHttpSchema = (_a = current.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'http-schema');
104
+ if (manuallyDefinedHttpSchema) {
105
+ this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
106
+ }
107
+ else {
108
+ const pair = this.getReferenceType(current.typeReference);
109
+ properties[current.name] = pair.schema;
110
+ referencedComponents.push(...pair.referenceComponents);
111
+ }
112
+ }
113
+ properties[current.name].description = (_b = current.docComment) === null || _b === void 0 ? void 0 : _b.description;
114
+ });
115
+ const mainReferenceComponents = this.buildMainReferenceComponent(typeBundle, properties);
116
+ // Make sure to add the "main" reference first
117
+ referencedComponents = [...mainReferenceComponents, ...referencedComponents];
118
+ return {
119
+ entrypointReferenceObject: {
120
+ $ref: `#/components/schemas/${this.getReferenceName(typeBundle)}`,
121
+ },
122
+ referenceComponents: referencedComponents,
123
+ };
124
+ }
125
+ handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents) {
126
+ // This can be of type ApexDocSchemaObject
127
+ const inYaml = manuallyDefinedHttpSchema === null || manuallyDefinedHttpSchema === void 0 ? void 0 : manuallyDefinedHttpSchema.bodyLines.reduce((prev, current) => prev + '\n' + current);
128
+ const asJson = yaml.load(inYaml);
129
+ const isReferenceString = this.isReferenceString(asJson);
130
+ if (isReferenceString) {
131
+ const reference = this.build(asJson);
132
+ properties[current.name] = reference.entrypointReferenceObject;
133
+ reference.referenceComponents.forEach((current) => referencedComponents.push(current));
134
+ }
135
+ else {
136
+ // If we are dealing with a manually defined schema object, we can add it directly to the "properties" map,
137
+ // because we don't need to add a reference component.
138
+ properties[current.name] = asJson;
139
+ }
140
+ }
141
+ getReferenceName(typeBundle) {
142
+ var _a;
143
+ let referenceName = typeBundle.type.name;
144
+ if (typeBundle.isChild) {
145
+ referenceName = `${(_a = typeBundle.parentType) === null || _a === void 0 ? void 0 : _a.name}.${typeBundle.type.name}`;
146
+ }
147
+ if (typeBundle.isCollection) {
148
+ referenceName = `${referenceName}_array`;
149
+ }
150
+ if (typeBundle.referenceOverrides.length) {
151
+ referenceName = `${referenceName}_${typeBundle.originalTypeName}`;
152
+ }
153
+ return referenceName;
154
+ }
155
+ buildMainReferenceComponent(typeBundle, properties) {
156
+ // For the main reference, we always want to get the reference of the object without the collection part,
157
+ // so we pass the typeBundle to `getReferenceName` but with the isCollection flag set to false.
158
+ const mainReferenceName = this.getReferenceName(Object.assign(Object.assign({}, typeBundle), { isCollection: false }));
159
+ const mainReference = {
160
+ referencedClass: mainReferenceName,
161
+ schema: {
162
+ type: 'object',
163
+ properties: properties,
164
+ },
165
+ };
166
+ const referencedComponents = [mainReference];
167
+ if (!typeBundle.isCollection) {
168
+ return referencedComponents;
169
+ }
170
+ return [
171
+ {
172
+ referencedClass: this.getReferenceName(typeBundle),
173
+ schema: {
174
+ type: 'array',
175
+ items: {
176
+ $ref: `#/components/schemas/${mainReferenceName}`,
177
+ },
178
+ },
179
+ },
180
+ ...referencedComponents,
181
+ ];
182
+ }
183
+ getReferenceType(typeInMirror) {
184
+ // Returns a valid type supported by OpenApi from a received Apex type.
185
+ const typeName = typeInMirror.type.toLowerCase();
186
+ switch (typeName) {
187
+ case 'boolean':
188
+ return { schema: { type: 'boolean' }, referenceComponents: [] };
189
+ case 'date':
190
+ return { schema: { type: 'string', format: 'date' }, referenceComponents: [] };
191
+ case 'datetime':
192
+ return { schema: { type: 'string', format: 'date-time' }, referenceComponents: [] };
193
+ case 'decimal':
194
+ return { schema: { type: 'number' }, referenceComponents: [] };
195
+ case 'double':
196
+ return { schema: { type: 'number' }, referenceComponents: [] };
197
+ case 'id':
198
+ return { schema: { type: 'string' }, referenceComponents: [] };
199
+ case 'integer':
200
+ return { schema: { type: 'integer' }, referenceComponents: [] };
201
+ case 'long':
202
+ return { schema: { type: 'integer', format: 'int64' }, referenceComponents: [] };
203
+ case 'string':
204
+ return { schema: { type: 'string' }, referenceComponents: [] };
205
+ case 'time':
206
+ return { schema: { type: 'string', format: 'time' }, referenceComponents: [] };
207
+ case 'list':
208
+ return this.buildCollectionPair(typeInMirror);
209
+ case 'set':
210
+ return this.buildCollectionPair(typeInMirror);
211
+ case 'map':
212
+ // For Maps, we treat them as objects but do not try to define their shape, because their keys can vary
213
+ // at runtime.
214
+ return { schema: { type: 'object' }, referenceComponents: [] };
215
+ case 'object':
216
+ return { schema: { type: 'object' }, referenceComponents: [] };
217
+ default: {
218
+ // If we got here we are dealing with a non-primitive (most likely a custom class or an SObject).
219
+ const referencedType = types_repository_1.TypesRepository.getInstance().getFromAllByName(typeName);
220
+ if (!referencedType) {
221
+ return { schema: { type: 'object' }, referenceComponents: [] };
222
+ }
223
+ const reference = this.buildReferenceFromType(Object.assign(Object.assign({}, referencedType), { isCollection: false, referenceOverrides: [], originalTypeName: typeName }));
224
+ return {
225
+ schema: reference.entrypointReferenceObject,
226
+ referenceComponents: [...reference.referenceComponents],
227
+ };
228
+ }
229
+ }
230
+ }
231
+ buildCollectionPair(typeInMirror) {
232
+ const innerReference = this.getReferenceType(typeInMirror.ofType);
233
+ return {
234
+ schema: { type: 'array', items: innerReference.schema },
235
+ referenceComponents: [...innerReference.referenceComponents],
236
+ };
237
+ }
238
+ }
239
+ exports.ReferenceBuilder = ReferenceBuilder;
240
+ class ReferenceOverrides {
241
+ static build(referenceAsString) {
242
+ const cleanedUpReference = referenceAsString.replace(/[[\]]/g, '');
243
+ const referenceStrings = cleanedUpReference.split(',').map((item) => item.replace(/\s/g, ''));
244
+ return referenceStrings.map((item) => {
245
+ const [propertyName, referenceName] = item.split(':');
246
+ return { propertyName, referenceName };
247
+ });
248
+ }
249
+ }
226
250
  //# sourceMappingURL=ReferenceBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ReferenceBuilder.ts"],"names":[],"mappings":";;;AAAA,gCAAgC;AAQhC,sEAA8E;AAW9E,MAAa,gBAAgB;IAA7B;QA6OU,sBAAiB,GAAG,CAAC,YAAqB,EAA0B,EAAE;YAC5E,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,YAAY,MAAM,CAAC;QAC5E,CAAC,CAAC;IACJ,CAAC;IA/OC,KAAK,CAAC,kBAA0B;QAC9B,MAAM,gBAAgB,GAAG,kBAAkB,CA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