@cparra/apexdocs 2.24.0 → 2.25.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (317) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.github/workflows/ci.yaml +22 -0
  3. package/.github/workflows/close_stale.yml +22 -22
  4. package/.prettierrc.js +7 -7
  5. package/LICENSE +21 -21
  6. package/README.md +742 -718
  7. package/apexdocs.config.ts +13 -13
  8. package/docs/{README.md → __old/README.md} +1 -1
  9. package/docs/{restapi.json → __old/restapi.json} +589 -589
  10. package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
  11. package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
  12. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  13. package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
  14. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  15. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  16. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  17. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  18. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  19. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  20. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  21. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  22. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  23. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  24. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  25. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  26. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  27. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  28. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  29. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  30. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  31. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  32. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  33. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  34. package/examples/includes/header.md +3 -3
  35. package/examples/plain-markdown/.forceignore +12 -0
  36. package/examples/plain-markdown/README.md +301 -0
  37. package/examples/plain-markdown/config/project-scratch-def.json +5 -0
  38. package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
  39. package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
  40. package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
  41. package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
  42. package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
  43. package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
  44. package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
  45. package/examples/plain-markdown/package-lock.json +665 -0
  46. package/examples/plain-markdown/package.json +24 -0
  47. package/examples/plain-markdown/sfdx-project.json +12 -0
  48. package/examples/plain-markdown/template.md +3 -0
  49. package/jest.config.js +5 -5
  50. package/lib/adapters/apex-types.d.ts +5 -0
  51. package/lib/adapters/apex-types.js +34 -0
  52. package/lib/adapters/apex-types.js.map +1 -0
  53. package/lib/adapters/documentables.d.ts +6 -0
  54. package/lib/adapters/documentables.js +41 -0
  55. package/lib/adapters/documentables.js.map +1 -0
  56. package/lib/adapters/fields-and-properties.d.ts +3 -0
  57. package/lib/adapters/fields-and-properties.js +10 -0
  58. package/lib/adapters/fields-and-properties.js.map +1 -0
  59. package/lib/adapters/methods-and-constructors.d.ts +4 -0
  60. package/lib/adapters/methods-and-constructors.js +49 -0
  61. package/lib/adapters/methods-and-constructors.js.map +1 -0
  62. package/lib/adapters/references.d.ts +5 -0
  63. package/lib/adapters/references.js +82 -0
  64. package/lib/adapters/references.js.map +1 -0
  65. package/lib/adapters/type-utils.d.ts +2 -0
  66. package/lib/adapters/type-utils.js +8 -0
  67. package/lib/adapters/type-utils.js.map +1 -0
  68. package/lib/application/Apexdocs.d.ts +13 -13
  69. package/lib/application/Apexdocs.js +79 -76
  70. package/lib/application/Apexdocs.js.map +1 -1
  71. package/lib/cli/generate.d.ts +2 -2
  72. package/lib/cli/generate.js +156 -130
  73. package/lib/cli/generate.js.map +1 -1
  74. package/lib/index.d.ts +1 -1
  75. package/lib/index.js +17 -17
  76. package/lib/model/apex-bundle.d.ts +6 -6
  77. package/lib/model/apex-bundle.js +10 -10
  78. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  79. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  80. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  81. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  82. package/lib/model/inheritance.d.ts +8 -8
  83. package/lib/model/inheritance.js +2 -2
  84. package/lib/model/manifest.d.ts +22 -22
  85. package/lib/model/manifest.js +46 -46
  86. package/lib/model/manifest.js.map +1 -1
  87. package/lib/model/markdown-file.d.ts +16 -16
  88. package/lib/model/markdown-file.js +109 -106
  89. package/lib/model/markdown-file.js.map +1 -1
  90. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  91. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
  92. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  93. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  94. package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
  95. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  96. package/lib/model/markdown-generation-util/index.js +19 -19
  97. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  98. package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
  99. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  100. package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
  101. package/lib/model/markdown-home-file.d.ts +11 -11
  102. package/lib/model/markdown-home-file.js +56 -53
  103. package/lib/model/markdown-home-file.js.map +1 -1
  104. package/lib/model/markdown-type-file.d.ts +26 -26
  105. package/lib/model/markdown-type-file.js +136 -133
  106. package/lib/model/markdown-type-file.js.map +1 -1
  107. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  108. package/lib/model/openapi/apex-doc-types.js +4 -4
  109. package/lib/model/openapi/open-api-types.d.ts +93 -93
  110. package/lib/model/openapi/open-api-types.js +2 -2
  111. package/lib/model/openapi/open-api.d.ts +16 -16
  112. package/lib/model/openapi/open-api.js +33 -33
  113. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  114. package/lib/model/openapi/openapi-type-file.js +16 -16
  115. package/lib/model/outputFile.d.ts +10 -10
  116. package/lib/model/outputFile.js +28 -28
  117. package/lib/model/types-repository.d.ts +16 -16
  118. package/lib/model/types-repository.js +53 -53
  119. package/lib/service/apex-file-reader.d.ts +14 -14
  120. package/lib/service/apex-file-reader.js +48 -45
  121. package/lib/service/apex-file-reader.js.map +1 -1
  122. package/lib/service/file-system.d.ts +14 -14
  123. package/lib/service/file-system.js +47 -24
  124. package/lib/service/file-system.js.map +1 -1
  125. package/lib/service/file-writer.d.ts +6 -6
  126. package/lib/service/file-writer.js +56 -33
  127. package/lib/service/file-writer.js.map +1 -1
  128. package/lib/service/manifest-factory.d.ts +10 -10
  129. package/lib/service/manifest-factory.js +16 -13
  130. package/lib/service/manifest-factory.js.map +1 -1
  131. package/lib/service/metadata-processor.d.ts +3 -3
  132. package/lib/service/metadata-processor.js +16 -16
  133. package/lib/service/parser.d.ts +21 -21
  134. package/lib/service/parser.js +137 -134
  135. package/lib/service/parser.js.map +1 -1
  136. package/lib/service/state.d.ts +9 -9
  137. package/lib/service/state.js +19 -19
  138. package/lib/service/walkers/class-walker.d.ts +4 -4
  139. package/lib/service/walkers/class-walker.js +32 -32
  140. package/lib/service/walkers/enum-walker.d.ts +4 -4
  141. package/lib/service/walkers/enum-walker.js +10 -10
  142. package/lib/service/walkers/interface-walker.d.ts +4 -4
  143. package/lib/service/walkers/interface-walker.js +14 -14
  144. package/lib/service/walkers/walker-factory.d.ts +5 -5
  145. package/lib/service/walkers/walker-factory.js +20 -20
  146. package/lib/service/walkers/walker.d.ts +19 -19
  147. package/lib/service/walkers/walker.js +16 -16
  148. package/lib/settings.d.ts +70 -64
  149. package/lib/settings.js +99 -88
  150. package/lib/settings.js.map +1 -1
  151. package/lib/templating/compile.d.ts +7 -0
  152. package/lib/templating/compile.js +98 -0
  153. package/lib/templating/compile.js.map +1 -0
  154. package/lib/templating/helpers.d.ts +2 -0
  155. package/lib/templating/helpers.js +18 -0
  156. package/lib/templating/helpers.js.map +1 -0
  157. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  158. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  159. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  160. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  161. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  162. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  163. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  164. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  165. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  166. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  167. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
  168. package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
  169. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
  170. package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
  171. package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
  172. package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
  173. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  174. package/lib/test-helpers/SettingsBuilder.js +26 -26
  175. package/lib/transpiler/factory.d.ts +6 -6
  176. package/lib/transpiler/factory.js +34 -31
  177. package/lib/transpiler/factory.js.map +1 -1
  178. package/lib/transpiler/file-container.d.ts +6 -6
  179. package/lib/transpiler/file-container.js +15 -15
  180. package/lib/transpiler/generator-choices.d.ts +1 -1
  181. package/lib/transpiler/generator-choices.js +2 -2
  182. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
  183. package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
  184. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  185. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  186. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  187. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
  188. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
  189. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  190. package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
  191. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
  192. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
  193. package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
  194. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
  195. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
  196. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
  197. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
  198. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
  199. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
  200. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
  201. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
  202. package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
  203. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
  204. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
  205. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
  206. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
  207. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
  208. package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
  209. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
  210. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
  211. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
  212. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
  213. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
  214. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
  215. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  216. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
  217. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
  218. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
  219. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  220. package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
  221. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  222. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  223. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  224. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  225. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  226. package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
  227. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  228. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  229. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  230. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  231. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
  232. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  233. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  234. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  235. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  236. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  237. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  238. package/lib/transpiler/processor-type-transpiler.js +8 -8
  239. package/lib/transpiler/transpiler.d.ts +5 -5
  240. package/lib/transpiler/transpiler.js +29 -26
  241. package/lib/transpiler/transpiler.js.map +1 -1
  242. package/lib/util/error-logger.d.ts +8 -8
  243. package/lib/util/error-logger.js +89 -89
  244. package/lib/util/error-logger.js.map +1 -1
  245. package/lib/util/logger.d.ts +21 -21
  246. package/lib/util/logger.js +60 -57
  247. package/lib/util/logger.js.map +1 -1
  248. package/lib/util/string-utils.d.ts +2 -2
  249. package/lib/util/string-utils.js +14 -14
  250. package/package.json +79 -78
  251. package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
  252. package/src/adapters/__tests__/references.spec.ts +115 -0
  253. package/src/adapters/apex-types.ts +67 -0
  254. package/src/adapters/documentables.ts +58 -0
  255. package/src/adapters/fields-and-properties.ts +14 -0
  256. package/src/adapters/methods-and-constructors.ts +78 -0
  257. package/src/adapters/references.ts +113 -0
  258. package/src/adapters/type-utils.ts +5 -0
  259. package/src/adapters/types.d.ts +8 -0
  260. package/src/cli/generate.ts +3 -0
  261. package/src/model/__tests__/manifest.spec.ts +1 -0
  262. package/src/model/manifest.ts +3 -3
  263. package/src/model/markdown-file.ts +1 -1
  264. package/src/model/openapi/open-api-types.ts +2 -2
  265. package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
  266. package/src/service/__tests__/manifest-factory.spec.ts +1 -2
  267. package/src/settings.ts +15 -0
  268. package/src/templating/__tests__/compile.spec.ts +741 -0
  269. package/src/templating/compile.ts +187 -0
  270. package/src/templating/helpers.ts +14 -0
  271. package/src/templating/types.d.ts +104 -0
  272. package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
  273. package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
  274. package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
  275. package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
  276. package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
  277. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
  278. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
  279. package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
  280. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
  281. package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
  282. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
  283. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
  284. package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
  285. package/src/transpiler/openapi/parsers/Builder.ts +1 -1
  286. package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
  287. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
  288. package/src/util/error-logger.ts +4 -4
  289. package/src/util/logger.ts +3 -3
  290. package/tsconfig.json +21 -20
  291. package/tslint.json +5 -5
  292. package/lib/model/manifest-diff.d.ts +0 -27
  293. package/lib/model/manifest-diff.js +0 -69
  294. package/lib/model/manifest-diff.js.map +0 -1
  295. package/src/model/__tests__/manifest-diff.spec.ts +0 -139
  296. package/src/model/manifest-diff.ts +0 -94
  297. /package/docs/{index.html → __old/index.html} +0 -0
  298. /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
  299. /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
  300. /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
  301. /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
  302. /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
  303. /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
  304. /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
  305. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
  306. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
  307. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
  308. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
  309. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
  310. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
  311. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
  312. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
  313. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
  314. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
  315. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
  316. /package/docs/{types → __old/types}/README.md +0 -0
  317. /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
@@ -1,167 +1,190 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MethodParser = void 0;
4
- const yaml = require("js-yaml");
5
- const ClassMirrorWrapper_1 = require("../../../model/apex-type-wrappers/ClassMirrorWrapper");
6
- const ReferenceBuilder_1 = require("./ReferenceBuilder");
7
- const ParameterObjectBuilder_1 = require("./ParameterObjectBuilder");
8
- const ResponsesBuilder_1 = require("./ResponsesBuilder");
9
- const RequestBodyBuilder_1 = require("./RequestBodyBuilder");
10
- const MethodMirrorWrapper_1 = require("../../../model/apex-type-wrappers/MethodMirrorWrapper");
11
- /**
12
- * Parses ApexDocs with HTTP REST annotations and turns them into an OpenApi specification.
13
- */
14
- class MethodParser {
15
- constructor(openApiModel) {
16
- this.openApiModel = openApiModel;
17
- }
18
- parseMethod(classMirror, httpUrlEndpoint, httpMethodKey, tag) {
19
- var _a, _b;
20
- const classMirrorWrapper = new ClassMirrorWrapper_1.ClassMirrorWrapper(classMirror);
21
- // Apex supports HttpGet, HttpPut, HttpPost, HttpDelete, and HttpPatch, so we search for a method
22
- // that has one of those annotations.
23
- const httpMethods = classMirrorWrapper.getMethodsByAnnotation(`http${httpMethodKey}`);
24
- if (!httpMethods.length) {
25
- return;
26
- }
27
- // We can assume there is at most one method per annotation, as this is an Apex rule.
28
- const httpMethod = httpMethods[0];
29
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey] = {};
30
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].tags = [tag];
31
- if ((_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
32
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].description = httpMethod.docComment.description;
33
- }
34
- const methodMirrorWrapper = new MethodMirrorWrapper_1.MethodMirrorWrapper(httpMethod);
35
- if (methodMirrorWrapper.hasDocCommentAnnotation('summary')) {
36
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].summary =
37
- (_b = methodMirrorWrapper.getDocCommentAnnotation('summary')) === null || _b === void 0 ? void 0 : _b.body;
38
- }
39
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-request-body', this.addRequestBodyToOpenApi.bind(this), this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey));
40
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-parameter', this.addParametersToOpenApi.bind(this));
41
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-response', this.addHttpResponsesToOpenApi.bind(this), this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey));
42
- }
43
- parseHttpAnnotation(httpMethod, urlValue, httpMethodKey, annotationName, addToOpenApi, fallbackParser) {
44
- var _a;
45
- const annotations = (_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((annotation) => annotation.name === annotationName);
46
- if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
47
- if (fallbackParser) {
48
- fallbackParser(httpMethod);
49
- }
50
- return;
51
- }
52
- for (const annotation of annotations) {
53
- // We expect the ApexDoc data representing this to be in YAML format.
54
- const inYaml = annotation === null || annotation === void 0 ? void 0 : annotation.bodyLines.reduce((prev, current, _) => prev + '\n' + current);
55
- if (!inYaml) {
56
- return;
57
- }
58
- this.addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi);
59
- }
60
- }
61
- addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi) {
62
- // Convert the YAML into a JSON object.
63
- const inJson = yaml.load(inYaml);
64
- const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(inJson);
65
- addToOpenApi(inJson, urlValue, httpMethodKey);
66
- this.addReference(requestBodyResponse);
67
- }
68
- addRequestBodyToOpenApi(input, urlValue, httpMethodKey) {
69
- const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(input);
70
- this.openApiModel.paths[urlValue][httpMethodKey].requestBody = requestBodyResponse.body;
71
- }
72
- addParametersToOpenApi(input, urlValue, httpMethodKey) {
73
- const parameterObjectResponse = new ParameterObjectBuilder_1.ParameterObjectBuilder().build(input);
74
- if (this.openApiModel.paths[urlValue][httpMethodKey].parameters === undefined) {
75
- // If no parameters have been defined yet, initialize the list.
76
- this.openApiModel.paths[urlValue][httpMethodKey].parameters = [];
77
- }
78
- this.openApiModel.paths[urlValue][httpMethodKey].parameters.push(parameterObjectResponse.body);
79
- }
80
- addHttpResponsesToOpenApi(input, urlValue, httpMethodKey) {
81
- const responseObjectResponse = new ResponsesBuilder_1.ResponsesBuilder().build(input);
82
- if (this.openApiModel.paths[urlValue][httpMethodKey].responses === undefined) {
83
- this.openApiModel.paths[urlValue][httpMethodKey].responses = {};
84
- }
85
- this.openApiModel.paths[urlValue][httpMethodKey].responses[input.statusCode] = responseObjectResponse.body;
86
- }
87
- fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey) {
88
- return (methodMirror) => {
89
- // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
90
- // object, with each key of the object being the parameter name.
91
- const parameters = methodMirror.parameters;
92
- if (!parameters.length) {
93
- return;
94
- }
95
- const propertiesObject = {};
96
- parameters.forEach((currentParameter) => {
97
- const propertyKey = currentParameter.name;
98
- const propertyReference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(currentParameter.typeReference);
99
- propertiesObject[propertyKey] = propertyReference.schema;
100
- this.addReference({
101
- reference: {
102
- entrypointReferenceObject: propertyReference.schema,
103
- referenceComponents: propertyReference.referenceComponents,
104
- },
105
- });
106
- });
107
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].requestBody = {
108
- content: {
109
- 'application/json': {
110
- schema: {
111
- type: 'object',
112
- properties: propertiesObject,
113
- },
114
- },
115
- },
116
- };
117
- };
118
- }
119
- getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey) {
120
- return (methodMirror) => {
121
- var _a, _b;
122
- // Parses methods that return an object (as opposed to void).
123
- const returnType = methodMirror.typeReference;
124
- if (returnType.type.toLowerCase() === 'void') {
125
- return;
126
- }
127
- const reference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(returnType);
128
- this.addReference({
129
- reference: {
130
- entrypointReferenceObject: reference.schema,
131
- referenceComponents: reference.referenceComponents,
132
- },
133
- });
134
- if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses === undefined) {
135
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses = {};
136
- }
137
- // Successful responses with a non-void return type always return a status code of 2000
138
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses['200'] = {
139
- description: (_b = (_a = methodMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : 'Status code 200',
140
- content: {
141
- 'application/json': { schema: reference.schema },
142
- },
143
- };
144
- };
145
- }
146
- addReference(referenceHolder) {
147
- if (referenceHolder.reference) {
148
- // If a reference is returned, we want to make sure to add it to the OpenApi object as well
149
- // Add to "component" section if it hasn't been already
150
- if (this.openApiModel.components === undefined) {
151
- this.openApiModel.components = {
152
- schemas: {},
153
- };
154
- }
155
- if (!referenceHolder.reference.referenceComponents.length) {
156
- return;
157
- }
158
- // Add all received references to the OpenApi components section.
159
- referenceHolder.reference.referenceComponents.forEach((current) => {
160
- // Check if the referenced object is already part of the OpenApi object
161
- this.openApiModel.components.schemas[current.referencedClass] = current.schema;
162
- });
163
- }
164
- }
165
- }
166
- exports.MethodParser = MethodParser;
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.MethodParser = void 0;
27
+ const yaml = __importStar(require("js-yaml"));
28
+ const ClassMirrorWrapper_1 = require("../../../model/apex-type-wrappers/ClassMirrorWrapper");
29
+ const ReferenceBuilder_1 = require("./ReferenceBuilder");
30
+ const ParameterObjectBuilder_1 = require("./ParameterObjectBuilder");
31
+ const ResponsesBuilder_1 = require("./ResponsesBuilder");
32
+ const RequestBodyBuilder_1 = require("./RequestBodyBuilder");
33
+ const MethodMirrorWrapper_1 = require("../../../model/apex-type-wrappers/MethodMirrorWrapper");
34
+ /**
35
+ * Parses ApexDocs with HTTP REST annotations and turns them into an OpenApi specification.
36
+ */
37
+ class MethodParser {
38
+ constructor(openApiModel) {
39
+ this.openApiModel = openApiModel;
40
+ }
41
+ parseMethod(classMirror, httpUrlEndpoint, httpMethodKey, tag) {
42
+ var _a, _b;
43
+ const classMirrorWrapper = new ClassMirrorWrapper_1.ClassMirrorWrapper(classMirror);
44
+ // Apex supports HttpGet, HttpPut, HttpPost, HttpDelete, and HttpPatch, so we search for a method
45
+ // that has one of those annotations.
46
+ const httpMethods = classMirrorWrapper.getMethodsByAnnotation(`http${httpMethodKey}`);
47
+ if (!httpMethods.length) {
48
+ return;
49
+ }
50
+ // We can assume there is at most one method per annotation, as this is an Apex rule.
51
+ const httpMethod = httpMethods[0];
52
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey] = {};
53
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].tags = [tag];
54
+ if ((_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
55
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].description = httpMethod.docComment.description;
56
+ }
57
+ const methodMirrorWrapper = new MethodMirrorWrapper_1.MethodMirrorWrapper(httpMethod);
58
+ if (methodMirrorWrapper.hasDocCommentAnnotation('summary')) {
59
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].summary =
60
+ (_b = methodMirrorWrapper.getDocCommentAnnotation('summary')) === null || _b === void 0 ? void 0 : _b.body;
61
+ }
62
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-request-body', this.addRequestBodyToOpenApi.bind(this), this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey));
63
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-parameter', this.addParametersToOpenApi.bind(this));
64
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-response', this.addHttpResponsesToOpenApi.bind(this), this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey));
65
+ }
66
+ parseHttpAnnotation(httpMethod, urlValue, httpMethodKey, annotationName, addToOpenApi, fallbackParser) {
67
+ var _a;
68
+ const annotations = (_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((annotation) => annotation.name === annotationName);
69
+ if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
70
+ if (fallbackParser) {
71
+ fallbackParser(httpMethod);
72
+ }
73
+ return;
74
+ }
75
+ for (const annotation of annotations) {
76
+ // We expect the ApexDoc data representing this to be in YAML format.
77
+ const inYaml = annotation === null || annotation === void 0 ? void 0 : annotation.bodyLines.reduce((prev, current) => prev + '\n' + current);
78
+ if (!inYaml) {
79
+ return;
80
+ }
81
+ this.addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi);
82
+ }
83
+ }
84
+ addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi) {
85
+ // Convert the YAML into a JSON object.
86
+ const inJson = yaml.load(inYaml);
87
+ const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(inJson);
88
+ addToOpenApi(inJson, urlValue, httpMethodKey);
89
+ this.addReference(requestBodyResponse);
90
+ }
91
+ addRequestBodyToOpenApi(input, urlValue, httpMethodKey) {
92
+ const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(input);
93
+ this.openApiModel.paths[urlValue][httpMethodKey].requestBody = requestBodyResponse.body;
94
+ }
95
+ addParametersToOpenApi(input, urlValue, httpMethodKey) {
96
+ const parameterObjectResponse = new ParameterObjectBuilder_1.ParameterObjectBuilder().build(input);
97
+ if (this.openApiModel.paths[urlValue][httpMethodKey].parameters === undefined) {
98
+ // If no parameters have been defined yet, initialize the list.
99
+ this.openApiModel.paths[urlValue][httpMethodKey].parameters = [];
100
+ }
101
+ this.openApiModel.paths[urlValue][httpMethodKey].parameters.push(parameterObjectResponse.body);
102
+ }
103
+ addHttpResponsesToOpenApi(input, urlValue, httpMethodKey) {
104
+ const responseObjectResponse = new ResponsesBuilder_1.ResponsesBuilder().build(input);
105
+ if (this.openApiModel.paths[urlValue][httpMethodKey].responses === undefined) {
106
+ this.openApiModel.paths[urlValue][httpMethodKey].responses = {};
107
+ }
108
+ this.openApiModel.paths[urlValue][httpMethodKey].responses[input.statusCode] = responseObjectResponse.body;
109
+ }
110
+ fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey) {
111
+ return (methodMirror) => {
112
+ // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
113
+ // object, with each key of the object being the parameter name.
114
+ const parameters = methodMirror.parameters;
115
+ if (!parameters.length) {
116
+ return;
117
+ }
118
+ const propertiesObject = {};
119
+ parameters.forEach((currentParameter) => {
120
+ const propertyKey = currentParameter.name;
121
+ const propertyReference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(currentParameter.typeReference);
122
+ propertiesObject[propertyKey] = propertyReference.schema;
123
+ this.addReference({
124
+ reference: {
125
+ entrypointReferenceObject: propertyReference.schema,
126
+ referenceComponents: propertyReference.referenceComponents,
127
+ },
128
+ });
129
+ });
130
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].requestBody = {
131
+ content: {
132
+ 'application/json': {
133
+ schema: {
134
+ type: 'object',
135
+ properties: propertiesObject,
136
+ },
137
+ },
138
+ },
139
+ };
140
+ };
141
+ }
142
+ getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey) {
143
+ return (methodMirror) => {
144
+ var _a, _b;
145
+ // Parses methods that return an object (as opposed to void).
146
+ const returnType = methodMirror.typeReference;
147
+ if (returnType.type.toLowerCase() === 'void') {
148
+ return;
149
+ }
150
+ const reference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(returnType);
151
+ this.addReference({
152
+ reference: {
153
+ entrypointReferenceObject: reference.schema,
154
+ referenceComponents: reference.referenceComponents,
155
+ },
156
+ });
157
+ if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses === undefined) {
158
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses = {};
159
+ }
160
+ // Successful responses with a non-void return type always return a status code of 2000
161
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses['200'] = {
162
+ description: (_b = (_a = methodMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : 'Status code 200',
163
+ content: {
164
+ 'application/json': { schema: reference.schema },
165
+ },
166
+ };
167
+ };
168
+ }
169
+ addReference(referenceHolder) {
170
+ if (referenceHolder.reference) {
171
+ // If a reference is returned, we want to make sure to add it to the OpenApi object as well
172
+ // Add to "component" section if it hasn't been already
173
+ if (this.openApiModel.components === undefined) {
174
+ this.openApiModel.components = {
175
+ schemas: {},
176
+ };
177
+ }
178
+ if (!referenceHolder.reference.referenceComponents.length) {
179
+ return;
180
+ }
181
+ // Add all received references to the OpenApi components section.
182
+ referenceHolder.reference.referenceComponents.forEach((current) => {
183
+ // Check if the referenced object is already part of the OpenApi object
184
+ this.openApiModel.components.schemas[current.referencedClass] = current.schema;
185
+ });
186
+ }
187
+ }
188
+ }
189
+ exports.MethodParser = MethodParser;
167
190
  //# sourceMappingURL=MethodParser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MethodParser.js","sourceRoot":"","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AE,EAAE;iBACZ,CAAC;aACH;YAED,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE;gBACzD,OAAO;aACR;YAED,iEAAiE;YACjE,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAChE,uEAAuE;gBACvE,IAAI,CAAC,YAAY,CAAC,UAAW,CAAC,OAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YACnF,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AA/ND,oCA+NC"}
@@ -1,7 +1,7 @@
1
- import { ParameterObject } from '../../../model/openapi/open-api-types';
2
- import { Reference } from './ReferenceBuilder';
3
- import { ApexDocParameterObject } from '../../../model/openapi/apex-doc-types';
4
- import { Builder } from './Builder';
5
- export declare class ParameterObjectBuilder extends Builder<ParameterObject, ApexDocParameterObject> {
6
- buildBody(apexDocObject: ApexDocParameterObject, reference?: Reference): ParameterObject;
7
- }
1
+ import { ParameterObject } from '../../../model/openapi/open-api-types';
2
+ import { Reference } from './ReferenceBuilder';
3
+ import { ApexDocParameterObject } from '../../../model/openapi/apex-doc-types';
4
+ import { Builder } from './Builder';
5
+ export declare class ParameterObjectBuilder extends Builder<ParameterObject, ApexDocParameterObject> {
6
+ buildBody(apexDocObject: ApexDocParameterObject, reference?: Reference): ParameterObject;
7
+ }
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParameterObjectBuilder = void 0;
4
- const Builder_1 = require("./Builder");
5
- class ParameterObjectBuilder extends Builder_1.Builder {
6
- buildBody(apexDocObject, reference) {
7
- return Object.assign(Object.assign({}, apexDocObject), { schema: this.getOpenApiSchemaFromApexDocSchema(apexDocObject, reference) });
8
- }
9
- }
10
- exports.ParameterObjectBuilder = ParameterObjectBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParameterObjectBuilder = void 0;
4
+ const Builder_1 = require("./Builder");
5
+ class ParameterObjectBuilder extends Builder_1.Builder {
6
+ buildBody(apexDocObject, reference) {
7
+ return Object.assign(Object.assign({}, apexDocObject), { schema: this.getOpenApiSchemaFromApexDocSchema(apexDocObject, reference) });
8
+ }
9
+ }
10
+ exports.ParameterObjectBuilder = ParameterObjectBuilder;
11
11
  //# sourceMappingURL=ParameterObjectBuilder.js.map
@@ -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 {};