@cparra/apexdocs 1.13.7 → 1.13.8
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/docs/single-file/Sample-Classes/SampleClass.md +115 -0
- package/lib/AsJsDocsProcessor.d.ts +1 -1
- package/lib/ClassFileGeneratorHelper.d.ts +1 -1
- package/lib/ClassFileGeneratorHelper.test.js +1 -1
- package/lib/{command → Command}/Generate.d.ts +1 -1
- package/lib/{command → Command}/Generate.js +1 -1
- package/lib/{command → Command}/__test__/Generte.test.d.ts +0 -0
- package/lib/{command → Command}/__test__/Generte.test.js +2 -2
- package/lib/DocsProcessor.d.ts +1 -1
- package/lib/FileManager.d.ts +1 -1
- package/lib/MarkdownDocsProcessor.d.ts +1 -1
- package/lib/MarkdownHelper.d.ts +1 -1
- package/lib/{parser → Parser}/ClassParser.d.ts +1 -1
- package/lib/{parser → Parser}/ClassParser.js +1 -1
- package/lib/{parser → Parser}/EnumParser.d.ts +1 -1
- package/lib/{parser → Parser}/EnumParser.js +1 -1
- package/lib/{parser → Parser}/FileParser.d.ts +1 -1
- package/lib/{parser → Parser}/FileParser.js +0 -0
- package/lib/{parser → Parser}/MethodParser.d.ts +1 -1
- package/lib/{parser → Parser}/MethodParser.js +1 -1
- package/lib/{parser → Parser}/PropertyParser.d.ts +1 -1
- package/lib/{parser → Parser}/PropertyParser.js +1 -1
- package/lib/{parser → Parser}/__test__/ClassParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/ClassParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/FileParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/FileParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/MethodParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/MethodParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/PropertyParser.test.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/PropertyParser.test.js +0 -0
- package/lib/{parser → Parser}/__test__/testFileContents.d.ts +0 -0
- package/lib/{parser → Parser}/__test__/testFileContents.js +0 -0
- package/lib/application/Apexdocs.d.ts +11 -0
- package/lib/application/Apexdocs.js +41 -0
- package/lib/application/Apexdocs.js.map +1 -0
- package/lib/cli/generate.js +1 -1
- package/lib/cli/generate.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -0
- package/lib/model/file.d.ts +10 -0
- package/lib/model/file.js +23 -0
- package/lib/model/file.js.map +1 -0
- package/lib/model/manifest-diff.d.ts +5 -0
- package/lib/model/manifest-diff.js +10 -0
- package/lib/model/manifest-diff.js.map +1 -0
- package/lib/model/manifest.d.ts +22 -0
- package/lib/model/manifest.js +42 -0
- package/lib/model/manifest.js.map +1 -0
- package/lib/model/markdown-file.d.ts +10 -0
- package/lib/model/markdown-file.js +52 -0
- package/lib/model/markdown-file.js.map +1 -0
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js +33 -0
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/index.d.ts +3 -0
- package/lib/model/markdown-generation-util/index.js +9 -0
- package/lib/model/markdown-generation-util/index.js.map +1 -0
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js +97 -0
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -0
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js +25 -0
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -0
- package/lib/model/markdown-home-file.d.ts +11 -0
- package/lib/model/markdown-home-file.js +50 -0
- package/lib/model/markdown-home-file.js.map +1 -0
- package/lib/model/markdown-type-file.d.ts +17 -0
- package/lib/model/markdown-type-file.js +62 -0
- package/lib/model/markdown-type-file.js.map +1 -0
- package/lib/service/apex-file-reader.d.ts +13 -0
- package/lib/service/apex-file-reader.js +39 -0
- package/lib/service/apex-file-reader.js.map +1 -0
- package/lib/service/file-system.d.ts +12 -0
- package/lib/service/file-system.js +21 -0
- package/lib/service/file-system.js.map +1 -0
- package/lib/service/file-writer.d.ts +4 -0
- package/lib/service/file-writer.js +25 -0
- package/lib/service/file-writer.js.map +1 -0
- package/lib/service/manifest-factory.d.ts +9 -0
- package/lib/service/manifest-factory.js +13 -0
- package/lib/service/manifest-factory.js.map +1 -0
- package/lib/service/parser.d.ts +9 -0
- package/lib/service/parser.js +17 -0
- package/lib/service/parser.js.map +1 -0
- package/lib/service/walkers/class-walker.d.ts +4 -0
- package/lib/service/walkers/class-walker.js +32 -0
- package/lib/service/walkers/class-walker.js.map +1 -0
- package/lib/service/walkers/enum-walker.d.ts +4 -0
- package/lib/service/walkers/enum-walker.js +10 -0
- package/lib/service/walkers/enum-walker.js.map +1 -0
- package/lib/service/walkers/interface-walker.d.ts +4 -0
- package/lib/service/walkers/interface-walker.js +14 -0
- package/lib/service/walkers/interface-walker.js.map +1 -0
- package/lib/service/walkers/walker-factory.d.ts +5 -0
- package/lib/service/walkers/walker-factory.js +20 -0
- package/lib/service/walkers/walker-factory.js.map +1 -0
- package/lib/service/walkers/walker.d.ts +16 -0
- package/lib/service/walkers/walker.js +9 -0
- package/lib/service/walkers/walker.js.map +1 -0
- package/lib/{Settings.d.ts → settings.d.ts} +0 -0
- package/lib/{Settings.js → settings.js} +0 -0
- package/lib/settings.js.map +1 -0
- package/lib/transpiler/file-container.d.ts +6 -0
- package/lib/transpiler/file-container.js +15 -0
- package/lib/transpiler/file-container.js.map +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +6 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +17 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +4 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +10 -0
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +8 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +24 -0
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -0
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +8 -0
- package/lib/transpiler/processor-type-transpiler.js +6 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -0
- package/lib/transpiler/transpiler.d.ts +5 -0
- package/lib/transpiler/transpiler.js +21 -0
- package/lib/transpiler/transpiler.js.map +1 -0
- package/lib/util/logger.d.ts +18 -0
- package/lib/util/logger.js +32 -0
- package/lib/util/logger.js.map +1 -0
- package/package.json +1 -1
- package/src/AsJsDocsProcessor.ts +1 -1
- package/src/ClassFileGeneratorHelper.test.ts +1 -1
- package/src/ClassFileGeneratorHelper.ts +1 -1
- package/src/Command/Generate.ts +2 -2
- package/src/Command/__test__/Generte.test.ts +2 -2
- package/src/DocsProcessor.ts +1 -1
- package/src/FileManager.ts +1 -1
- package/src/MarkdownDocsProcessor.ts +2 -2
- package/src/MarkdownHelper.ts +1 -1
- package/src/Parser/ClassParser.ts +1 -1
- package/src/Parser/EnumParser.ts +1 -1
- package/src/Parser/FileParser.ts +1 -1
- package/src/Parser/MethodParser.ts +1 -1
- package/src/Parser/PropertyParser.ts +1 -1
- package/src/Parser/__test__/MethodParser.test.ts +1 -1
- package/src/Parser/__test__/PropertyParser.test.ts +1 -1
- package/src/cli/generate.ts +1 -1
- package/src/index.ts +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: default
|
|
3
|
+
---
|
|
4
|
+
# SampleClass class
|
|
5
|
+
|
|
6
|
+
`NamespaceAccessible`
|
|
7
|
+
|
|
8
|
+
This is a class description.
|
|
9
|
+
|
|
10
|
+
## Related
|
|
11
|
+
|
|
12
|
+
SampleInterface
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
SampleClass2
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
## Constructors
|
|
19
|
+
### `SampleClass()`
|
|
20
|
+
|
|
21
|
+
`NamespaceAccessible`
|
|
22
|
+
|
|
23
|
+
Constructs a SampleClass without any arguments.
|
|
24
|
+
#### Example
|
|
25
|
+
```
|
|
26
|
+
<pre>
|
|
27
|
+
SampleClass sampleInstance = new SampleClass();
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### `SampleClass(String argument)`
|
|
31
|
+
|
|
32
|
+
`NamespaceAccessible`
|
|
33
|
+
|
|
34
|
+
Constructs a SampleClass with an argument.
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
| Param | Description |
|
|
38
|
+
| ----- | ----------- |
|
|
39
|
+
|`argument` | Some argument. Of type String. |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
## Properties
|
|
43
|
+
|
|
44
|
+
### `AnotherProp` → `Decimal`
|
|
45
|
+
|
|
46
|
+
`NamespaceAccessible`
|
|
47
|
+
|
|
48
|
+
This is a Decimal property.
|
|
49
|
+
|
|
50
|
+
### `MyProp` → `String`
|
|
51
|
+
|
|
52
|
+
`NamespaceAccessible`
|
|
53
|
+
|
|
54
|
+
This is a String property.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
## Methods
|
|
58
|
+
### `call()` → `void`
|
|
59
|
+
|
|
60
|
+
`NamespaceAccessible`
|
|
61
|
+
|
|
62
|
+
Calls the method. This methods allows you to call it.
|
|
63
|
+
|
|
64
|
+
### `testMethod(String argument)` → `String`
|
|
65
|
+
|
|
66
|
+
`NamespaceAccessible`
|
|
67
|
+
|
|
68
|
+
Executes commands based on the passed in argument.
|
|
69
|
+
|
|
70
|
+
#### Example
|
|
71
|
+
```
|
|
72
|
+
<pre>
|
|
73
|
+
String result = SampleClass.testMethod();
|
|
74
|
+
System.debug(result);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
## Inner Classes
|
|
79
|
+
|
|
80
|
+
### SampleClass.AnotherInnerClass class
|
|
81
|
+
|
|
82
|
+
Inner class belonging to SampleClass.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
#### Properties
|
|
86
|
+
|
|
87
|
+
##### `InnerProp` → `public`
|
|
88
|
+
|
|
89
|
+
Description of the inner property.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
#### Methods
|
|
93
|
+
##### `innerMethod()` → `void`
|
|
94
|
+
|
|
95
|
+
Executes from the inner class.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
### SampleClass.InnerClass class
|
|
99
|
+
|
|
100
|
+
Inner class belonging to SampleClass.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
#### Properties
|
|
104
|
+
|
|
105
|
+
##### `InnerProp` → `public`
|
|
106
|
+
|
|
107
|
+
Description of the inner property.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
#### Methods
|
|
111
|
+
##### `innerMethod()` → `void`
|
|
112
|
+
|
|
113
|
+
Executes from the inner class.
|
|
114
|
+
|
|
115
|
+
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DocsProcessor from './DocsProcessor';
|
|
2
2
|
import JsHelper from './JsHelper';
|
|
3
|
-
import ClassModel from './
|
|
3
|
+
import ClassModel from './Model/ClassModel';
|
|
4
4
|
export default class AsJsDocsProcessor extends DocsProcessor {
|
|
5
5
|
process(classModel: ClassModel, outputDir: string): void;
|
|
6
6
|
generateDocsForClass(generator: JsHelper, classModel: ClassModel): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ClassModel from './
|
|
1
|
+
import ClassModel from './Model/ClassModel';
|
|
2
2
|
export default class ClassFileGeneratorHelper {
|
|
3
3
|
static getSanitizedGroup(classModel: ClassModel): string;
|
|
4
4
|
static getFileLink(classModel: ClassModel, forRelatedReference?: boolean): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ClassFileGeneratorHelper_1 = require("./ClassFileGeneratorHelper");
|
|
4
|
-
const ClassModel_1 = require("./
|
|
4
|
+
const ClassModel_1 = require("./Model/ClassModel");
|
|
5
5
|
const Settings_1 = require("./Settings");
|
|
6
6
|
test('that getSanitizedGroup returns the same string when there is nothing to sanitize', () => {
|
|
7
7
|
const testClass = new ClassModel_1.default();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ClassModel from '../
|
|
1
|
+
import ClassModel from '../Model/ClassModel';
|
|
2
2
|
export declare function generate(sourceDirectory: string, recursive?: boolean, scope?: string[], outputDir?: string, targetGenerator?: string, configPath?: string, group?: boolean): ClassModel[];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const Settings_1 = require("../Settings");
|
|
6
|
-
const FileParser_1 = require("../
|
|
6
|
+
const FileParser_1 = require("../Parser/FileParser");
|
|
7
7
|
const DocsifyDocsProcessor_1 = require("../DocsifyDocsProcessor");
|
|
8
8
|
const JekyllDocsProcessor_1 = require("../JekyllDocsProcessor");
|
|
9
9
|
const AsJsDocsProcessor_1 = require("../AsJsDocsProcessor");
|
|
File without changes
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const Generate_1 = require("../Generate");
|
|
5
|
-
const FileParser_1 = require("../../
|
|
5
|
+
const FileParser_1 = require("../../Parser/FileParser");
|
|
6
6
|
jest.mock('fs');
|
|
7
|
-
jest.mock('../../
|
|
7
|
+
jest.mock('../../Parser/FileParser');
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
FileParser_1.default.mockClear();
|
|
10
10
|
});
|
package/lib/DocsProcessor.d.ts
CHANGED
package/lib/FileManager.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import DocsProcessor from './DocsProcessor';
|
|
2
2
|
import MarkdownHelper from './MarkdownHelper';
|
|
3
|
-
import ClassModel from './
|
|
3
|
+
import ClassModel from './Model/ClassModel';
|
|
4
4
|
export default abstract class MarkdownDocsProcessor extends DocsProcessor {
|
|
5
5
|
private classes;
|
|
6
6
|
abstract getHomeFileName(): string;
|
package/lib/MarkdownHelper.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ClassModel_1 = require("../
|
|
3
|
+
const ClassModel_1 = require("../Model/ClassModel");
|
|
4
4
|
const sanitize = require("sanitize-filename-ts");
|
|
5
5
|
class ClassParser {
|
|
6
6
|
getClass(strLine, lstComments, iLine, parent) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import EnumModel from '../
|
|
1
|
+
import EnumModel from '../Model/EnumModel';
|
|
2
2
|
export default class EnumParser {
|
|
3
3
|
getEnum(strLine: string, lstComments: string[], iLine: number): EnumModel;
|
|
4
4
|
fillEnumModel(enumModel: EnumModel, nameLine: string, lstComments: string[], iLine: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const EnumModel_1 = require("../
|
|
3
|
+
const EnumModel_1 = require("../Model/EnumModel");
|
|
4
4
|
class EnumParser {
|
|
5
5
|
getEnum(strLine, lstComments, iLine) {
|
|
6
6
|
const enumModel = new EnumModel_1.default();
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import MethodModel from '../
|
|
1
|
+
import MethodModel from '../Model/MethodModel';
|
|
2
2
|
export default class MethodParser {
|
|
3
3
|
getMethod(parentClassName: string, strLine: string, lstComments: string[], iLine: number): MethodModel;
|
|
4
4
|
fillMethodModel(parentClassName: string, mModel: MethodModel, name: string, lstComments: string[], iLine: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const MethodModel_1 = require("../
|
|
3
|
+
const MethodModel_1 = require("../Model/MethodModel");
|
|
4
4
|
class MethodParser {
|
|
5
5
|
getMethod(parentClassName, strLine, lstComments, iLine) {
|
|
6
6
|
const mModel = new MethodModel_1.default();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PropertyModel from '../
|
|
1
|
+
import PropertyModel from '../Model/PropertyModel';
|
|
2
2
|
export default class PropertyParser {
|
|
3
3
|
getProperty(strLine: string, lstComments: string[], iLine: number): PropertyModel;
|
|
4
4
|
fillPropertyModel(propertyModel: PropertyModel, name: string, lstComments: string[], iLine: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const PropertyModel_1 = require("../
|
|
3
|
+
const PropertyModel_1 = require("../Model/PropertyModel");
|
|
4
4
|
class PropertyParser {
|
|
5
5
|
getProperty(strLine, lstComments, iLine) {
|
|
6
6
|
const propertyModel = new PropertyModel_1.default();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
2
|
+
/**
|
|
3
|
+
* Application entry-point to generate documentation out of Apex source files.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Apexdocs {
|
|
6
|
+
/**
|
|
7
|
+
* Generates documentation out of Apex source files.
|
|
8
|
+
*/
|
|
9
|
+
static generate(): void;
|
|
10
|
+
static _reflectionWithLogger: (declarationBody: string) => ReflectionResult;
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const apex_file_reader_1 = require("../service/apex-file-reader");
|
|
4
|
+
const file_system_1 = require("../service/file-system");
|
|
5
|
+
const apex_reflection_1 = require("@cparra/apex-reflection");
|
|
6
|
+
const logger_1 = require("../util/logger");
|
|
7
|
+
const manifest_factory_1 = require("../service/manifest-factory");
|
|
8
|
+
const parser_1 = require("../service/parser");
|
|
9
|
+
const settings_1 = require("../settings");
|
|
10
|
+
const transpiler_1 = require("../transpiler/transpiler");
|
|
11
|
+
const file_writer_1 = require("../service/file-writer");
|
|
12
|
+
/**
|
|
13
|
+
* Application entry-point to generate documentation out of Apex source files.
|
|
14
|
+
*/
|
|
15
|
+
class Apexdocs {
|
|
16
|
+
/**
|
|
17
|
+
* Generates documentation out of Apex source files.
|
|
18
|
+
*/
|
|
19
|
+
static generate() {
|
|
20
|
+
const fileBodies = apex_file_reader_1.ApexFileReader.processFiles(new file_system_1.DefaultFileSystem());
|
|
21
|
+
const manifest = manifest_factory_1.createManifest(new parser_1.RawBodyParser(fileBodies), this._reflectionWithLogger);
|
|
22
|
+
const filteredManifest = manifest.filteredByAccessModifierAndAnnotations(settings_1.Settings.getInstance().scope);
|
|
23
|
+
logger_1.Logger.log(`Parsed ${filteredManifest.length} files`);
|
|
24
|
+
const processor = settings_1.Settings.getInstance().typeTranspiler;
|
|
25
|
+
transpiler_1.default.generate(filteredManifest, processor);
|
|
26
|
+
const generatedFiles = processor.fileBuilder().files();
|
|
27
|
+
file_writer_1.FileWriter.write(generatedFiles, (fileName) => {
|
|
28
|
+
logger_1.Logger.log(`${fileName} processed.`);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Apexdocs = Apexdocs;
|
|
33
|
+
Apexdocs._reflectionWithLogger = (declarationBody) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const result = apex_reflection_1.reflect(declarationBody);
|
|
36
|
+
if (result.error) {
|
|
37
|
+
logger_1.Logger.log(`Parsing error ${(_a = result.error) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Apexdocs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Apexdocs.js","sourceRoot":"","sources":["../../src/application/Apexdocs.ts"],"names":[],"mappings":";;AAAA,kEAA6D;AAC7D,wDAA2D;AAC3D,6DAAoE;AACpE,2CAAwC;AACxC,kEAA6D;AAC7D,8CAAkD;AAClD,0CAAuC;AACvC,yDAAkD;AAClD,wDAAoD;AAEpD;;GAEG;AACH,MAAa,QAAQ;IACnB;;OAEG;IACH,MAAM,CAAC,QAAQ;QACb,MAAM,UAAU,GAAG,iCAAc,CAAC,YAAY,CAAC,IAAI,+BAAiB,EAAE,CAAC,CAAC;QACxE,MAAM,QAAQ,GAAG,iCAAc,CAAC,IAAI,sBAAa,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAE3F,MAAM,gBAAgB,GAAG,QAAQ,CAAC,sCAAsC,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAEvG,eAAM,CAAC,GAAG,CAAC,UAAU,gBAAgB,CAAC,MAAM,QAAQ,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC;QACxD,oBAAU,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;QACjD,MAAM,cAAc,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,CAAC;QACvD,wBAAU,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;YACpD,eAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,aAAa,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;;AAjBH,4BA0BC;AAPQ,8BAAqB,GAAG,CAAC,eAAuB,EAAoB,EAAE;;IAC3E,MAAM,MAAM,GAAG,yBAAO,CAAC,eAAe,CAAC,CAAC;IACxC,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,eAAM,CAAC,GAAG,CAAC,iBAAiB,MAAA,MAAM,CAAC,KAAK,0CAAE,OAAO,EAAE,CAAC,CAAC;KACtD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/cli/generate.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const yargs = require("yargs");
|
|
5
|
-
const Generate_1 = require("../
|
|
5
|
+
const Generate_1 = require("../Command/Generate");
|
|
6
6
|
const FileManager_1 = require("../FileManager");
|
|
7
7
|
const argv = yargs.options({
|
|
8
8
|
sourceDir: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAyD;AACzD,sDAAmD;AAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,0HAA0H;KAC7H;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC9B,QAAQ,EACN,mHAAmH;KACtH;CACF,CAAC,CAAC,IAAI,CAAC;AAER,mBAAQ,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;CAC1D,CAAC,CAAC;AAEH,mBAAQ,CAAC,QAAQ,EAAE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './Command/Generate';
|
package/lib/index.js
CHANGED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,gDAA2C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare abstract class File {
|
|
2
|
+
fileName: string;
|
|
3
|
+
dir: string;
|
|
4
|
+
_contents: string;
|
|
5
|
+
constructor(fileName: string, dir: string);
|
|
6
|
+
abstract fileExtension(): string;
|
|
7
|
+
get body(): string;
|
|
8
|
+
addText(text: string, encodeHtml?: boolean): void;
|
|
9
|
+
addBlankLine(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const html_entities_1 = require("html-entities");
|
|
4
|
+
class File {
|
|
5
|
+
constructor(fileName, dir) {
|
|
6
|
+
this.fileName = fileName;
|
|
7
|
+
this.dir = dir;
|
|
8
|
+
this._contents = '';
|
|
9
|
+
}
|
|
10
|
+
get body() {
|
|
11
|
+
return this._contents;
|
|
12
|
+
}
|
|
13
|
+
addText(text, encodeHtml = true) {
|
|
14
|
+
const textToAdd = encodeHtml ? html_entities_1.encode(text) : text;
|
|
15
|
+
this._contents += textToAdd;
|
|
16
|
+
this.addBlankLine();
|
|
17
|
+
}
|
|
18
|
+
addBlankLine() {
|
|
19
|
+
this._contents += '\n';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.File = File;
|
|
23
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/model/file.ts"],"names":[],"mappings":";;AAAA,iDAAuC;AAEvC,MAAsB,IAAI;IAGxB,YAAmB,QAAgB,EAAS,GAAW;QAApC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAFvD,cAAS,GAAG,EAAE,CAAC;IAE2C,CAAC;IAI3D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,IAAI;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,sBAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzB,CAAC;CACF;AApBD,oBAoBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsondiffpatch = require("jsondiffpatch");
|
|
4
|
+
class ManifestDiff {
|
|
5
|
+
static build(originalManifest, newManifest) {
|
|
6
|
+
return jsondiffpatch.diff(originalManifest, newManifest);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.ManifestDiff = ManifestDiff;
|
|
10
|
+
//# sourceMappingURL=manifest-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-diff.js","sourceRoot":"","sources":["../../src/model/manifest-diff.ts"],"names":[],"mappings":";;AACA,+CAA+C;AAE/C,MAAa,YAAY;IACvB,MAAM,CAAC,KAAK,CAAC,gBAA0B,EAAE,WAAqB;QAC5D,OAAO,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;IAC3D,CAAC;CACF;AAJD,oCAIC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Type, Annotation } from '@cparra/apex-reflection';
|
|
2
|
+
declare type AccessAware = {
|
|
3
|
+
access_modifier: string;
|
|
4
|
+
} & {
|
|
5
|
+
annotations: Annotation[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Represents the full library of Apex top-level types (classes, enums, and interface) for a Salesforce project.
|
|
9
|
+
*/
|
|
10
|
+
export default class Manifest {
|
|
11
|
+
types: Type[];
|
|
12
|
+
isForInnerTypes: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new Manifest object.
|
|
15
|
+
* @param types List of types to be wrapped by this object.
|
|
16
|
+
* @param isForInnerTypes Whether this manifest represent an inner type or not.
|
|
17
|
+
*/
|
|
18
|
+
constructor(types: Type[], isForInnerTypes?: boolean);
|
|
19
|
+
filteredByAccessModifierAndAnnotations(modifiers: string[]): Type[];
|
|
20
|
+
filterAccessibleModifier(accessAware: AccessAware[], modifiers: string[]): AccessAware[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents the full library of Apex top-level types (classes, enums, and interface) for a Salesforce project.
|
|
5
|
+
*/
|
|
6
|
+
class Manifest {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new Manifest object.
|
|
9
|
+
* @param types List of types to be wrapped by this object.
|
|
10
|
+
* @param isForInnerTypes Whether this manifest represent an inner type or not.
|
|
11
|
+
*/
|
|
12
|
+
constructor(types, isForInnerTypes = false) {
|
|
13
|
+
this.types = types;
|
|
14
|
+
this.isForInnerTypes = isForInnerTypes;
|
|
15
|
+
}
|
|
16
|
+
filteredByAccessModifierAndAnnotations(modifiers) {
|
|
17
|
+
const filteredTypes = this.filterAccessibleModifier(this.types, modifiers);
|
|
18
|
+
const typesToReturn = [];
|
|
19
|
+
for (const filteredType of filteredTypes) {
|
|
20
|
+
const currentType = filteredType;
|
|
21
|
+
if (currentType.type_name !== 'class') {
|
|
22
|
+
typesToReturn.push(currentType);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const currentClass = currentType;
|
|
26
|
+
let filteredClass = Object.assign(Object.assign({}, currentType), { methods: this.filterAccessibleModifier(currentClass.methods, modifiers), properties: this.filterAccessibleModifier(currentClass.properties, modifiers), fields: this.filterAccessibleModifier(currentClass.fields, modifiers), constructors: this.filterAccessibleModifier(currentClass.constructors, modifiers) });
|
|
27
|
+
if (!this.isForInnerTypes) {
|
|
28
|
+
filteredClass = Object.assign(Object.assign({}, filteredClass), { enums: this.filterAccessibleModifier(currentClass.enums, modifiers), interfaces: this.filterAccessibleModifier(currentClass.interfaces, modifiers), classes: new Manifest(currentClass.classes, true).filteredByAccessModifierAndAnnotations(modifiers) });
|
|
29
|
+
}
|
|
30
|
+
typesToReturn.push(filteredClass);
|
|
31
|
+
}
|
|
32
|
+
return typesToReturn;
|
|
33
|
+
}
|
|
34
|
+
filterAccessibleModifier(accessAware, modifiers) {
|
|
35
|
+
return accessAware.filter((currentType) => {
|
|
36
|
+
return (modifiers.includes(currentType.access_modifier) ||
|
|
37
|
+
currentType.annotations.some((annotation) => modifiers.includes(annotation.type.toLowerCase())));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = Manifest;
|
|
42
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/model/manifest.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH,MAAqB,QAAQ;IAC3B;;;;OAIG;IACH,YAAmB,KAAa,EAAS,kBAA2B,KAAK;QAAtD,UAAK,GAAL,KAAK,CAAQ;QAAS,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAE7E,sCAAsC,CAAC,SAAmB;QACxD,MAAM,aAAa,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAW,EAAE,CAAC;QACjC,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;YACxC,MAAM,WAAW,GAAG,YAAoB,CAAC;YACzC,IAAI,WAAW,CAAC,SAAS,KAAK,OAAO,EAAE;gBACrC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAChC,SAAS;aACV;YAED,MAAM,YAAY,GAAG,WAA0B,CAAC;YAChD,IAAI,aAAa,mCACZ,WAAW,KACd,OAAO,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,EACvE,UAAU,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC,EAC7E,MAAM,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,EACrE,YAAY,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,GAClF,CAAC;YAEF,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;gBACzB,aAAa,mCACR,aAAa,KAChB,KAAK,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,CAAiB,EACnF,UAAU,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAsB,EAClG,OAAO,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,sCAAsC,CACtF,SAAS,CACO,GACnB,CAAC;aACH;YAED,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACnC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,wBAAwB,CAAC,WAA0B,EAAE,SAAmB;QACtE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;YACxC,OAAO,CACL,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,eAAe,CAAC;gBAC/C,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAC5G,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AApDD,2BAoDC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { File } from './file';
|
|
2
|
+
export declare class MarkdownFile extends File {
|
|
3
|
+
fileExtension(): string;
|
|
4
|
+
addTitle(text: string, level?: number): void;
|
|
5
|
+
startCodeBlock(): void;
|
|
6
|
+
endCodeBlock(): void;
|
|
7
|
+
addHorizontalRule(): void;
|
|
8
|
+
initializeTable(...headers: string[]): void;
|
|
9
|
+
addTableRow(...columns: string[]): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const file_1 = require("./file");
|
|
4
|
+
class MarkdownFile extends file_1.File {
|
|
5
|
+
fileExtension() {
|
|
6
|
+
return '.md';
|
|
7
|
+
}
|
|
8
|
+
addTitle(text, level = 1) {
|
|
9
|
+
let title = '';
|
|
10
|
+
for (let i = 0; i < level; i++) {
|
|
11
|
+
title += '#';
|
|
12
|
+
}
|
|
13
|
+
title += ' ';
|
|
14
|
+
title += text;
|
|
15
|
+
this._contents += title;
|
|
16
|
+
this.addBlankLine();
|
|
17
|
+
}
|
|
18
|
+
startCodeBlock() {
|
|
19
|
+
this._contents += '```';
|
|
20
|
+
const sourceLanguage = 'apex';
|
|
21
|
+
this._contents += sourceLanguage;
|
|
22
|
+
this.addBlankLine();
|
|
23
|
+
}
|
|
24
|
+
endCodeBlock() {
|
|
25
|
+
this._contents += '```';
|
|
26
|
+
this.addBlankLine();
|
|
27
|
+
}
|
|
28
|
+
addHorizontalRule() {
|
|
29
|
+
this._contents += '---';
|
|
30
|
+
this.addBlankLine();
|
|
31
|
+
}
|
|
32
|
+
initializeTable(...headers) {
|
|
33
|
+
this._contents += '|';
|
|
34
|
+
headers.forEach((header) => {
|
|
35
|
+
this._contents += header + '|';
|
|
36
|
+
});
|
|
37
|
+
this.addBlankLine();
|
|
38
|
+
this._contents += '|';
|
|
39
|
+
headers.forEach((_) => {
|
|
40
|
+
this._contents += '---' + '|';
|
|
41
|
+
});
|
|
42
|
+
this.addBlankLine();
|
|
43
|
+
}
|
|
44
|
+
addTableRow(...columns) {
|
|
45
|
+
this._contents += '|';
|
|
46
|
+
columns.forEach((column) => {
|
|
47
|
+
this._contents += column + '|';
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.MarkdownFile = MarkdownFile;
|
|
52
|
+
//# sourceMappingURL=markdown-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-file.js","sourceRoot":"","sources":["../../src/model/markdown-file.ts"],"names":[],"mappings":";;AAAA,iCAA8B;AAE9B,MAAa,YAAa,SAAQ,WAAI;IACpC,aAAa;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,KAAK,GAAG,CAAC;QAC9B,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,KAAK,IAAI,GAAG,CAAC;SACd;QAED,KAAK,IAAI,GAAG,CAAC;QACb,KAAK,IAAI,IAAI,CAAC;QACd,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,cAAc;QACZ,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;QACxB,MAAM,cAAc,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC;QACjC,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,eAAe,CAAC,GAAG,OAAiB;QAClC,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC;QACtB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YACzB,IAAI,CAAC,SAAS,IAAI,MAAM,GAAG,GAAG,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC;QACtB,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,IAAI,CAAC,SAAS,IAAI,KAAK,GAAG,GAAG,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,WAAW,CAAC,GAAG,OAAiB;QAC9B,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC;QACtB,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YACzB,IAAI,CAAC,SAAS,IAAI,MAAM,GAAG,GAAG,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AArDD,oCAqDC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { MarkdownFile } from '../markdown-file';
|
|
2
|
+
import { FieldMirror, PropertyMirror } from '@cparra/apex-reflection';
|
|
3
|
+
export declare function declareField(title: string, markdownFile: MarkdownFile, fields: FieldMirror[] | PropertyMirror[], startingHeadingLevel: number): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function declareField(title, markdownFile, fields, startingHeadingLevel) {
|
|
4
|
+
markdownFile.addTitle(title, startingHeadingLevel + 1);
|
|
5
|
+
markdownFile.addBlankLine();
|
|
6
|
+
fields
|
|
7
|
+
.sort((propA, propB) => {
|
|
8
|
+
if (propA.name < propB.name)
|
|
9
|
+
return -1;
|
|
10
|
+
if (propA.name > propB.name)
|
|
11
|
+
return 1;
|
|
12
|
+
return 0;
|
|
13
|
+
})
|
|
14
|
+
.forEach((propertyModel) => {
|
|
15
|
+
addFieldSection(markdownFile, propertyModel, startingHeadingLevel);
|
|
16
|
+
});
|
|
17
|
+
markdownFile.addHorizontalRule();
|
|
18
|
+
}
|
|
19
|
+
exports.declareField = declareField;
|
|
20
|
+
function addFieldSection(markdownFile, propertyModel, startingHeadingLevel) {
|
|
21
|
+
var _a;
|
|
22
|
+
markdownFile.addTitle(`\`${propertyModel.name}\` → \`${propertyModel.type}\``, startingHeadingLevel + 2);
|
|
23
|
+
propertyModel.annotations.forEach((annotation) => {
|
|
24
|
+
markdownFile.addBlankLine();
|
|
25
|
+
markdownFile.addText(`\`${annotation.type.toUpperCase()}\``);
|
|
26
|
+
});
|
|
27
|
+
if ((_a = propertyModel.docComment) === null || _a === void 0 ? void 0 : _a.description) {
|
|
28
|
+
markdownFile.addBlankLine();
|
|
29
|
+
markdownFile.addText(propertyModel.docComment.description);
|
|
30
|
+
}
|
|
31
|
+
markdownFile.addBlankLine();
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=field-declaration-util.js.map
|