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

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 (189) hide show
  1. package/dist/cli/generate.js +2745 -39
  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 +1 -1
  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 +1 -1
  16. package/examples/plain-markdown/package.json +3 -4
  17. package/examples/vitepress/.forceignore +12 -0
  18. package/examples/vitepress/apexdocs.config.ts +108 -0
  19. package/examples/vitepress/config/project-scratch-def.json +13 -0
  20. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +259 -0
  21. package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +7 -0
  22. package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +40 -0
  23. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +11474 -0
  24. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +7 -0
  25. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +9172 -0
  26. package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +7 -0
  27. package/examples/vitepress/docs/.vitepress/cache/deps/package.json +3 -0
  28. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4339 -0
  29. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
  30. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +567 -0
  31. package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
  32. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +323 -0
  33. package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +7 -0
  34. package/examples/vitepress/docs/.vitepress/config.mts +21 -0
  35. package/examples/vitepress/docs/.vitepress/sidebar.json +119 -0
  36. package/examples/vitepress/docs/Miscellaneous/apexdocs.BaseClass.md +20 -0
  37. package/examples/vitepress/docs/Miscellaneous/apexdocs.MultiInheritanceClass.md +78 -0
  38. package/examples/vitepress/docs/Miscellaneous/apexdocs.ParentInterface.md +19 -0
  39. package/examples/vitepress/docs/Miscellaneous/apexdocs.ReferencedEnum.md +15 -0
  40. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleException.md +28 -0
  41. package/examples/vitepress/docs/Miscellaneous/apexdocs.SampleInterface.md +122 -0
  42. package/examples/vitepress/docs/Miscellaneous/apexdocs.Url.md +318 -0
  43. package/examples/vitepress/docs/Sample-Enums/apexdocs.SampleEnum.md +41 -0
  44. package/examples/vitepress/docs/SampleGroup/apexdocs.SampleClass.md +178 -0
  45. package/examples/vitepress/docs/api-examples.md +49 -0
  46. package/examples/vitepress/docs/index-frontmatter.md +16 -0
  47. package/examples/vitepress/docs/index.md +127 -0
  48. package/examples/vitepress/docs/markdown-examples.md +85 -0
  49. package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +3 -0
  50. package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +1 -0
  51. package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +3 -0
  52. package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +5 -0
  53. package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +72 -0
  54. package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +30 -0
  55. package/examples/vitepress/force-app/main/default/classes/SampleException.cls +17 -0
  56. package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +46 -0
  57. package/examples/vitepress/force-app/main/default/classes/Url.cls +195 -0
  58. package/examples/vitepress/package-lock.json +2574 -0
  59. package/examples/vitepress/package.json +18 -0
  60. package/examples/vitepress/sfdx-project.json +12 -0
  61. package/jest.config.js +1 -0
  62. package/package.json +11 -10
  63. package/src/application/Apexdocs.ts +16 -104
  64. package/src/application/__tests__/apex-file-reader.spec.ts +104 -0
  65. package/src/application/apex-file-reader.ts +42 -0
  66. package/src/application/file-writer.ts +25 -0
  67. package/src/application/generators/markdown.ts +53 -0
  68. package/src/application/generators/openapi.ts +56 -0
  69. package/src/cli/args.ts +17 -112
  70. package/src/cli/commands/markdown.ts +58 -0
  71. package/src/cli/generate.ts +7 -5
  72. package/src/{model/__tests__ → core/__test__}/manifest.spec.ts +1 -1
  73. package/src/core/manifest.ts +57 -51
  74. package/src/{__spec__/core → core/markdown/__test__}/expect-extensions.ts +5 -5
  75. package/src/core/markdown/__test__/generating-class-docs.spec.ts +727 -0
  76. package/src/{__spec__/core → core/markdown/__test__}/generating-enum-docs.spec.ts +82 -59
  77. package/src/{__spec__/core → core/markdown/__test__}/generating-interface-docs.spec.ts +94 -75
  78. package/src/core/markdown/__test__/generating-reference-guide.spec.ts +184 -0
  79. package/src/core/{__test__ → markdown/__test__}/inheritance-chain.test.ts +2 -2
  80. package/src/core/markdown/__test__/test-helpers.ts +22 -0
  81. package/src/core/{adapters → markdown/adapters}/__tests__/interface-adapter.spec.ts +38 -8
  82. package/src/core/{adapters → markdown/adapters}/apex-types.ts +7 -4
  83. package/src/core/{adapters → markdown/adapters}/inline.ts +1 -1
  84. package/src/core/markdown/adapters/renderable-bundle.ts +144 -0
  85. package/src/core/markdown/adapters/renderable-to-page-data.ts +92 -0
  86. package/src/core/{adapters → markdown/adapters}/types.d.ts +16 -2
  87. package/src/core/markdown/generate-docs.ts +158 -0
  88. package/src/core/markdown/reflection/error-handling.ts +37 -0
  89. package/src/core/markdown/reflection/filter-scope.ts +13 -0
  90. package/src/core/markdown/reflection/inheritance-chain-expanion.ts +22 -0
  91. package/src/core/markdown/reflection/inherited-member-expansion.ts +105 -0
  92. package/src/core/markdown/reflection/reflect-source.ts +41 -0
  93. package/src/core/markdown/reflection/sort-members.ts +59 -0
  94. package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/class-template.ts +2 -0
  95. package/src/core/markdown/templates/hookable.ts +7 -0
  96. package/src/core/{template.ts → markdown/templates/template.ts} +12 -12
  97. package/src/core/markdown/utils.ts +3 -0
  98. package/src/{transpiler → core}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
  99. package/src/{model → core/openapi}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
  100. package/src/core/openapi/file-container.ts +13 -0
  101. package/src/{service → core/openapi}/manifest-factory.ts +3 -3
  102. package/src/{transpiler → core}/openapi/open-api-docs-processor.ts +9 -10
  103. package/src/core/openapi/openapi-type-file.ts +14 -0
  104. package/src/{service → core/openapi}/parser.ts +8 -8
  105. package/src/{transpiler → core}/openapi/parsers/Builder.ts +2 -2
  106. package/src/{transpiler → core}/openapi/parsers/MethodParser.ts +5 -5
  107. package/src/{transpiler → core}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
  108. package/src/{transpiler → core}/openapi/parsers/ReferenceBuilder.ts +3 -3
  109. package/src/{transpiler → core}/openapi/parsers/RequestBodyBuilder.ts +2 -2
  110. package/src/{transpiler → core}/openapi/parsers/ResponsesBuilder.ts +2 -2
  111. package/src/{transpiler → core}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
  112. package/src/{transpiler → core}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
  113. package/src/{transpiler → core}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
  114. package/src/{transpiler → core}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
  115. package/src/{transpiler → core}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
  116. package/src/{transpiler → core/openapi}/transpiler.ts +2 -6
  117. package/src/{model → core/openapi}/types-repository.ts +0 -9
  118. package/src/core/parse-apex-metadata.ts +14 -0
  119. package/src/core/settings.ts +56 -0
  120. package/src/core/shared/types.d.ts +92 -0
  121. package/src/core/shared/utils.ts +5 -0
  122. package/src/defaults.ts +8 -0
  123. package/src/index.ts +34 -2
  124. package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -5
  125. package/src/test-helpers/SettingsBuilder.ts +1 -3
  126. package/src/util/logger.ts +2 -2
  127. package/src/util/string-utils.ts +0 -4
  128. package/tsconfig.json +5 -1
  129. package/apexdocs.config.ts +0 -13
  130. package/examples/plain-markdown/template.md +0 -3
  131. package/src/__spec__/core/generating-class-docs.spec.ts +0 -531
  132. package/src/__spec__/core/generating-reference-guide.spec.ts +0 -164
  133. package/src/__spec__/core/test-helpers.ts +0 -9
  134. package/src/application/generators/generate-markdown-files.ts +0 -53
  135. package/src/core/apex-bundle.ts +0 -3
  136. package/src/core/generate-docs.ts +0 -432
  137. package/src/model/markdown-file.ts +0 -122
  138. package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +0 -50
  139. package/src/model/markdown-generation-util/field-declaration-util.ts +0 -71
  140. package/src/model/markdown-generation-util/index.ts +0 -3
  141. package/src/model/markdown-generation-util/method-declaration-util.ts +0 -166
  142. package/src/model/markdown-generation-util/type-declaration-util.ts +0 -91
  143. package/src/model/markdown-home-file.ts +0 -58
  144. package/src/model/markdown-type-file.ts +0 -169
  145. package/src/model/openapi/openapi-type-file.ts +0 -14
  146. package/src/model/outputFile.ts +0 -20
  147. package/src/service/__tests__/apex-file-reader.spec.ts +0 -93
  148. package/src/service/apex-file-reader.ts +0 -47
  149. package/src/service/file-writer.ts +0 -34
  150. package/src/service/metadata-processor.ts +0 -16
  151. package/src/service/state.ts +0 -24
  152. package/src/service/walkers/class-walker.ts +0 -30
  153. package/src/service/walkers/enum-walker.ts +0 -7
  154. package/src/service/walkers/interface-walker.ts +0 -12
  155. package/src/service/walkers/walker-factory.ts +0 -19
  156. package/src/service/walkers/walker.ts +0 -42
  157. package/src/settings.ts +0 -143
  158. package/src/transpiler/factory.ts +0 -31
  159. package/src/transpiler/file-container.ts +0 -13
  160. package/src/transpiler/generator-choices.ts +0 -1
  161. package/src/transpiler/markdown/class-file-generatorHelper.ts +0 -61
  162. package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +0 -12
  163. package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +0 -50
  164. package/src/transpiler/markdown/markdown-transpiler-base.ts +0 -28
  165. package/src/transpiler/processor-type-transpiler.ts +0 -18
  166. /package/src/{service → application}/file-system.ts +0 -0
  167. /package/src/core/{adapters → markdown/adapters}/__tests__/documentables.spec.ts +0 -0
  168. /package/src/core/{adapters → markdown/adapters}/__tests__/references.spec.ts +0 -0
  169. /package/src/core/{adapters → markdown/adapters}/documentables.ts +0 -0
  170. /package/src/core/{adapters → markdown/adapters}/fields-and-properties.ts +0 -0
  171. /package/src/core/{adapters → markdown/adapters}/methods-and-constructors.ts +0 -0
  172. /package/src/core/{adapters → markdown/adapters}/type-utils.ts +0 -0
  173. /package/src/core/{inheritance-chain.ts → markdown/reflection/inheritance-chain.ts} +0 -0
  174. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/constructors-partial-template.ts +0 -0
  175. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/documentable-partial-template.ts +0 -0
  176. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/enum-template.ts +0 -0
  177. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/fieldsPartialTemplate.ts +0 -0
  178. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/grouped-members-partial-template.ts +0 -0
  179. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/interface-template.ts +0 -0
  180. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/methods-partial-template.ts +0 -0
  181. /package/src/core/{templates → markdown/templates}/reference-guide.ts +0 -0
  182. /package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/type-doc-partial.ts +0 -0
  183. /package/src/{service → core/openapi}/__tests__/manifest-factory.spec.ts +0 -0
  184. /package/src/{model → core}/openapi/__tests__/open-api.spec.ts +0 -0
  185. /package/src/{model → core}/openapi/apex-doc-types.ts +0 -0
  186. /package/src/{model → core/openapi}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
  187. /package/src/{model → core/openapi}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
  188. /package/src/{model → core}/openapi/open-api-types.ts +0 -0
  189. /package/src/{model → core}/openapi/open-api.ts +0 -0
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: SampleInterface
3
+ ---
4
+
5
+ # SampleInterface Interface
6
+
7
+ `NAMESPACEACCESSIBLE`
8
+
9
+ This is a sample interface
10
+
11
+ **Author** John Doe
12
+
13
+ **Date** 2020-01-01
14
+
15
+ **See** [apexdocs.SampleEnum](../Sample-Enums/apexdocs.SampleEnum.md)
16
+
17
+ **See** [apexdocs.ReferencedEnum](./apexdocs.ReferencedEnum.md)
18
+
19
+ ## Namespace
20
+ apexdocs
21
+
22
+ ## Diagram
23
+ ```mermaid
24
+ graph TD
25
+ A[SampleInterface] -->|extends| B[ParentInterface]
26
+ B -->|extends| C[GrandParentInterface]
27
+ C -->|extends| D[GreatGrandParentInterface]
28
+ ```
29
+
30
+ ## Example
31
+ ```apex
32
+ SampleInterface sampleInterface = new SampleInterface();
33
+ sampleInterface.sampleMethod();
34
+ ```
35
+
36
+ **Extends**
37
+ [apexdocs.ParentInterface](./apexdocs.ParentInterface.md)
38
+
39
+ ## Methods
40
+ ### `sampleMethod()`
41
+
42
+ `NAMESPACEACCESSIBLE`
43
+
44
+ This is a sample method
45
+
46
+ **Custom Tag**
47
+
48
+ This is a custom tag
49
+
50
+ **Another Custom Tag**
51
+
52
+ This is another custom tag
53
+
54
+ #### Signature
55
+ ```apex
56
+ public String sampleMethod()
57
+ ```
58
+
59
+ #### Return Type
60
+ **String**
61
+
62
+ Some return value
63
+
64
+ #### Throws
65
+ [apexdocs.SampleException](./apexdocs.SampleException.md): This is a sample exception
66
+
67
+ AnotherSampleException: This is another sample exception
68
+
69
+ #### Diagram
70
+ ```mermaid
71
+ graph TD
72
+ A[SampleInterface] -->|extends| B[ParentInterface]
73
+ B -->|extends| C[GrandParentInterface]
74
+ C -->|extends| D[GreatGrandParentInterface]
75
+ ```
76
+
77
+ #### Example
78
+ ```apex
79
+ SampleInterface sampleInterface = new SampleInterface();
80
+ sampleInterface.sampleMethod();
81
+ ```
82
+
83
+ ---
84
+
85
+ ### `sampleMethodWithParams(param1, param2, theEnum)`
86
+
87
+ `NAMESPACEACCESSIBLE`
88
+ `DEPRECATED`
89
+
90
+ This is a sample method with parameters
91
+ Sometimes it won't be possible to find a NonExistent link.
92
+
93
+ #### Signature
94
+ ```apex
95
+ public SampleEnum sampleMethodWithParams(String param1, Integer param2, SampleEnum theEnum)
96
+ ```
97
+
98
+ #### Parameters
99
+ | Name | Type | Description |
100
+ |------|------|-------------|
101
+ | param1 | String | This is the first parameter |
102
+ | param2 | Integer | This is the second parameter |
103
+ | theEnum | [apexdocs.SampleEnum](../Sample-Enums/apexdocs.SampleEnum.md) | This is an enum parameter |
104
+
105
+ #### Return Type
106
+ **[apexdocs.SampleEnum](../Sample-Enums/apexdocs.SampleEnum.md)**
107
+
108
+ Some return value
109
+
110
+ ---
111
+
112
+ ### `sampleParentMethod()`
113
+
114
+ *Inherited*
115
+
116
+ #### Signature
117
+ ```apex
118
+ public void sampleParentMethod()
119
+ ```
120
+
121
+ #### Return Type
122
+ **void**
@@ -0,0 +1,318 @@
1
+ ---
2
+ title: Url
3
+ ---
4
+
5
+ # Url Class
6
+
7
+ Represents a uniform resource locator (URL) and provides access to parts of the URL.
8
+ Enables access to the base URL used to access your Salesforce org.
9
+
10
+ ## Usage
11
+ Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
12
+ logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
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
+
26
+ The following example creates a link to a Salesforce record. The full URL is created by concatenating the Salesforce base
27
+ URL with the record ID.
28
+
29
+ ```apex
30
+ Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
31
+ String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
32
+ ```
33
+
34
+
35
+ ## Example
36
+ In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
37
+ pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
38
+ prints out all the results to the debug log output.
39
+
40
+ ```apex
41
+ // Create a new account called Acme that we will create a link for later.
42
+ Account myAccount = new Account(Name='Acme');
43
+ insert myAccount;
44
+
45
+ // Get the base URL.
46
+ String sfdcBaseURL = URL.getOrgDomainURL().toExternalForm();
47
+ System.debug('Base URL: ' + sfdcBaseURL );
48
+
49
+ // Get the URL for the current request.
50
+ String currentRequestURL = URL.getCurrentRequestUrl().toExternalForm();
51
+ System.debug('Current request URL: ' + currentRequestURL);
52
+
53
+ // Create the account URL from the base URL.
54
+ String accountURL = URL.getOrgDomainURL().toExternalForm() +
55
+ '/' + myAccount.Id;
56
+ System.debug('URL of a particular account: ' + accountURL);
57
+
58
+ // Get some parts of the base URL.
59
+ System.debug('Host: ' + URL.getOrgDomainURL().getHost());
60
+ System.debug('Protocol: ' + URL.getOrgDomainURL().getProtocol());
61
+
62
+ // Get the query string of the current request.
63
+ System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
64
+ ```
65
+
66
+
67
+ ## Version Behavior Changes
68
+ In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
69
+
70
+ The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
71
+ specific instance. Salesforce strongly encourages you to use API 41.0 and later versions for fully RFC-compliant URL
72
+ parsing that includes proper handling of edge cases of complex URL structures. API 41.0 and later versions also enforce
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
+ * [URL Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_methods)
77
+
78
+ **See Also**
79
+ * [URL Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_url.htm)
80
+
81
+ ## Namespace
82
+ apexdocs
83
+
84
+ ## Constructors
85
+ ### `Url(spec)`
86
+
87
+ Creates a new instance of the URL class using the specified string representation of the URL.
88
+
89
+ #### Signature
90
+ ```apex
91
+ global Url(String spec)
92
+ ```
93
+
94
+ #### Parameters
95
+ | Name | Type | Description |
96
+ |------|------|-------------|
97
+ | spec | String | The string to parse as a URL. |
98
+
99
+ ---
100
+
101
+ ### `Url(context, spec)`
102
+
103
+ Creates a new instance of the URL class by parsing the specified spec within the specified context.
104
+
105
+ **Usage**
106
+
107
+ The new URL is created from the given context URL and the spec argument as described in RFC2396 "Uniform Resource Identifiers : Generic * Syntax" :
108
+ ```xml
109
+ <scheme>://<authority><path>?<query>#<fragment>
110
+ ```
111
+
112
+
113
+ For more information about the arguments of this constructor, see the corresponding URL(java.net.URL, java.lang.String) constructor for Java.
114
+
115
+ #### Signature
116
+ ```apex
117
+ global Url(Url context, String spec)
118
+ ```
119
+
120
+ #### Parameters
121
+ | Name | Type | Description |
122
+ |------|------|-------------|
123
+ | context | [apexdocs.Url](./apexdocs.Url.md) | The context in which to parse the specification. |
124
+ | spec | String | The string to parse as a URL. |
125
+
126
+ ---
127
+
128
+ ### `Url(protocol, host, file)`
129
+
130
+ 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.
131
+
132
+ #### Signature
133
+ ```apex
134
+ global Url(String protocol, String host, String file)
135
+ ```
136
+
137
+ #### Parameters
138
+ | Name | Type | Description |
139
+ |------|------|-------------|
140
+ | protocol | String | The protocol name for this URL. |
141
+ | host | String | The host name for this URL. |
142
+ | file | String | The file name for this URL. |
143
+
144
+ ---
145
+
146
+ ### `Url(protocol, host, port, file)`
147
+
148
+ Creates a new instance of the URL class using the specified protocol, host, port number, and file on the host.
149
+
150
+ #### Signature
151
+ ```apex
152
+ global Url(String protocol, String host, Integer port, String file)
153
+ ```
154
+
155
+ #### Parameters
156
+ | Name | Type | Description |
157
+ |------|------|-------------|
158
+ | protocol | String | The protocol name for this URL. |
159
+ | host | String | The host name for this URL. |
160
+ | port | Integer | The port number for this URL. |
161
+ | file | String | The file name for this URL. |
162
+
163
+ ## Methods
164
+ ### `getAuthority()`
165
+
166
+ Returns the authority portion of the current URL.
167
+
168
+ #### Signature
169
+ ```apex
170
+ global String getAuthority()
171
+ ```
172
+
173
+ #### Return Type
174
+ **String**
175
+
176
+ The authority portion of the current URL.
177
+
178
+ ---
179
+
180
+ ### `getCurrentRequestUrl()`
181
+
182
+ Returns the URL of an entire request on a Salesforce instance.
183
+
184
+ **Usage**
185
+
186
+ An example of a URL for an entire request is https://yourInstance.salesforce.com/apex/myVfPage.apexp.
187
+
188
+ #### Signature
189
+ ```apex
190
+ global static Url getCurrentRequestUrl()
191
+ ```
192
+
193
+ #### Return Type
194
+ **[apexdocs.Url](./apexdocs.Url.md)**
195
+
196
+ The URL of the entire request.
197
+
198
+ ---
199
+
200
+ ### `getDefPort()`
201
+
202
+ Returns the default port number of the protocol associated with the current URL.
203
+
204
+ **Usage**
205
+
206
+ Returns -1 if the URL scheme or the stream protocol handler for the URL doesn&#x27;t define a default port number.
207
+
208
+ #### Signature
209
+ ```apex
210
+ global Integer getDefPort()
211
+ ```
212
+
213
+ #### Return Type
214
+ **Integer**
215
+
216
+ The default port number of the protocol associated with the current URL.
217
+
218
+ ---
219
+
220
+ ### `getFile()`
221
+
222
+ Returns the file name of the current URL.
223
+
224
+ #### Signature
225
+ ```apex
226
+ global String getFile()
227
+ ```
228
+
229
+ #### Return Type
230
+ **String**
231
+
232
+ The file name of the current URL.
233
+
234
+ ---
235
+
236
+ ### `getFileFieldURL(entityId, fieldName)`
237
+
238
+ Returns the download URL for a file attachment.
239
+
240
+ #### Signature
241
+ ```apex
242
+ global static String getFileFieldURL(String entityId, String fieldName)
243
+ ```
244
+
245
+ #### Parameters
246
+ | Name | Type | Description |
247
+ |------|------|-------------|
248
+ | entityId | String | Specifies the ID of the entity that holds the file data. |
249
+ | fieldName | String | Specifies the API name of a file field component, such as `AttachmentBody` . |
250
+
251
+ #### Return Type
252
+ **String**
253
+
254
+ The download URL for the file attachment.
255
+
256
+ #### Example
257
+ ```apex
258
+ String fileURL =
259
+ URL.getFileFieldURL(
260
+ '087000000000123' ,
261
+ 'AttachmentBody');
262
+ ```
263
+
264
+ ---
265
+
266
+ ### `getHost()`
267
+
268
+ Returns the host name of the current URL.
269
+
270
+ #### Signature
271
+ ```apex
272
+ global String getHost()
273
+ ```
274
+
275
+ #### Return Type
276
+ **String**
277
+
278
+ The host name of the current URL.
279
+
280
+ ---
281
+
282
+ ### `getOrgDomainUrl()`
283
+
284
+ Returns the canonical URL for your org. For example, https://MyDomainName.my.salesforce.com.
285
+
286
+ **Usage**
287
+
288
+ 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.
289
+
290
+ `getOrgDomainUrl()` can access the domain URL only for the org in which the Apex code is running.
291
+
292
+ You don&#x27;t need a RemoteSiteSetting for your org to interact with the Salesforce APIs using domain URLs retrieved with this method.
293
+
294
+ **See Also**
295
+
296
+ * [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)
297
+
298
+ #### Signature
299
+ ```apex
300
+ global static Url getOrgDomainUrl()
301
+ ```
302
+
303
+ #### Return Type
304
+ **[apexdocs.Url](./apexdocs.Url.md)**
305
+
306
+ getOrgDomainUrl() always returns the login URL for your org, regardless of context. Use that URL when making API calls to your org.
307
+
308
+ #### Example
309
+ ```apex
310
+ // This example uses the Salesforce REST API to get organization limit values. For information on limits, see Limits in the REST API Developer Guide.
311
+ Http h = new Http();
312
+ HttpRequest req = new HttpRequest();
313
+ req.setEndpoint(Url.getOrgDomainUrl().toExternalForm()
314
+ + '/services/data/v44.0/limits');
315
+ req.setMethod('GET');
316
+ req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
317
+ HttpResponse res = h.send(req);
318
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: SampleEnum
3
+ ---
4
+
5
+ # SampleEnum Enum
6
+
7
+ `NAMESPACEACCESSIBLE`
8
+
9
+ This is a sample enum. This references [apexdocs.ReferencedEnum](../Miscellaneous/apexdocs.ReferencedEnum.md) .
10
+
11
+ This description has several lines
12
+
13
+ **Some Custom**
14
+
15
+ Test. I can also have a [apexdocs.ReferencedEnum](../Miscellaneous/apexdocs.ReferencedEnum.md) here.
16
+ And it can be multiline.
17
+
18
+ **Group** Sample Enums
19
+
20
+ **Author** John Doe
21
+
22
+ **Date** 2022-01-01
23
+
24
+ **See** [apexdocs.ReferencedEnum](../Miscellaneous/apexdocs.ReferencedEnum.md)
25
+
26
+ ## Namespace
27
+ apexdocs
28
+
29
+ ## Diagram
30
+ ```mermaid
31
+ graph TD
32
+ A[SampleEnum] -->|references| B[ReferencedEnum]
33
+ B -->|referenced by| A
34
+ ```
35
+
36
+ ## Values
37
+ | Value | Description |
38
+ |-------|-------------|
39
+ | VALUE1 | This is value 1 |
40
+ | VALUE2 | This is value 2 |
41
+ | VALUE3 | This is value 3 |
@@ -0,0 +1,178 @@
1
+ ---
2
+ title: SampleClass
3
+ ---
4
+
5
+ # SampleClass Class
6
+ `virtual`
7
+
8
+ aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
9
+ deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
10
+
11
+ **Group** SampleGroup
12
+
13
+ ## Namespace
14
+ apexdocs
15
+
16
+ ## Example
17
+ ```apex
18
+ SampleClass sample = new SampleClass();
19
+ sample.doSomething();
20
+ ```
21
+
22
+ **Inheritance**
23
+
24
+ [apexdocs.BaseClass](../Miscellaneous/apexdocs.BaseClass.md)
25
+
26
+ **Implements**
27
+
28
+ [apexdocs.SampleInterface](../Miscellaneous/apexdocs.SampleInterface.md),
29
+ [apexdocs.ParentInterface](../Miscellaneous/apexdocs.ParentInterface.md)
30
+
31
+ ## Fields
32
+ ### Group Name
33
+ #### `name`
34
+
35
+ This is a sample field.
36
+
37
+ ##### Signature
38
+ ```apex
39
+ private final name
40
+ ```
41
+
42
+ ##### Type
43
+ String
44
+
45
+ ### Other
46
+ #### `sampleEnumFromBase`
47
+
48
+ *Inherited*
49
+
50
+ ##### Signature
51
+ ```apex
52
+ public sampleEnumFromBase
53
+ ```
54
+
55
+ ##### Type
56
+ [apexdocs.SampleEnum](../Sample-Enums/apexdocs.SampleEnum.md)
57
+
58
+ ## Properties
59
+ ### Group Name
60
+ #### `someProperty`
61
+
62
+ ##### Signature
63
+ ```apex
64
+ public someProperty
65
+ ```
66
+
67
+ ##### Type
68
+ String
69
+
70
+ ## Constructors
71
+ ### Other
72
+ #### `SampleClass()`
73
+
74
+ This is a sample constructor.
75
+
76
+ ##### Signature
77
+ ```apex
78
+ public SampleClass()
79
+ ```
80
+
81
+ ### Other Constructors
82
+ #### `SampleClass(name)`
83
+
84
+ ##### Signature
85
+ ```apex
86
+ public SampleClass(String name)
87
+ ```
88
+
89
+ ##### Parameters
90
+ | Name | Type | Description |
91
+ |------|------|-------------|
92
+ | name | String | |
93
+
94
+ ## Methods
95
+ ### Available Methods
96
+ #### `doSomething()`
97
+
98
+ ##### Signature
99
+ ```apex
100
+ public void doSomething()
101
+ ```
102
+
103
+ ##### Return Type
104
+ **void**
105
+
106
+ ### Deprecated Methods
107
+ #### `sayHello()`
108
+
109
+ `DEPRECATED`
110
+
111
+ This is a sample method.
112
+
113
+ ##### Signature
114
+ ```apex
115
+ public virtual String sayHello()
116
+ ```
117
+
118
+ ##### Return Type
119
+ **String**
120
+
121
+ A string value.
122
+
123
+ ##### Example
124
+ ```apex
125
+ SampleClass sample = new SampleClass();
126
+ sample.doSomething();
127
+ ```
128
+
129
+ ## Classes
130
+ ### SomeInnerClass Class
131
+
132
+ #### Fields
133
+ ##### `someInnerField`
134
+
135
+ ###### Signature
136
+ ```apex
137
+ public someInnerField
138
+ ```
139
+
140
+ ###### Type
141
+ String
142
+
143
+ #### Methods
144
+ ##### `doSomething()`
145
+
146
+ ###### Signature
147
+ ```apex
148
+ public void doSomething()
149
+ ```
150
+
151
+ ###### Return Type
152
+ **void**
153
+
154
+ ## Enums
155
+ ### SomeEnum Enum
156
+
157
+ This enum is used for foo and bar.
158
+
159
+ #### Values
160
+ | Value | Description |
161
+ |-------|-------------|
162
+ | TEST_1 | This is a test. |
163
+ | TEST_2 | |
164
+ | TEST_3 | |
165
+
166
+ ## Interfaces
167
+ ### SomeInterface Interface
168
+
169
+ #### Methods
170
+ ##### `doSomething()`
171
+
172
+ ###### Signature
173
+ ```apex
174
+ public void doSomething()
175
+ ```
176
+
177
+ ###### Return Type
178
+ **void**
@@ -0,0 +1,49 @@
1
+ ---
2
+ outline: deep
3
+ ---
4
+
5
+ # Runtime API Examples
6
+
7
+ This page demonstrates usage of some of the runtime APIs provided by VitePress.
8
+
9
+ The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10
+
11
+ ```md
12
+ <script setup>
13
+ import { useData } from 'vitepress'
14
+
15
+ const { theme, page, frontmatter } = useData()
16
+ </script>
17
+
18
+ ## Results
19
+
20
+ ### Theme Data
21
+ <pre>{{ theme }}</pre>
22
+
23
+ ### Page Data
24
+ <pre>{{ page }}</pre>
25
+
26
+ ### Page Frontmatter
27
+ <pre>{{ frontmatter }}</pre>
28
+ ```
29
+
30
+ <script setup>
31
+ import { useData } from 'vitepress'
32
+
33
+ const { site, theme, page, frontmatter } = useData()
34
+ </script>
35
+
36
+ ## Results
37
+
38
+ ### Theme Data
39
+ <pre>{{ theme }}</pre>
40
+
41
+ ### Page Data
42
+ <pre>{{ page }}</pre>
43
+
44
+ ### Page Frontmatter
45
+ <pre>{{ frontmatter }}</pre>
46
+
47
+ ## More
48
+
49
+ Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
@@ -0,0 +1,16 @@
1
+ ---
2
+ # https://vitepress.dev/reference/default-theme-home-page
3
+ layout: home
4
+
5
+ hero:
6
+ name: "Apexdocs Vitepress Example"
7
+ text: "API Documentation"
8
+ tagline: My great project tagline
9
+ actions:
10
+ - theme: brand
11
+ text: Markdown Examples
12
+ link: /markdown-examples
13
+ - theme: alt
14
+ text: API Examples
15
+ link: /api-examples
16
+ ---