@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
package/lib/service/parser.js
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RawBodyParser = void 0;
|
|
4
|
-
const metadata_processor_1 = require("./metadata-processor");
|
|
5
|
-
const logger_1 = require("../util/logger");
|
|
6
|
-
class RawBodyParser {
|
|
7
|
-
constructor(typeBundles) {
|
|
8
|
-
this.typeBundles = typeBundles;
|
|
9
|
-
}
|
|
10
|
-
parse(reflect) {
|
|
11
|
-
const types = this.typeBundles
|
|
12
|
-
.map((currentBundle) => {
|
|
13
|
-
logger_1.Logger.log(`Parsing file: ${currentBundle.filePath}`);
|
|
14
|
-
const result = reflect(currentBundle);
|
|
15
|
-
if (!!result.typeMirror && !!currentBundle.rawMetadataContent) {
|
|
16
|
-
// If successful and there is a metadata file
|
|
17
|
-
const metadataParams = metadata_processor_1.default.process(currentBundle.rawMetadataContent);
|
|
18
|
-
metadataParams.forEach((value, key) => {
|
|
19
|
-
var _a;
|
|
20
|
-
const declaration = `${key}: ${value}`;
|
|
21
|
-
(_a = result.typeMirror) === null || _a === void 0 ? void 0 : _a.annotations.push({
|
|
22
|
-
rawDeclaration: declaration,
|
|
23
|
-
name: declaration,
|
|
24
|
-
type: declaration,
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return result;
|
|
29
|
-
})
|
|
30
|
-
.filter((reflectionResult) => {
|
|
31
|
-
return reflectionResult.typeMirror;
|
|
32
|
-
})
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
|
-
.map((reflectionResult) => reflectionResult.typeMirror);
|
|
35
|
-
return this.addFieldsFromParent(types);
|
|
36
|
-
}
|
|
37
|
-
addFieldsFromParent(types) {
|
|
38
|
-
const typesWithFields = [];
|
|
39
|
-
for (const currentType of types) {
|
|
40
|
-
if (currentType.type_name !== 'class' && currentType.type_name !== 'interface') {
|
|
41
|
-
typesWithFields.push(currentType);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (currentType.type_name === 'class') {
|
|
45
|
-
let typeAsClass = currentType;
|
|
46
|
-
if (!typeAsClass.extended_class) {
|
|
47
|
-
typesWithFields.push(currentType);
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
typeAsClass = this.addMembersFromParent(typeAsClass, types);
|
|
51
|
-
typesWithFields.push(typeAsClass);
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
// If reaching here then we are dealing with an interface
|
|
55
|
-
let typeAsInterface = currentType;
|
|
56
|
-
if (!typeAsInterface.extended_interfaces.length) {
|
|
57
|
-
typesWithFields.push(currentType);
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
typeAsInterface = this.addMethodsFromParent(typeAsInterface, types);
|
|
61
|
-
typesWithFields.push(typeAsInterface);
|
|
62
|
-
}
|
|
63
|
-
return typesWithFields;
|
|
64
|
-
}
|
|
65
|
-
addMembersFromParent(currentClass, allTypes) {
|
|
66
|
-
if (!currentClass.extended_class) {
|
|
67
|
-
return currentClass;
|
|
68
|
-
}
|
|
69
|
-
const parent = allTypes.find((currentType) => currentType.name === currentClass.extended_class);
|
|
70
|
-
if (!parent || parent.type_name !== 'class') {
|
|
71
|
-
return currentClass;
|
|
72
|
-
}
|
|
73
|
-
let parentAsClass = parent;
|
|
74
|
-
if (parentAsClass.extended_class) {
|
|
75
|
-
parentAsClass = this.addMembersFromParent(parentAsClass, allTypes);
|
|
76
|
-
}
|
|
77
|
-
currentClass.fields = [...currentClass.fields, ...this.getInheritedFields(parentAsClass, currentClass)];
|
|
78
|
-
currentClass.properties = [...currentClass.properties, ...this.getInheritedProperties(parentAsClass, currentClass)];
|
|
79
|
-
currentClass.methods = [...currentClass.methods, ...this.getInheritedMethods(parentAsClass, currentClass)];
|
|
80
|
-
return currentClass;
|
|
81
|
-
}
|
|
82
|
-
addMethodsFromParent(currentInterface, allTypes) {
|
|
83
|
-
if (!currentInterface.extended_interfaces.length) {
|
|
84
|
-
return currentInterface;
|
|
85
|
-
}
|
|
86
|
-
const parents = [];
|
|
87
|
-
for (const currentInterfaceName of currentInterface.extended_interfaces) {
|
|
88
|
-
const parent = allTypes.find((currentType) => currentType.name === currentInterfaceName);
|
|
89
|
-
if (parent) {
|
|
90
|
-
parents.push(parent);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
for (const parent of parents) {
|
|
94
|
-
let parentAsInterface = parent;
|
|
95
|
-
if (parentAsInterface.extended_interfaces.length) {
|
|
96
|
-
parentAsInterface = this.addMethodsFromParent(parentAsInterface, allTypes);
|
|
97
|
-
}
|
|
98
|
-
currentInterface.methods = [
|
|
99
|
-
...currentInterface.methods,
|
|
100
|
-
...this.getInheritedMethods(parentAsInterface, currentInterface),
|
|
101
|
-
];
|
|
102
|
-
}
|
|
103
|
-
return currentInterface;
|
|
104
|
-
}
|
|
105
|
-
getInheritedFields(parentAsClass, currentClass) {
|
|
106
|
-
return (parentAsClass.fields
|
|
107
|
-
// Filter out private fields
|
|
108
|
-
.filter((currentField) => currentField.access_modifier.toLowerCase() !== 'private')
|
|
109
|
-
// Filter out fields that also exist on the child
|
|
110
|
-
.filter((currentField) => !this.memberExists(currentClass.fields, currentField.name))
|
|
111
|
-
.map((currentField) => (Object.assign(Object.assign({}, currentField), { inherited: true }))));
|
|
112
|
-
}
|
|
113
|
-
getInheritedProperties(parentAsClass, currentClass) {
|
|
114
|
-
return (parentAsClass.properties
|
|
115
|
-
// Filter out private properties
|
|
116
|
-
.filter((currentProperty) => currentProperty.access_modifier.toLowerCase() !== 'private')
|
|
117
|
-
// Filter out properties that also exist on the child
|
|
118
|
-
.filter((currentProperty) => !this.memberExists(currentClass.properties, currentProperty.name))
|
|
119
|
-
.map((currentProperty) => (Object.assign(Object.assign({}, currentProperty), { inherited: true }))));
|
|
120
|
-
}
|
|
121
|
-
getInheritedMethods(parentAsClass, currentClass) {
|
|
122
|
-
return (parentAsClass.methods
|
|
123
|
-
// Filter out private methods
|
|
124
|
-
.filter((currentMethod) => currentMethod.access_modifier.toLowerCase() !== 'private')
|
|
125
|
-
// Filter out methods that also exist on the child
|
|
126
|
-
.filter((currentMethod) => !this.memberExists(currentClass.methods, currentMethod.name))
|
|
127
|
-
.map((currentMethod) => (Object.assign(Object.assign({}, currentMethod), { inherited: true }))));
|
|
128
|
-
}
|
|
129
|
-
memberExists(members, fieldName) {
|
|
130
|
-
const fieldNames = members.map((currentMember) => currentMember.name);
|
|
131
|
-
return fieldNames.includes(fieldName);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.RawBodyParser = RawBodyParser;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RawBodyParser = void 0;
|
|
4
|
+
const metadata_processor_1 = require("./metadata-processor");
|
|
5
|
+
const logger_1 = require("../util/logger");
|
|
6
|
+
class RawBodyParser {
|
|
7
|
+
constructor(typeBundles) {
|
|
8
|
+
this.typeBundles = typeBundles;
|
|
9
|
+
}
|
|
10
|
+
parse(reflect) {
|
|
11
|
+
const types = this.typeBundles
|
|
12
|
+
.map((currentBundle) => {
|
|
13
|
+
logger_1.Logger.log(`Parsing file: ${currentBundle.filePath}`);
|
|
14
|
+
const result = reflect(currentBundle);
|
|
15
|
+
if (!!result.typeMirror && !!currentBundle.rawMetadataContent) {
|
|
16
|
+
// If successful and there is a metadata file
|
|
17
|
+
const metadataParams = metadata_processor_1.default.process(currentBundle.rawMetadataContent);
|
|
18
|
+
metadataParams.forEach((value, key) => {
|
|
19
|
+
var _a;
|
|
20
|
+
const declaration = `${key}: ${value}`;
|
|
21
|
+
(_a = result.typeMirror) === null || _a === void 0 ? void 0 : _a.annotations.push({
|
|
22
|
+
rawDeclaration: declaration,
|
|
23
|
+
name: declaration,
|
|
24
|
+
type: declaration,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
})
|
|
30
|
+
.filter((reflectionResult) => {
|
|
31
|
+
return reflectionResult.typeMirror;
|
|
32
|
+
})
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
34
|
+
.map((reflectionResult) => reflectionResult.typeMirror);
|
|
35
|
+
return this.addFieldsFromParent(types);
|
|
36
|
+
}
|
|
37
|
+
addFieldsFromParent(types) {
|
|
38
|
+
const typesWithFields = [];
|
|
39
|
+
for (const currentType of types) {
|
|
40
|
+
if (currentType.type_name !== 'class' && currentType.type_name !== 'interface') {
|
|
41
|
+
typesWithFields.push(currentType);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (currentType.type_name === 'class') {
|
|
45
|
+
let typeAsClass = currentType;
|
|
46
|
+
if (!typeAsClass.extended_class) {
|
|
47
|
+
typesWithFields.push(currentType);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
typeAsClass = this.addMembersFromParent(typeAsClass, types);
|
|
51
|
+
typesWithFields.push(typeAsClass);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// If reaching here then we are dealing with an interface
|
|
55
|
+
let typeAsInterface = currentType;
|
|
56
|
+
if (!typeAsInterface.extended_interfaces.length) {
|
|
57
|
+
typesWithFields.push(currentType);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
typeAsInterface = this.addMethodsFromParent(typeAsInterface, types);
|
|
61
|
+
typesWithFields.push(typeAsInterface);
|
|
62
|
+
}
|
|
63
|
+
return typesWithFields;
|
|
64
|
+
}
|
|
65
|
+
addMembersFromParent(currentClass, allTypes) {
|
|
66
|
+
if (!currentClass.extended_class) {
|
|
67
|
+
return currentClass;
|
|
68
|
+
}
|
|
69
|
+
const parent = allTypes.find((currentType) => currentType.name === currentClass.extended_class);
|
|
70
|
+
if (!parent || parent.type_name !== 'class') {
|
|
71
|
+
return currentClass;
|
|
72
|
+
}
|
|
73
|
+
let parentAsClass = parent;
|
|
74
|
+
if (parentAsClass.extended_class) {
|
|
75
|
+
parentAsClass = this.addMembersFromParent(parentAsClass, allTypes);
|
|
76
|
+
}
|
|
77
|
+
currentClass.fields = [...currentClass.fields, ...this.getInheritedFields(parentAsClass, currentClass)];
|
|
78
|
+
currentClass.properties = [...currentClass.properties, ...this.getInheritedProperties(parentAsClass, currentClass)];
|
|
79
|
+
currentClass.methods = [...currentClass.methods, ...this.getInheritedMethods(parentAsClass, currentClass)];
|
|
80
|
+
return currentClass;
|
|
81
|
+
}
|
|
82
|
+
addMethodsFromParent(currentInterface, allTypes) {
|
|
83
|
+
if (!currentInterface.extended_interfaces.length) {
|
|
84
|
+
return currentInterface;
|
|
85
|
+
}
|
|
86
|
+
const parents = [];
|
|
87
|
+
for (const currentInterfaceName of currentInterface.extended_interfaces) {
|
|
88
|
+
const parent = allTypes.find((currentType) => currentType.name === currentInterfaceName);
|
|
89
|
+
if (parent) {
|
|
90
|
+
parents.push(parent);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const parent of parents) {
|
|
94
|
+
let parentAsInterface = parent;
|
|
95
|
+
if (parentAsInterface.extended_interfaces.length) {
|
|
96
|
+
parentAsInterface = this.addMethodsFromParent(parentAsInterface, allTypes);
|
|
97
|
+
}
|
|
98
|
+
currentInterface.methods = [
|
|
99
|
+
...currentInterface.methods,
|
|
100
|
+
...this.getInheritedMethods(parentAsInterface, currentInterface),
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
return currentInterface;
|
|
104
|
+
}
|
|
105
|
+
getInheritedFields(parentAsClass, currentClass) {
|
|
106
|
+
return (parentAsClass.fields
|
|
107
|
+
// Filter out private fields
|
|
108
|
+
.filter((currentField) => currentField.access_modifier.toLowerCase() !== 'private')
|
|
109
|
+
// Filter out fields that also exist on the child
|
|
110
|
+
.filter((currentField) => !this.memberExists(currentClass.fields, currentField.name))
|
|
111
|
+
.map((currentField) => (Object.assign(Object.assign({}, currentField), { inherited: true }))));
|
|
112
|
+
}
|
|
113
|
+
getInheritedProperties(parentAsClass, currentClass) {
|
|
114
|
+
return (parentAsClass.properties
|
|
115
|
+
// Filter out private properties
|
|
116
|
+
.filter((currentProperty) => currentProperty.access_modifier.toLowerCase() !== 'private')
|
|
117
|
+
// Filter out properties that also exist on the child
|
|
118
|
+
.filter((currentProperty) => !this.memberExists(currentClass.properties, currentProperty.name))
|
|
119
|
+
.map((currentProperty) => (Object.assign(Object.assign({}, currentProperty), { inherited: true }))));
|
|
120
|
+
}
|
|
121
|
+
getInheritedMethods(parentAsClass, currentClass) {
|
|
122
|
+
return (parentAsClass.methods
|
|
123
|
+
// Filter out private methods
|
|
124
|
+
.filter((currentMethod) => currentMethod.access_modifier.toLowerCase() !== 'private')
|
|
125
|
+
// Filter out methods that also exist on the child
|
|
126
|
+
.filter((currentMethod) => !this.memberExists(currentClass.methods, currentMethod.name))
|
|
127
|
+
.map((currentMethod) => (Object.assign(Object.assign({}, currentMethod), { inherited: true }))));
|
|
128
|
+
}
|
|
129
|
+
memberExists(members, fieldName) {
|
|
130
|
+
const fieldNames = members.map((currentMember) => currentMember.name);
|
|
131
|
+
return fieldNames.includes(fieldName);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.RawBodyParser = RawBodyParser;
|
|
135
135
|
//# sourceMappingURL=parser.js.map
|
package/lib/service/state.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Type } from '@cparra/apex-reflection';
|
|
2
|
-
export default class State {
|
|
3
|
-
private static instance;
|
|
4
|
-
private typeBeingProcessed?;
|
|
5
|
-
private constructor();
|
|
6
|
-
static getInstance(): State;
|
|
7
|
-
setTypeBeingProcessed(typeToSet: Type): void;
|
|
8
|
-
getTypeBeingProcessed(): Type | undefined;
|
|
9
|
-
}
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
export default class State {
|
|
3
|
+
private static instance;
|
|
4
|
+
private typeBeingProcessed?;
|
|
5
|
+
private constructor();
|
|
6
|
+
static getInstance(): State;
|
|
7
|
+
setTypeBeingProcessed(typeToSet: Type): void;
|
|
8
|
+
getTypeBeingProcessed(): Type | undefined;
|
|
9
|
+
}
|
package/lib/service/state.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class State {
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
-
constructor() { }
|
|
6
|
-
static getInstance() {
|
|
7
|
-
if (!State.instance) {
|
|
8
|
-
State.instance = new State();
|
|
9
|
-
}
|
|
10
|
-
return State.instance;
|
|
11
|
-
}
|
|
12
|
-
setTypeBeingProcessed(typeToSet) {
|
|
13
|
-
this.typeBeingProcessed = typeToSet;
|
|
14
|
-
}
|
|
15
|
-
getTypeBeingProcessed() {
|
|
16
|
-
return this.typeBeingProcessed;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.default = State;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class State {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
+
constructor() { }
|
|
6
|
+
static getInstance() {
|
|
7
|
+
if (!State.instance) {
|
|
8
|
+
State.instance = new State();
|
|
9
|
+
}
|
|
10
|
+
return State.instance;
|
|
11
|
+
}
|
|
12
|
+
setTypeBeingProcessed(typeToSet) {
|
|
13
|
+
this.typeBeingProcessed = typeToSet;
|
|
14
|
+
}
|
|
15
|
+
getTypeBeingProcessed() {
|
|
16
|
+
return this.typeBeingProcessed;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = State;
|
|
20
20
|
//# sourceMappingURL=state.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Walker, WalkerListener } from './walker';
|
|
2
|
-
export declare class ClassWalker extends Walker {
|
|
3
|
-
walk(listener: WalkerListener): void;
|
|
4
|
-
}
|
|
1
|
+
import { Walker, WalkerListener } from './walker';
|
|
2
|
+
export declare class ClassWalker extends Walker {
|
|
3
|
+
walk(listener: WalkerListener): void;
|
|
4
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClassWalker = void 0;
|
|
4
|
-
const walker_1 = require("./walker");
|
|
5
|
-
class ClassWalker extends walker_1.Walker {
|
|
6
|
-
walk(listener) {
|
|
7
|
-
listener.onTypeDeclaration(this.type);
|
|
8
|
-
const classMirror = this.type;
|
|
9
|
-
if (classMirror.constructors.length) {
|
|
10
|
-
listener.onConstructorDeclaration(this.type.name, classMirror.constructors);
|
|
11
|
-
}
|
|
12
|
-
if (classMirror.fields.length) {
|
|
13
|
-
listener.onFieldsDeclaration(this.sortType(classMirror.fields));
|
|
14
|
-
}
|
|
15
|
-
if (classMirror.properties.length) {
|
|
16
|
-
listener.onPropertiesDeclaration(this.sortType(classMirror.properties));
|
|
17
|
-
}
|
|
18
|
-
if (classMirror.methods.length) {
|
|
19
|
-
listener.onMethodsDeclaration(this.sortType(classMirror.methods));
|
|
20
|
-
}
|
|
21
|
-
if (classMirror.enums.length) {
|
|
22
|
-
listener.onInnerEnumsDeclaration(this.sortType(classMirror.enums));
|
|
23
|
-
}
|
|
24
|
-
if (classMirror.classes.length) {
|
|
25
|
-
listener.onInnerClassesDeclaration(this.sortType(classMirror.classes));
|
|
26
|
-
}
|
|
27
|
-
if (classMirror.interfaces.length) {
|
|
28
|
-
listener.onInnerInterfacesDeclaration(this.sortType(classMirror.interfaces));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.ClassWalker = ClassWalker;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClassWalker = void 0;
|
|
4
|
+
const walker_1 = require("./walker");
|
|
5
|
+
class ClassWalker extends walker_1.Walker {
|
|
6
|
+
walk(listener) {
|
|
7
|
+
listener.onTypeDeclaration(this.type);
|
|
8
|
+
const classMirror = this.type;
|
|
9
|
+
if (classMirror.constructors.length) {
|
|
10
|
+
listener.onConstructorDeclaration(this.type.name, classMirror.constructors);
|
|
11
|
+
}
|
|
12
|
+
if (classMirror.fields.length) {
|
|
13
|
+
listener.onFieldsDeclaration(this.sortType(classMirror.fields));
|
|
14
|
+
}
|
|
15
|
+
if (classMirror.properties.length) {
|
|
16
|
+
listener.onPropertiesDeclaration(this.sortType(classMirror.properties));
|
|
17
|
+
}
|
|
18
|
+
if (classMirror.methods.length) {
|
|
19
|
+
listener.onMethodsDeclaration(this.sortType(classMirror.methods));
|
|
20
|
+
}
|
|
21
|
+
if (classMirror.enums.length) {
|
|
22
|
+
listener.onInnerEnumsDeclaration(this.sortType(classMirror.enums));
|
|
23
|
+
}
|
|
24
|
+
if (classMirror.classes.length) {
|
|
25
|
+
listener.onInnerClassesDeclaration(this.sortType(classMirror.classes));
|
|
26
|
+
}
|
|
27
|
+
if (classMirror.interfaces.length) {
|
|
28
|
+
listener.onInnerInterfacesDeclaration(this.sortType(classMirror.interfaces));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ClassWalker = ClassWalker;
|
|
33
33
|
//# sourceMappingURL=class-walker.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Walker, WalkerListener } from './walker';
|
|
2
|
-
export declare class EnumWalker extends Walker {
|
|
3
|
-
walk(listener: WalkerListener): void;
|
|
4
|
-
}
|
|
1
|
+
import { Walker, WalkerListener } from './walker';
|
|
2
|
+
export declare class EnumWalker extends Walker {
|
|
3
|
+
walk(listener: WalkerListener): void;
|
|
4
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnumWalker = void 0;
|
|
4
|
-
const walker_1 = require("./walker");
|
|
5
|
-
class EnumWalker extends walker_1.Walker {
|
|
6
|
-
walk(listener) {
|
|
7
|
-
listener.onTypeDeclaration(this.type);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.EnumWalker = EnumWalker;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnumWalker = void 0;
|
|
4
|
+
const walker_1 = require("./walker");
|
|
5
|
+
class EnumWalker extends walker_1.Walker {
|
|
6
|
+
walk(listener) {
|
|
7
|
+
listener.onTypeDeclaration(this.type);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.EnumWalker = EnumWalker;
|
|
11
11
|
//# sourceMappingURL=enum-walker.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Walker, WalkerListener } from './walker';
|
|
2
|
-
export declare class InterfaceWalker extends Walker {
|
|
3
|
-
walk(listener: WalkerListener): void;
|
|
4
|
-
}
|
|
1
|
+
import { Walker, WalkerListener } from './walker';
|
|
2
|
+
export declare class InterfaceWalker extends Walker {
|
|
3
|
+
walk(listener: WalkerListener): void;
|
|
4
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InterfaceWalker = void 0;
|
|
4
|
-
const walker_1 = require("./walker");
|
|
5
|
-
class InterfaceWalker extends walker_1.Walker {
|
|
6
|
-
walk(listener) {
|
|
7
|
-
listener.onTypeDeclaration(this.type);
|
|
8
|
-
const interfaceMirror = this.type;
|
|
9
|
-
if (interfaceMirror.methods.length) {
|
|
10
|
-
listener.onMethodsDeclaration(this.sortType(interfaceMirror.methods));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.InterfaceWalker = InterfaceWalker;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InterfaceWalker = void 0;
|
|
4
|
+
const walker_1 = require("./walker");
|
|
5
|
+
class InterfaceWalker extends walker_1.Walker {
|
|
6
|
+
walk(listener) {
|
|
7
|
+
listener.onTypeDeclaration(this.type);
|
|
8
|
+
const interfaceMirror = this.type;
|
|
9
|
+
if (interfaceMirror.methods.length) {
|
|
10
|
+
listener.onMethodsDeclaration(this.sortType(interfaceMirror.methods));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.InterfaceWalker = InterfaceWalker;
|
|
15
15
|
//# sourceMappingURL=interface-walker.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Type } from '@cparra/apex-reflection';
|
|
2
|
-
import { Walker } from './walker';
|
|
3
|
-
export declare class WalkerFactory {
|
|
4
|
-
static get(type: Type): Walker;
|
|
5
|
-
}
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
import { Walker } from './walker';
|
|
3
|
+
export declare class WalkerFactory {
|
|
4
|
+
static get(type: Type): Walker;
|
|
5
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalkerFactory = void 0;
|
|
4
|
-
const class_walker_1 = require("./class-walker");
|
|
5
|
-
const enum_walker_1 = require("./enum-walker");
|
|
6
|
-
const interface_walker_1 = require("./interface-walker");
|
|
7
|
-
class WalkerFactory {
|
|
8
|
-
static get(type) {
|
|
9
|
-
switch (type.type_name) {
|
|
10
|
-
case 'class':
|
|
11
|
-
return new class_walker_1.ClassWalker(type);
|
|
12
|
-
case 'enum':
|
|
13
|
-
return new enum_walker_1.EnumWalker(type);
|
|
14
|
-
case 'interface':
|
|
15
|
-
return new interface_walker_1.InterfaceWalker(type);
|
|
16
|
-
}
|
|
17
|
-
throw Error('Walker not found for type.');
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.WalkerFactory = WalkerFactory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalkerFactory = void 0;
|
|
4
|
+
const class_walker_1 = require("./class-walker");
|
|
5
|
+
const enum_walker_1 = require("./enum-walker");
|
|
6
|
+
const interface_walker_1 = require("./interface-walker");
|
|
7
|
+
class WalkerFactory {
|
|
8
|
+
static get(type) {
|
|
9
|
+
switch (type.type_name) {
|
|
10
|
+
case 'class':
|
|
11
|
+
return new class_walker_1.ClassWalker(type);
|
|
12
|
+
case 'enum':
|
|
13
|
+
return new enum_walker_1.EnumWalker(type);
|
|
14
|
+
case 'interface':
|
|
15
|
+
return new interface_walker_1.InterfaceWalker(type);
|
|
16
|
+
}
|
|
17
|
+
throw Error('Walker not found for type.');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.WalkerFactory = WalkerFactory;
|
|
21
21
|
//# sourceMappingURL=walker-factory.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ClassMirror, ConstructorMirror, EnumMirror, FieldMirror, InterfaceMirror, MethodMirror, PropertyMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
-
export interface WalkerListener {
|
|
3
|
-
onTypeDeclaration(typeMirror: Type): void;
|
|
4
|
-
onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void;
|
|
5
|
-
onFieldsDeclaration(fields: FieldMirror[]): void;
|
|
6
|
-
onPropertiesDeclaration(properties: PropertyMirror[]): void;
|
|
7
|
-
onMethodsDeclaration(methods: MethodMirror[]): void;
|
|
8
|
-
onInnerEnumsDeclaration(enums: EnumMirror[]): void;
|
|
9
|
-
onInnerClassesDeclaration(classes: ClassMirror[]): void;
|
|
10
|
-
onInnerInterfacesDeclaration(interfaces: InterfaceMirror[]): void;
|
|
11
|
-
}
|
|
12
|
-
export declare abstract class Walker {
|
|
13
|
-
type: Type;
|
|
14
|
-
constructor(type: Type);
|
|
15
|
-
abstract walk(listener: WalkerListener): void;
|
|
16
|
-
protected sortType<T extends {
|
|
17
|
-
name: string;
|
|
18
|
-
}>(types: T[]): T[];
|
|
19
|
-
}
|
|
1
|
+
import { ClassMirror, ConstructorMirror, EnumMirror, FieldMirror, InterfaceMirror, MethodMirror, PropertyMirror, Type } from '@cparra/apex-reflection';
|
|
2
|
+
export interface WalkerListener {
|
|
3
|
+
onTypeDeclaration(typeMirror: Type): void;
|
|
4
|
+
onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void;
|
|
5
|
+
onFieldsDeclaration(fields: FieldMirror[]): void;
|
|
6
|
+
onPropertiesDeclaration(properties: PropertyMirror[]): void;
|
|
7
|
+
onMethodsDeclaration(methods: MethodMirror[]): void;
|
|
8
|
+
onInnerEnumsDeclaration(enums: EnumMirror[]): void;
|
|
9
|
+
onInnerClassesDeclaration(classes: ClassMirror[]): void;
|
|
10
|
+
onInnerInterfacesDeclaration(interfaces: InterfaceMirror[]): void;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class Walker {
|
|
13
|
+
type: Type;
|
|
14
|
+
constructor(type: Type);
|
|
15
|
+
abstract walk(listener: WalkerListener): void;
|
|
16
|
+
protected sortType<T extends {
|
|
17
|
+
name: string;
|
|
18
|
+
}>(types: T[]): T[];
|
|
19
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Walker = void 0;
|
|
4
|
-
const settings_1 = require("../../settings");
|
|
5
|
-
class Walker {
|
|
6
|
-
constructor(type) {
|
|
7
|
-
this.type = type;
|
|
8
|
-
}
|
|
9
|
-
sortType(types) {
|
|
10
|
-
if (settings_1.Settings.getInstance().sortMembersAlphabetically()) {
|
|
11
|
-
return types.sort((a, b) => a.name.localeCompare(b.name));
|
|
12
|
-
}
|
|
13
|
-
return types;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.Walker = Walker;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Walker = void 0;
|
|
4
|
+
const settings_1 = require("../../settings");
|
|
5
|
+
class Walker {
|
|
6
|
+
constructor(type) {
|
|
7
|
+
this.type = type;
|
|
8
|
+
}
|
|
9
|
+
sortType(types) {
|
|
10
|
+
if (settings_1.Settings.getInstance().sortMembersAlphabetically()) {
|
|
11
|
+
return types.sort((a, b) => a.name.localeCompare(b.name));
|
|
12
|
+
}
|
|
13
|
+
return types;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Walker = Walker;
|
|
17
17
|
//# sourceMappingURL=walker.js.map
|