@cparra/apexdocs 2.25.0-alpha.2 → 2.25.0-alpha.4

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 (355) hide show
  1. package/README.md +37 -0
  2. package/dist/cli/generate.js +291 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +1 -0
  5. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +18 -0
  6. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
  7. package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
  8. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
  9. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
  10. package/examples/plain-markdown/docs/index.md +84 -0
  11. package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
  12. package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
  13. package/examples/plain-markdown/package.json +2 -1
  14. package/jest.config.js +1 -1
  15. package/package.json +11 -13
  16. package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
  17. package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
  18. package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
  19. package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
  20. package/src/__spec__/core/test-helpers.ts +9 -0
  21. package/src/application/Apexdocs.ts +34 -5
  22. package/src/application/{flows → generators}/generate-markdown-files.ts +19 -13
  23. package/src/cli/args.ts +138 -0
  24. package/src/cli/generate.ts +12 -138
  25. package/src/core/adapters/__tests__/documentables.spec.ts +109 -0
  26. package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
  27. package/src/{adapters → core/adapters}/__tests__/references.spec.ts +23 -2
  28. package/src/{adapters → core/adapters}/apex-types.ts +18 -15
  29. package/src/{adapters → core/adapters}/documentables.ts +54 -12
  30. package/src/{adapters → core/adapters}/fields-and-properties.ts +17 -10
  31. package/src/{adapters/references.ts → core/adapters/inline.ts} +43 -13
  32. package/src/{adapters → core/adapters}/methods-and-constructors.ts +21 -9
  33. package/src/core/adapters/type-utils.ts +13 -0
  34. package/src/core/{renderable → adapters}/types.d.ts +42 -4
  35. package/src/core/generate-docs.ts +55 -19
  36. package/src/core/template.ts +15 -9
  37. package/src/core/templates/reference-guide.ts +1 -1
  38. package/src/model/__tests__/manifest.spec.ts +1 -1
  39. package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
  40. package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
  41. package/src/model/markdown-type-file.ts +5 -1
  42. package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
  43. package/src/service/apex-file-reader.ts +2 -6
  44. package/src/service/manifest-factory.ts +2 -2
  45. package/src/service/parser.ts +1 -1
  46. package/src/settings.ts +6 -10
  47. package/src/test-helpers/SettingsBuilder.ts +1 -2
  48. package/src/transpiler/factory.ts +2 -4
  49. package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
  50. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +2 -2
  51. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
  52. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
  53. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
  54. package/src/util/fp.ts +3 -0
  55. package/tsconfig.json +1 -1
  56. package/docs/.nojekyll +0 -0
  57. package/docs/__old/README.md +0 -1
  58. package/docs/__old/index.html +0 -22
  59. package/docs/__old/restapi.json +0 -589
  60. package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
  61. package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
  62. package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
  63. package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
  64. package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
  65. package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
  66. package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
  67. package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
  68. package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
  69. package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
  70. package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
  71. package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
  72. package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
  73. package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
  74. package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
  75. package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
  76. package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
  77. package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
  78. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
  79. package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
  80. package/docs/__old/types/README.md +0 -97
  81. package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
  82. package/examples/includes/header.md +0 -3
  83. package/lib/__spec__/core/expect-extensions.d.ts +0 -3
  84. package/lib/__spec__/core/expect-extensions.js +0 -54
  85. package/lib/__spec__/core/expect-extensions.js.map +0 -1
  86. package/lib/__spec__/core/generating-class-docs.spec.d.ts +0 -1
  87. package/lib/__spec__/core/generating-class-docs.spec.js +0 -427
  88. package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
  89. package/lib/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
  90. package/lib/__spec__/core/generating-enum-docs.spec.js +0 -303
  91. package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
  92. package/lib/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
  93. package/lib/__spec__/core/generating-interface-docs.spec.js +0 -361
  94. package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
  95. package/lib/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
  96. package/lib/__spec__/core/generating-reference-guide.spec.js +0 -161
  97. package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
  98. package/lib/adapters/apex-types.d.ts +0 -5
  99. package/lib/adapters/apex-types.js +0 -109
  100. package/lib/adapters/apex-types.js.map +0 -1
  101. package/lib/adapters/documentables.d.ts +0 -7
  102. package/lib/adapters/documentables.js +0 -56
  103. package/lib/adapters/documentables.js.map +0 -1
  104. package/lib/adapters/fields-and-properties.d.ts +0 -4
  105. package/lib/adapters/fields-and-properties.js +0 -31
  106. package/lib/adapters/fields-and-properties.js.map +0 -1
  107. package/lib/adapters/methods-and-constructors.d.ts +0 -5
  108. package/lib/adapters/methods-and-constructors.js +0 -91
  109. package/lib/adapters/methods-and-constructors.js.map +0 -1
  110. package/lib/adapters/references.d.ts +0 -5
  111. package/lib/adapters/references.js +0 -82
  112. package/lib/adapters/references.js.map +0 -1
  113. package/lib/adapters/type-utils.d.ts +0 -2
  114. package/lib/adapters/type-utils.js +0 -7
  115. package/lib/adapters/type-utils.js.map +0 -1
  116. package/lib/application/Apexdocs.d.ts +0 -13
  117. package/lib/application/Apexdocs.js +0 -86
  118. package/lib/application/Apexdocs.js.map +0 -1
  119. package/lib/application/flows/generate-markdown-files.d.ts +0 -3
  120. package/lib/application/flows/generate-markdown-files.js +0 -57
  121. package/lib/application/flows/generate-markdown-files.js.map +0 -1
  122. package/lib/cli/generate.d.ts +0 -2
  123. package/lib/cli/generate.js +0 -157
  124. package/lib/cli/generate.js.map +0 -1
  125. package/lib/core/__test__/inheritance-chain.test.d.ts +0 -1
  126. package/lib/core/__test__/inheritance-chain.test.js +0 -42
  127. package/lib/core/__test__/inheritance-chain.test.js.map +0 -1
  128. package/lib/core/generate-docs.d.ts +0 -24
  129. package/lib/core/generate-docs.js +0 -267
  130. package/lib/core/generate-docs.js.map +0 -1
  131. package/lib/core/inheritance-chain.d.ts +0 -2
  132. package/lib/core/inheritance-chain.js +0 -35
  133. package/lib/core/inheritance-chain.js.map +0 -1
  134. package/lib/core/template.d.ts +0 -10
  135. package/lib/core/template.js +0 -92
  136. package/lib/core/template.js.map +0 -1
  137. package/lib/core/templates/reference-guide.d.ts +0 -1
  138. package/lib/core/templates/reference-guide.js +0 -18
  139. package/lib/core/templates/reference-guide.js.map +0 -1
  140. package/lib/index.d.ts +0 -2
  141. package/lib/index.js +0 -29
  142. package/lib/index.js.map +0 -1
  143. package/lib/model/apex-bundle.d.ts +0 -6
  144. package/lib/model/apex-bundle.js +0 -11
  145. package/lib/model/apex-bundle.js.map +0 -1
  146. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
  147. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
  148. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
  149. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
  150. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
  151. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
  152. package/lib/model/inheritance.d.ts +0 -11
  153. package/lib/model/inheritance.js +0 -3
  154. package/lib/model/inheritance.js.map +0 -1
  155. package/lib/model/manifest.d.ts +0 -22
  156. package/lib/model/manifest.js +0 -53
  157. package/lib/model/manifest.js.map +0 -1
  158. package/lib/model/markdown-file.d.ts +0 -16
  159. package/lib/model/markdown-file.js +0 -111
  160. package/lib/model/markdown-file.js.map +0 -1
  161. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
  162. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +0 -46
  163. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
  164. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
  165. package/lib/model/markdown-generation-util/field-declaration-util.js +0 -54
  166. package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
  167. package/lib/model/markdown-generation-util/index.d.ts +0 -3
  168. package/lib/model/markdown-generation-util/index.js +0 -20
  169. package/lib/model/markdown-generation-util/index.js.map +0 -1
  170. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
  171. package/lib/model/markdown-generation-util/method-declaration-util.js +0 -114
  172. package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
  173. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
  174. package/lib/model/markdown-generation-util/type-declaration-util.js +0 -81
  175. package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
  176. package/lib/model/markdown-home-file.d.ts +0 -11
  177. package/lib/model/markdown-home-file.js +0 -57
  178. package/lib/model/markdown-home-file.js.map +0 -1
  179. package/lib/model/markdown-type-file.d.ts +0 -26
  180. package/lib/model/markdown-type-file.js +0 -137
  181. package/lib/model/markdown-type-file.js.map +0 -1
  182. package/lib/model/openapi/apex-doc-types.d.ts +0 -19
  183. package/lib/model/openapi/apex-doc-types.js +0 -5
  184. package/lib/model/openapi/apex-doc-types.js.map +0 -1
  185. package/lib/model/openapi/open-api-types.d.ts +0 -93
  186. package/lib/model/openapi/open-api-types.js +0 -3
  187. package/lib/model/openapi/open-api-types.js.map +0 -1
  188. package/lib/model/openapi/open-api.d.ts +0 -16
  189. package/lib/model/openapi/open-api.js +0 -34
  190. package/lib/model/openapi/open-api.js.map +0 -1
  191. package/lib/model/openapi/openapi-type-file.d.ts +0 -7
  192. package/lib/model/openapi/openapi-type-file.js +0 -17
  193. package/lib/model/openapi/openapi-type-file.js.map +0 -1
  194. package/lib/model/outputFile.d.ts +0 -10
  195. package/lib/model/outputFile.js +0 -22
  196. package/lib/model/outputFile.js.map +0 -1
  197. package/lib/model/types-repository.d.ts +0 -16
  198. package/lib/model/types-repository.js +0 -54
  199. package/lib/model/types-repository.js.map +0 -1
  200. package/lib/service/apex-file-reader.d.ts +0 -14
  201. package/lib/service/apex-file-reader.js +0 -49
  202. package/lib/service/apex-file-reader.js.map +0 -1
  203. package/lib/service/file-system.d.ts +0 -14
  204. package/lib/service/file-system.js +0 -48
  205. package/lib/service/file-system.js.map +0 -1
  206. package/lib/service/file-writer.d.ts +0 -6
  207. package/lib/service/file-writer.js +0 -57
  208. package/lib/service/file-writer.js.map +0 -1
  209. package/lib/service/manifest-factory.d.ts +0 -10
  210. package/lib/service/manifest-factory.js +0 -16
  211. package/lib/service/manifest-factory.js.map +0 -1
  212. package/lib/service/metadata-processor.d.ts +0 -3
  213. package/lib/service/metadata-processor.js +0 -17
  214. package/lib/service/metadata-processor.js.map +0 -1
  215. package/lib/service/parser.d.ts +0 -21
  216. package/lib/service/parser.js +0 -138
  217. package/lib/service/parser.js.map +0 -1
  218. package/lib/service/state.d.ts +0 -9
  219. package/lib/service/state.js +0 -20
  220. package/lib/service/state.js.map +0 -1
  221. package/lib/service/walkers/class-walker.d.ts +0 -4
  222. package/lib/service/walkers/class-walker.js +0 -33
  223. package/lib/service/walkers/class-walker.js.map +0 -1
  224. package/lib/service/walkers/enum-walker.d.ts +0 -4
  225. package/lib/service/walkers/enum-walker.js +0 -11
  226. package/lib/service/walkers/enum-walker.js.map +0 -1
  227. package/lib/service/walkers/interface-walker.d.ts +0 -4
  228. package/lib/service/walkers/interface-walker.js +0 -15
  229. package/lib/service/walkers/interface-walker.js.map +0 -1
  230. package/lib/service/walkers/walker-factory.d.ts +0 -5
  231. package/lib/service/walkers/walker-factory.js +0 -21
  232. package/lib/service/walkers/walker-factory.js.map +0 -1
  233. package/lib/service/walkers/walker.d.ts +0 -19
  234. package/lib/service/walkers/walker.js +0 -17
  235. package/lib/service/walkers/walker.js.map +0 -1
  236. package/lib/settings.d.ts +0 -64
  237. package/lib/settings.js +0 -89
  238. package/lib/settings.js.map +0 -1
  239. package/lib/test-helpers/AnnotationBuilder.d.ts +0 -12
  240. package/lib/test-helpers/AnnotationBuilder.js +0 -31
  241. package/lib/test-helpers/AnnotationBuilder.js.map +0 -1
  242. package/lib/test-helpers/ClassMirrorBuilder.d.ts +0 -22
  243. package/lib/test-helpers/ClassMirrorBuilder.js +0 -64
  244. package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
  245. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
  246. package/lib/test-helpers/DocCommentAnnotationBuilder.js +0 -26
  247. package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
  248. package/lib/test-helpers/DocCommentBuilder.d.ts +0 -12
  249. package/lib/test-helpers/DocCommentBuilder.js +0 -38
  250. package/lib/test-helpers/DocCommentBuilder.js.map +0 -1
  251. package/lib/test-helpers/FieldMirrorBuilder.d.ts +0 -18
  252. package/lib/test-helpers/FieldMirrorBuilder.js +0 -54
  253. package/lib/test-helpers/FieldMirrorBuilder.js.map +0 -1
  254. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
  255. package/lib/test-helpers/InterfaceMirrorBuilder.js +0 -43
  256. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
  257. package/lib/test-helpers/MethodMirrorBuilder.d.ts +0 -29
  258. package/lib/test-helpers/MethodMirrorBuilder.js +0 -72
  259. package/lib/test-helpers/MethodMirrorBuilder.js.map +0 -1
  260. package/lib/test-helpers/SettingsBuilder.d.ts +0 -8
  261. package/lib/test-helpers/SettingsBuilder.js +0 -27
  262. package/lib/test-helpers/SettingsBuilder.js.map +0 -1
  263. package/lib/transpiler/factory.d.ts +0 -6
  264. package/lib/transpiler/factory.js +0 -35
  265. package/lib/transpiler/factory.js.map +0 -1
  266. package/lib/transpiler/file-container.d.ts +0 -6
  267. package/lib/transpiler/file-container.js +0 -16
  268. package/lib/transpiler/file-container.js.map +0 -1
  269. package/lib/transpiler/generator-choices.d.ts +0 -1
  270. package/lib/transpiler/generator-choices.js +0 -3
  271. package/lib/transpiler/generator-choices.js.map +0 -1
  272. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +0 -11
  273. package/lib/transpiler/markdown/class-file-generatorHelper.js +0 -75
  274. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
  275. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
  276. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
  277. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
  278. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
  279. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
  280. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
  281. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
  282. package/lib/transpiler/markdown/markdown-transpiler-base.js +0 -27
  283. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
  284. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
  285. package/lib/transpiler/markdown/plain-markdown/class-template.js +0 -77
  286. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
  287. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
  288. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -36
  289. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
  290. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
  291. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -28
  292. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
  293. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
  294. package/lib/transpiler/markdown/plain-markdown/enum-template.js +0 -16
  295. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
  296. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
  297. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -27
  298. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
  299. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
  300. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
  301. package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -1
  302. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
  303. package/lib/transpiler/markdown/plain-markdown/interface-template.js +0 -20
  304. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
  305. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
  306. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -47
  307. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
  308. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
  309. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
  310. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
  311. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
  312. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
  313. package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -1
  314. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
  315. package/lib/transpiler/openapi/open-api-docs-processor.js +0 -78
  316. package/lib/transpiler/openapi/open-api-docs-processor.js.map +0 -1
  317. package/lib/transpiler/openapi/parsers/Builder.d.ts +0 -16
  318. package/lib/transpiler/openapi/parsers/Builder.js +0 -30
  319. package/lib/transpiler/openapi/parsers/Builder.js.map +0 -1
  320. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
  321. package/lib/transpiler/openapi/parsers/MethodParser.js +0 -190
  322. package/lib/transpiler/openapi/parsers/MethodParser.js.map +0 -1
  323. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
  324. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
  325. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
  326. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
  327. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +0 -250
  328. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
  329. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
  330. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
  331. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
  332. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
  333. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
  334. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
  335. package/lib/transpiler/processor-type-transpiler.d.ts +0 -10
  336. package/lib/transpiler/processor-type-transpiler.js +0 -9
  337. package/lib/transpiler/processor-type-transpiler.js.map +0 -1
  338. package/lib/transpiler/transpiler.d.ts +0 -5
  339. package/lib/transpiler/transpiler.js +0 -30
  340. package/lib/transpiler/transpiler.js.map +0 -1
  341. package/lib/util/error-logger.d.ts +0 -8
  342. package/lib/util/error-logger.js +0 -90
  343. package/lib/util/error-logger.js.map +0 -1
  344. package/lib/util/logger.d.ts +0 -21
  345. package/lib/util/logger.js +0 -61
  346. package/lib/util/logger.js.map +0 -1
  347. package/lib/util/string-utils.d.ts +0 -2
  348. package/lib/util/string-utils.js +0 -15
  349. package/lib/util/string-utils.js.map +0 -1
  350. package/src/adapters/type-utils.ts +0 -5
  351. package/src/adapters/types.d.ts +0 -8
  352. package/src/model/inheritance.ts +0 -8
  353. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
  354. /package/src/{model → core}/apex-bundle.ts +0 -0
  355. /package/src/{model → core}/manifest.ts +0 -0
@@ -1,190 +0,0 @@
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;
190
- //# sourceMappingURL=MethodParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MethodParser.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/MethodParser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8CAAgC;AAChC,6FAA0F;AAC1F,yDAAiE;AACjE,qEAAkE;AAClE,yDAAsD;AAMtD,6DAA0D;AAG1D,+FAA4F;AAO5F;;GAEG;AACH,MAAa,YAAY;IACvB,YAAmB,YAAqB;QAArB,iBAAY,GAAZ,YAAY,CAAS;IAAG,CAAC;IAErC,WAAW,CAAC,WAAwB,EAAE,eAAuB,EAAE,aAA6B,EAAE,GAAW;;QAC9G,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,WAAW,CAAC,CAAC;QAC/D,iGAAiG;QACjG,qCAAqC;QACrC,MAAM,WAAW,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,OAAO,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QAED,qFAAqF;QACrF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAC7D,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACtE,IAAI,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAE,CAAC,WAAW,GAAG,UA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../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 +0,0 @@
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
- //# sourceMappingURL=ParameterObjectBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParameterObjectBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ParameterObjectBuilder.ts"],"names":[],"mappings":";;;AAGA,uCAAoC;AAEpC,MAAa,sBAAuB,SAAQ,iBAAgD;IAC1F,SAAS,CAAC,aAAqC,EAAE,SAAqB;QACpE,uCACK,aAAa,KAChB,MAAM,EAAE,IAAI,CAAC,iCAAiC,CAAC,aAAa,EAAE,SAAS,CAAC,IACxE;IACJ,CAAC;CACF;AAPD,wDAOC"}
@@ -1,39 +0,0 @@
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,250 +0,0 @@
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
- }
250
- //# sourceMappingURL=ReferenceBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ReferenceBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAgC;AAQhC,sEAA8E;AAW9E,MAAa,gBAAgB;IAA7B;QA8OU,sBAAiB,GAAG,CAAC,YAAqB,EAA0B,EAAE;YAC5E,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,YAAY,MAAM,CAAC;QAC5E,CAAC,CAAC;IACJ,CAAC;IAhPC,KAAK,CAAC,kBAA0B;QAC9B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;QAE5C,4EAA4E;QAC5E,MAAM,uBAAuB,GAAG,WAAW,CAAC;QAC5C,MAAM,eAAe,GAAG,kBAAkB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC1E,IAAI,kBAAkB,GAAwB,EAAE,CAAC;QACjD,IAAI,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,kBAAkB,GAAG,kBAAkB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,kBAAkB,GAAG,kBAAkB,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BAAkB,GAAG,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnE,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;QAC9F,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,10 +0,0 @@
1
- import { RequestBody } from '../../../model/openapi/open-api-types';
2
- import { Reference } from './ReferenceBuilder';
3
- import { ApexDocHttpRequestBody } from '../../../model/openapi/apex-doc-types';
4
- import { Builder } from './Builder';
5
- /**
6
- * Parses and builds OpenApi Request Body objects.
7
- */
8
- export declare class RequestBodyBuilder extends Builder<RequestBody, ApexDocHttpRequestBody> {
9
- buildBody(apexRequestBody: ApexDocHttpRequestBody, reference?: Reference): RequestBody;
10
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequestBodyBuilder = void 0;
4
- const Builder_1 = require("./Builder");
5
- /**
6
- * Parses and builds OpenApi Request Body objects.
7
- */
8
- class RequestBodyBuilder extends Builder_1.Builder {
9
- buildBody(apexRequestBody, reference) {
10
- return {
11
- description: apexRequestBody.description,
12
- content: {
13
- 'application/json': { schema: this.getOpenApiSchemaFromApexDocSchema(apexRequestBody, reference) },
14
- },
15
- required: apexRequestBody.required,
16
- };
17
- }
18
- }
19
- exports.RequestBodyBuilder = RequestBodyBuilder;
20
- //# sourceMappingURL=RequestBodyBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestBodyBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/RequestBodyBuilder.ts"],"names":[],"mappings":";;;AAGA,uCAAoC;AAEpC;;GAEG;AACH,MAAa,kBAAmB,SAAQ,iBAA4C;IAClF,SAAS,CAAC,eAAuC,EAAE,SAAqB;QACtE,OAAO;YACL,WAAW,EAAE,eAAe,CAAC,WAAW;YACxC,OAAO,EAAE;gBACP,kBAAkB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,iCAAiC,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE;aACnG;YACD,QAAQ,EAAE,eAAe,CAAC,QAAQ;SACnC,CAAC;IACJ,CAAC;CACF;AAVD,gDAUC"}
@@ -1,7 +0,0 @@
1
- import { ResponseObject } from '../../../model/openapi/open-api-types';
2
- import { Reference } from './ReferenceBuilder';
3
- import { ApexDocHttpResponse } from '../../../model/openapi/apex-doc-types';
4
- import { Builder } from './Builder';
5
- export declare class ResponsesBuilder extends Builder<ResponseObject, ApexDocHttpResponse> {
6
- buildBody(apexDocResponseDefinition: ApexDocHttpResponse, reference?: Reference): ResponseObject;
7
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ResponsesBuilder = void 0;
4
- const Builder_1 = require("./Builder");
5
- class ResponsesBuilder extends Builder_1.Builder {
6
- buildBody(apexDocResponseDefinition, reference) {
7
- let description = `Status code ${apexDocResponseDefinition.statusCode}`;
8
- if (apexDocResponseDefinition.description) {
9
- description = apexDocResponseDefinition.description;
10
- }
11
- return {
12
- description: description,
13
- content: {
14
- 'application/json': {
15
- schema: this.getOpenApiSchemaFromApexDocSchema(apexDocResponseDefinition, reference),
16
- },
17
- },
18
- };
19
- }
20
- }
21
- exports.ResponsesBuilder = ResponsesBuilder;
22
- //# sourceMappingURL=ResponsesBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ResponsesBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ResponsesBuilder.ts"],"names":[],"mappings":";;;AAGA,uCAAoC;AAEpC,MAAa,gBAAiB,SAAQ,iBAA4C;IAChF,SAAS,CAAC,yBAA8C,EAAE,SAAqB;QAC7E,IAAI,WAAW,GAAG,eAAe,yBAAyB,CAAC,UAAU,EAAE,CAAC;QACxE,IAAI,yBAAyB,CAAC,WAAW,EAAE,CAAC;YAC1C,WAAW,GAAG,yBAAyB,CAAC,WAAW,CAAC;QACtD,CAAC;QACD,OAAO;YACL,WAAW,EAAE,WAAW;YACxB,OAAO,EAAE;gBACP,kBAAkB,EAAE;oBAClB,MAAM,EAAE,IAAI,CAAC,iCAAiC,CAAC,yBAAyB,EAAE,SAAS,CAAC;iBACrF;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAfD,4CAeC"}
@@ -1,10 +0,0 @@
1
- import { Type } from '@cparra/apex-reflection';
2
- import { FileContainer } from './file-container';
3
- export type LinkingStrategy = 'root-relative' | 'path-relative';
4
- export default abstract class ProcessorTypeTranspiler {
5
- onBeforeProcess: ((types: Type[]) => void) | undefined;
6
- abstract onProcess(type: Type): void;
7
- onAfterProcess: ((types: Type[]) => void) | undefined;
8
- abstract fileBuilder(): FileContainer;
9
- getLinkingStrategy(): LinkingStrategy;
10
- }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class ProcessorTypeTranspiler {
4
- getLinkingStrategy() {
5
- return 'root-relative';
6
- }
7
- }
8
- exports.default = ProcessorTypeTranspiler;
9
- //# sourceMappingURL=processor-type-transpiler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processor-type-transpiler.js","sourceRoot":"","sources":["../../src/transpiler/processor-type-transpiler.ts"],"names":[],"mappings":";;AAKA,MAA8B,uBAAuB;IASnD,kBAAkB;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AAZD,0CAYC"}
@@ -1,5 +0,0 @@
1
- import { Type } from '@cparra/apex-reflection';
2
- import ProcessorTypeTranspiler from './processor-type-transpiler';
3
- export default class Transpiler {
4
- static generate(types: Type[], processor: ProcessorTypeTranspiler): void;
5
- }