@cparra/apexdocs 2.23.0 → 2.24.0
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/.eslintrc.js +12 -12
- package/.github/workflows/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +718 -718
- package/apexdocs.config.ts +13 -13
- package/docs/README.md +1 -1
- package/docs/restapi.json +589 -589
- package/docs/types/Classes/nspc.ChildClass.md +97 -97
- package/docs/types/Main/nspc.SampleClass.md +189 -189
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
- package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
- package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
- package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
- package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
- package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
- package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
- package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
- package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
- package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
- package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
- package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
- package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
- package/examples/includes/header.md +3 -3
- package/jest.config.js +5 -5
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +76 -76
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +130 -130
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -17
- package/lib/model/apex-bundle.d.ts +6 -6
- package/lib/model/apex-bundle.js +10 -10
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
- package/lib/model/inheritance.d.ts +8 -8
- package/lib/model/inheritance.js +2 -2
- package/lib/model/manifest-diff.d.ts +27 -27
- package/lib/model/manifest-diff.js +68 -68
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +46 -46
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +106 -106
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +43 -43
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
- package/lib/model/markdown-generation-util/index.d.ts +3 -3
- package/lib/model/markdown-generation-util/index.js +19 -19
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
- package/lib/model/markdown-home-file.d.ts +11 -11
- package/lib/model/markdown-home-file.js +53 -53
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +133 -133
- package/lib/model/openapi/apex-doc-types.d.ts +19 -19
- package/lib/model/openapi/apex-doc-types.js +4 -4
- package/lib/model/openapi/open-api-types.d.ts +93 -93
- package/lib/model/openapi/open-api-types.js +2 -2
- package/lib/model/openapi/open-api.d.ts +16 -16
- package/lib/model/openapi/open-api.js +33 -33
- package/lib/model/openapi/openapi-type-file.d.ts +7 -7
- package/lib/model/openapi/openapi-type-file.js +16 -16
- package/lib/model/outputFile.d.ts +10 -10
- package/lib/model/outputFile.js +28 -28
- package/lib/model/types-repository.d.ts +16 -16
- package/lib/model/types-repository.js +53 -53
- package/lib/service/apex-file-reader.d.ts +14 -14
- package/lib/service/apex-file-reader.js +45 -45
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +24 -24
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +33 -33
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +13 -13
- package/lib/service/metadata-processor.d.ts +3 -3
- package/lib/service/metadata-processor.js +16 -16
- package/lib/service/parser.d.ts +21 -21
- package/lib/service/parser.js +134 -134
- package/lib/service/state.d.ts +9 -9
- package/lib/service/state.js +19 -19
- package/lib/service/walkers/class-walker.d.ts +4 -4
- package/lib/service/walkers/class-walker.js +32 -32
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/walker-factory.d.ts +5 -5
- package/lib/service/walkers/walker-factory.js +20 -20
- package/lib/service/walkers/walker.d.ts +19 -19
- package/lib/service/walkers/walker.js +16 -16
- package/lib/settings.d.ts +64 -64
- package/lib/settings.js +88 -88
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
- package/lib/test-helpers/AnnotationBuilder.js +30 -30
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
- package/lib/test-helpers/DocCommentBuilder.js +37 -37
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +10 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +36 -36
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
- package/lib/test-helpers/SettingsBuilder.js +26 -26
- package/lib/transpiler/factory.d.ts +6 -6
- package/lib/transpiler/factory.js +31 -31
- package/lib/transpiler/file-container.d.ts +6 -6
- package/lib/transpiler/file-container.js +15 -15
- package/lib/transpiler/generator-choices.d.ts +1 -1
- package/lib/transpiler/generator-choices.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +8 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +55 -55
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -23
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +74 -74
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +166 -166
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +225 -225
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
- package/lib/transpiler/processor-type-transpiler.js +8 -8
- package/lib/transpiler/transpiler.d.ts +5 -5
- package/lib/transpiler/transpiler.js +26 -26
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +57 -57
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/package.json +78 -78
- package/tsconfig.json +20 -20
- package/tslint.json +5 -5
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import Manifest from './manifest';
|
|
2
|
-
import { Type } from '@cparra/apex-reflection';
|
|
3
|
-
import { Annotation } from '@cparra/apex-reflection/index';
|
|
4
|
-
export declare class ManifestDiff {
|
|
5
|
-
added: Type[];
|
|
6
|
-
deleted: Type[];
|
|
7
|
-
changes: DiffChange[];
|
|
8
|
-
static build(originalManifest: Manifest, newManifest: Manifest): ManifestDiff;
|
|
9
|
-
}
|
|
10
|
-
declare class DiffChange {
|
|
11
|
-
originalType: Type;
|
|
12
|
-
newType: Type;
|
|
13
|
-
accessModifierChange?: AccessModifierChange;
|
|
14
|
-
annotationChanges: AnnotationChange[];
|
|
15
|
-
constructor(originalType: Type, newType: Type);
|
|
16
|
-
hasChanges(): boolean;
|
|
17
|
-
private parse;
|
|
18
|
-
}
|
|
19
|
-
interface AccessModifierChange {
|
|
20
|
-
oldAccessModifier: string;
|
|
21
|
-
newAccessModifier: string;
|
|
22
|
-
}
|
|
23
|
-
interface AnnotationChange {
|
|
24
|
-
annotation: Annotation;
|
|
25
|
-
type: 'added' | 'removed';
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
1
|
+
import Manifest from './manifest';
|
|
2
|
+
import { Type } from '@cparra/apex-reflection';
|
|
3
|
+
import { Annotation } from '@cparra/apex-reflection/index';
|
|
4
|
+
export declare class ManifestDiff {
|
|
5
|
+
added: Type[];
|
|
6
|
+
deleted: Type[];
|
|
7
|
+
changes: DiffChange[];
|
|
8
|
+
static build(originalManifest: Manifest, newManifest: Manifest): ManifestDiff;
|
|
9
|
+
}
|
|
10
|
+
declare class DiffChange {
|
|
11
|
+
originalType: Type;
|
|
12
|
+
newType: Type;
|
|
13
|
+
accessModifierChange?: AccessModifierChange;
|
|
14
|
+
annotationChanges: AnnotationChange[];
|
|
15
|
+
constructor(originalType: Type, newType: Type);
|
|
16
|
+
hasChanges(): boolean;
|
|
17
|
+
private parse;
|
|
18
|
+
}
|
|
19
|
+
interface AccessModifierChange {
|
|
20
|
+
oldAccessModifier: string;
|
|
21
|
+
newAccessModifier: string;
|
|
22
|
+
}
|
|
23
|
+
interface AnnotationChange {
|
|
24
|
+
annotation: Annotation;
|
|
25
|
+
type: 'added' | 'removed';
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ManifestDiff = void 0;
|
|
4
|
-
class ManifestDiff {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.added = [];
|
|
7
|
-
this.deleted = [];
|
|
8
|
-
this.changes = [];
|
|
9
|
-
}
|
|
10
|
-
static build(originalManifest, newManifest) {
|
|
11
|
-
const addedTypes = newManifest.types.filter((currentType) => !originalManifest.types.find((originalType) => currentType.name === originalType.name));
|
|
12
|
-
const deletedTypes = originalManifest.types.filter((currentType) => !newManifest.types.find((newType) => currentType.name === newType.name));
|
|
13
|
-
const changes = [];
|
|
14
|
-
for (const newType of newManifest.types) {
|
|
15
|
-
const oldType = originalManifest.types.find((oldType) => oldType.name === newType.name);
|
|
16
|
-
if (!oldType) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const change = new DiffChange(oldType, newType);
|
|
20
|
-
if (change.hasChanges()) {
|
|
21
|
-
changes.push(change);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const diff = new ManifestDiff();
|
|
25
|
-
diff.added = addedTypes;
|
|
26
|
-
diff.deleted = deletedTypes;
|
|
27
|
-
diff.changes = changes;
|
|
28
|
-
return diff;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ManifestDiff = ManifestDiff;
|
|
32
|
-
class DiffChange {
|
|
33
|
-
constructor(originalType, newType) {
|
|
34
|
-
this.originalType = originalType;
|
|
35
|
-
this.newType = newType;
|
|
36
|
-
this.annotationChanges = [];
|
|
37
|
-
this.parse();
|
|
38
|
-
}
|
|
39
|
-
hasChanges() {
|
|
40
|
-
return !!this.accessModifierChange || this.annotationChanges.length > 0;
|
|
41
|
-
}
|
|
42
|
-
parse() {
|
|
43
|
-
// Access modifier changes
|
|
44
|
-
if (this.originalType.access_modifier !== this.newType.access_modifier) {
|
|
45
|
-
this.accessModifierChange = {
|
|
46
|
-
oldAccessModifier: this.originalType.access_modifier,
|
|
47
|
-
newAccessModifier: this.newType.access_modifier,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
// Annotation changes
|
|
51
|
-
const addedAnnotations = this.newType.annotations.filter((currentAnnotation) => !this.originalType.annotations.find((originalAnnotation) => currentAnnotation.name === originalAnnotation.name));
|
|
52
|
-
const removedAnnotations = this.originalType.annotations.filter((currentAnnotation) => !this.newType.annotations.find((newAnnotation) => currentAnnotation.name === newAnnotation.name));
|
|
53
|
-
const annotationChangeMapper = (annotation, changeType) => {
|
|
54
|
-
return {
|
|
55
|
-
annotation: annotation,
|
|
56
|
-
type: changeType,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
this.annotationChanges = [
|
|
60
|
-
...addedAnnotations.map((annotation) => {
|
|
61
|
-
return annotationChangeMapper(annotation, 'added');
|
|
62
|
-
}),
|
|
63
|
-
...removedAnnotations.map((annotation) => {
|
|
64
|
-
return annotationChangeMapper(annotation, 'removed');
|
|
65
|
-
}),
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManifestDiff = void 0;
|
|
4
|
+
class ManifestDiff {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.added = [];
|
|
7
|
+
this.deleted = [];
|
|
8
|
+
this.changes = [];
|
|
9
|
+
}
|
|
10
|
+
static build(originalManifest, newManifest) {
|
|
11
|
+
const addedTypes = newManifest.types.filter((currentType) => !originalManifest.types.find((originalType) => currentType.name === originalType.name));
|
|
12
|
+
const deletedTypes = originalManifest.types.filter((currentType) => !newManifest.types.find((newType) => currentType.name === newType.name));
|
|
13
|
+
const changes = [];
|
|
14
|
+
for (const newType of newManifest.types) {
|
|
15
|
+
const oldType = originalManifest.types.find((oldType) => oldType.name === newType.name);
|
|
16
|
+
if (!oldType) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const change = new DiffChange(oldType, newType);
|
|
20
|
+
if (change.hasChanges()) {
|
|
21
|
+
changes.push(change);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const diff = new ManifestDiff();
|
|
25
|
+
diff.added = addedTypes;
|
|
26
|
+
diff.deleted = deletedTypes;
|
|
27
|
+
diff.changes = changes;
|
|
28
|
+
return diff;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ManifestDiff = ManifestDiff;
|
|
32
|
+
class DiffChange {
|
|
33
|
+
constructor(originalType, newType) {
|
|
34
|
+
this.originalType = originalType;
|
|
35
|
+
this.newType = newType;
|
|
36
|
+
this.annotationChanges = [];
|
|
37
|
+
this.parse();
|
|
38
|
+
}
|
|
39
|
+
hasChanges() {
|
|
40
|
+
return !!this.accessModifierChange || this.annotationChanges.length > 0;
|
|
41
|
+
}
|
|
42
|
+
parse() {
|
|
43
|
+
// Access modifier changes
|
|
44
|
+
if (this.originalType.access_modifier !== this.newType.access_modifier) {
|
|
45
|
+
this.accessModifierChange = {
|
|
46
|
+
oldAccessModifier: this.originalType.access_modifier,
|
|
47
|
+
newAccessModifier: this.newType.access_modifier,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Annotation changes
|
|
51
|
+
const addedAnnotations = this.newType.annotations.filter((currentAnnotation) => !this.originalType.annotations.find((originalAnnotation) => currentAnnotation.name === originalAnnotation.name));
|
|
52
|
+
const removedAnnotations = this.originalType.annotations.filter((currentAnnotation) => !this.newType.annotations.find((newAnnotation) => currentAnnotation.name === newAnnotation.name));
|
|
53
|
+
const annotationChangeMapper = (annotation, changeType) => {
|
|
54
|
+
return {
|
|
55
|
+
annotation: annotation,
|
|
56
|
+
type: changeType,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
this.annotationChanges = [
|
|
60
|
+
...addedAnnotations.map((annotation) => {
|
|
61
|
+
return annotationChangeMapper(annotation, 'added');
|
|
62
|
+
}),
|
|
63
|
+
...removedAnnotations.map((annotation) => {
|
|
64
|
+
return annotationChangeMapper(annotation, 'removed');
|
|
65
|
+
}),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
69
|
//# sourceMappingURL=manifest-diff.js.map
|
package/lib/model/manifest.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Type, Annotation, DocComment } from '@cparra/apex-reflection';
|
|
2
|
-
type AccessAndDocAware = {
|
|
3
|
-
access_modifier: string;
|
|
4
|
-
annotations: Annotation[];
|
|
5
|
-
docComment?: DocComment;
|
|
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(accessAndDocAwares: AccessAndDocAware[], modifiers: string[]): AccessAndDocAware[];
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
1
|
+
import { Type, Annotation, DocComment } from '@cparra/apex-reflection';
|
|
2
|
+
type AccessAndDocAware = {
|
|
3
|
+
access_modifier: string;
|
|
4
|
+
annotations: Annotation[];
|
|
5
|
+
docComment?: DocComment;
|
|
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(accessAndDocAwares: AccessAndDocAware[], modifiers: string[]): AccessAndDocAware[];
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/lib/model/manifest.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
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(accessAndDocAwares, modifiers) {
|
|
35
|
-
return accessAndDocAwares.filter((currentType) => {
|
|
36
|
-
var _a;
|
|
37
|
-
const hasIgnoreDocAnnotation = (_a = currentType.docComment) === null || _a === void 0 ? void 0 : _a.annotations.some((annotation) => annotation.name === 'ignore');
|
|
38
|
-
if (hasIgnoreDocAnnotation) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return (modifiers.includes(currentType.access_modifier) ||
|
|
42
|
-
currentType.annotations.some((annotation) => modifiers.includes(annotation.type.toLowerCase())));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.default = Manifest;
|
|
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(accessAndDocAwares, modifiers) {
|
|
35
|
+
return accessAndDocAwares.filter((currentType) => {
|
|
36
|
+
var _a;
|
|
37
|
+
const hasIgnoreDocAnnotation = (_a = currentType.docComment) === null || _a === void 0 ? void 0 : _a.annotations.some((annotation) => annotation.name === 'ignore');
|
|
38
|
+
if (hasIgnoreDocAnnotation) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return (modifiers.includes(currentType.access_modifier) ||
|
|
42
|
+
currentType.annotations.some((annotation) => modifiers.includes(annotation.type.toLowerCase())));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.default = Manifest;
|
|
47
47
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { OutputFile } from './outputFile';
|
|
2
|
-
export declare class MarkdownFile extends OutputFile {
|
|
3
|
-
fileExtension(): string;
|
|
4
|
-
addTitle(text: string, level?: number): void;
|
|
5
|
-
addText(text: string, encodeHtml?: boolean): void;
|
|
6
|
-
addLink(text: string, encodeHtml?: boolean): void;
|
|
7
|
-
startCodeBlock(language?: string): void;
|
|
8
|
-
endCodeBlock(): void;
|
|
9
|
-
addHorizontalRule(): void;
|
|
10
|
-
initializeTable(...headers: string[]): void;
|
|
11
|
-
addTableRow(...columns: string[]): void;
|
|
12
|
-
addListItem(text: string): void;
|
|
13
|
-
protected static replaceInlineLinks(text: string): string;
|
|
14
|
-
protected static replaceInlineEmails(text: string): string;
|
|
15
|
-
private _replaceInlineReferences;
|
|
16
|
-
}
|
|
1
|
+
import { OutputFile } from './outputFile';
|
|
2
|
+
export declare class MarkdownFile extends OutputFile {
|
|
3
|
+
fileExtension(): string;
|
|
4
|
+
addTitle(text: string, level?: number): void;
|
|
5
|
+
addText(text: string, encodeHtml?: boolean): void;
|
|
6
|
+
addLink(text: string, encodeHtml?: boolean): void;
|
|
7
|
+
startCodeBlock(language?: string): void;
|
|
8
|
+
endCodeBlock(): void;
|
|
9
|
+
addHorizontalRule(): void;
|
|
10
|
+
initializeTable(...headers: string[]): void;
|
|
11
|
+
addTableRow(...columns: string[]): void;
|
|
12
|
+
addListItem(text: string): void;
|
|
13
|
+
protected static replaceInlineLinks(text: string): string;
|
|
14
|
+
protected static replaceInlineEmails(text: string): string;
|
|
15
|
+
private _replaceInlineReferences;
|
|
16
|
+
}
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarkdownFile = void 0;
|
|
4
|
-
const outputFile_1 = require("./outputFile");
|
|
5
|
-
const class_file_generatorHelper_1 = require("../transpiler/markdown/class-file-generatorHelper");
|
|
6
|
-
class MarkdownFile extends outputFile_1.OutputFile {
|
|
7
|
-
fileExtension() {
|
|
8
|
-
return '.md';
|
|
9
|
-
}
|
|
10
|
-
addTitle(text, level = 1) {
|
|
11
|
-
let title = '';
|
|
12
|
-
for (let i = 0; i < level; i++) {
|
|
13
|
-
title += '#';
|
|
14
|
-
}
|
|
15
|
-
title += ' ';
|
|
16
|
-
title += text;
|
|
17
|
-
this._contents += title;
|
|
18
|
-
this.addBlankLine();
|
|
19
|
-
}
|
|
20
|
-
addText(text, encodeHtml = true) {
|
|
21
|
-
super.addText(this._replaceInlineReferences(text), encodeHtml);
|
|
22
|
-
}
|
|
23
|
-
addLink(text, encodeHtml = true) {
|
|
24
|
-
this.addText(`\{@link ${text}\}`, encodeHtml);
|
|
25
|
-
}
|
|
26
|
-
startCodeBlock(language = 'apex') {
|
|
27
|
-
this.addText(`\`\`\`${language}`);
|
|
28
|
-
}
|
|
29
|
-
endCodeBlock() {
|
|
30
|
-
this.addText('```');
|
|
31
|
-
this.addBlankLine();
|
|
32
|
-
}
|
|
33
|
-
addHorizontalRule() {
|
|
34
|
-
this._contents += '---';
|
|
35
|
-
this.addBlankLine();
|
|
36
|
-
}
|
|
37
|
-
initializeTable(...headers) {
|
|
38
|
-
this.addBlankLine();
|
|
39
|
-
this._contents += '|';
|
|
40
|
-
headers.forEach((header) => {
|
|
41
|
-
this._contents += header + '|';
|
|
42
|
-
});
|
|
43
|
-
this.addBlankLine();
|
|
44
|
-
this._contents += '|';
|
|
45
|
-
headers.forEach((_) => {
|
|
46
|
-
this._contents += '---' + '|';
|
|
47
|
-
});
|
|
48
|
-
this.addBlankLine();
|
|
49
|
-
}
|
|
50
|
-
addTableRow(...columns) {
|
|
51
|
-
this._contents += '|';
|
|
52
|
-
columns.forEach((column) => {
|
|
53
|
-
this._contents += this._replaceInlineReferences(column) + '|';
|
|
54
|
-
});
|
|
55
|
-
this.addBlankLine();
|
|
56
|
-
}
|
|
57
|
-
addListItem(text) {
|
|
58
|
-
this._contents += `* ${text}`;
|
|
59
|
-
}
|
|
60
|
-
static replaceInlineLinks(text) {
|
|
61
|
-
// Parsing text to extract possible linking classes.
|
|
62
|
-
const possibleLinks = text.match(/<<.*?>>/g);
|
|
63
|
-
possibleLinks === null || possibleLinks === void 0 ? void 0 : possibleLinks.forEach((currentMatch) => {
|
|
64
|
-
const classNameForMatch = currentMatch.replace('<<', '').replace('>>', '');
|
|
65
|
-
text = text.replace(currentMatch, class_file_generatorHelper_1.default.getFileLinkByTypeName(classNameForMatch));
|
|
66
|
-
});
|
|
67
|
-
// Parsing links using {@link ClassName} format
|
|
68
|
-
const linkFormatRegEx = '{@link (.*?)}';
|
|
69
|
-
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
70
|
-
let match;
|
|
71
|
-
const matches = [];
|
|
72
|
-
do {
|
|
73
|
-
match = expression.exec(text);
|
|
74
|
-
if (match) {
|
|
75
|
-
matches.push(match);
|
|
76
|
-
}
|
|
77
|
-
} while (match);
|
|
78
|
-
for (const currentMatch of matches) {
|
|
79
|
-
text = text.replace(currentMatch[0], class_file_generatorHelper_1.default.getFileLinkByTypeName(currentMatch[1]));
|
|
80
|
-
}
|
|
81
|
-
return text;
|
|
82
|
-
}
|
|
83
|
-
static replaceInlineEmails(text) {
|
|
84
|
-
// Parsing links using {@link ClassName} format
|
|
85
|
-
const linkFormatRegEx = '{@email (.*?)}';
|
|
86
|
-
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
87
|
-
let match;
|
|
88
|
-
const matches = [];
|
|
89
|
-
do {
|
|
90
|
-
match = expression.exec(text);
|
|
91
|
-
if (match) {
|
|
92
|
-
matches.push(match);
|
|
93
|
-
}
|
|
94
|
-
} while (match);
|
|
95
|
-
for (const currentMatch of matches) {
|
|
96
|
-
text = text.replace(currentMatch[0], `[${currentMatch[1]}](mailto:${currentMatch[1]})`);
|
|
97
|
-
}
|
|
98
|
-
return text;
|
|
99
|
-
}
|
|
100
|
-
_replaceInlineReferences(text) {
|
|
101
|
-
text = MarkdownFile.replaceInlineLinks(text);
|
|
102
|
-
text = MarkdownFile.replaceInlineEmails(text);
|
|
103
|
-
return text;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.MarkdownFile = MarkdownFile;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MarkdownFile = void 0;
|
|
4
|
+
const outputFile_1 = require("./outputFile");
|
|
5
|
+
const class_file_generatorHelper_1 = require("../transpiler/markdown/class-file-generatorHelper");
|
|
6
|
+
class MarkdownFile extends outputFile_1.OutputFile {
|
|
7
|
+
fileExtension() {
|
|
8
|
+
return '.md';
|
|
9
|
+
}
|
|
10
|
+
addTitle(text, level = 1) {
|
|
11
|
+
let title = '';
|
|
12
|
+
for (let i = 0; i < level; i++) {
|
|
13
|
+
title += '#';
|
|
14
|
+
}
|
|
15
|
+
title += ' ';
|
|
16
|
+
title += text;
|
|
17
|
+
this._contents += title;
|
|
18
|
+
this.addBlankLine();
|
|
19
|
+
}
|
|
20
|
+
addText(text, encodeHtml = true) {
|
|
21
|
+
super.addText(this._replaceInlineReferences(text), encodeHtml);
|
|
22
|
+
}
|
|
23
|
+
addLink(text, encodeHtml = true) {
|
|
24
|
+
this.addText(`\{@link ${text}\}`, encodeHtml);
|
|
25
|
+
}
|
|
26
|
+
startCodeBlock(language = 'apex') {
|
|
27
|
+
this.addText(`\`\`\`${language}`);
|
|
28
|
+
}
|
|
29
|
+
endCodeBlock() {
|
|
30
|
+
this.addText('```');
|
|
31
|
+
this.addBlankLine();
|
|
32
|
+
}
|
|
33
|
+
addHorizontalRule() {
|
|
34
|
+
this._contents += '---';
|
|
35
|
+
this.addBlankLine();
|
|
36
|
+
}
|
|
37
|
+
initializeTable(...headers) {
|
|
38
|
+
this.addBlankLine();
|
|
39
|
+
this._contents += '|';
|
|
40
|
+
headers.forEach((header) => {
|
|
41
|
+
this._contents += header + '|';
|
|
42
|
+
});
|
|
43
|
+
this.addBlankLine();
|
|
44
|
+
this._contents += '|';
|
|
45
|
+
headers.forEach((_) => {
|
|
46
|
+
this._contents += '---' + '|';
|
|
47
|
+
});
|
|
48
|
+
this.addBlankLine();
|
|
49
|
+
}
|
|
50
|
+
addTableRow(...columns) {
|
|
51
|
+
this._contents += '|';
|
|
52
|
+
columns.forEach((column) => {
|
|
53
|
+
this._contents += this._replaceInlineReferences(column) + '|';
|
|
54
|
+
});
|
|
55
|
+
this.addBlankLine();
|
|
56
|
+
}
|
|
57
|
+
addListItem(text) {
|
|
58
|
+
this._contents += `* ${text}`;
|
|
59
|
+
}
|
|
60
|
+
static replaceInlineLinks(text) {
|
|
61
|
+
// Parsing text to extract possible linking classes.
|
|
62
|
+
const possibleLinks = text.match(/<<.*?>>/g);
|
|
63
|
+
possibleLinks === null || possibleLinks === void 0 ? void 0 : possibleLinks.forEach((currentMatch) => {
|
|
64
|
+
const classNameForMatch = currentMatch.replace('<<', '').replace('>>', '');
|
|
65
|
+
text = text.replace(currentMatch, class_file_generatorHelper_1.default.getFileLinkByTypeName(classNameForMatch));
|
|
66
|
+
});
|
|
67
|
+
// Parsing links using {@link ClassName} format
|
|
68
|
+
const linkFormatRegEx = '{@link (.*?)}';
|
|
69
|
+
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
70
|
+
let match;
|
|
71
|
+
const matches = [];
|
|
72
|
+
do {
|
|
73
|
+
match = expression.exec(text);
|
|
74
|
+
if (match) {
|
|
75
|
+
matches.push(match);
|
|
76
|
+
}
|
|
77
|
+
} while (match);
|
|
78
|
+
for (const currentMatch of matches) {
|
|
79
|
+
text = text.replace(currentMatch[0], class_file_generatorHelper_1.default.getFileLinkByTypeName(currentMatch[1]));
|
|
80
|
+
}
|
|
81
|
+
return text;
|
|
82
|
+
}
|
|
83
|
+
static replaceInlineEmails(text) {
|
|
84
|
+
// Parsing links using {@link ClassName} format
|
|
85
|
+
const linkFormatRegEx = '{@email (.*?)}';
|
|
86
|
+
const expression = new RegExp(linkFormatRegEx, 'gi');
|
|
87
|
+
let match;
|
|
88
|
+
const matches = [];
|
|
89
|
+
do {
|
|
90
|
+
match = expression.exec(text);
|
|
91
|
+
if (match) {
|
|
92
|
+
matches.push(match);
|
|
93
|
+
}
|
|
94
|
+
} while (match);
|
|
95
|
+
for (const currentMatch of matches) {
|
|
96
|
+
text = text.replace(currentMatch[0], `[${currentMatch[1]}](mailto:${currentMatch[1]})`);
|
|
97
|
+
}
|
|
98
|
+
return text;
|
|
99
|
+
}
|
|
100
|
+
_replaceInlineReferences(text) {
|
|
101
|
+
text = MarkdownFile.replaceInlineLinks(text);
|
|
102
|
+
text = MarkdownFile.replaceInlineEmails(text);
|
|
103
|
+
return text;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.MarkdownFile = MarkdownFile;
|
|
107
107
|
//# sourceMappingURL=markdown-file.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DocComment } from '@cparra/apex-reflection';
|
|
2
|
-
import { MarkdownFile } from '../markdown-file';
|
|
3
|
-
interface DocCommentAware {
|
|
4
|
-
docComment?: DocComment;
|
|
5
|
-
}
|
|
6
|
-
export declare function addMermaid(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
7
|
-
export declare function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
8
|
-
export {};
|
|
1
|
+
import { DocComment } from '@cparra/apex-reflection';
|
|
2
|
+
import { MarkdownFile } from '../markdown-file';
|
|
3
|
+
interface DocCommentAware {
|
|
4
|
+
docComment?: DocComment;
|
|
5
|
+
}
|
|
6
|
+
export declare function addMermaid(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
7
|
+
export declare function addCustomDocCommentAnnotations(markdownFile: MarkdownFile, docCommentAware: DocCommentAware): void;
|
|
8
|
+
export {};
|