@cparra/apexdocs 2.22.0 → 2.23.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.
Files changed (184) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.github/workflows/close_stale.yml +22 -22
  3. package/.prettierrc.js +7 -7
  4. package/LICENSE +21 -21
  5. package/README.md +718 -682
  6. package/apexdocs.config.ts +13 -11
  7. package/docs/README.md +1 -1
  8. package/docs/restapi.json +589 -589
  9. package/docs/types/Classes/nspc.ChildClass.md +21 -18
  10. package/docs/types/Main/nspc.SampleClass.md +13 -13
  11. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  12. package/examples/force-app/main/default/classes/ChildClass.cls +42 -41
  13. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  14. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  15. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  16. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  17. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  18. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  19. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  20. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  21. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  22. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  23. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  24. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  25. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  26. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  27. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  28. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  29. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  30. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  31. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  32. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  33. package/examples/includes/header.md +3 -3
  34. package/jest.config.js +5 -5
  35. package/lib/application/Apexdocs.d.ts +13 -13
  36. package/lib/application/Apexdocs.js +76 -76
  37. package/lib/cli/generate.d.ts +2 -2
  38. package/lib/cli/generate.js +130 -122
  39. package/lib/cli/generate.js.map +1 -1
  40. package/lib/index.d.ts +1 -1
  41. package/lib/index.js +17 -17
  42. package/lib/model/apex-bundle.d.ts +6 -6
  43. package/lib/model/apex-bundle.js +10 -10
  44. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  45. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  46. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  47. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  48. package/lib/model/inheritance.d.ts +8 -8
  49. package/lib/model/inheritance.js +2 -2
  50. package/lib/model/manifest-diff.d.ts +27 -27
  51. package/lib/model/manifest-diff.js +68 -68
  52. package/lib/model/manifest.d.ts +22 -22
  53. package/lib/model/manifest.js +46 -46
  54. package/lib/model/markdown-file.d.ts +16 -16
  55. package/lib/model/markdown-file.js +106 -106
  56. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  57. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +43 -43
  58. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  59. package/lib/model/markdown-generation-util/field-declaration-util.js +54 -62
  60. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
  61. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  62. package/lib/model/markdown-generation-util/index.js +19 -19
  63. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  64. package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
  65. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  66. package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
  67. package/lib/model/markdown-home-file.d.ts +11 -11
  68. package/lib/model/markdown-home-file.js +53 -53
  69. package/lib/model/markdown-type-file.d.ts +26 -26
  70. package/lib/model/markdown-type-file.js +133 -141
  71. package/lib/model/markdown-type-file.js.map +1 -1
  72. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  73. package/lib/model/openapi/apex-doc-types.js +4 -4
  74. package/lib/model/openapi/open-api-types.d.ts +93 -93
  75. package/lib/model/openapi/open-api-types.js +2 -2
  76. package/lib/model/openapi/open-api.d.ts +16 -16
  77. package/lib/model/openapi/open-api.js +33 -33
  78. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  79. package/lib/model/openapi/openapi-type-file.js +16 -16
  80. package/lib/model/outputFile.d.ts +10 -10
  81. package/lib/model/outputFile.js +28 -28
  82. package/lib/model/types-repository.d.ts +16 -16
  83. package/lib/model/types-repository.js +53 -53
  84. package/lib/service/apex-file-reader.d.ts +14 -14
  85. package/lib/service/apex-file-reader.js +45 -45
  86. package/lib/service/file-system.d.ts +14 -14
  87. package/lib/service/file-system.js +24 -24
  88. package/lib/service/file-writer.d.ts +6 -6
  89. package/lib/service/file-writer.js +33 -33
  90. package/lib/service/manifest-factory.d.ts +10 -10
  91. package/lib/service/manifest-factory.js +13 -13
  92. package/lib/service/metadata-processor.d.ts +3 -3
  93. package/lib/service/metadata-processor.js +16 -16
  94. package/lib/service/parser.d.ts +21 -21
  95. package/lib/service/parser.js +134 -134
  96. package/lib/service/state.d.ts +9 -9
  97. package/lib/service/state.js +19 -19
  98. package/lib/service/walkers/class-walker.d.ts +4 -4
  99. package/lib/service/walkers/class-walker.js +32 -32
  100. package/lib/service/walkers/class-walker.js.map +1 -1
  101. package/lib/service/walkers/enum-walker.d.ts +4 -4
  102. package/lib/service/walkers/enum-walker.js +10 -10
  103. package/lib/service/walkers/enum-walker.js.map +1 -1
  104. package/lib/service/walkers/interface-walker.d.ts +4 -4
  105. package/lib/service/walkers/interface-walker.js +14 -14
  106. package/lib/service/walkers/interface-walker.js.map +1 -1
  107. package/lib/service/walkers/walker-factory.d.ts +5 -5
  108. package/lib/service/walkers/walker-factory.js +20 -20
  109. package/lib/service/walkers/walker.d.ts +19 -16
  110. package/lib/service/walkers/walker.js +16 -9
  111. package/lib/service/walkers/walker.js.map +1 -1
  112. package/lib/settings.d.ts +64 -53
  113. package/lib/settings.js +88 -78
  114. package/lib/settings.js.map +1 -1
  115. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  116. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  117. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  118. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  119. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  120. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  121. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  122. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  123. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  124. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  125. package/lib/test-helpers/MethodMirrorBuilder.d.ts +10 -10
  126. package/lib/test-helpers/MethodMirrorBuilder.js +36 -36
  127. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  128. package/lib/test-helpers/SettingsBuilder.js +26 -26
  129. package/lib/transpiler/factory.d.ts +6 -6
  130. package/lib/transpiler/factory.js +31 -31
  131. package/lib/transpiler/file-container.d.ts +6 -6
  132. package/lib/transpiler/file-container.js +15 -15
  133. package/lib/transpiler/generator-choices.d.ts +1 -1
  134. package/lib/transpiler/generator-choices.js +2 -2
  135. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +8 -8
  136. package/lib/transpiler/markdown/class-file-generatorHelper.js +55 -55
  137. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  138. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  139. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  140. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -10
  141. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -27
  142. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -1
  143. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  144. package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -23
  145. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -6
  146. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +13 -13
  147. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  148. package/lib/transpiler/openapi/open-api-docs-processor.js +74 -74
  149. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  150. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  151. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  152. package/lib/transpiler/openapi/parsers/MethodParser.js +166 -166
  153. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  154. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  155. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  156. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +225 -225
  157. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  158. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  159. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  160. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  161. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  162. package/lib/transpiler/processor-type-transpiler.js +8 -8
  163. package/lib/transpiler/transpiler.d.ts +5 -5
  164. package/lib/transpiler/transpiler.js +26 -26
  165. package/lib/util/error-logger.d.ts +8 -8
  166. package/lib/util/error-logger.js +89 -89
  167. package/lib/util/logger.d.ts +21 -21
  168. package/lib/util/logger.js +57 -57
  169. package/lib/util/string-utils.d.ts +2 -2
  170. package/lib/util/string-utils.js +14 -14
  171. package/package.json +78 -78
  172. package/src/cli/generate.ts +8 -0
  173. package/src/model/markdown-generation-util/field-declaration-util.ts +3 -9
  174. package/src/model/markdown-type-file.ts +4 -10
  175. package/src/service/walkers/class-walker.ts +6 -7
  176. package/src/service/walkers/enum-walker.ts +0 -1
  177. package/src/service/walkers/interface-walker.ts +1 -1
  178. package/src/service/walkers/walker.ts +8 -1
  179. package/src/settings.ts +21 -0
  180. package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -2
  181. package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +26 -3
  182. package/tsconfig.json +20 -20
  183. package/tslint.json +5 -5
  184. package/ROADMAP.md +0 -16
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocCommentBuilder = void 0;
4
- /**
5
- * Builder class to create DocComment objects.
6
- * For testing purposes only.
7
- */
8
- class DocCommentBuilder {
9
- constructor() {
10
- this.annotations = [];
11
- }
12
- addAnnotation(annotation) {
13
- this.annotations.push(annotation);
14
- return this;
15
- }
16
- withDescription(description) {
17
- this.description = description;
18
- return this;
19
- }
20
- build() {
21
- var _a;
22
- return {
23
- paramAnnotations: [],
24
- returnAnnotation: {
25
- bodyLines: [],
26
- },
27
- exampleAnnotation: {
28
- bodyLines: [],
29
- },
30
- throwsAnnotations: [],
31
- annotations: this.annotations,
32
- descriptionLines: [],
33
- description: (_a = this.description) !== null && _a !== void 0 ? _a : 'Sample Description',
34
- };
35
- }
36
- }
37
- exports.DocCommentBuilder = DocCommentBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocCommentBuilder = void 0;
4
+ /**
5
+ * Builder class to create DocComment objects.
6
+ * For testing purposes only.
7
+ */
8
+ class DocCommentBuilder {
9
+ constructor() {
10
+ this.annotations = [];
11
+ }
12
+ addAnnotation(annotation) {
13
+ this.annotations.push(annotation);
14
+ return this;
15
+ }
16
+ withDescription(description) {
17
+ this.description = description;
18
+ return this;
19
+ }
20
+ build() {
21
+ var _a;
22
+ return {
23
+ paramAnnotations: [],
24
+ returnAnnotation: {
25
+ bodyLines: [],
26
+ },
27
+ exampleAnnotation: {
28
+ bodyLines: [],
29
+ },
30
+ throwsAnnotations: [],
31
+ annotations: this.annotations,
32
+ descriptionLines: [],
33
+ description: (_a = this.description) !== null && _a !== void 0 ? _a : 'Sample Description',
34
+ };
35
+ }
36
+ }
37
+ exports.DocCommentBuilder = DocCommentBuilder;
38
38
  //# sourceMappingURL=DocCommentBuilder.js.map
@@ -1,18 +1,18 @@
1
- import { DocComment, FieldMirror } from '@cparra/apex-reflection';
2
- import { ReferencedType } from '@cparra/apex-reflection/index';
3
- type MemberModifier = 'static' | 'webservice' | 'final' | 'override' | 'testmethod' | 'transient';
4
- export declare class FieldMirrorBuilder {
5
- private docComment;
6
- private accessModifier;
7
- private name;
8
- private memberModifiers;
9
- private type;
10
- withAccessModifier(accessModifier: string): FieldMirrorBuilder;
11
- withName(name: string): FieldMirrorBuilder;
12
- withType(type: string): FieldMirrorBuilder;
13
- withReferencedType(type: ReferencedType): FieldMirrorBuilder;
14
- addMemberModifier(memberModifier: MemberModifier): FieldMirrorBuilder;
15
- withDocComment(docComment: DocComment): FieldMirrorBuilder;
16
- build(): FieldMirror;
17
- }
18
- export {};
1
+ import { DocComment, FieldMirror } from '@cparra/apex-reflection';
2
+ import { ReferencedType } from '@cparra/apex-reflection/index';
3
+ type MemberModifier = 'static' | 'webservice' | 'final' | 'override' | 'testmethod' | 'transient';
4
+ export declare class FieldMirrorBuilder {
5
+ private docComment;
6
+ private accessModifier;
7
+ private name;
8
+ private memberModifiers;
9
+ private type;
10
+ withAccessModifier(accessModifier: string): FieldMirrorBuilder;
11
+ withName(name: string): FieldMirrorBuilder;
12
+ withType(type: string): FieldMirrorBuilder;
13
+ withReferencedType(type: ReferencedType): FieldMirrorBuilder;
14
+ addMemberModifier(memberModifier: MemberModifier): FieldMirrorBuilder;
15
+ withDocComment(docComment: DocComment): FieldMirrorBuilder;
16
+ build(): FieldMirror;
17
+ }
18
+ export {};
@@ -1,54 +1,54 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FieldMirrorBuilder = void 0;
4
- class FieldMirrorBuilder {
5
- constructor() {
6
- this.docComment = undefined;
7
- this.accessModifier = 'public';
8
- this.name = 'fieldName';
9
- this.memberModifiers = [];
10
- this.type = {
11
- type: 'String',
12
- rawDeclaration: 'String',
13
- };
14
- }
15
- withAccessModifier(accessModifier) {
16
- this.accessModifier = accessModifier;
17
- return this;
18
- }
19
- withName(name) {
20
- this.name = name;
21
- return this;
22
- }
23
- withType(type) {
24
- this.type = {
25
- rawDeclaration: type,
26
- type: type,
27
- };
28
- return this;
29
- }
30
- withReferencedType(type) {
31
- this.type = type;
32
- return this;
33
- }
34
- addMemberModifier(memberModifier) {
35
- this.memberModifiers.push(memberModifier);
36
- return this;
37
- }
38
- withDocComment(docComment) {
39
- this.docComment = docComment;
40
- return this;
41
- }
42
- build() {
43
- return {
44
- access_modifier: this.accessModifier,
45
- annotations: [],
46
- name: this.name,
47
- memberModifiers: this.memberModifiers,
48
- typeReference: this.type,
49
- docComment: this.docComment,
50
- };
51
- }
52
- }
53
- exports.FieldMirrorBuilder = FieldMirrorBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldMirrorBuilder = void 0;
4
+ class FieldMirrorBuilder {
5
+ constructor() {
6
+ this.docComment = undefined;
7
+ this.accessModifier = 'public';
8
+ this.name = 'fieldName';
9
+ this.memberModifiers = [];
10
+ this.type = {
11
+ type: 'String',
12
+ rawDeclaration: 'String',
13
+ };
14
+ }
15
+ withAccessModifier(accessModifier) {
16
+ this.accessModifier = accessModifier;
17
+ return this;
18
+ }
19
+ withName(name) {
20
+ this.name = name;
21
+ return this;
22
+ }
23
+ withType(type) {
24
+ this.type = {
25
+ rawDeclaration: type,
26
+ type: type,
27
+ };
28
+ return this;
29
+ }
30
+ withReferencedType(type) {
31
+ this.type = type;
32
+ return this;
33
+ }
34
+ addMemberModifier(memberModifier) {
35
+ this.memberModifiers.push(memberModifier);
36
+ return this;
37
+ }
38
+ withDocComment(docComment) {
39
+ this.docComment = docComment;
40
+ return this;
41
+ }
42
+ build() {
43
+ return {
44
+ access_modifier: this.accessModifier,
45
+ annotations: [],
46
+ name: this.name,
47
+ memberModifiers: this.memberModifiers,
48
+ typeReference: this.type,
49
+ docComment: this.docComment,
50
+ };
51
+ }
52
+ }
53
+ exports.FieldMirrorBuilder = FieldMirrorBuilder;
54
54
  //# sourceMappingURL=FieldMirrorBuilder.js.map
@@ -1,10 +1,10 @@
1
- import { Annotation, DocComment, MethodMirror } from '@cparra/apex-reflection';
2
- export declare class MethodMirrorBuilder {
3
- private name;
4
- private annotations;
5
- private docComment?;
6
- withName(name: string): MethodMirrorBuilder;
7
- addAnnotation(annotation: Annotation): MethodMirrorBuilder;
8
- withDocComment(docComment: DocComment): MethodMirrorBuilder;
9
- build(): MethodMirror;
10
- }
1
+ import { Annotation, DocComment, MethodMirror } from '@cparra/apex-reflection';
2
+ export declare class MethodMirrorBuilder {
3
+ private name;
4
+ private annotations;
5
+ private docComment?;
6
+ withName(name: string): MethodMirrorBuilder;
7
+ addAnnotation(annotation: Annotation): MethodMirrorBuilder;
8
+ withDocComment(docComment: DocComment): MethodMirrorBuilder;
9
+ build(): MethodMirror;
10
+ }
@@ -1,37 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MethodMirrorBuilder = void 0;
4
- class MethodMirrorBuilder {
5
- constructor() {
6
- this.name = 'sampleMethod';
7
- this.annotations = [];
8
- }
9
- withName(name) {
10
- this.name = name;
11
- return this;
12
- }
13
- addAnnotation(annotation) {
14
- this.annotations.push(annotation);
15
- return this;
16
- }
17
- withDocComment(docComment) {
18
- this.docComment = docComment;
19
- return this;
20
- }
21
- build() {
22
- return {
23
- access_modifier: 'public',
24
- annotations: this.annotations,
25
- name: this.name,
26
- memberModifiers: [],
27
- typeReference: {
28
- type: 'void',
29
- rawDeclaration: 'void',
30
- },
31
- parameters: [],
32
- docComment: this.docComment,
33
- };
34
- }
35
- }
36
- exports.MethodMirrorBuilder = MethodMirrorBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MethodMirrorBuilder = void 0;
4
+ class MethodMirrorBuilder {
5
+ constructor() {
6
+ this.name = 'sampleMethod';
7
+ this.annotations = [];
8
+ }
9
+ withName(name) {
10
+ this.name = name;
11
+ return this;
12
+ }
13
+ addAnnotation(annotation) {
14
+ this.annotations.push(annotation);
15
+ return this;
16
+ }
17
+ withDocComment(docComment) {
18
+ this.docComment = docComment;
19
+ return this;
20
+ }
21
+ build() {
22
+ return {
23
+ access_modifier: 'public',
24
+ annotations: this.annotations,
25
+ name: this.name,
26
+ memberModifiers: [],
27
+ typeReference: {
28
+ type: 'void',
29
+ rawDeclaration: 'void',
30
+ },
31
+ parameters: [],
32
+ docComment: this.docComment,
33
+ };
34
+ }
35
+ }
36
+ exports.MethodMirrorBuilder = MethodMirrorBuilder;
37
37
  //# sourceMappingURL=MethodMirrorBuilder.js.map
@@ -1,8 +1,8 @@
1
- import { SettingsConfig } from '../settings';
2
- /**
3
- * Builder class to create SettingsConfig objects.
4
- * For testing purposes only.
5
- */
6
- export declare class SettingsBuilder {
7
- build(): SettingsConfig;
8
- }
1
+ import { SettingsConfig } from '../settings';
2
+ /**
3
+ * Builder class to create SettingsConfig objects.
4
+ * For testing purposes only.
5
+ */
6
+ export declare class SettingsBuilder {
7
+ build(): SettingsConfig;
8
+ }
@@ -1,27 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SettingsBuilder = void 0;
4
- /**
5
- * Builder class to create SettingsConfig objects.
6
- * For testing purposes only.
7
- */
8
- class SettingsBuilder {
9
- build() {
10
- return {
11
- sourceDirectory: './',
12
- recursive: true,
13
- scope: [],
14
- outputDir: './',
15
- targetGenerator: 'openapi',
16
- indexOnly: false,
17
- defaultGroupName: 'Misc',
18
- sanitizeHtml: true,
19
- openApiTitle: 'Apex API',
20
- openApiFileName: 'openapi',
21
- title: 'Classes',
22
- includeMetadata: false,
23
- };
24
- }
25
- }
26
- exports.SettingsBuilder = SettingsBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SettingsBuilder = void 0;
4
+ /**
5
+ * Builder class to create SettingsConfig objects.
6
+ * For testing purposes only.
7
+ */
8
+ class SettingsBuilder {
9
+ build() {
10
+ return {
11
+ sourceDirectory: './',
12
+ recursive: true,
13
+ scope: [],
14
+ outputDir: './',
15
+ targetGenerator: 'openapi',
16
+ indexOnly: false,
17
+ defaultGroupName: 'Misc',
18
+ sanitizeHtml: true,
19
+ openApiTitle: 'Apex API',
20
+ openApiFileName: 'openapi',
21
+ title: 'Classes',
22
+ includeMetadata: false,
23
+ };
24
+ }
25
+ }
26
+ exports.SettingsBuilder = SettingsBuilder;
27
27
  //# sourceMappingURL=SettingsBuilder.js.map
@@ -1,6 +1,6 @@
1
- import ProcessorTypeTranspiler from './processor-type-transpiler';
2
- import { GeneratorChoices } from './generator-choices';
3
- export declare class TypeTranspilerFactory {
4
- private static typeTranspilerCache?;
5
- static get(generator: GeneratorChoices): ProcessorTypeTranspiler;
6
- }
1
+ import ProcessorTypeTranspiler from './processor-type-transpiler';
2
+ import { GeneratorChoices } from './generator-choices';
3
+ export declare class TypeTranspilerFactory {
4
+ private static typeTranspilerCache?;
5
+ static get(generator: GeneratorChoices): ProcessorTypeTranspiler;
6
+ }
@@ -1,32 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypeTranspilerFactory = void 0;
4
- const jekyll_docsProcessor_1 = require("./markdown/jekyll/jekyll-docsProcessor");
5
- const docsify_docs_processor_1 = require("./markdown/docsify/docsify-docs-processor");
6
- const plain_docsProcessor_1 = require("./markdown/plain-markdown/plain-docsProcessor");
7
- const open_api_docs_processor_1 = require("./openapi/open-api-docs-processor");
8
- class TypeTranspilerFactory {
9
- static get(generator) {
10
- if (this.typeTranspilerCache) {
11
- return this.typeTranspilerCache;
12
- }
13
- switch (generator) {
14
- case 'jekyll':
15
- this.typeTranspilerCache = new jekyll_docsProcessor_1.JekyllDocsProcessor();
16
- return this.typeTranspilerCache;
17
- case 'docsify':
18
- this.typeTranspilerCache = new docsify_docs_processor_1.default();
19
- return this.typeTranspilerCache;
20
- case 'plain-markdown':
21
- this.typeTranspilerCache = new plain_docsProcessor_1.PlainMarkdownDocsProcessor();
22
- return this.typeTranspilerCache;
23
- case 'openapi':
24
- this.typeTranspilerCache = new open_api_docs_processor_1.OpenApiDocsProcessor();
25
- return this.typeTranspilerCache;
26
- default:
27
- throw Error('Invalid target generator');
28
- }
29
- }
30
- }
31
- exports.TypeTranspilerFactory = TypeTranspilerFactory;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeTranspilerFactory = void 0;
4
+ const jekyll_docsProcessor_1 = require("./markdown/jekyll/jekyll-docsProcessor");
5
+ const docsify_docs_processor_1 = require("./markdown/docsify/docsify-docs-processor");
6
+ const plain_docsProcessor_1 = require("./markdown/plain-markdown/plain-docsProcessor");
7
+ const open_api_docs_processor_1 = require("./openapi/open-api-docs-processor");
8
+ class TypeTranspilerFactory {
9
+ static get(generator) {
10
+ if (this.typeTranspilerCache) {
11
+ return this.typeTranspilerCache;
12
+ }
13
+ switch (generator) {
14
+ case 'jekyll':
15
+ this.typeTranspilerCache = new jekyll_docsProcessor_1.JekyllDocsProcessor();
16
+ return this.typeTranspilerCache;
17
+ case 'docsify':
18
+ this.typeTranspilerCache = new docsify_docs_processor_1.default();
19
+ return this.typeTranspilerCache;
20
+ case 'plain-markdown':
21
+ this.typeTranspilerCache = new plain_docsProcessor_1.PlainMarkdownDocsProcessor();
22
+ return this.typeTranspilerCache;
23
+ case 'openapi':
24
+ this.typeTranspilerCache = new open_api_docs_processor_1.OpenApiDocsProcessor();
25
+ return this.typeTranspilerCache;
26
+ default:
27
+ throw Error('Invalid target generator');
28
+ }
29
+ }
30
+ }
31
+ exports.TypeTranspilerFactory = TypeTranspilerFactory;
32
32
  //# sourceMappingURL=factory.js.map
@@ -1,6 +1,6 @@
1
- import { OutputFile } from '../model/outputFile';
2
- export declare class FileContainer {
3
- _files: OutputFile[];
4
- files(): OutputFile[];
5
- pushFile(file: OutputFile): void;
6
- }
1
+ import { OutputFile } from '../model/outputFile';
2
+ export declare class FileContainer {
3
+ _files: OutputFile[];
4
+ files(): OutputFile[];
5
+ pushFile(file: OutputFile): void;
6
+ }
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FileContainer = void 0;
4
- class FileContainer {
5
- constructor() {
6
- this._files = [];
7
- }
8
- files() {
9
- return this._files;
10
- }
11
- pushFile(file) {
12
- this._files.push(file);
13
- }
14
- }
15
- exports.FileContainer = FileContainer;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileContainer = void 0;
4
+ class FileContainer {
5
+ constructor() {
6
+ this._files = [];
7
+ }
8
+ files() {
9
+ return this._files;
10
+ }
11
+ pushFile(file) {
12
+ this._files.push(file);
13
+ }
14
+ }
15
+ exports.FileContainer = FileContainer;
16
16
  //# sourceMappingURL=file-container.js.map
@@ -1 +1 @@
1
- export type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown' | 'openapi';
1
+ export type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown' | 'openapi';
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=generator-choices.js.map
@@ -1,8 +1,8 @@
1
- import { Type } from '@cparra/apex-reflection';
2
- export default class ClassFileGeneratorHelper {
3
- static getSanitizedGroup(classModel: Type): string;
4
- static getFileLink(classModel: Type): string;
5
- static getFileLinkByTypeName(typeName: string): string;
6
- private static getDirectoryRoot;
7
- private static getClassGroup;
8
- }
1
+ import { Type } from '@cparra/apex-reflection';
2
+ export default class ClassFileGeneratorHelper {
3
+ static getSanitizedGroup(classModel: Type): string;
4
+ static getFileLink(classModel: Type): string;
5
+ static getFileLinkByTypeName(typeName: string): string;
6
+ private static getDirectoryRoot;
7
+ private static getClassGroup;
8
+ }
@@ -1,56 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const types_repository_1 = require("../../model/types-repository");
4
- const settings_1 = require("../../settings");
5
- const state_1 = require("../../service/state");
6
- const factory_1 = require("../factory");
7
- class ClassFileGeneratorHelper {
8
- static getSanitizedGroup(classModel) {
9
- return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
10
- }
11
- static getFileLink(classModel) {
12
- var _a;
13
- const documentationRoot = (_a = settings_1.Settings.getInstance().getRootDir()) !== null && _a !== void 0 ? _a : '';
14
- const directoryRoot = `${documentationRoot}${this.getDirectoryRoot(classModel)}`;
15
- const fullClassName = `${settings_1.Settings.getInstance().getNamespacePrefix()}${classModel.name}`;
16
- return `[${fullClassName}](${directoryRoot}${fullClassName}.md)`;
17
- }
18
- static getFileLinkByTypeName(typeName) {
19
- const type = types_repository_1.TypesRepository.getInstance().getFromScopedByName(typeName);
20
- if (!type) {
21
- // If the type is not found, we return a Markdown hyperlink with whatever we received.
22
- return `[${typeName}](${typeName})`;
23
- }
24
- return this.getFileLink(type);
25
- }
26
- static getDirectoryRoot(classModel) {
27
- // root-relative links start from the root by using a leading '/'
28
- const generator = settings_1.Settings.getInstance().targetGenerator;
29
- if (factory_1.TypeTranspilerFactory.get(generator).getLinkingStrategy() === 'root-relative') {
30
- return `/${this.getSanitizedGroup(classModel)}/`;
31
- }
32
- // path-relative links traverse the directory structure
33
- const typeBeingProcessed = state_1.default.getInstance().getTypeBeingProcessed();
34
- if (typeBeingProcessed) {
35
- if (this.getClassGroup(typeBeingProcessed) === this.getClassGroup(classModel)) {
36
- // If the types the same groups then we simply link directly to that file
37
- return './';
38
- }
39
- else {
40
- // If the types have different groups then we have to go up a directory
41
- return `../${this.getSanitizedGroup(classModel)}/`;
42
- }
43
- }
44
- else {
45
- // If nothing is being processed then we assume we are at the root and links should include the groups
46
- return `./${this.getSanitizedGroup(classModel)}/`;
47
- }
48
- }
49
- static getClassGroup(classModel) {
50
- var _a, _b;
51
- const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'group');
52
- return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : settings_1.Settings.getInstance().getDefaultGroupName();
53
- }
54
- }
55
- exports.default = ClassFileGeneratorHelper;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_repository_1 = require("../../model/types-repository");
4
+ const settings_1 = require("../../settings");
5
+ const state_1 = require("../../service/state");
6
+ const factory_1 = require("../factory");
7
+ class ClassFileGeneratorHelper {
8
+ static getSanitizedGroup(classModel) {
9
+ return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
10
+ }
11
+ static getFileLink(classModel) {
12
+ var _a;
13
+ const documentationRoot = (_a = settings_1.Settings.getInstance().getRootDir()) !== null && _a !== void 0 ? _a : '';
14
+ const directoryRoot = `${documentationRoot}${this.getDirectoryRoot(classModel)}`;
15
+ const fullClassName = `${settings_1.Settings.getInstance().getNamespacePrefix()}${classModel.name}`;
16
+ return `[${fullClassName}](${directoryRoot}${fullClassName}.md)`;
17
+ }
18
+ static getFileLinkByTypeName(typeName) {
19
+ const type = types_repository_1.TypesRepository.getInstance().getFromScopedByName(typeName);
20
+ if (!type) {
21
+ // If the type is not found, we return a Markdown hyperlink with whatever we received.
22
+ return `[${typeName}](${typeName})`;
23
+ }
24
+ return this.getFileLink(type);
25
+ }
26
+ static getDirectoryRoot(classModel) {
27
+ // root-relative links start from the root by using a leading '/'
28
+ const generator = settings_1.Settings.getInstance().targetGenerator;
29
+ if (factory_1.TypeTranspilerFactory.get(generator).getLinkingStrategy() === 'root-relative') {
30
+ return `/${this.getSanitizedGroup(classModel)}/`;
31
+ }
32
+ // path-relative links traverse the directory structure
33
+ const typeBeingProcessed = state_1.default.getInstance().getTypeBeingProcessed();
34
+ if (typeBeingProcessed) {
35
+ if (this.getClassGroup(typeBeingProcessed) === this.getClassGroup(classModel)) {
36
+ // If the types the same groups then we simply link directly to that file
37
+ return './';
38
+ }
39
+ else {
40
+ // If the types have different groups, then we have to go up a directory
41
+ return `../${this.getSanitizedGroup(classModel)}/`;
42
+ }
43
+ }
44
+ else {
45
+ // If nothing is being processed, then we assume we are at the root and links should include the groups
46
+ return `./${this.getSanitizedGroup(classModel)}/`;
47
+ }
48
+ }
49
+ static getClassGroup(classModel) {
50
+ var _a, _b;
51
+ const groupAnnotation = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'group');
52
+ return (_b = groupAnnotation === null || groupAnnotation === void 0 ? void 0 : groupAnnotation.body) !== null && _b !== void 0 ? _b : settings_1.Settings.getInstance().getDefaultGroupName();
53
+ }
54
+ }
55
+ exports.default = ClassFileGeneratorHelper;
56
56
  //# sourceMappingURL=class-file-generatorHelper.js.map