@cparra/apexdocs 1.13.4 → 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/README.md +277 -277
- package/docs/Gemfile.lock +1 -1
- package/docs/Sample-Classes/SampleClass.md +115 -30
- package/docs/Sample-Classes/SampleClass2.md +115 -0
- package/docs/Sample-Interfaces/SampleInterface.md +32 -13
- package/docs/index.md +27 -20
- package/docs/single-file/Sample-Classes/SampleClass.md +115 -0
- package/examples/apex/SampleClass.cls +13 -5
- package/examples/apex/SampleClass2.cls +96 -0
- package/examples/apex/SampleInterface.cls +3 -1
- package/lib/AsJsDocsProcessor.d.ts +1 -1
- package/lib/ClassFileGeneratorHelper.d.ts +2 -2
- package/lib/ClassFileGeneratorHelper.js +8 -3
- 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 +2 -1
- package/lib/DocsProcessor.js +3 -0
- package/lib/FileManager.d.ts +1 -1
- package/lib/JekyllDocsProcessor.d.ts +1 -0
- package/lib/JekyllDocsProcessor.js +3 -0
- package/lib/MarkdownDocsProcessor.d.ts +1 -1
- package/lib/MarkdownDocsProcessor.js +7 -5
- package/lib/MarkdownHelper.d.ts +1 -1
- package/lib/MarkdownHelper.js +2 -2
- package/lib/{parser → Parser}/ClassParser.d.ts +1 -1
- package/lib/{parser → Parser}/ClassParser.js +6 -2
- 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 +1 -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 +70 -68
- package/src/AsJsDocsProcessor.ts +1 -1
- package/src/ClassFileGeneratorHelper.test.ts +1 -1
- package/src/ClassFileGeneratorHelper.ts +12 -3
- package/src/{command → Command}/Generate.ts +2 -2
- package/src/{command → Command}/__test__/Generte.test.ts +2 -2
- package/src/DocsProcessor.ts +7 -1
- package/src/DocsifyDocsProcessor.ts +7 -7
- package/src/FileManager.ts +1 -1
- package/src/JekyllDocsProcessor.ts +4 -0
- package/src/MarkdownDocsProcessor.ts +9 -7
- package/src/MarkdownHelper.ts +3 -3
- package/src/{model → Model}/ApexModel.ts +0 -0
- package/src/{model → Model}/ClassModel.ts +0 -0
- package/src/{model → Model}/EnumModel.ts +0 -0
- package/src/{model → Model}/MethodModel.ts +0 -0
- package/src/{model → Model}/PropertyModel.ts +0 -0
- package/src/{model → Model}/__test__/ClassModel.test.ts +0 -0
- package/src/{model → Model}/__test__/MethodModel.test.ts +0 -0
- package/src/{model → Model}/__test__/PropertyModel.test.ts +0 -0
- package/src/{parser → Parser}/ClassParser.ts +7 -2
- package/src/{parser → Parser}/EnumParser.ts +1 -1
- package/src/{parser → Parser}/FileParser.ts +2 -1
- package/src/{parser → Parser}/MethodParser.ts +1 -1
- package/src/{parser → Parser}/PropertyParser.ts +1 -1
- package/src/{parser → Parser}/__test__/ClassParser.test.ts +0 -0
- package/src/{parser → Parser}/__test__/FileParser.test.ts +0 -0
- package/src/{parser → Parser}/__test__/MethodParser.test.ts +1 -1
- package/src/{parser → Parser}/__test__/PropertyParser.test.ts +1 -1
- package/src/{parser → Parser}/__test__/testFileContents.ts +0 -0
- package/src/cli/generate.ts +1 -1
- package/src/index.ts +1 -1
|
@@ -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
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import ClassModel from './
|
|
1
|
+
import ClassModel from './Model/ClassModel';
|
|
2
2
|
export default abstract class DocsProcessor {
|
|
3
3
|
onBeforeProcess(classes: ClassModel[], outputDir: string): void;
|
|
4
4
|
abstract process(cModel: ClassModel, outputDir: string): void;
|
|
5
5
|
onAfterProcess(classes: ClassModel[], outputDir: string): void;
|
|
6
|
+
defaultRoot(): string;
|
|
6
7
|
}
|
package/lib/DocsProcessor.js
CHANGED
package/lib/FileManager.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export default class JekyllDocsProcessor extends MarkdownDocsProcessor {
|
|
|
4
4
|
getHomeFileName(): string;
|
|
5
5
|
onBeforeHomeFileCreated(generator: MarkdownHelper): void;
|
|
6
6
|
onBeforeClassFileCreated(generator: MarkdownHelper): void;
|
|
7
|
+
defaultRoot(): string;
|
|
7
8
|
private addFrontMatterHeader;
|
|
8
9
|
}
|
|
@@ -11,6 +11,9 @@ class JekyllDocsProcessor extends MarkdownDocsProcessor_1.default {
|
|
|
11
11
|
onBeforeClassFileCreated(generator) {
|
|
12
12
|
this.addFrontMatterHeader(generator);
|
|
13
13
|
}
|
|
14
|
+
defaultRoot() {
|
|
15
|
+
return '..';
|
|
16
|
+
}
|
|
14
17
|
addFrontMatterHeader(generator) {
|
|
15
18
|
generator.addText('---');
|
|
16
19
|
generator.addText('layout: default');
|
|
@@ -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;
|
|
@@ -116,7 +116,7 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
116
116
|
const relatedClass = this.classes.find(currentClassModel => currentClassModel.getClassName() === relatedClassName);
|
|
117
117
|
generator.addBlankLine();
|
|
118
118
|
if (relatedClass) {
|
|
119
|
-
generator.addText(ClassFileGeneratorHelper_1.default.getFileLink(relatedClass));
|
|
119
|
+
generator.addText(ClassFileGeneratorHelper_1.default.getFileLink(relatedClass, true));
|
|
120
120
|
}
|
|
121
121
|
else {
|
|
122
122
|
generator.addText(relatedClassName);
|
|
@@ -313,9 +313,10 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
313
313
|
}
|
|
314
314
|
addParameters(generator, level, methodModel) {
|
|
315
315
|
generator.addTitle('Parameters', level + 3);
|
|
316
|
+
generator.addBlankLine();
|
|
316
317
|
// Building a table to display the parameters
|
|
317
|
-
generator.addText('|Param|Description|');
|
|
318
|
-
generator.addText('
|
|
318
|
+
generator.addText('| Param | Description |');
|
|
319
|
+
generator.addText('| ----- | ----------- |');
|
|
319
320
|
methodModel.getParams().forEach(param => {
|
|
320
321
|
const paramName = param.substr(0, param.indexOf(' '));
|
|
321
322
|
const paramDescription = param.substr(param.indexOf(' '));
|
|
@@ -337,9 +338,10 @@ class MarkdownDocsProcessor extends DocsProcessor_1.default {
|
|
|
337
338
|
}
|
|
338
339
|
addThrowsBlock(generator, level, methodModel) {
|
|
339
340
|
generator.addTitle('Throws', level + 3);
|
|
341
|
+
generator.addBlankLine();
|
|
340
342
|
// Building a table to display the exceptions
|
|
341
|
-
generator.addText('|Exception|Description|');
|
|
342
|
-
generator.addText('
|
|
343
|
+
generator.addText('| Exception | Description |');
|
|
344
|
+
generator.addText('| --------- | ----------- |');
|
|
343
345
|
methodModel.getThrownExceptions().forEach(param => {
|
|
344
346
|
const exceptionName = param.substr(0, param.indexOf(' '));
|
|
345
347
|
const exceptionDescription = param.substr(param.indexOf(' '));
|
package/lib/MarkdownHelper.d.ts
CHANGED
package/lib/MarkdownHelper.js
CHANGED
|
@@ -28,7 +28,7 @@ class MarkdownHelper {
|
|
|
28
28
|
const classNameForMatch = currentMatch.replace('<<', '').replace('>>', '');
|
|
29
29
|
this.classes.forEach(classModel => {
|
|
30
30
|
if (classModel.getClassName() === classNameForMatch) {
|
|
31
|
-
text = text.replace(currentMatch, ClassFileGeneratorHelper_1.default.getFileLink(classModel));
|
|
31
|
+
text = text.replace(currentMatch, ClassFileGeneratorHelper_1.default.getFileLink(classModel, true));
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
});
|
|
@@ -46,7 +46,7 @@ class MarkdownHelper {
|
|
|
46
46
|
for (const currentMatch of matches) {
|
|
47
47
|
this.classes.forEach(classModel => {
|
|
48
48
|
if (classModel.getClassName() === currentMatch[1]) {
|
|
49
|
-
text = text.replace(currentMatch[0], ClassFileGeneratorHelper_1.default.getFileLink(classModel));
|
|
49
|
+
text = text.replace(currentMatch[0], ClassFileGeneratorHelper_1.default.getFileLink(classModel, true));
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
+
const sanitize = require("sanitize-filename-ts");
|
|
4
5
|
class ClassParser {
|
|
5
6
|
getClass(strLine, lstComments, iLine, parent) {
|
|
6
7
|
// create the new class
|
|
@@ -37,7 +38,10 @@ class ClassParser {
|
|
|
37
38
|
}
|
|
38
39
|
idxStart = comment.toLowerCase().indexOf('@group '); // needed to include space to not match group-content.
|
|
39
40
|
if (idxStart !== -1) {
|
|
40
|
-
|
|
41
|
+
const group = sanitize.sanitize(comment.substring(idxStart + 6).trim());
|
|
42
|
+
if (group) {
|
|
43
|
+
cModel.setClassGroup(group);
|
|
44
|
+
}
|
|
41
45
|
inDescription = false;
|
|
42
46
|
continue;
|
|
43
47
|
}
|
|
@@ -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();
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/field-declaration-util.ts"],"names":[],"mappings":";;AAGA,SAAgB,YAAY,CAC1B,KAAa,EACb,YAA0B,EAC1B,MAAwC,EACxC,oBAA4B;IAE5B,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IACvD,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM;SACH,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,IAAI,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC;QACtC,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;SACD,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;QACzB,eAAe,CAAC,YAAY,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEL,YAAY,CAAC,iBAAiB,EAAE,CAAC;AACnC,CAAC;AAnBD,oCAmBC;AAED,SAAS,eAAe,CACtB,YAA0B,EAC1B,aAA2C,EAC3C,oBAA4B;;IAE5B,YAAY,CAAC,QAAQ,CAAC,KAAK,aAAa,CAAC,IAAI,UAAU,aAAa,CAAC,IAAI,IAAI,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAEzG,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QAC/C,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,UAAI,aAAa,CAAC,UAAU,0CAAE,WAAW,EAAE;QACzC,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;KAC5D;IACD,YAAY,CAAC,YAAY,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function __export(m) {
|
|
3
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
4
|
+
}
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
__export(require("./type-declaration-util"));
|
|
7
|
+
__export(require("./method-declaration-util"));
|
|
8
|
+
__export(require("./field-declaration-util"));
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/index.ts"],"names":[],"mappings":";;;;;AAAA,6CAAwC;AACxC,+CAA0C;AAC1C,8CAAyC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ConstructorMirror, MethodMirror } from '@cparra/apex-reflection';
|
|
2
|
+
import { MarkdownFile } from '../markdown-file';
|
|
3
|
+
export declare function declareMethod(title: string, markdownFile: MarkdownFile, methods: ConstructorMirror[] | MethodMirror[], startingHeadingLevel: number, className?: string): void;
|