@cparra/apexdocs 2.25.0-alpha.6 → 2.25.0-alpha.9
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.
- package/dist/cli/generate.js +192 -225
- package/dist/index.d.ts +51 -13
- package/examples/plain-markdown/docs/index.md +25 -33
- package/examples/plain-markdown/docs/{Miscellaneous/ns.BaseClass.md → miscellaneous/BaseClass.md} +1 -1
- package/examples/plain-markdown/docs/{Miscellaneous/ns.MultiInheritanceClass.md → miscellaneous/MultiInheritanceClass.md} +5 -6
- package/examples/plain-markdown/docs/{Miscellaneous/ns.SampleException.md → miscellaneous/SampleException.md} +3 -4
- package/examples/plain-markdown/docs/{Miscellaneous/ns.SampleInterface.md → miscellaneous/SampleInterface.md} +22 -29
- package/examples/plain-markdown/docs/{Miscellaneous/ns.Url.md → miscellaneous/Url.md} +32 -43
- package/examples/plain-markdown/docs/sample-enums/SampleEnum.md +36 -0
- package/examples/plain-markdown/docs/{SampleGroup/ns.SampleClass.md → samplegroup/SampleClass.md} +8 -11
- package/examples/vitepress/apexdocs.config.ts +1 -3
- package/examples/vitepress/docs/.vitepress/sidebar.json +18 -18
- package/examples/vitepress/docs/index.md +11 -82
- package/examples/vitepress/docs/{Miscellaneous/apexdocs.BaseClass.md → miscellaneous/BaseClass.md} +1 -1
- package/examples/vitepress/docs/{Miscellaneous/apexdocs.MultiInheritanceClass.md → miscellaneous/MultiInheritanceClass.md} +4 -6
- package/examples/vitepress/docs/{Miscellaneous/apexdocs.SampleException.md → miscellaneous/SampleException.md} +1 -1
- package/examples/vitepress/docs/{Miscellaneous/apexdocs.SampleInterface.md → miscellaneous/SampleInterface.md} +22 -28
- package/examples/vitepress/docs/{Miscellaneous/apexdocs.Url.md → miscellaneous/Url.md} +31 -32
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +40 -0
- package/examples/vitepress/docs/{SampleGroup/apexdocs.SampleClass.md → samplegroup/SampleClass.md} +6 -10
- package/examples/vitepress/force-app/main/default/classes/Url.cls +7 -4
- package/package.json +1 -1
- package/src/application/apex-file-reader.ts +3 -3
- package/src/application/file-writer.ts +5 -9
- package/src/application/generators/markdown.ts +9 -4
- package/src/application/generators/openapi.ts +4 -4
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +11 -3
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +7 -3
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +11 -3
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +3 -7
- package/src/core/markdown/__test__/test-helpers.ts +3 -3
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +40 -5
- package/src/core/markdown/adapters/apex-types.ts +3 -2
- package/src/core/markdown/adapters/documentables.ts +49 -68
- package/src/core/markdown/adapters/reference-guide.ts +35 -0
- package/src/core/markdown/adapters/renderable-bundle.ts +43 -119
- package/src/core/markdown/adapters/renderable-to-page-data.ts +12 -15
- package/src/core/markdown/adapters/types.d.ts +5 -8
- package/src/core/markdown/generate-docs.ts +99 -42
- package/src/core/markdown/reflection/inheritance-chain-expanion.ts +1 -1
- package/src/core/markdown/reflection/reflect-source.ts +8 -4
- package/src/core/markdown/templates/documentable-partial-template.ts +1 -1
- package/src/core/openapi/manifest-factory.ts +2 -2
- package/src/core/openapi/openapi-type-file.ts +1 -3
- package/src/core/openapi/parser.ts +4 -4
- package/src/core/shared/types.d.ts +52 -14
- package/src/index.ts +2 -1
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +0 -38
- package/examples/vitepress/docs/Sample-Enums/apexdocs.SampleEnum.md +0 -41
- /package/examples/plain-markdown/docs/{Miscellaneous/ns.ParentInterface.md → miscellaneous/ParentInterface.md} +0 -0
- /package/examples/plain-markdown/docs/{Miscellaneous/ns.ReferencedEnum.md → miscellaneous/ReferencedEnum.md} +0 -0
- /package/examples/vitepress/docs/{Miscellaneous/apexdocs.ParentInterface.md → miscellaneous/ParentInterface.md} +0 -0
- /package/examples/vitepress/docs/{Miscellaneous/apexdocs.ReferencedEnum.md → miscellaneous/ReferencedEnum.md} +0 -0
|
@@ -86,9 +86,7 @@ export default defineMarkdownConfig({
|
|
|
86
86
|
function toSidebarLink(doc: DocPageData) {
|
|
87
87
|
return {
|
|
88
88
|
text: doc.source.name,
|
|
89
|
-
link:
|
|
90
|
-
// remove the leading "./"
|
|
91
|
-
.replace(/^\.\//, ''),
|
|
89
|
+
link: doc.filePath,
|
|
92
90
|
};
|
|
93
91
|
}
|
|
94
92
|
|
|
@@ -10,23 +10,23 @@
|
|
|
10
10
|
"items": [
|
|
11
11
|
{
|
|
12
12
|
"text": "BaseClass",
|
|
13
|
-
"link": "
|
|
13
|
+
"link": "miscellaneous/BaseClass.md"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"text": "MultiInheritanceClass",
|
|
17
|
-
"link": "
|
|
17
|
+
"link": "miscellaneous/MultiInheritanceClass.md"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"text": "SampleClass",
|
|
21
|
-
"link": "
|
|
21
|
+
"link": "samplegroup/SampleClass.md"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"text": "SampleException",
|
|
25
|
-
"link": "
|
|
25
|
+
"link": "miscellaneous/SampleException.md"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"text": "Url",
|
|
29
|
-
"link": "
|
|
29
|
+
"link": "miscellaneous/Url.md"
|
|
30
30
|
}
|
|
31
31
|
]
|
|
32
32
|
},
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"items": [
|
|
36
36
|
{
|
|
37
37
|
"text": "ParentInterface",
|
|
38
|
-
"link": "
|
|
38
|
+
"link": "miscellaneous/ParentInterface.md"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"text": "SampleInterface",
|
|
42
|
-
"link": "
|
|
42
|
+
"link": "miscellaneous/SampleInterface.md"
|
|
43
43
|
}
|
|
44
44
|
]
|
|
45
45
|
},
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"items": [
|
|
49
49
|
{
|
|
50
50
|
"text": "ReferencedEnum",
|
|
51
|
-
"link": "
|
|
51
|
+
"link": "miscellaneous/ReferencedEnum.md"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"text": "SampleEnum",
|
|
55
|
-
"link": "
|
|
55
|
+
"link": "sample-enums/SampleEnum.md"
|
|
56
56
|
}
|
|
57
57
|
]
|
|
58
58
|
}
|
|
@@ -66,31 +66,31 @@
|
|
|
66
66
|
"items": [
|
|
67
67
|
{
|
|
68
68
|
"text": "BaseClass",
|
|
69
|
-
"link": "
|
|
69
|
+
"link": "miscellaneous/BaseClass.md"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"text": "MultiInheritanceClass",
|
|
73
|
-
"link": "
|
|
73
|
+
"link": "miscellaneous/MultiInheritanceClass.md"
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
"text": "ParentInterface",
|
|
77
|
-
"link": "
|
|
77
|
+
"link": "miscellaneous/ParentInterface.md"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
"text": "ReferencedEnum",
|
|
81
|
-
"link": "
|
|
81
|
+
"link": "miscellaneous/ReferencedEnum.md"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"text": "SampleException",
|
|
85
|
-
"link": "
|
|
85
|
+
"link": "miscellaneous/SampleException.md"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"text": "SampleInterface",
|
|
89
|
-
"link": "
|
|
89
|
+
"link": "miscellaneous/SampleInterface.md"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"text": "Url",
|
|
93
|
-
"link": "
|
|
93
|
+
"link": "miscellaneous/Url.md"
|
|
94
94
|
}
|
|
95
95
|
]
|
|
96
96
|
},
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"items": [
|
|
100
100
|
{
|
|
101
101
|
"text": "SampleClass",
|
|
102
|
-
"link": "
|
|
102
|
+
"link": "samplegroup/SampleClass.md"
|
|
103
103
|
}
|
|
104
104
|
]
|
|
105
105
|
},
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"items": [
|
|
109
109
|
{
|
|
110
110
|
"text": "SampleEnum",
|
|
111
|
-
"link": "
|
|
111
|
+
"link": "sample-enums/SampleEnum.md"
|
|
112
112
|
}
|
|
113
113
|
]
|
|
114
114
|
}
|
|
@@ -19,109 +19,38 @@ hero:
|
|
|
19
19
|
|
|
20
20
|
## Miscellaneous
|
|
21
21
|
|
|
22
|
-
### [
|
|
22
|
+
### [BaseClass](/miscellaneous/BaseClass.md)
|
|
23
23
|
|
|
24
|
-
### [
|
|
24
|
+
### [MultiInheritanceClass](/miscellaneous/MultiInheritanceClass.md)
|
|
25
25
|
|
|
26
|
-
### [
|
|
26
|
+
### [ParentInterface](/miscellaneous/ParentInterface.md)
|
|
27
27
|
|
|
28
|
-
### [
|
|
28
|
+
### [ReferencedEnum](/miscellaneous/ReferencedEnum.md)
|
|
29
29
|
|
|
30
|
-
### [
|
|
30
|
+
### [SampleException](/miscellaneous/SampleException.md)
|
|
31
31
|
|
|
32
32
|
This is a sample exception.
|
|
33
33
|
|
|
34
|
-
### [
|
|
34
|
+
### [SampleInterface](/miscellaneous/SampleInterface.md)
|
|
35
35
|
|
|
36
36
|
This is a sample interface
|
|
37
37
|
|
|
38
|
-
### [
|
|
38
|
+
### [Url](/miscellaneous/Url.md)
|
|
39
39
|
|
|
40
40
|
Represents a uniform resource locator (URL) and provides access to parts of the URL.
|
|
41
|
-
Enables access to the base URL used to access your Salesforce org.
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
|
|
45
|
-
logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
|
|
46
|
-
a link to a file uploaded as an attachment to a Chatter post by concatenating the Salesforce base URL with the file ID:
|
|
47
|
-
|
|
48
|
-
```apex
|
|
49
|
-
// Get a file uploaded through Chatter.
|
|
50
|
-
ContentDocument doc = [SELECT Id FROM ContentDocument
|
|
51
|
-
WHERE Title = 'myfile'];
|
|
52
|
-
// Create a link to the file.
|
|
53
|
-
String fullFileURL = URL.getOrgDomainURL().toExternalForm() +
|
|
54
|
-
'/' + doc.id;
|
|
55
|
-
System.debug(fullFileURL);
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
The following example creates a link to a Salesforce record. The full URL is created by concatenating the Salesforce base
|
|
60
|
-
URL with the record ID.
|
|
61
|
-
|
|
62
|
-
```apex
|
|
63
|
-
Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
|
|
64
|
-
String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## Example
|
|
69
|
-
In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
|
|
70
|
-
pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
|
|
71
|
-
prints out all the results to the debug log output.
|
|
72
|
-
|
|
73
|
-
```apex
|
|
74
|
-
// Create a new account called Acme that we will create a link for later.
|
|
75
|
-
Account myAccount = new Account(Name='Acme');
|
|
76
|
-
insert myAccount;
|
|
77
|
-
|
|
78
|
-
// Get the base URL.
|
|
79
|
-
String sfdcBaseURL = URL.getOrgDomainURL().toExternalForm();
|
|
80
|
-
System.debug('Base URL: ' + sfdcBaseURL );
|
|
81
|
-
|
|
82
|
-
// Get the URL for the current request.
|
|
83
|
-
String currentRequestURL = URL.getCurrentRequestUrl().toExternalForm();
|
|
84
|
-
System.debug('Current request URL: ' + currentRequestURL);
|
|
85
|
-
|
|
86
|
-
// Create the account URL from the base URL.
|
|
87
|
-
String accountURL = URL.getOrgDomainURL().toExternalForm() +
|
|
88
|
-
'/' + myAccount.Id;
|
|
89
|
-
System.debug('URL of a particular account: ' + accountURL);
|
|
90
|
-
|
|
91
|
-
// Get some parts of the base URL.
|
|
92
|
-
System.debug('Host: ' + URL.getOrgDomainURL().getHost());
|
|
93
|
-
System.debug('Protocol: ' + URL.getOrgDomainURL().getProtocol());
|
|
94
|
-
|
|
95
|
-
// Get the query string of the current request.
|
|
96
|
-
System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
## Version Behavior Changes
|
|
101
|
-
In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
|
|
102
|
-
|
|
103
|
-
The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
|
|
104
|
-
specific instance. Salesforce strongly encourages you to use API 41.0 and later versions for fully RFC-compliant URL
|
|
105
|
-
parsing that includes proper handling of edge cases of complex URL structures. API 41.0 and later versions also enforce
|
|
106
|
-
that inputs are valid, RFC-compliant URL or URI strings.
|
|
107
|
-
|
|
108
|
-
* [URL Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_constructors)
|
|
109
|
-
* [URL Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_methods)
|
|
110
|
-
|
|
111
|
-
**See Also**
|
|
112
|
-
* [URL Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_url.htm)
|
|
41
|
+
Enables access to the base URL used to access your Salesforce org.
|
|
113
42
|
|
|
114
43
|
## Sample Enums
|
|
115
44
|
|
|
116
|
-
### [
|
|
45
|
+
### [SampleEnum](/sample-enums/SampleEnum.md)
|
|
117
46
|
|
|
118
|
-
This is a sample enum. This references [
|
|
47
|
+
This is a sample enum. This references [ReferencedEnum](/miscellaneous/ReferencedEnum.md) .
|
|
119
48
|
|
|
120
49
|
This description has several lines
|
|
121
50
|
|
|
122
51
|
## SampleGroup
|
|
123
52
|
|
|
124
|
-
### [
|
|
53
|
+
### [SampleClass](/samplegroup/SampleClass.md)
|
|
125
54
|
|
|
126
55
|
aliquip ex sunt officia ullamco anim deserunt magna aliquip nisi eiusmod in sit officia veniam ex
|
|
127
56
|
deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet cupidatat.
|
|
@@ -9,7 +9,7 @@ apexdocs
|
|
|
9
9
|
|
|
10
10
|
**Inheritance**
|
|
11
11
|
|
|
12
|
-
[
|
|
12
|
+
[SampleClass](/samplegroup/SampleClass.md) < [BaseClass](/miscellaneous/BaseClass.md)
|
|
13
13
|
|
|
14
14
|
## Fields
|
|
15
15
|
### `sampleEnumFromBase`
|
|
@@ -22,7 +22,7 @@ public sampleEnumFromBase
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
#### Type
|
|
25
|
-
[
|
|
25
|
+
[SampleEnum](/sample-enums/SampleEnum.md)
|
|
26
26
|
|
|
27
27
|
## Properties
|
|
28
28
|
### Group Name
|
|
@@ -72,7 +72,5 @@ public virtual String sayHello()
|
|
|
72
72
|
A string value.
|
|
73
73
|
|
|
74
74
|
##### Example
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
sample.doSomething();
|
|
78
|
-
```
|
|
75
|
+
SampleClass sample = new SampleClass();
|
|
76
|
+
sample.doSomething();
|
|
@@ -9,7 +9,7 @@ This is a sample exception.
|
|
|
9
9
|
**Usage**
|
|
10
10
|
|
|
11
11
|
You can use the exception the following way.
|
|
12
|
-
You can also take a look at [
|
|
12
|
+
You can also take a look at [SampleClass](/samplegroup/SampleClass.md) to see how it is used.
|
|
13
13
|
This is a dangerous HTML tag: <script>alert('Hello');</script>
|
|
14
14
|
|
|
15
15
|
```apex
|
|
@@ -8,33 +8,30 @@ title: SampleInterface
|
|
|
8
8
|
|
|
9
9
|
This is a sample interface
|
|
10
10
|
|
|
11
|
+
**Mermaid**
|
|
12
|
+
|
|
13
|
+
graph TD
|
|
14
|
+
A[SampleInterface] -->|extends| B[ParentInterface]
|
|
15
|
+
B -->|extends| C[GrandParentInterface]
|
|
16
|
+
C -->|extends| D[GreatGrandParentInterface]
|
|
17
|
+
|
|
11
18
|
**Author** John Doe
|
|
12
19
|
|
|
13
20
|
**Date** 2020-01-01
|
|
14
21
|
|
|
15
|
-
**See** [
|
|
22
|
+
**See** [SampleEnum](/sample-enums/SampleEnum.md)
|
|
16
23
|
|
|
17
|
-
**See** [
|
|
24
|
+
**See** [ReferencedEnum](/miscellaneous/ReferencedEnum.md)
|
|
18
25
|
|
|
19
26
|
## Namespace
|
|
20
27
|
apexdocs
|
|
21
28
|
|
|
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
29
|
## Example
|
|
31
|
-
|
|
32
|
-
SampleInterface sampleInterface = new SampleInterface();
|
|
30
|
+
SampleInterface sampleInterface = new SampleInterface();
|
|
33
31
|
sampleInterface.sampleMethod();
|
|
34
|
-
```
|
|
35
32
|
|
|
36
33
|
**Extends**
|
|
37
|
-
[
|
|
34
|
+
[ParentInterface](/miscellaneous/ParentInterface.md)
|
|
38
35
|
|
|
39
36
|
## Methods
|
|
40
37
|
### `sampleMethod()`
|
|
@@ -51,6 +48,13 @@ This is a custom tag
|
|
|
51
48
|
|
|
52
49
|
This is another custom tag
|
|
53
50
|
|
|
51
|
+
**Mermaid**
|
|
52
|
+
|
|
53
|
+
graph TD
|
|
54
|
+
A[SampleInterface] -->|extends| B[ParentInterface]
|
|
55
|
+
B -->|extends| C[GrandParentInterface]
|
|
56
|
+
C -->|extends| D[GreatGrandParentInterface]
|
|
57
|
+
|
|
54
58
|
#### Signature
|
|
55
59
|
```apex
|
|
56
60
|
public String sampleMethod()
|
|
@@ -62,23 +66,13 @@ public String sampleMethod()
|
|
|
62
66
|
Some return value
|
|
63
67
|
|
|
64
68
|
#### Throws
|
|
65
|
-
[
|
|
69
|
+
[SampleException](/miscellaneous/SampleException.md): This is a sample exception
|
|
66
70
|
|
|
67
71
|
AnotherSampleException: This is another sample exception
|
|
68
72
|
|
|
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
73
|
#### Example
|
|
78
|
-
|
|
79
|
-
SampleInterface sampleInterface = new SampleInterface();
|
|
74
|
+
SampleInterface sampleInterface = new SampleInterface();
|
|
80
75
|
sampleInterface.sampleMethod();
|
|
81
|
-
```
|
|
82
76
|
|
|
83
77
|
---
|
|
84
78
|
|
|
@@ -100,10 +94,10 @@ public SampleEnum sampleMethodWithParams(String param1, Integer param2, SampleEn
|
|
|
100
94
|
|------|------|-------------|
|
|
101
95
|
| param1 | String | This is the first parameter |
|
|
102
96
|
| param2 | Integer | This is the second parameter |
|
|
103
|
-
| theEnum | [
|
|
97
|
+
| theEnum | [SampleEnum](/sample-enums/SampleEnum.md) | This is an enum parameter |
|
|
104
98
|
|
|
105
99
|
#### Return Type
|
|
106
|
-
**[
|
|
100
|
+
**[SampleEnum](/sample-enums/SampleEnum.md)**
|
|
107
101
|
|
|
108
102
|
Some return value
|
|
109
103
|
|
|
@@ -5,9 +5,10 @@ title: Url
|
|
|
5
5
|
# Url Class
|
|
6
6
|
|
|
7
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
|
-
|
|
8
|
+
Enables access to the base URL used to access your Salesforce org.
|
|
9
|
+
|
|
10
|
+
**Usage**
|
|
11
|
+
|
|
11
12
|
Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
|
|
12
13
|
logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
|
|
13
14
|
a link to a file uploaded as an attachment to a Chatter post by concatenating the Salesforce base URL with the file ID:
|
|
@@ -31,8 +32,25 @@ Account acct = [SELECT Id FROM Account WHERE Name = 'Acme' LIMIT 1];
|
|
|
31
32
|
String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
**Version Behavior Changes**
|
|
36
|
+
|
|
37
|
+
In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
|
|
38
|
+
|
|
39
|
+
The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
|
|
40
|
+
specific instance. Salesforce strongly encourages you to use API 41.0 and later versions for fully RFC-compliant URL
|
|
41
|
+
parsing that includes proper handling of edge cases of complex URL structures. API 41.0 and later versions also enforce
|
|
42
|
+
that inputs are valid, RFC-compliant URL or URI strings.
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
* [URL Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_constructors)
|
|
45
|
+
* [URL Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_url.htm#apex_System_URL_methods)
|
|
46
|
+
|
|
47
|
+
**See Also**
|
|
48
|
+
* [URL Class](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_url.htm)
|
|
49
|
+
|
|
50
|
+
## Namespace
|
|
51
|
+
apexdocs
|
|
52
|
+
|
|
53
|
+
## Example
|
|
36
54
|
In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
|
|
37
55
|
pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
|
|
38
56
|
prints out all the results to the debug log output.
|
|
@@ -63,24 +81,6 @@ System.debug('Protocol: ' + URL.getOrgDomainURL().getProtocol());
|
|
|
63
81
|
System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
|
|
64
82
|
```
|
|
65
83
|
|
|
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
84
|
## Constructors
|
|
85
85
|
### `Url(spec)`
|
|
86
86
|
|
|
@@ -120,7 +120,7 @@ global Url(Url context, String spec)
|
|
|
120
120
|
#### Parameters
|
|
121
121
|
| Name | Type | Description |
|
|
122
122
|
|------|------|-------------|
|
|
123
|
-
| context | [
|
|
123
|
+
| context | [Url](/miscellaneous/Url.md) | The context in which to parse the specification. |
|
|
124
124
|
| spec | String | The string to parse as a URL. |
|
|
125
125
|
|
|
126
126
|
---
|
|
@@ -191,7 +191,7 @@ global static Url getCurrentRequestUrl()
|
|
|
191
191
|
```
|
|
192
192
|
|
|
193
193
|
#### Return Type
|
|
194
|
-
**[
|
|
194
|
+
**[Url](/miscellaneous/Url.md)**
|
|
195
195
|
|
|
196
196
|
The URL of the entire request.
|
|
197
197
|
|
|
@@ -254,12 +254,10 @@ global static String getFileFieldURL(String entityId, String fieldName)
|
|
|
254
254
|
The download URL for the file attachment.
|
|
255
255
|
|
|
256
256
|
#### Example
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
'AttachmentBody');
|
|
262
|
-
```
|
|
257
|
+
String fileURL =
|
|
258
|
+
URL.getFileFieldURL(
|
|
259
|
+
'087000000000123' ,
|
|
260
|
+
'AttachmentBody');
|
|
263
261
|
|
|
264
262
|
---
|
|
265
263
|
|
|
@@ -301,13 +299,14 @@ global static Url getOrgDomainUrl()
|
|
|
301
299
|
```
|
|
302
300
|
|
|
303
301
|
#### Return Type
|
|
304
|
-
**[
|
|
302
|
+
**[Url](/miscellaneous/Url.md)**
|
|
305
303
|
|
|
306
304
|
getOrgDomainUrl() always returns the login URL for your org, regardless of context. Use that URL when making API calls to your org.
|
|
307
305
|
|
|
308
306
|
#### Example
|
|
307
|
+
This example uses the Salesforce REST API to get organization limit values. For information on limits, see Limits in the REST API Developer Guide.
|
|
308
|
+
|
|
309
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
310
|
Http h = new Http();
|
|
312
311
|
HttpRequest req = new HttpRequest();
|
|
313
312
|
req.setEndpoint(Url.getOrgDomainUrl().toExternalForm()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SampleEnum
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# SampleEnum Enum
|
|
6
|
+
|
|
7
|
+
`NAMESPACEACCESSIBLE`
|
|
8
|
+
|
|
9
|
+
This is a sample enum. This references [ReferencedEnum](/miscellaneous/ReferencedEnum.md) .
|
|
10
|
+
|
|
11
|
+
This description has several lines
|
|
12
|
+
|
|
13
|
+
**Some Custom**
|
|
14
|
+
|
|
15
|
+
Test. I can also have a [ReferencedEnum](/miscellaneous/ReferencedEnum.md) here.
|
|
16
|
+
And it can be multiline.
|
|
17
|
+
|
|
18
|
+
**Mermaid**
|
|
19
|
+
|
|
20
|
+
graph TD
|
|
21
|
+
A[SampleEnum] -->|references| B[ReferencedEnum]
|
|
22
|
+
B -->|referenced by| A
|
|
23
|
+
|
|
24
|
+
**Group** Sample Enums
|
|
25
|
+
|
|
26
|
+
**Author** John Doe
|
|
27
|
+
|
|
28
|
+
**Date** 2022-01-01
|
|
29
|
+
|
|
30
|
+
**See** [ReferencedEnum](/miscellaneous/ReferencedEnum.md)
|
|
31
|
+
|
|
32
|
+
## Namespace
|
|
33
|
+
apexdocs
|
|
34
|
+
|
|
35
|
+
## Values
|
|
36
|
+
| Value | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| VALUE1 | This is value 1 |
|
|
39
|
+
| VALUE2 | This is value 2 |
|
|
40
|
+
| VALUE3 | This is value 3 |
|
package/examples/vitepress/docs/{SampleGroup/apexdocs.SampleClass.md → samplegroup/SampleClass.md}
RENAMED
|
@@ -14,19 +14,17 @@ deserunt ea officia exercitation laboris enim in duis quis enim eiusmod eu amet
|
|
|
14
14
|
apexdocs
|
|
15
15
|
|
|
16
16
|
## Example
|
|
17
|
-
|
|
18
|
-
SampleClass sample = new SampleClass();
|
|
17
|
+
SampleClass sample = new SampleClass();
|
|
19
18
|
sample.doSomething();
|
|
20
|
-
```
|
|
21
19
|
|
|
22
20
|
**Inheritance**
|
|
23
21
|
|
|
24
|
-
[
|
|
22
|
+
[BaseClass](/miscellaneous/BaseClass.md)
|
|
25
23
|
|
|
26
24
|
**Implements**
|
|
27
25
|
|
|
28
|
-
[
|
|
29
|
-
[
|
|
26
|
+
[SampleInterface](/miscellaneous/SampleInterface.md),
|
|
27
|
+
[ParentInterface](/miscellaneous/ParentInterface.md)
|
|
30
28
|
|
|
31
29
|
## Fields
|
|
32
30
|
### Group Name
|
|
@@ -53,7 +51,7 @@ public sampleEnumFromBase
|
|
|
53
51
|
```
|
|
54
52
|
|
|
55
53
|
##### Type
|
|
56
|
-
[
|
|
54
|
+
[SampleEnum](/sample-enums/SampleEnum.md)
|
|
57
55
|
|
|
58
56
|
## Properties
|
|
59
57
|
### Group Name
|
|
@@ -121,10 +119,8 @@ public virtual String sayHello()
|
|
|
121
119
|
A string value.
|
|
122
120
|
|
|
123
121
|
##### Example
|
|
124
|
-
|
|
125
|
-
SampleClass sample = new SampleClass();
|
|
122
|
+
SampleClass sample = new SampleClass();
|
|
126
123
|
sample.doSomething();
|
|
127
|
-
```
|
|
128
124
|
|
|
129
125
|
## Classes
|
|
130
126
|
### SomeInnerClass Class
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description Represents a uniform resource locator (URL) and provides access to parts of the URL.
|
|
3
3
|
* Enables access to the base URL used to access your Salesforce org.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* @usage
|
|
6
6
|
* Use the methods of the `System.URL` class to create links to objects in your organization. Such objects can be files, images,
|
|
7
7
|
* logos, or records that you want to include in external emails, in activities, or in Chatter posts. For example, you can create
|
|
8
8
|
* a link to a file uploaded as an attachment to a Chatter post by concatenating the Salesforce base URL with the file ID:
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* String fullRecordURL = URL.getOrgDomainURL().toExternalForm() + '/' + acct.Id;
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
|
-
*
|
|
28
|
+
* @example
|
|
29
29
|
* In this example, the base URL and the full request URL of the current Salesforce server instance are retrieved. Next, a URL
|
|
30
30
|
* pointing to a specific account object is created. Finally, components of the base and full URL are obtained. This example
|
|
31
31
|
* prints out all the results to the debug log output.
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
* System.debug('Query: ' + URL.getCurrentRequestUrl().getQuery());
|
|
57
57
|
* ```
|
|
58
58
|
*
|
|
59
|
-
*
|
|
59
|
+
* @version-behavior-changes
|
|
60
60
|
* In API version 41.0 and later, Apex URL objects are represented by the java.net.URI type, not the java.net.URL type.
|
|
61
61
|
*
|
|
62
62
|
* The API version in which the URL object was instantiated determines the behavior of subsequent method calls to the
|
|
@@ -177,7 +177,9 @@ global class Url {
|
|
|
177
177
|
* You don't need a RemoteSiteSetting for your org to interact with the Salesforce APIs using domain URLs retrieved with this method.
|
|
178
178
|
*
|
|
179
179
|
* @example
|
|
180
|
-
*
|
|
180
|
+
* This example uses the Salesforce REST API to get organization limit values. For information on limits, see Limits in the REST API Developer Guide.
|
|
181
|
+
*
|
|
182
|
+
* ```apex
|
|
181
183
|
* Http h = new Http();
|
|
182
184
|
* HttpRequest req = new HttpRequest();
|
|
183
185
|
* req.setEndpoint(Url.getOrgDomainUrl().toExternalForm()
|
|
@@ -185,6 +187,7 @@ global class Url {
|
|
|
185
187
|
* req.setMethod('GET');
|
|
186
188
|
* req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
|
|
187
189
|
* HttpResponse res = h.send(req);
|
|
190
|
+
* ```
|
|
188
191
|
*
|
|
189
192
|
* @see-also
|
|
190
193
|
* * [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)
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileSystem } from './file-system';
|
|
2
|
-
import {
|
|
2
|
+
import { UnparsedSourceFile } from '../core/shared/types';
|
|
3
3
|
|
|
4
4
|
const APEX_FILE_EXTENSION = '.cls';
|
|
5
5
|
|
|
@@ -10,8 +10,8 @@ export class ApexFileReader {
|
|
|
10
10
|
/**
|
|
11
11
|
* Reads from .cls files and returns their raw body.
|
|
12
12
|
*/
|
|
13
|
-
static processFiles(fileSystem: FileSystem, rootPath: string, includeMetadata: boolean):
|
|
14
|
-
let bundles:
|
|
13
|
+
static processFiles(fileSystem: FileSystem, rootPath: string, includeMetadata: boolean): UnparsedSourceFile[] {
|
|
14
|
+
let bundles: UnparsedSourceFile[] = [];
|
|
15
15
|
|
|
16
16
|
const directoryContents = fileSystem.readDirectory(rootPath);
|
|
17
17
|
directoryContents.forEach((filePath) => {
|