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

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 (455) hide show
  1. package/dist/cli/generate.js +2746 -40
  2. package/dist/defaults-DUwru49Q.js +12 -0
  3. package/dist/defaults-SH0Rsi5E.js +11 -0
  4. package/dist/index.d.ts +62 -2
  5. package/dist/index.js +36 -1
  6. package/examples/plain-markdown/docs/Miscellaneous/ns.BaseClass.md +1 -1
  7. package/examples/plain-markdown/docs/Miscellaneous/ns.MultiInheritanceClass.md +1 -1
  8. package/examples/plain-markdown/docs/Miscellaneous/ns.ParentInterface.md +1 -1
  9. package/examples/plain-markdown/docs/Miscellaneous/ns.ReferencedEnum.md +1 -1
  10. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +1 -1
  11. package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +1 -1
  12. package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
  13. package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +1 -1
  14. package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
  15. package/examples/plain-markdown/docs/index.md +83 -1
  16. package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
  17. package/examples/plain-markdown/package.json +2 -2
  18. package/examples/vitepress/.forceignore +12 -0
  19. package/examples/vitepress/apexdocs.config.ts +108 -0
  20. package/examples/vitepress/config/project-scratch-def.json +13 -0
  21. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +259 -0
  22. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +7 -0
  23. package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +40 -0
  24. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +11474 -0
  25. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +7 -0
  26. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +9172 -0
  27. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +7 -0
  28. package/examples/vitepress/docs/.vitepress/cache/deps/package.json +3 -0
  29. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4339 -0
  30. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  31. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +567 -0
  32. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  33. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +323 -0
  34. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +7 -0
  35. package/examples/vitepress/docs/.vitepress/config.mts +21 -0
  36. package/examples/vitepress/docs/.vitepress/sidebar.json +119 -0
  37. package/examples/vitepress/docs/Miscellaneous/apexdocs.BaseClass.md +20 -0
  38. package/examples/vitepress/docs/Miscellaneous/apexdocs.MultiInheritanceClass.md +78 -0
  39. package/examples/vitepress/docs/Miscellaneous/apexdocs.ParentInterface.md +19 -0
  40. package/examples/vitepress/docs/Miscellaneous/apexdocs.ReferencedEnum.md +15 -0
  41. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleException.md +28 -0
  42. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleInterface.md +122 -0
  43. package/examples/vitepress/docs/Miscellaneous/apexdocs.Url.md +318 -0
  44. package/examples/vitepress/docs/Sample-Enums/apexdocs.SampleEnum.md +41 -0
  45. package/examples/vitepress/docs/SampleGroup/apexdocs.SampleClass.md +178 -0
  46. package/examples/vitepress/docs/api-examples.md +49 -0
  47. package/examples/vitepress/docs/index-frontmatter.md +16 -0
  48. package/examples/vitepress/docs/index.md +127 -0
  49. package/examples/vitepress/docs/markdown-examples.md +85 -0
  50. package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +3 -0
  51. package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +1 -0
  52. package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +3 -0
  53. package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +5 -0
  54. package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +72 -0
  55. package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +30 -0
  56. package/examples/vitepress/force-app/main/default/classes/SampleException.cls +17 -0
  57. package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +46 -0
  58. package/examples/vitepress/force-app/main/default/classes/Url.cls +195 -0
  59. package/examples/vitepress/package-lock.json +2574 -0
  60. package/examples/vitepress/package.json +18 -0
  61. package/examples/vitepress/sfdx-project.json +12 -0
  62. package/jest.config.js +1 -0
  63. package/package.json +10 -6
  64. package/src/application/Apexdocs.ts +16 -106
  65. package/src/application/__tests__/apex-file-reader.spec.ts +104 -0
  66. package/src/application/apex-file-reader.ts +42 -0
  67. package/src/application/file-writer.ts +25 -0
  68. package/src/application/generators/markdown.ts +53 -0
  69. package/src/application/generators/openapi.ts +56 -0
  70. package/src/cli/args.ts +17 -110
  71. package/src/cli/commands/markdown.ts +58 -0
  72. package/src/cli/generate.ts +7 -7
  73. package/src/{model/__tests__ → core/__test__}/manifest.spec.ts +1 -1
  74. package/src/core/manifest.ts +57 -51
  75. package/src/{__spec__/core → core/markdown/__test__}/expect-extensions.ts +5 -5
  76. package/src/core/markdown/__test__/generating-class-docs.spec.ts +727 -0
  77. package/src/{__spec__/core → core/markdown/__test__}/generating-enum-docs.spec.ts +82 -59
  78. package/src/{__spec__/core → core/markdown/__test__}/generating-interface-docs.spec.ts +94 -75
  79. package/src/core/markdown/__test__/generating-reference-guide.spec.ts +184 -0
  80. package/src/core/{__test__ → markdown/__test__}/inheritance-chain.test.ts +2 -2
  81. package/src/core/markdown/__test__/test-helpers.ts +22 -0
  82. package/src/core/markdown/adapters/__tests__/documentables.spec.ts +109 -0
  83. package/src/core/{adapters → markdown/adapters}/__tests__/interface-adapter.spec.ts +38 -8
  84. package/src/core/{adapters → markdown/adapters}/__tests__/references.spec.ts +12 -1
  85. package/src/core/{adapters → markdown/adapters}/apex-types.ts +8 -5
  86. package/src/core/{adapters → markdown/adapters}/documentables.ts +2 -62
  87. package/src/core/{adapters → markdown/adapters}/fields-and-properties.ts +7 -2
  88. package/src/core/{adapters/references.ts → markdown/adapters/inline.ts} +43 -10
  89. package/src/core/{adapters → markdown/adapters}/methods-and-constructors.ts +7 -2
  90. package/src/core/markdown/adapters/renderable-bundle.ts +144 -0
  91. package/src/core/markdown/adapters/renderable-to-page-data.ts +92 -0
  92. package/src/core/{adapters → markdown/adapters}/type-utils.ts +5 -1
  93. package/src/core/{adapters → markdown/adapters}/types.d.ts +24 -3
  94. package/src/core/markdown/generate-docs.ts +158 -0
  95. package/src/core/markdown/reflection/error-handling.ts +37 -0
  96. package/src/core/markdown/reflection/filter-scope.ts +13 -0
  97. package/src/core/markdown/reflection/inheritance-chain-expanion.ts +22 -0
  98. package/src/core/markdown/reflection/inherited-member-expansion.ts +105 -0
  99. package/src/core/markdown/reflection/reflect-source.ts +41 -0
  100. package/src/core/markdown/reflection/sort-members.ts +59 -0
  101. package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/class-template.ts +2 -0
  102. package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/constructors-partial-template.ts +1 -1
  103. package/src/core/markdown/templates/hookable.ts +7 -0
  104. package/src/core/{template.ts → markdown/templates/template.ts} +15 -12
  105. package/src/core/markdown/utils.ts +3 -0
  106. package/src/{transpiler → core}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
  107. package/src/{model → core/openapi}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
  108. package/src/core/openapi/file-container.ts +13 -0
  109. package/src/{service → core/openapi}/manifest-factory.ts +3 -3
  110. package/src/{transpiler → core}/openapi/open-api-docs-processor.ts +9 -10
  111. package/src/core/openapi/openapi-type-file.ts +14 -0
  112. package/src/{service → core/openapi}/parser.ts +8 -8
  113. package/src/{transpiler → core}/openapi/parsers/Builder.ts +2 -2
  114. package/src/{transpiler → core}/openapi/parsers/MethodParser.ts +5 -5
  115. package/src/{transpiler → core}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
  116. package/src/{transpiler → core}/openapi/parsers/ReferenceBuilder.ts +3 -3
  117. package/src/{transpiler → core}/openapi/parsers/RequestBodyBuilder.ts +2 -2
  118. package/src/{transpiler → core}/openapi/parsers/ResponsesBuilder.ts +2 -2
  119. package/src/{transpiler → core}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
  120. package/src/{transpiler → core}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
  121. package/src/{transpiler → core}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
  122. package/src/{transpiler → core}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
  123. package/src/{transpiler → core}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
  124. package/src/{transpiler → core/openapi}/transpiler.ts +2 -6
  125. package/src/{model → core/openapi}/types-repository.ts +0 -9
  126. package/src/core/parse-apex-metadata.ts +14 -0
  127. package/src/core/settings.ts +56 -0
  128. package/src/core/shared/types.d.ts +92 -0
  129. package/src/core/shared/utils.ts +5 -0
  130. package/src/defaults.ts +8 -0
  131. package/src/index.ts +34 -2
  132. package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -5
  133. package/src/test-helpers/SettingsBuilder.ts +1 -5
  134. package/src/util/fp.ts +3 -0
  135. package/src/util/logger.ts +2 -2
  136. package/src/util/string-utils.ts +0 -4
  137. package/tsconfig.json +5 -1
  138. package/apexdocs.config.ts +0 -13
  139. package/dist/__spec__/core/expect-extensions.d.ts +0 -3
  140. package/dist/__spec__/core/expect-extensions.js +0 -55
  141. package/dist/__spec__/core/expect-extensions.js.map +0 -1
  142. package/dist/__spec__/core/generating-class-docs.spec.d.ts +0 -1
  143. package/dist/__spec__/core/generating-class-docs.spec.js +0 -444
  144. package/dist/__spec__/core/generating-class-docs.spec.js.map +0 -1
  145. package/dist/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
  146. package/dist/__spec__/core/generating-enum-docs.spec.js +0 -306
  147. package/dist/__spec__/core/generating-enum-docs.spec.js.map +0 -1
  148. package/dist/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
  149. package/dist/__spec__/core/generating-interface-docs.spec.js +0 -364
  150. package/dist/__spec__/core/generating-interface-docs.spec.js.map +0 -1
  151. package/dist/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
  152. package/dist/__spec__/core/generating-reference-guide.spec.js +0 -162
  153. package/dist/__spec__/core/generating-reference-guide.spec.js.map +0 -1
  154. package/dist/__spec__/core/test-helpers.d.ts +0 -2
  155. package/dist/__spec__/core/test-helpers.js +0 -12
  156. package/dist/__spec__/core/test-helpers.js.map +0 -1
  157. package/dist/application/Apexdocs.d.ts +0 -15
  158. package/dist/application/Apexdocs.js +0 -113
  159. package/dist/application/Apexdocs.js.map +0 -1
  160. package/dist/application/generators/generate-markdown-files.d.ts +0 -3
  161. package/dist/application/generators/generate-markdown-files.js +0 -64
  162. package/dist/application/generators/generate-markdown-files.js.map +0 -1
  163. package/dist/cli/args.d.ts +0 -39
  164. package/dist/cli/args.js +0 -154
  165. package/dist/cli/args.js.map +0 -1
  166. package/dist/cli/generate.d.ts +0 -2
  167. package/dist/cli/generate.js.map +0 -1
  168. package/dist/core/__test__/inheritance-chain.test.d.ts +0 -1
  169. package/dist/core/__test__/inheritance-chain.test.js +0 -42
  170. package/dist/core/__test__/inheritance-chain.test.js.map +0 -1
  171. package/dist/core/adapters/apex-types.d.ts +0 -6
  172. package/dist/core/adapters/apex-types.js +0 -109
  173. package/dist/core/adapters/apex-types.js.map +0 -1
  174. package/dist/core/adapters/documentables.d.ts +0 -7
  175. package/dist/core/adapters/documentables.js +0 -154
  176. package/dist/core/adapters/documentables.js.map +0 -1
  177. package/dist/core/adapters/fields-and-properties.d.ts +0 -3
  178. package/dist/core/adapters/fields-and-properties.js +0 -37
  179. package/dist/core/adapters/fields-and-properties.js.map +0 -1
  180. package/dist/core/adapters/methods-and-constructors.d.ts +0 -5
  181. package/dist/core/adapters/methods-and-constructors.js +0 -100
  182. package/dist/core/adapters/methods-and-constructors.js.map +0 -1
  183. package/dist/core/adapters/references.d.ts +0 -4
  184. package/dist/core/adapters/references.js +0 -78
  185. package/dist/core/adapters/references.js.map +0 -1
  186. package/dist/core/adapters/type-utils.d.ts +0 -3
  187. package/dist/core/adapters/type-utils.js +0 -12
  188. package/dist/core/adapters/type-utils.js.map +0 -1
  189. package/dist/core/apex-bundle.d.ts +0 -6
  190. package/dist/core/apex-bundle.js +0 -11
  191. package/dist/core/apex-bundle.js.map +0 -1
  192. package/dist/core/generate-docs.d.ts +0 -28
  193. package/dist/core/generate-docs.js +0 -296
  194. package/dist/core/generate-docs.js.map +0 -1
  195. package/dist/core/inheritance-chain.d.ts +0 -2
  196. package/dist/core/inheritance-chain.js +0 -36
  197. package/dist/core/inheritance-chain.js.map +0 -1
  198. package/dist/core/manifest.d.ts +0 -22
  199. package/dist/core/manifest.js +0 -53
  200. package/dist/core/manifest.js.map +0 -1
  201. package/dist/core/template.d.ts +0 -10
  202. package/dist/core/template.js +0 -97
  203. package/dist/core/template.js.map +0 -1
  204. package/dist/core/templates/reference-guide.d.ts +0 -1
  205. package/dist/core/templates/reference-guide.js +0 -18
  206. package/dist/core/templates/reference-guide.js.map +0 -1
  207. package/dist/index.js.map +0 -1
  208. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
  209. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
  210. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
  211. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
  212. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
  213. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
  214. package/dist/model/markdown-file.d.ts +0 -16
  215. package/dist/model/markdown-file.js +0 -111
  216. package/dist/model/markdown-file.js.map +0 -1
  217. package/dist/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
  218. package/dist/model/markdown-generation-util/doc-comment-annotation-util.js +0 -47
  219. package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
  220. package/dist/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
  221. package/dist/model/markdown-generation-util/field-declaration-util.js +0 -55
  222. package/dist/model/markdown-generation-util/field-declaration-util.js.map +0 -1
  223. package/dist/model/markdown-generation-util/index.d.ts +0 -3
  224. package/dist/model/markdown-generation-util/index.js +0 -20
  225. package/dist/model/markdown-generation-util/index.js.map +0 -1
  226. package/dist/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
  227. package/dist/model/markdown-generation-util/method-declaration-util.js +0 -115
  228. package/dist/model/markdown-generation-util/method-declaration-util.js.map +0 -1
  229. package/dist/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
  230. package/dist/model/markdown-generation-util/type-declaration-util.js +0 -82
  231. package/dist/model/markdown-generation-util/type-declaration-util.js.map +0 -1
  232. package/dist/model/markdown-home-file.d.ts +0 -11
  233. package/dist/model/markdown-home-file.js +0 -57
  234. package/dist/model/markdown-home-file.js.map +0 -1
  235. package/dist/model/markdown-type-file.d.ts +0 -26
  236. package/dist/model/markdown-type-file.js +0 -137
  237. package/dist/model/markdown-type-file.js.map +0 -1
  238. package/dist/model/openapi/apex-doc-types.d.ts +0 -19
  239. package/dist/model/openapi/apex-doc-types.js +0 -5
  240. package/dist/model/openapi/apex-doc-types.js.map +0 -1
  241. package/dist/model/openapi/open-api-types.d.ts +0 -93
  242. package/dist/model/openapi/open-api-types.js +0 -3
  243. package/dist/model/openapi/open-api-types.js.map +0 -1
  244. package/dist/model/openapi/open-api.d.ts +0 -16
  245. package/dist/model/openapi/open-api.js +0 -34
  246. package/dist/model/openapi/open-api.js.map +0 -1
  247. package/dist/model/openapi/openapi-type-file.d.ts +0 -7
  248. package/dist/model/openapi/openapi-type-file.js +0 -17
  249. package/dist/model/openapi/openapi-type-file.js.map +0 -1
  250. package/dist/model/outputFile.d.ts +0 -10
  251. package/dist/model/outputFile.js +0 -22
  252. package/dist/model/outputFile.js.map +0 -1
  253. package/dist/model/types-repository.d.ts +0 -16
  254. package/dist/model/types-repository.js +0 -54
  255. package/dist/model/types-repository.js.map +0 -1
  256. package/dist/service/apex-file-reader.d.ts +0 -14
  257. package/dist/service/apex-file-reader.js +0 -49
  258. package/dist/service/apex-file-reader.js.map +0 -1
  259. package/dist/service/file-system.d.ts +0 -14
  260. package/dist/service/file-system.js +0 -48
  261. package/dist/service/file-system.js.map +0 -1
  262. package/dist/service/file-writer.d.ts +0 -6
  263. package/dist/service/file-writer.js +0 -57
  264. package/dist/service/file-writer.js.map +0 -1
  265. package/dist/service/manifest-factory.d.ts +0 -10
  266. package/dist/service/manifest-factory.js +0 -17
  267. package/dist/service/manifest-factory.js.map +0 -1
  268. package/dist/service/metadata-processor.d.ts +0 -3
  269. package/dist/service/metadata-processor.js +0 -17
  270. package/dist/service/metadata-processor.js.map +0 -1
  271. package/dist/service/parser.d.ts +0 -21
  272. package/dist/service/parser.js +0 -138
  273. package/dist/service/parser.js.map +0 -1
  274. package/dist/service/state.d.ts +0 -9
  275. package/dist/service/state.js +0 -20
  276. package/dist/service/state.js.map +0 -1
  277. package/dist/service/walkers/class-walker.d.ts +0 -4
  278. package/dist/service/walkers/class-walker.js +0 -33
  279. package/dist/service/walkers/class-walker.js.map +0 -1
  280. package/dist/service/walkers/enum-walker.d.ts +0 -4
  281. package/dist/service/walkers/enum-walker.js +0 -11
  282. package/dist/service/walkers/enum-walker.js.map +0 -1
  283. package/dist/service/walkers/interface-walker.d.ts +0 -4
  284. package/dist/service/walkers/interface-walker.js +0 -15
  285. package/dist/service/walkers/interface-walker.js.map +0 -1
  286. package/dist/service/walkers/walker-factory.d.ts +0 -5
  287. package/dist/service/walkers/walker-factory.js +0 -21
  288. package/dist/service/walkers/walker-factory.js.map +0 -1
  289. package/dist/service/walkers/walker.d.ts +0 -19
  290. package/dist/service/walkers/walker.js +0 -17
  291. package/dist/service/walkers/walker.js.map +0 -1
  292. package/dist/settings.d.ts +0 -67
  293. package/dist/settings.js +0 -92
  294. package/dist/settings.js.map +0 -1
  295. package/dist/test-helpers/AnnotationBuilder.d.ts +0 -12
  296. package/dist/test-helpers/AnnotationBuilder.js +0 -31
  297. package/dist/test-helpers/AnnotationBuilder.js.map +0 -1
  298. package/dist/test-helpers/ClassMirrorBuilder.d.ts +0 -22
  299. package/dist/test-helpers/ClassMirrorBuilder.js +0 -64
  300. package/dist/test-helpers/ClassMirrorBuilder.js.map +0 -1
  301. package/dist/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
  302. package/dist/test-helpers/DocCommentAnnotationBuilder.js +0 -26
  303. package/dist/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
  304. package/dist/test-helpers/DocCommentBuilder.d.ts +0 -12
  305. package/dist/test-helpers/DocCommentBuilder.js +0 -38
  306. package/dist/test-helpers/DocCommentBuilder.js.map +0 -1
  307. package/dist/test-helpers/FieldMirrorBuilder.d.ts +0 -18
  308. package/dist/test-helpers/FieldMirrorBuilder.js +0 -54
  309. package/dist/test-helpers/FieldMirrorBuilder.js.map +0 -1
  310. package/dist/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
  311. package/dist/test-helpers/InterfaceMirrorBuilder.js +0 -43
  312. package/dist/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
  313. package/dist/test-helpers/MethodMirrorBuilder.d.ts +0 -29
  314. package/dist/test-helpers/MethodMirrorBuilder.js +0 -72
  315. package/dist/test-helpers/MethodMirrorBuilder.js.map +0 -1
  316. package/dist/test-helpers/SettingsBuilder.d.ts +0 -8
  317. package/dist/test-helpers/SettingsBuilder.js +0 -28
  318. package/dist/test-helpers/SettingsBuilder.js.map +0 -1
  319. package/dist/transpiler/factory.d.ts +0 -6
  320. package/dist/transpiler/factory.js +0 -33
  321. package/dist/transpiler/factory.js.map +0 -1
  322. package/dist/transpiler/file-container.d.ts +0 -6
  323. package/dist/transpiler/file-container.js +0 -16
  324. package/dist/transpiler/file-container.js.map +0 -1
  325. package/dist/transpiler/generator-choices.d.ts +0 -1
  326. package/dist/transpiler/generator-choices.js +0 -3
  327. package/dist/transpiler/generator-choices.js.map +0 -1
  328. package/dist/transpiler/markdown/class-file-generatorHelper.d.ts +0 -9
  329. package/dist/transpiler/markdown/class-file-generatorHelper.js +0 -61
  330. package/dist/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
  331. package/dist/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
  332. package/dist/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
  333. package/dist/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
  334. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
  335. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
  336. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
  337. package/dist/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
  338. package/dist/transpiler/markdown/markdown-transpiler-base.js +0 -27
  339. package/dist/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
  340. package/dist/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
  341. package/dist/transpiler/markdown/plain-markdown/class-template.js +0 -77
  342. package/dist/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
  343. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
  344. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -36
  345. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
  346. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
  347. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -30
  348. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
  349. package/dist/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
  350. package/dist/transpiler/markdown/plain-markdown/enum-template.js +0 -16
  351. package/dist/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
  352. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
  353. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -27
  354. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
  355. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
  356. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
  357. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -1
  358. package/dist/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
  359. package/dist/transpiler/markdown/plain-markdown/interface-template.js +0 -20
  360. package/dist/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
  361. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
  362. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -47
  363. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
  364. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
  365. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
  366. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -1
  367. package/dist/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
  368. package/dist/transpiler/openapi/open-api-docs-processor.js +0 -78
  369. package/dist/transpiler/openapi/open-api-docs-processor.js.map +0 -1
  370. package/dist/transpiler/openapi/parsers/Builder.d.ts +0 -16
  371. package/dist/transpiler/openapi/parsers/Builder.js +0 -30
  372. package/dist/transpiler/openapi/parsers/Builder.js.map +0 -1
  373. package/dist/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
  374. package/dist/transpiler/openapi/parsers/MethodParser.js +0 -190
  375. package/dist/transpiler/openapi/parsers/MethodParser.js.map +0 -1
  376. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
  377. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
  378. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
  379. package/dist/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
  380. package/dist/transpiler/openapi/parsers/ReferenceBuilder.js +0 -250
  381. package/dist/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
  382. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
  383. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
  384. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
  385. package/dist/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
  386. package/dist/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
  387. package/dist/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
  388. package/dist/transpiler/processor-type-transpiler.d.ts +0 -10
  389. package/dist/transpiler/processor-type-transpiler.js +0 -9
  390. package/dist/transpiler/processor-type-transpiler.js.map +0 -1
  391. package/dist/transpiler/transpiler.d.ts +0 -5
  392. package/dist/transpiler/transpiler.js +0 -30
  393. package/dist/transpiler/transpiler.js.map +0 -1
  394. package/dist/util/error-logger.d.ts +0 -8
  395. package/dist/util/error-logger.js +0 -90
  396. package/dist/util/error-logger.js.map +0 -1
  397. package/dist/util/logger.d.ts +0 -21
  398. package/dist/util/logger.js +0 -61
  399. package/dist/util/logger.js.map +0 -1
  400. package/dist/util/string-utils.d.ts +0 -2
  401. package/dist/util/string-utils.js +0 -15
  402. package/dist/util/string-utils.js.map +0 -1
  403. package/examples/plain-markdown/template.md +0 -3
  404. package/src/__spec__/core/generating-class-docs.spec.ts +0 -531
  405. package/src/__spec__/core/generating-reference-guide.spec.ts +0 -164
  406. package/src/__spec__/core/test-helpers.ts +0 -9
  407. package/src/application/generators/generate-markdown-files.ts +0 -53
  408. package/src/core/apex-bundle.ts +0 -3
  409. package/src/core/generate-docs.ts +0 -432
  410. package/src/model/markdown-file.ts +0 -122
  411. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +0 -50
  412. package/src/model/markdown-generation-util/field-declaration-util.ts +0 -71
  413. package/src/model/markdown-generation-util/index.ts +0 -3
  414. package/src/model/markdown-generation-util/method-declaration-util.ts +0 -166
  415. package/src/model/markdown-generation-util/type-declaration-util.ts +0 -91
  416. package/src/model/markdown-home-file.ts +0 -58
  417. package/src/model/markdown-type-file.ts +0 -169
  418. package/src/model/openapi/openapi-type-file.ts +0 -14
  419. package/src/model/outputFile.ts +0 -20
  420. package/src/service/__tests__/apex-file-reader.spec.ts +0 -93
  421. package/src/service/apex-file-reader.ts +0 -51
  422. package/src/service/file-writer.ts +0 -34
  423. package/src/service/metadata-processor.ts +0 -16
  424. package/src/service/state.ts +0 -24
  425. package/src/service/walkers/class-walker.ts +0 -30
  426. package/src/service/walkers/enum-walker.ts +0 -7
  427. package/src/service/walkers/interface-walker.ts +0 -12
  428. package/src/service/walkers/walker-factory.ts +0 -19
  429. package/src/service/walkers/walker.ts +0 -42
  430. package/src/settings.ts +0 -153
  431. package/src/transpiler/factory.ts +0 -31
  432. package/src/transpiler/file-container.ts +0 -13
  433. package/src/transpiler/generator-choices.ts +0 -1
  434. package/src/transpiler/markdown/class-file-generatorHelper.ts +0 -61
  435. package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +0 -12
  436. package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +0 -50
  437. package/src/transpiler/markdown/markdown-transpiler-base.ts +0 -28
  438. package/src/transpiler/processor-type-transpiler.ts +0 -18
  439. /package/src/{service → application}/file-system.ts +0 -0
  440. /package/src/core/{inheritance-chain.ts → markdown/reflection/inheritance-chain.ts} +0 -0
  441. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/documentable-partial-template.ts +0 -0
  442. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/enum-template.ts +0 -0
  443. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/fieldsPartialTemplate.ts +0 -0
  444. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/grouped-members-partial-template.ts +0 -0
  445. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/interface-template.ts +0 -0
  446. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/methods-partial-template.ts +0 -0
  447. /package/src/core/{templates → markdown/templates}/reference-guide.ts +0 -0
  448. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/type-doc-partial.ts +0 -0
  449. /package/src/{service → core/openapi}/__tests__/manifest-factory.spec.ts +0 -0
  450. /package/src/{model → core}/openapi/__tests__/open-api.spec.ts +0 -0
  451. /package/src/{model → core}/openapi/apex-doc-types.ts +0 -0
  452. /package/src/{model → core/openapi}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
  453. /package/src/{model → core/openapi}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
  454. /package/src/{model → core}/openapi/open-api-types.ts +0 -0
  455. /package/src/{model → core}/openapi/open-api.ts +0 -0
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ const defaults = {
4
+ targetGenerator: "markdown",
5
+ targetDir: "./docs/",
6
+ scope: ["global"],
7
+ defaultGroupName: "Miscellaneous",
8
+ includeMetadata: false,
9
+ sortMembersAlphabetically: false
10
+ };
11
+
12
+ exports.defaults = defaults;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ const defaults = {
4
+ targetGenerator: "markdown",
5
+ targetDir: "./docs/",
6
+ scope: ["global"],
7
+ defaultGroupName: "Miscellaneous",
8
+ includeMetadata: false
9
+ };
10
+
11
+ exports.defaults = defaults;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,62 @@
1
- import * as apexReflection from '@cparra/apex-reflection';
2
- export { apexReflection as reflection };
1
+ import { SetOptional } from 'type-fest';
2
+
3
+ type ConfigurableHooks = {
4
+ transformReferenceGuide: TransformReferenceGuide;
5
+ transformDocs: TransformDocs;
6
+ transformDocPage: TransformDocPage;
7
+ };
8
+
9
+ type UserDefinedMarkdownConfig = {
10
+ targetGenerator: 'markdown';
11
+ sourceDir: string;
12
+ targetDir: string;
13
+ scope: string[];
14
+ defaultGroupName: string;
15
+ namespace?: string;
16
+ sortMembersAlphabetically: boolean;
17
+ includeMetadata: boolean;
18
+ } & Partial<ConfigurableHooks>;
19
+
20
+ type Frontmatter = string | Record<string, unknown> | null;
21
+
22
+ type ReferenceGuidePageData = {
23
+ directory: string;
24
+ frontmatter: Frontmatter;
25
+ content: string;
26
+ fileExtension: string;
27
+ fileName: string;
28
+ };
29
+
30
+ type DocPageData = {
31
+ source: {
32
+ filePath: string;
33
+ name: string;
34
+ type: 'interface' | 'class' | 'enum';
35
+ };
36
+ group: string | null;
37
+ fileName: string;
38
+ fileExtension: string;
39
+ directory: string;
40
+ frontmatter: Frontmatter;
41
+ content: string;
42
+ };
43
+
44
+ type Skip = {
45
+ readonly _tag: 'Skip';
46
+ };
47
+
48
+ // Configurable Hooks
49
+
50
+ type TransformReferenceGuide = (
51
+ referenceGuide: ReferenceGuidePageData,
52
+ ) => Partial<ReferenceGuidePageData> | Skip | Promise<Partial<ReferenceGuidePageData> | Skip>;
53
+
54
+ type TransformDocs = (docs: DocPageData[]) => DocPageData[] | Promise<DocPageData[]>;
55
+
56
+ type TransformDocPage = (doc: DocPageData) => Partial<DocPageData> | Promise<Partial<DocPageData>>;
57
+
58
+ type ConfigurableMarkdownConfig = Omit<SetOptional<UserDefinedMarkdownConfig, 'targetDir' | 'scope' | 'defaultGroupName' | 'includeMetadata' | 'sortMembersAlphabetically'>, 'targetGenerator'>;
59
+ declare function defineMarkdownConfig(config: ConfigurableMarkdownConfig): UserDefinedMarkdownConfig;
60
+ declare function skip(): Skip;
61
+
62
+ export { type ConfigurableHooks, type DocPageData, type ReferenceGuidePageData, defineMarkdownConfig, skip };
package/dist/index.js CHANGED
@@ -1 +1,36 @@
1
- "use strict";var a=Object.defineProperty;var c=(e,t)=>a(e,"name",{value:t,configurable:!0});var f=require("@cparra/apex-reflection");function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}c(i,"_interopNamespaceDefault");var u=i(f);exports.reflection=u;
1
+ 'use strict';
2
+
3
+ var defaults = require('./defaults-DUwru49Q.js');
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __defProps = Object.defineProperties;
7
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ function defineMarkdownConfig(config) {
25
+ return __spreadProps(__spreadValues(__spreadValues({}, defaults.defaults), config), {
26
+ targetGenerator: "markdown"
27
+ });
28
+ }
29
+ function skip() {
30
+ return {
31
+ _tag: "Skip"
32
+ };
33
+ }
34
+
35
+ exports.defineMarkdownConfig = defineMarkdownConfig;
36
+ exports.skip = skip;
@@ -13,4 +13,4 @@ public sampleEnumFromBase
13
13
  ```
14
14
 
15
15
  #### Type
16
- [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
16
+ [ns.SampleEnum](../Sample-Enums/ns.SampleEnum.md)
@@ -70,4 +70,4 @@ A string value.
70
70
  ```apex
71
71
  SampleClass sample = new SampleClass();
72
72
  sample.doSomething();
73
- ```
73
+ ```
@@ -12,4 +12,4 @@ public void sampleParentMethod()
12
12
  ```
13
13
 
14
14
  #### Return Type
15
- **void**
15
+ **void**
@@ -5,4 +5,4 @@ ns
5
5
 
6
6
  ## Values
7
7
  | Value | Description |
8
- |-------|-------------|
8
+ |-------|-------------|
@@ -22,4 +22,4 @@ try {
22
22
  ns
23
23
 
24
24
  **Inheritance**
25
- Exception
25
+ Exception
@@ -116,4 +116,4 @@ public void sampleParentMethod()
116
116
  ```
117
117
 
118
118
  #### Return Type
119
- **void**
119
+ **void**
@@ -0,0 +1,320 @@
1
+ # Url Class
2
+
3
+ Represents a uniform resource locator (URL) and provides access to parts of the URL.
4
+
5
+ Enables access to the base URL used to access your Salesforce org.
6
+
7
+ ## Usage
8
+
9
+ Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
10
+
11
+ logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
12
+
13
+ a link to a file uploaded as an attachment to a Chatter post by concatenating the Salesforce base URL with the file ID:
14
+
15
+ ```apex
16
+ // Get a file uploaded through Chatter.
17
+ ContentDocument doc = [SELECT Id FROM ContentDocument
18
+ WHERE Title = 'myfile'];
19
+ // Create a link to the file.
20
+ String fullFileURL = URL.getOrgDomainURL().toExternalForm() +
21
+ '/' + doc.id;
22
+ system.debug(fullFileURL);
23
+ ```
24
+
25
+ The following example creates a link to a Salesforce record. The full URL is created by concatenating the Salesforce base
26
+
27
+ URL with the record ID.
28
+
29
+ ```ape
30
+ Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
31
+ String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
32
+ ```
33
+
34
+ ## Example
35
+
36
+ In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
37
+
38
+ pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
39
+
40
+ prints out all the results to the debug log output.
41
+
42
+ ```apex
43
+ // Create a new account called Acme that we will create a link for later.
44
+ Account myAccount = new Account(Name='Acme');
45
+ insert myAccount;
46
+ // Get the base URL.
47
+ String sfdcBaseURL = URL.getOrgDomainURL().toExternalForm();
48
+ System.debug('Base URL: ' + sfdcBaseURL );
49
+ // Get the URL for the current request.
50
+ String currentRequestURL = URL.getCurrentRequestUrl().toExternalForm();
51
+ System.debug('Current request URL: ' + currentRequestURL);
52
+ // Create the account URL from the base URL.
53
+ String accountURL = URL.getOrgDomainURL().toExternalForm() +
54
+ '/' + myAccount.Id;
55
+ System.debug('URL of a particular account: ' + accountURL);
56
+ // Get some parts of the base URL.
57
+ System.debug('Host: ' + URL.getOrgDomainURL().getHost());
58
+ System.debug('Protocol: ' + URL.getOrgDomainURL().getProtocol());
59
+ // Get the query string of the current request.
60
+ System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
61
+ ```
62
+
63
+ ## Version Behavior Changes
64
+
65
+ In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
66
+
67
+ The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
68
+
69
+ specific instance. Salesforce strongly encourages you to use API 41.0 and later versions for fully RFC-compliant URL
70
+
71
+ parsing that includes proper handling of edge cases of complex URL structures. API 41.0 and later versions also enforce
72
+
73
+ that inputs are valid, RFC-compliant URL or URI strings.
74
+
75
+ * [URL Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_constructors)
76
+
77
+ * [URL Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_methods)
78
+
79
+ **See Also**
80
+
81
+ * [URL Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_url.htm)
82
+
83
+ ## Namespace
84
+ ns
85
+
86
+ ## Constructors
87
+ ### `Url(spec)`
88
+
89
+ Creates a new instance of the URL class using the specified string representation of the URL.
90
+
91
+ #### Signature
92
+ ```apex
93
+ global Url(String spec)
94
+ ```
95
+
96
+ #### Parameters
97
+ | Name | Type | Description |
98
+ |------|------|-------------|
99
+ | spec | String | The string to parse as a URL. |
100
+
101
+ ---
102
+
103
+ ### `Url(context, spec)`
104
+
105
+ Creates a new instance of the URL class by parsing the specified spec within the specified context.
106
+
107
+ **Usage**
108
+
109
+ The new URL is created from the given context URL and the spec argument as described in RFC2396 &quot;Uniform Resource Identifiers : Generic * Syntax&quot; :
110
+
111
+ ```xml
112
+ <scheme>://<authority><path>?<query>#<fragment>
113
+ ```
114
+
115
+ For more information about the arguments of this constructor, see the corresponding URL(java.net.URL, java.lang.String) constructor for Java.
116
+
117
+ #### Signature
118
+ ```apex
119
+ global Url(Url context, String spec)
120
+ ```
121
+
122
+ #### Parameters
123
+ | Name | Type | Description |
124
+ |------|------|-------------|
125
+ | context | [ns.Url](./ns.Url.md) | The context in which to parse the specification. |
126
+ | spec | String | The string to parse as a URL. |
127
+
128
+ ---
129
+
130
+ ### `Url(protocol, host, file)`
131
+
132
+ Creates a new instance of the URL class using the specified protocol, host, and file on the host. The default port for the specified protocol is used.
133
+
134
+ #### Signature
135
+ ```apex
136
+ global Url(String protocol, String host, String file)
137
+ ```
138
+
139
+ #### Parameters
140
+ | Name | Type | Description |
141
+ |------|------|-------------|
142
+ | protocol | String | The protocol name for this URL. |
143
+ | host | String | The host name for this URL. |
144
+ | file | String | The file name for this URL. |
145
+
146
+ ---
147
+
148
+ ### `Url(protocol, host, port, file)`
149
+
150
+ Creates a new instance of the URL class using the specified protocol, host, port number, and file on the host.
151
+
152
+ #### Signature
153
+ ```apex
154
+ global Url(String protocol, String host, Integer port, String file)
155
+ ```
156
+
157
+ #### Parameters
158
+ | Name | Type | Description |
159
+ |------|------|-------------|
160
+ | protocol | String | The protocol name for this URL. |
161
+ | host | String | The host name for this URL. |
162
+ | port | Integer | The port number for this URL. |
163
+ | file | String | The file name for this URL. |
164
+
165
+ ## Methods
166
+ ### `getAuthority()`
167
+
168
+ Returns the authority portion of the current URL.
169
+
170
+ #### Signature
171
+ ```apex
172
+ global String getAuthority()
173
+ ```
174
+
175
+ #### Return Type
176
+ **String**
177
+
178
+ The authority portion of the current URL.
179
+
180
+ ---
181
+
182
+ ### `getCurrentRequestUrl()`
183
+
184
+ Returns the URL of an entire request on a Salesforce instance.
185
+
186
+ **Usage**
187
+
188
+ An example of a URL for an entire request is https://yourInstance.salesforce.com/apex/myVfPage.apexp.
189
+
190
+ #### Signature
191
+ ```apex
192
+ global static Url getCurrentRequestUrl()
193
+ ```
194
+
195
+ #### Return Type
196
+ **[ns.Url](./ns.Url.md)**
197
+
198
+ The URL of the entire request.
199
+
200
+ ---
201
+
202
+ ### `getDefPort()`
203
+
204
+ Returns the default port number of the protocol associated with the current URL.
205
+
206
+ **Usage**
207
+
208
+ Returns -1 if the URL scheme or the stream protocol handler for the URL doesn&#x27;t define a default port number.
209
+
210
+ #### Signature
211
+ ```apex
212
+ global Integer getDefPort()
213
+ ```
214
+
215
+ #### Return Type
216
+ **Integer**
217
+
218
+ The default port number of the protocol associated with the current URL.
219
+
220
+ ---
221
+
222
+ ### `getFile()`
223
+
224
+ Returns the file name of the current URL.
225
+
226
+ #### Signature
227
+ ```apex
228
+ global String getFile()
229
+ ```
230
+
231
+ #### Return Type
232
+ **String**
233
+
234
+ The file name of the current URL.
235
+
236
+ ---
237
+
238
+ ### `getFileFieldURL(entityId, fieldName)`
239
+
240
+ Returns the download URL for a file attachment.
241
+
242
+ #### Signature
243
+ ```apex
244
+ global static String getFileFieldURL(String entityId, String fieldName)
245
+ ```
246
+
247
+ #### Parameters
248
+ | Name | Type | Description |
249
+ |------|------|-------------|
250
+ | entityId | String | Specifies the ID of the entity that holds the file data. |
251
+ | fieldName | String | Specifies the API name of a file field component, such as `AttachmentBody` . |
252
+
253
+ #### Return Type
254
+ **String**
255
+
256
+ The download URL for the file attachment.
257
+
258
+ #### Example
259
+ ```apex
260
+ String fileURL =
261
+ URL.getFileFieldURL(
262
+ '087000000000123' ,
263
+ 'AttachmentBody');
264
+ ```
265
+
266
+ ---
267
+
268
+ ### `getHost()`
269
+
270
+ Returns the host name of the current URL.
271
+
272
+ #### Signature
273
+ ```apex
274
+ global String getHost()
275
+ ```
276
+
277
+ #### Return Type
278
+ **String**
279
+
280
+ The host name of the current URL.
281
+
282
+ ---
283
+
284
+ ### `getOrgDomainUrl()`
285
+
286
+ Returns the canonical URL for your org. For example, https://MyDomainName.my.salesforce.com.
287
+
288
+ **Usage**
289
+
290
+ Use getOrgDomainUrl() to interact with Salesforce REST and SOAP APIs in Apex code. Get endpoints for User Interface API calls, for creating and customizing picklist value sets and custom fields, and more.
291
+
292
+ `getOrgDomainUrl()` can access the domain URL only for the org in which the Apex code is running.
293
+
294
+ You don&#x27;t need a RemoteSiteSetting for your org to interact with the Salesforce APIs using domain URLs retrieved with this method.
295
+
296
+ **See Also**
297
+
298
+ * [Lightning Aura Components Developer Guide: Making API Calls from Apex](https://developer.salesforce.com/docs/atlas.en-us.250.0.lightning.meta/lightning/apex_api_calls.htm)
299
+
300
+ #### Signature
301
+ ```apex
302
+ global static Url getOrgDomainUrl()
303
+ ```
304
+
305
+ #### Return Type
306
+ **[ns.Url](./ns.Url.md)**
307
+
308
+ getOrgDomainUrl() always returns the login URL for your org, regardless of context. Use that URL when making API calls to your org.
309
+
310
+ #### Example
311
+ ```apex
312
+ // This example uses the Salesforce REST API to get organization limit values. For information on limits, see Limits in the REST API Developer Guide.
313
+ Http h = new Http();
314
+ HttpRequest req = new HttpRequest();
315
+ req.setEndpoint(Url.getOrgDomainUrl().toExternalForm()
316
+ + '/services/data/v44.0/limits');
317
+ req.setMethod('GET');
318
+ req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
319
+ HttpResponse res = h.send(req);
320
+ ```
@@ -35,4 +35,4 @@ graph TD
35
35
  |-------|-------------|
36
36
  | VALUE1 | This is value 1 |
37
37
  | VALUE2 | This is value 2 |
38
- | VALUE3 | This is value 3 |
38
+ | VALUE3 | This is value 3 |
@@ -170,4 +170,4 @@ public void doSomething()
170
170
  ```
171
171
 
172
172
  ###### Return Type
173
- **void**
173
+ **void**
@@ -18,6 +18,88 @@ This is a sample exception.
18
18
 
19
19
  This is a sample interface
20
20
 
21
+ ### [ns.Url](./Miscellaneous/ns.Url.md)
22
+
23
+ Represents a uniform resource locator (URL) and provides access to parts of the URL.
24
+
25
+ Enables access to the base URL used to access your Salesforce org.
26
+
27
+ ## Usage
28
+
29
+ Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
30
+
31
+ logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
32
+
33
+ a link to a file uploaded as an attachment to a Chatter post by concatenating the Salesforce base URL with the file ID:
34
+
35
+ ```apex
36
+ // Get a file uploaded through Chatter.
37
+ ContentDocument doc = [SELECT Id FROM ContentDocument
38
+ WHERE Title = 'myfile'];
39
+ // Create a link to the file.
40
+ String fullFileURL = URL.getOrgDomainURL().toExternalForm() +
41
+ '/' + doc.id;
42
+ system.debug(fullFileURL);
43
+ ```
44
+
45
+ The following example creates a link to a Salesforce record. The full URL is created by concatenating the Salesforce base
46
+
47
+ URL with the record ID.
48
+
49
+ ```ape
50
+ Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
51
+ String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
52
+ ```
53
+
54
+ ## Example
55
+
56
+ In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
57
+
58
+ pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
59
+
60
+ prints out all the results to the debug log output.
61
+
62
+ ```apex
63
+ // Create a new account called Acme that we will create a link for later.
64
+ Account myAccount = new Account(Name='Acme');
65
+ insert myAccount;
66
+ // Get the base URL.
67
+ String sfdcBaseURL = URL.getOrgDomainURL().toExternalForm();
68
+ System.debug('Base URL: ' + sfdcBaseURL );
69
+ // Get the URL for the current request.
70
+ String currentRequestURL = URL.getCurrentRequestUrl().toExternalForm();
71
+ System.debug('Current request URL: ' + currentRequestURL);
72
+ // Create the account URL from the base URL.
73
+ String accountURL = URL.getOrgDomainURL().toExternalForm() +
74
+ '/' + myAccount.Id;
75
+ System.debug('URL of a particular account: ' + accountURL);
76
+ // Get some parts of the base URL.
77
+ System.debug('Host: ' + URL.getOrgDomainURL().getHost());
78
+ System.debug('Protocol: ' + URL.getOrgDomainURL().getProtocol());
79
+ // Get the query string of the current request.
80
+ System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
81
+ ```
82
+
83
+ ## Version Behavior Changes
84
+
85
+ In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
86
+
87
+ The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
88
+
89
+ specific instance. Salesforce strongly encourages you to use API 41.0 and later versions for fully RFC-compliant URL
90
+
91
+ parsing that includes proper handling of edge cases of complex URL structures. API 41.0 and later versions also enforce
92
+
93
+ that inputs are valid, RFC-compliant URL or URI strings.
94
+
95
+ * [URL Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_constructors)
96
+
97
+ * [URL Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_methods)
98
+
99
+ **See Also**
100
+
101
+ * [URL Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_url.htm)
102
+
21
103
  ## Sample Enums
22
104
 
23
105
  ### [ns.SampleEnum](./Sample-Enums/ns.SampleEnum.md)
@@ -32,4 +114,4 @@ This description has several lines
32
114
 
33
115
  aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
34
116
 
35
- deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
117
+ deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.