@cparra/apexdocs 1.13.4 → 1.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/README.md +277 -277
  2. package/docs/Gemfile.lock +1 -1
  3. package/docs/Sample-Classes/SampleClass.md +115 -30
  4. package/docs/Sample-Classes/SampleClass2.md +115 -0
  5. package/docs/Sample-Interfaces/SampleInterface.md +32 -13
  6. package/docs/index.md +27 -20
  7. package/docs/single-file/Sample-Classes/SampleClass.md +115 -0
  8. package/examples/apex/SampleClass.cls +13 -5
  9. package/examples/apex/SampleClass2.cls +96 -0
  10. package/examples/apex/SampleInterface.cls +3 -1
  11. package/lib/AsJsDocsProcessor.d.ts +1 -1
  12. package/lib/ClassFileGeneratorHelper.d.ts +2 -2
  13. package/lib/ClassFileGeneratorHelper.js +8 -3
  14. package/lib/ClassFileGeneratorHelper.test.js +1 -1
  15. package/lib/{command → Command}/Generate.d.ts +1 -1
  16. package/lib/{command → Command}/Generate.js +1 -1
  17. package/lib/{command → Command}/__test__/Generte.test.d.ts +0 -0
  18. package/lib/{command → Command}/__test__/Generte.test.js +2 -2
  19. package/lib/DocsProcessor.d.ts +2 -1
  20. package/lib/DocsProcessor.js +3 -0
  21. package/lib/FileManager.d.ts +1 -1
  22. package/lib/JekyllDocsProcessor.d.ts +1 -0
  23. package/lib/JekyllDocsProcessor.js +3 -0
  24. package/lib/MarkdownDocsProcessor.d.ts +1 -1
  25. package/lib/MarkdownDocsProcessor.js +7 -5
  26. package/lib/MarkdownHelper.d.ts +1 -1
  27. package/lib/MarkdownHelper.js +2 -2
  28. package/lib/{parser → Parser}/ClassParser.d.ts +1 -1
  29. package/lib/{parser → Parser}/ClassParser.js +6 -2
  30. package/lib/{parser → Parser}/EnumParser.d.ts +1 -1
  31. package/lib/{parser → Parser}/EnumParser.js +1 -1
  32. package/lib/{parser → Parser}/FileParser.d.ts +1 -1
  33. package/lib/{parser → Parser}/FileParser.js +1 -0
  34. package/lib/{parser → Parser}/MethodParser.d.ts +1 -1
  35. package/lib/{parser → Parser}/MethodParser.js +1 -1
  36. package/lib/{parser → Parser}/PropertyParser.d.ts +1 -1
  37. package/lib/{parser → Parser}/PropertyParser.js +1 -1
  38. package/lib/{parser → Parser}/__test__/ClassParser.test.d.ts +0 -0
  39. package/lib/{parser → Parser}/__test__/ClassParser.test.js +0 -0
  40. package/lib/{parser → Parser}/__test__/FileParser.test.d.ts +0 -0
  41. package/lib/{parser → Parser}/__test__/FileParser.test.js +0 -0
  42. package/lib/{parser → Parser}/__test__/MethodParser.test.d.ts +0 -0
  43. package/lib/{parser → Parser}/__test__/MethodParser.test.js +0 -0
  44. package/lib/{parser → Parser}/__test__/PropertyParser.test.d.ts +0 -0
  45. package/lib/{parser → Parser}/__test__/PropertyParser.test.js +0 -0
  46. package/lib/{parser → Parser}/__test__/testFileContents.d.ts +0 -0
  47. package/lib/{parser → Parser}/__test__/testFileContents.js +0 -0
  48. package/lib/application/Apexdocs.d.ts +11 -0
  49. package/lib/application/Apexdocs.js +41 -0
  50. package/lib/application/Apexdocs.js.map +1 -0
  51. package/lib/cli/generate.js +1 -1
  52. package/lib/cli/generate.js.map +1 -0
  53. package/lib/index.d.ts +1 -1
  54. package/lib/index.js +1 -1
  55. package/lib/index.js.map +1 -0
  56. package/lib/model/file.d.ts +10 -0
  57. package/lib/model/file.js +23 -0
  58. package/lib/model/file.js.map +1 -0
  59. package/lib/model/manifest-diff.d.ts +5 -0
  60. package/lib/model/manifest-diff.js +10 -0
  61. package/lib/model/manifest-diff.js.map +1 -0
  62. package/lib/model/manifest.d.ts +22 -0
  63. package/lib/model/manifest.js +42 -0
  64. package/lib/model/manifest.js.map +1 -0
  65. package/lib/model/markdown-file.d.ts +10 -0
  66. package/lib/model/markdown-file.js +52 -0
  67. package/lib/model/markdown-file.js.map +1 -0
  68. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -0
  69. package/lib/model/markdown-generation-util/field-declaration-util.js +33 -0
  70. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -0
  71. package/lib/model/markdown-generation-util/index.d.ts +3 -0
  72. package/lib/model/markdown-generation-util/index.js +9 -0
  73. package/lib/model/markdown-generation-util/index.js.map +1 -0
  74. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +3 -0
  75. package/lib/model/markdown-generation-util/method-declaration-util.js +97 -0
  76. package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -0
  77. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -0
  78. package/lib/model/markdown-generation-util/type-declaration-util.js +25 -0
  79. package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -0
  80. package/lib/model/markdown-home-file.d.ts +11 -0
  81. package/lib/model/markdown-home-file.js +50 -0
  82. package/lib/model/markdown-home-file.js.map +1 -0
  83. package/lib/model/markdown-type-file.d.ts +17 -0
  84. package/lib/model/markdown-type-file.js +62 -0
  85. package/lib/model/markdown-type-file.js.map +1 -0
  86. package/lib/service/apex-file-reader.d.ts +13 -0
  87. package/lib/service/apex-file-reader.js +39 -0
  88. package/lib/service/apex-file-reader.js.map +1 -0
  89. package/lib/service/file-system.d.ts +12 -0
  90. package/lib/service/file-system.js +21 -0
  91. package/lib/service/file-system.js.map +1 -0
  92. package/lib/service/file-writer.d.ts +4 -0
  93. package/lib/service/file-writer.js +25 -0
  94. package/lib/service/file-writer.js.map +1 -0
  95. package/lib/service/manifest-factory.d.ts +9 -0
  96. package/lib/service/manifest-factory.js +13 -0
  97. package/lib/service/manifest-factory.js.map +1 -0
  98. package/lib/service/parser.d.ts +9 -0
  99. package/lib/service/parser.js +17 -0
  100. package/lib/service/parser.js.map +1 -0
  101. package/lib/service/walkers/class-walker.d.ts +4 -0
  102. package/lib/service/walkers/class-walker.js +32 -0
  103. package/lib/service/walkers/class-walker.js.map +1 -0
  104. package/lib/service/walkers/enum-walker.d.ts +4 -0
  105. package/lib/service/walkers/enum-walker.js +10 -0
  106. package/lib/service/walkers/enum-walker.js.map +1 -0
  107. package/lib/service/walkers/interface-walker.d.ts +4 -0
  108. package/lib/service/walkers/interface-walker.js +14 -0
  109. package/lib/service/walkers/interface-walker.js.map +1 -0
  110. package/lib/service/walkers/walker-factory.d.ts +5 -0
  111. package/lib/service/walkers/walker-factory.js +20 -0
  112. package/lib/service/walkers/walker-factory.js.map +1 -0
  113. package/lib/service/walkers/walker.d.ts +16 -0
  114. package/lib/service/walkers/walker.js +9 -0
  115. package/lib/service/walkers/walker.js.map +1 -0
  116. package/lib/{Settings.d.ts → settings.d.ts} +0 -0
  117. package/lib/{Settings.js → settings.js} +0 -0
  118. package/lib/settings.js.map +1 -0
  119. package/lib/transpiler/file-container.d.ts +6 -0
  120. package/lib/transpiler/file-container.js +15 -0
  121. package/lib/transpiler/file-container.js.map +1 -0
  122. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +6 -0
  123. package/lib/transpiler/markdown/class-file-generatorHelper.js +17 -0
  124. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -0
  125. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +4 -0
  126. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +10 -0
  127. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +1 -0
  128. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +8 -0
  129. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +24 -0
  130. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +1 -0
  131. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -0
  132. package/lib/transpiler/markdown/markdown-transpiler-base.js +23 -0
  133. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -0
  134. package/lib/transpiler/processor-type-transpiler.d.ts +8 -0
  135. package/lib/transpiler/processor-type-transpiler.js +6 -0
  136. package/lib/transpiler/processor-type-transpiler.js.map +1 -0
  137. package/lib/transpiler/transpiler.d.ts +5 -0
  138. package/lib/transpiler/transpiler.js +21 -0
  139. package/lib/transpiler/transpiler.js.map +1 -0
  140. package/lib/util/logger.d.ts +18 -0
  141. package/lib/util/logger.js +32 -0
  142. package/lib/util/logger.js.map +1 -0
  143. package/package.json +70 -68
  144. package/src/AsJsDocsProcessor.ts +1 -1
  145. package/src/ClassFileGeneratorHelper.test.ts +1 -1
  146. package/src/ClassFileGeneratorHelper.ts +12 -3
  147. package/src/{command → Command}/Generate.ts +2 -2
  148. package/src/{command → Command}/__test__/Generte.test.ts +2 -2
  149. package/src/DocsProcessor.ts +7 -1
  150. package/src/DocsifyDocsProcessor.ts +7 -7
  151. package/src/FileManager.ts +1 -1
  152. package/src/JekyllDocsProcessor.ts +4 -0
  153. package/src/MarkdownDocsProcessor.ts +9 -7
  154. package/src/MarkdownHelper.ts +3 -3
  155. package/src/{model → Model}/ApexModel.ts +0 -0
  156. package/src/{model → Model}/ClassModel.ts +0 -0
  157. package/src/{model → Model}/EnumModel.ts +0 -0
  158. package/src/{model → Model}/MethodModel.ts +0 -0
  159. package/src/{model → Model}/PropertyModel.ts +0 -0
  160. package/src/{model → Model}/__test__/ClassModel.test.ts +0 -0
  161. package/src/{model → Model}/__test__/MethodModel.test.ts +0 -0
  162. package/src/{model → Model}/__test__/PropertyModel.test.ts +0 -0
  163. package/src/{parser → Parser}/ClassParser.ts +7 -2
  164. package/src/{parser → Parser}/EnumParser.ts +1 -1
  165. package/src/{parser → Parser}/FileParser.ts +2 -1
  166. package/src/{parser → Parser}/MethodParser.ts +1 -1
  167. package/src/{parser → Parser}/PropertyParser.ts +1 -1
  168. package/src/{parser → Parser}/__test__/ClassParser.test.ts +0 -0
  169. package/src/{parser → Parser}/__test__/FileParser.test.ts +0 -0
  170. package/src/{parser → Parser}/__test__/MethodParser.test.ts +1 -1
  171. package/src/{parser → Parser}/__test__/PropertyParser.test.ts +1 -1
  172. package/src/{parser → Parser}/__test__/testFileContents.ts +0 -0
  173. package/src/cli/generate.ts +1 -1
  174. package/src/index.ts +1 -1
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function declareMethod(title, markdownFile, methods, startingHeadingLevel, className = '') {
4
+ markdownFile.addTitle(title, startingHeadingLevel + 1);
5
+ methods.forEach((currentMethod) => {
6
+ var _a, _b;
7
+ const signatureName = isMethod(currentMethod) ? currentMethod.name : className;
8
+ markdownFile.addTitle(`\`${buildSignature(signatureName, currentMethod)}\``, startingHeadingLevel + 2);
9
+ currentMethod.annotations.forEach((annotation) => {
10
+ markdownFile.addBlankLine();
11
+ markdownFile.addText(`\`${annotation.type.toUpperCase()}\``);
12
+ });
13
+ if ((_a = currentMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
14
+ markdownFile.addBlankLine();
15
+ markdownFile.addText(currentMethod.docComment.description);
16
+ markdownFile.addBlankLine();
17
+ }
18
+ if (currentMethod.parameters.length) {
19
+ addParameters(markdownFile, currentMethod, startingHeadingLevel);
20
+ }
21
+ if (isMethod(currentMethod)) {
22
+ addReturns(markdownFile, currentMethod, startingHeadingLevel);
23
+ }
24
+ addThrowsBlock(markdownFile, currentMethod, startingHeadingLevel);
25
+ if ((_b = currentMethod.docComment) === null || _b === void 0 ? void 0 : _b.exampleAnnotation) {
26
+ addExample(markdownFile, currentMethod, startingHeadingLevel);
27
+ }
28
+ });
29
+ markdownFile.addHorizontalRule();
30
+ }
31
+ exports.declareMethod = declareMethod;
32
+ function buildSignature(name, parameterAware) {
33
+ let signature = `${name}(`;
34
+ if (isMethod(parameterAware) && parameterAware.memberModifiers.length) {
35
+ signature = parameterAware.memberModifiers.join(' ') + ' ' + signature;
36
+ }
37
+ const signatureParameters = parameterAware.parameters.map((param) => {
38
+ signature += `${param.type} ${param.name}`;
39
+ });
40
+ signature += signatureParameters.join(', ');
41
+ return (signature += ')');
42
+ }
43
+ function addParameters(markdownFile, methodModel, startingHeadingLevel) {
44
+ var _a;
45
+ markdownFile.addTitle('Parameters', startingHeadingLevel + 3);
46
+ markdownFile.initializeTable('Param', 'Description');
47
+ (_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.paramAnnotations.forEach((paramAnnotation) => {
48
+ const paramName = paramAnnotation.paramName;
49
+ const paramDescription = paramAnnotation.bodyLines.join(' ');
50
+ markdownFile.addTableRow(`\`${paramName}\``, paramDescription);
51
+ });
52
+ markdownFile.addBlankLine();
53
+ }
54
+ function addReturns(markdownFile, methodModel, startingHeadingLevel) {
55
+ var _a, _b;
56
+ if (!((_a = methodModel.docComment) === null || _a === void 0 ? void 0 : _a.returnAnnotation)) {
57
+ return;
58
+ }
59
+ markdownFile.addTitle('Return', startingHeadingLevel + 3);
60
+ markdownFile.addBlankLine();
61
+ markdownFile.addText('**Type**');
62
+ markdownFile.addBlankLine();
63
+ markdownFile.addText(methodModel.type);
64
+ markdownFile.addBlankLine();
65
+ markdownFile.addText('**Description**');
66
+ markdownFile.addBlankLine();
67
+ markdownFile.addText((_b = methodModel.docComment) === null || _b === void 0 ? void 0 : _b.returnAnnotation.bodyLines.join(' '));
68
+ markdownFile.addBlankLine();
69
+ }
70
+ function addThrowsBlock(markdownFile, docCommentAware, startingHeadingLevel) {
71
+ var _a, _b;
72
+ if (!((_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.throwsAnnotations.length)) {
73
+ return;
74
+ }
75
+ markdownFile.addTitle('Throws', startingHeadingLevel + 3);
76
+ markdownFile.initializeTable('Exception', 'Description');
77
+ (_b = docCommentAware.docComment) === null || _b === void 0 ? void 0 : _b.throwsAnnotations.forEach((annotation) => {
78
+ const exceptionName = annotation.exceptionName;
79
+ const exceptionDescription = annotation.bodyLines.join(' ');
80
+ markdownFile.addTableRow(`\`${exceptionName}\``, exceptionDescription);
81
+ });
82
+ markdownFile.addBlankLine();
83
+ }
84
+ function addExample(markdownFile, docCommentAware, startingHeadingLevel) {
85
+ var _a;
86
+ markdownFile.addTitle('Example', startingHeadingLevel + 3);
87
+ markdownFile.startCodeBlock();
88
+ (_a = docCommentAware.docComment) === null || _a === void 0 ? void 0 : _a.exampleAnnotation.bodyLines.forEach((line) => {
89
+ markdownFile.addText(line, false);
90
+ });
91
+ markdownFile.endCodeBlock();
92
+ markdownFile.addBlankLine();
93
+ }
94
+ function isMethod(method) {
95
+ return method.type !== undefined;
96
+ }
97
+ //# sourceMappingURL=method-declaration-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/method-declaration-util.ts"],"names":[],"mappings":";;AAIA,SAAgB,aAAa,CAC3B,KAAa,EACb,YAA0B,EAC1B,OAA6C,EAC7C,oBAA4B,EAC5B,SAAS,GAAG,EAAE;IAEd,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,EAAE,EAAE;;QAChC,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAE,aAA8B,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACjG,YAAY,CAAC,QAAQ,CAAC,KAAK,cAAc,CAAC,aAAa,EAAE,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;QACvG,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAC/C,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,UAAI,aAAa,CAAC,UAAU,0CAAE,WAAW,EAAE;YACzC,YAAY,CAAC,YAAY,EAAE,CAAC;YAC5B,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAC3D,YAAY,CAAC,YAAY,EAAE,CAAC;SAC7B;QAED,IAAI,aAAa,CAAC,UAAU,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IACD,YAAY,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAC1D,YAAY,CAAC,eAAe,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEzD,MAAA,eAAe,CAAC,UAAU,0CAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC/C,MAAM,oBAAoB,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5D,YAAY,CAAC,WAAW,CAAC,KAAK,aAAa,IAAI,EAAE,oBAAoB,CAAC,CAAC;IACzE,CAAC,EAAE;IAEH,YAAY,CAAC,YAAY,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,UAAU,CAAC,YAA0B,EAAE,eAAgC,EAAE,oBAA4B;;IAC5G,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IAC3D,YAAY,CAAC,cAAc,EAAE,CAAC;IAC9B,MAAA,eAAe,CAAC,UAAU,0CAAE,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvE,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC,EAAE;IACH,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,YAAY,CAAC,YAAY,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,QAAQ,CAAC,MAAyD;IACzE,OAAQ,MAAuB,CAAC,IAAI,KAAK,SAAS,CAAC;AACrD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { MarkdownFile } from '../markdown-file';
2
+ import { Type } from '@cparra/apex-reflection';
3
+ export declare function declareType(markdownFile: MarkdownFile, typeMirror: Type, startingHeadingLevel: number): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function declareType(markdownFile, typeMirror, startingHeadingLevel) {
4
+ var _a, _b;
5
+ markdownFile.addTitle(typeMirror.name, startingHeadingLevel);
6
+ typeMirror.annotations.forEach((currentAnnotation) => {
7
+ markdownFile.addBlankLine();
8
+ markdownFile.addText(`\`${currentAnnotation.type.toUpperCase()}\``);
9
+ });
10
+ if ((_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) {
11
+ markdownFile.addBlankLine();
12
+ markdownFile.addText(typeMirror.docComment.description);
13
+ markdownFile.addBlankLine();
14
+ }
15
+ function capitalizeFirstLetter(text) {
16
+ return text.charAt(0).toUpperCase() + text.slice(1);
17
+ }
18
+ (_b = typeMirror.docComment) === null || _b === void 0 ? void 0 : _b.annotations.filter((currentAnnotation) => currentAnnotation.name !== 'description').forEach((currentAnnotation) => {
19
+ markdownFile.addBlankLine();
20
+ markdownFile.addText(`**${capitalizeFirstLetter(currentAnnotation.name)}** ${currentAnnotation.body}`);
21
+ markdownFile.addBlankLine();
22
+ });
23
+ }
24
+ exports.declareType = declareType;
25
+ //# sourceMappingURL=type-declaration-util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/type-declaration-util.ts"],"names":[],"mappings":";;AAGA,SAAgB,WAAW,CAAC,YAA0B,EAAE,UAAgB,EAAE,oBAA4B;;IACpG,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAE7D,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE;QACnD,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,KAAK,iBAAiB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,UAAI,UAAU,CAAC,UAAU,0CAAE,WAAW,EAAE;QACtC,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACxD,YAAY,CAAC,YAAY,EAAE,CAAC;KAC7B;IAED,SAAS,qBAAqB,CAAC,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAC/B,MAAM,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,aAAa,EACtE,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE;QAC7B,YAAY,CAAC,YAAY,EAAE,CAAC;QAC5B,YAAY,CAAC,OAAO,CAAC,KAAK,qBAAqB,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;QACvG,YAAY,CAAC,YAAY,EAAE,CAAC;IAC9B,CAAC,EAAE;AACP,CAAC;AAzBD,kCAyBC"}
@@ -0,0 +1,11 @@
1
+ import { Type } from '@cparra/apex-reflection';
2
+ import { MarkdownFile } from './markdown-file';
3
+ export declare class MarkdownHomeFile extends MarkdownFile {
4
+ fileName: string;
5
+ types: Type[];
6
+ constructor(fileName: string, types: Type[], headerContent?: string);
7
+ private addTypeEntries;
8
+ private addTypeEntry;
9
+ private group;
10
+ private getClassGroup;
11
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const class_file_generatorHelper_1 = require("../transpiler/markdown/class-file-generatorHelper");
4
+ const markdown_file_1 = require("./markdown-file");
5
+ class MarkdownHomeFile extends markdown_file_1.MarkdownFile {
6
+ constructor(fileName, types, headerContent) {
7
+ super(fileName, '');
8
+ this.fileName = fileName;
9
+ this.types = types;
10
+ if (headerContent) {
11
+ this.addText(headerContent);
12
+ }
13
+ this.addTitle('Classes');
14
+ this.addTypeEntries(types);
15
+ }
16
+ addTypeEntries(types) {
17
+ const groupedClasses = this.group(types);
18
+ groupedClasses.forEach((value, key) => {
19
+ this.addTitle(key, 2);
20
+ value.forEach((typeMirror) => {
21
+ this.addTypeEntry(typeMirror);
22
+ });
23
+ });
24
+ }
25
+ addTypeEntry(typeMirror) {
26
+ var _a, _b;
27
+ this.addBlankLine();
28
+ this.addTitle(class_file_generatorHelper_1.default.getFileLink(typeMirror), 2);
29
+ this.addBlankLine();
30
+ this.addBlankLine();
31
+ this.addText((_b = (_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : '');
32
+ this.addBlankLine();
33
+ this.addBlankLine();
34
+ }
35
+ group(classes) {
36
+ return classes.reduce((groups, currentClass) => {
37
+ const key = this.getClassGroup(currentClass);
38
+ const group = groups.get(key) || [];
39
+ group.push(currentClass);
40
+ groups.set(key, group);
41
+ return groups;
42
+ }, new Map());
43
+ }
44
+ getClassGroup(classModel) {
45
+ var _a, _b, _c;
46
+ return (_c = (_b = (_a = classModel.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name === 'group')) === null || _b === void 0 ? void 0 : _b.body) !== null && _c !== void 0 ? _c : '';
47
+ }
48
+ }
49
+ exports.MarkdownHomeFile = MarkdownHomeFile;
50
+ //# sourceMappingURL=markdown-home-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-home-file.js","sourceRoot":"","sources":["../../src/model/markdown-home-file.ts"],"names":[],"mappings":";;AACA,kGAAyF;AACzF,mDAA+C;AAE/C,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAmB,QAAgB,EAAS,KAAa,EAAE,aAAsB;QAC/E,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QADH,aAAQ,GAAR,QAAQ,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAEvD,IAAI,aAAa,EAAE;YACj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AAC;YACzB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvB,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IAChB,CAAC;IAEO,aAAa,CAAC,UAAgB;;QACpC,yBAAO,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,2CAAG,IAAI,mCAAI,EAAE,CAAC;IAC1G,CAAC;CACF;AA3CD,4CA2CC"}
@@ -0,0 +1,17 @@
1
+ import { ClassMirror, ConstructorMirror, EnumMirror, FieldMirror, InterfaceMirror, MethodMirror, PropertyMirror, Type } from '@cparra/apex-reflection';
2
+ import { WalkerListener } from '../service/walkers/walker';
3
+ import { MarkdownFile } from './markdown-file';
4
+ export declare class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
5
+ type: Type;
6
+ startingHeadingLevel: number;
7
+ constructor(type: Type, startingHeadingLevel?: number, headerContent?: string);
8
+ onTypeDeclaration(typeMirror: Type, headingLevel?: 1): void;
9
+ onConstructorDeclaration(className: string, constructors: ConstructorMirror[]): void;
10
+ onFieldsDeclaration(fields: FieldMirror[]): void;
11
+ onPropertiesDeclaration(properties: PropertyMirror[]): void;
12
+ onMethodsDeclaration(methods: MethodMirror[]): void;
13
+ onInnerEnumsDeclaration(enums: EnumMirror[]): void;
14
+ onInnerClassesDeclaration(classes: ClassMirror[]): void;
15
+ onInnerInterfacesDeclaration(interfaces: InterfaceMirror[]): void;
16
+ private addInnerTypes;
17
+ }
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const walker_factory_1 = require("../service/walkers/walker-factory");
4
+ const markdown_file_1 = require("./markdown-file");
5
+ const markdown_generation_util_1 = require("./markdown-generation-util");
6
+ const class_file_generatorHelper_1 = require("../transpiler/markdown/class-file-generatorHelper");
7
+ class MarkdownTypeFile extends markdown_file_1.MarkdownFile {
8
+ constructor(type, startingHeadingLevel = 1, headerContent) {
9
+ super(`${type.name}`, class_file_generatorHelper_1.default.getSanitizedGroup(type));
10
+ this.type = type;
11
+ this.startingHeadingLevel = startingHeadingLevel;
12
+ if (headerContent) {
13
+ this.addText(headerContent);
14
+ }
15
+ const walker = walker_factory_1.WalkerFactory.get(type);
16
+ walker.walk(this);
17
+ }
18
+ onTypeDeclaration(typeMirror, headingLevel) {
19
+ markdown_generation_util_1.declareType(this, typeMirror, this.startingHeadingLevel);
20
+ }
21
+ onConstructorDeclaration(className, constructors) {
22
+ markdown_generation_util_1.declareMethod('Constructors', this, constructors, this.startingHeadingLevel, className);
23
+ }
24
+ onFieldsDeclaration(fields) {
25
+ markdown_generation_util_1.declareField('Fields', this, fields, this.startingHeadingLevel);
26
+ }
27
+ onPropertiesDeclaration(properties) {
28
+ markdown_generation_util_1.declareField('Properties', this, properties, this.startingHeadingLevel);
29
+ }
30
+ onMethodsDeclaration(methods) {
31
+ markdown_generation_util_1.declareMethod('Methods', this, methods, this.startingHeadingLevel);
32
+ }
33
+ onInnerEnumsDeclaration(enums) {
34
+ this.addInnerTypes('Enums', enums);
35
+ }
36
+ onInnerClassesDeclaration(classes) {
37
+ this.addInnerTypes('Classes', classes);
38
+ }
39
+ onInnerInterfacesDeclaration(interfaces) {
40
+ this.addInnerTypes('Interfaces', interfaces, false);
41
+ }
42
+ addInnerTypes(title, types, addSeparator = true) {
43
+ this.addTitle(title, this.startingHeadingLevel + 1);
44
+ types
45
+ .sort((typeA, typeB) => {
46
+ if (typeA.name < typeB.name)
47
+ return -1;
48
+ if (typeA.name > typeB.name)
49
+ return 1;
50
+ return 0;
51
+ })
52
+ .forEach((currentType) => {
53
+ const innerFile = new MarkdownTypeFile(currentType, this.startingHeadingLevel + 2);
54
+ this.addText(innerFile._contents);
55
+ });
56
+ if (addSeparator) {
57
+ this.addHorizontalRule();
58
+ }
59
+ }
60
+ }
61
+ exports.MarkdownTypeFile = MarkdownTypeFile;
62
+ //# sourceMappingURL=markdown-type-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-type-file.js","sourceRoot":"","sources":["../../src/model/markdown-type-file.ts"],"names":[],"mappings":";;AAUA,sEAAkE;AAElE,mDAA+C;AAC/C,yEAAsF;AACtF,kGAAyF;AAEzF,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAmB,IAAU,EAAS,uBAA+B,CAAC,EAAE,aAAsB;QAC5F,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,oCAAwB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QADvD,SAAI,GAAJ,IAAI,CAAM;QAAS,yBAAoB,GAApB,oBAAoB,CAAY;QAEpE,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7B;QACD,MAAM,MAAM,GAAG,8BAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAEM,iBAAiB,CAAC,UAAgB,EAAE,YAAgB;QACzD,sCAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC3D,CAAC;IAEM,wBAAwB,CAAC,SAAiB,EAAE,YAAiC;QAClF,wCAAa,CAAC,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAC1F,CAAC;IAEM,mBAAmB,CAAC,MAAqB;QAC9C,uCAAY,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAClE,CAAC;IAEM,uBAAuB,CAAC,UAA4B;QACzD,uCAAY,CAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC1E,CAAC;IAEM,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3
+ * Reads from .cls files and returns their raw body.
4
+ */
5
+ export declare class ApexFileReader {
6
+ /**
7
+ * Reads from .cls files and returns their raw body.
8
+ */
9
+ static processFiles(fileSystem: FileSystem): string[];
10
+ private static isApexFile;
11
+ private static get sourceDirectory();
12
+ private static get readRecursively();
13
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const settings_1 = require("../settings");
4
+ const APEX_FILE_EXTENSION = '.cls';
5
+ /**
6
+ * Reads from .cls files and returns their raw body.
7
+ */
8
+ class ApexFileReader {
9
+ /**
10
+ * Reads from .cls files and returns their raw body.
11
+ */
12
+ static processFiles(fileSystem) {
13
+ let bodies = [];
14
+ const directoryContents = fileSystem.readDirectory(this.sourceDirectory);
15
+ directoryContents.forEach((currentFilePath) => {
16
+ const currentPath = fileSystem.joinPath(this.sourceDirectory, currentFilePath);
17
+ if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
18
+ bodies = bodies.concat(this.processFiles(fileSystem));
19
+ }
20
+ if (!this.isApexFile(currentFilePath)) {
21
+ return;
22
+ }
23
+ const rawFile = fileSystem.readFile(currentPath);
24
+ bodies.push(rawFile);
25
+ });
26
+ return bodies;
27
+ }
28
+ static isApexFile(currentFile) {
29
+ return currentFile.endsWith(APEX_FILE_EXTENSION);
30
+ }
31
+ static get sourceDirectory() {
32
+ return settings_1.Settings.getInstance().sourceDirectory;
33
+ }
34
+ static get readRecursively() {
35
+ return settings_1.Settings.getInstance().recursive;
36
+ }
37
+ }
38
+ exports.ApexFileReader = ApexFileReader;
39
+ //# sourceMappingURL=apex-file-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apex-file-reader.js","sourceRoot":"","sources":["../../src/service/apex-file-reader.ts"],"names":[],"mappings":";;AAAA,0CAAuC;AAGvC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,UAAsB;QACxC,IAAI,MAAM,GAAa,EAAE,CAAC;QAE1B,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEzE,iBAAiB,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;YAC/E,IAAI,IAAI,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;gBAC/D,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;aACvD;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;gBACrC,OAAO;aACR;YAED,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACjD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,MAAM,CAAC,UAAU,CAAC,WAAmB;QAC3C,OAAO,WAAW,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACnD,CAAC;IAEO,MAAM,KAAK,eAAe;QAChC,OAAO,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;IAChD,CAAC;IAEO,MAAM,KAAK,eAAe;QAChC,OAAO,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;IAC1C,CAAC;CACF;AApCD,wCAoCC"}
@@ -0,0 +1,12 @@
1
+ export interface FileSystem {
2
+ readDirectory: (sourceDirectory: string) => string[];
3
+ isDirectory: (path: string) => boolean;
4
+ readFile: (path: string) => string;
5
+ joinPath: (...paths: string[]) => string;
6
+ }
7
+ export declare class DefaultFileSystem implements FileSystem {
8
+ isDirectory(pathToRead: string): boolean;
9
+ readDirectory(sourceDirectory: string): string[];
10
+ readFile(pathToRead: string): string;
11
+ joinPath(...paths: string[]): string;
12
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ class DefaultFileSystem {
6
+ isDirectory(pathToRead) {
7
+ return fs.statSync(pathToRead).isDirectory();
8
+ }
9
+ readDirectory(sourceDirectory) {
10
+ return fs.readdirSync(sourceDirectory);
11
+ }
12
+ readFile(pathToRead) {
13
+ const rawFile = fs.readFileSync(pathToRead);
14
+ return rawFile.toString();
15
+ }
16
+ joinPath(...paths) {
17
+ return path.join(...paths);
18
+ }
19
+ }
20
+ exports.DefaultFileSystem = DefaultFileSystem;
21
+ //# sourceMappingURL=file-system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/service/file-system.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAS7B,MAAa,iBAAiB;IAC5B,WAAW,CAAC,UAAkB;QAC5B,OAAO,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC;IAED,aAAa,CAAC,eAAuB;QACnC,OAAO,EAAE,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CAAC,UAAkB;QACzB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC5C,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,GAAG,KAAe;QACzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF;AAjBD,8CAiBC"}
@@ -0,0 +1,4 @@
1
+ import { File } from '../model/file';
2
+ export declare class FileWriter {
3
+ static write(files: File[], onWriteCallback: (fileName: string) => void): void;
4
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const settings_1 = require("../settings");
6
+ class FileWriter {
7
+ static write(files, onWriteCallback) {
8
+ const outputDir = settings_1.Settings.getInstance().outputDir;
9
+ if (!fs.existsSync(outputDir)) {
10
+ fs.mkdirSync(outputDir);
11
+ }
12
+ files.forEach((file) => {
13
+ const dirPath = path.join(outputDir, file.dir);
14
+ if (!fs.existsSync(dirPath)) {
15
+ fs.mkdirSync(dirPath);
16
+ }
17
+ const filePath = path.join(dirPath, `${file.fileName}${file.fileExtension()}`);
18
+ fs.writeFile(filePath, file.body, 'utf8', () => {
19
+ onWriteCallback(file.fileName);
20
+ });
21
+ });
22
+ }
23
+ }
24
+ exports.FileWriter = FileWriter;
25
+ //# sourceMappingURL=file-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,0CAAuC;AAEvC,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,KAAa,EAAE,eAA2C;QACrE,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC7B,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SACzB;QAED,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;aACvB;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;YAC/E,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;gBAC7C,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,gCAmBC"}
@@ -0,0 +1,9 @@
1
+ import Manifest from '../model/manifest';
2
+ import { TypeParser } from './parser';
3
+ import { ReflectionResult } from '@cparra/apex-reflection';
4
+ /**
5
+ * Builds a new Manifest object, sourcing its types from the received TypeParser.
6
+ * @param typeParser In charge of returning the list of reflected types.
7
+ * @param reflect Reflection function.
8
+ */
9
+ export declare function createManifest(typeParser: TypeParser, reflect: (typeBody: string) => ReflectionResult): Manifest;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const manifest_1 = require("../model/manifest");
4
+ /**
5
+ * Builds a new Manifest object, sourcing its types from the received TypeParser.
6
+ * @param typeParser In charge of returning the list of reflected types.
7
+ * @param reflect Reflection function.
8
+ */
9
+ function createManifest(typeParser, reflect) {
10
+ return new manifest_1.default(typeParser.parse(reflect));
11
+ }
12
+ exports.createManifest = createManifest;
13
+ //# sourceMappingURL=manifest-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":";;AAAA,gDAAyC;AAIzC;;;;GAIG;AACH,SAAgB,cAAc,CAAC,UAAsB,EAAE,OAA+C;IACpG,OAAO,IAAI,kBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,wCAEC"}
@@ -0,0 +1,9 @@
1
+ import { Type, ReflectionResult } from '@cparra/apex-reflection';
2
+ export interface TypeParser {
3
+ parse(reflect: (typeBody: string) => ReflectionResult): Type[];
4
+ }
5
+ export declare class RawBodyParser implements TypeParser {
6
+ typeBodies: string[];
7
+ constructor(typeBodies: string[]);
8
+ parse(reflect: (typeBody: string) => ReflectionResult): Type[];
9
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class RawBodyParser {
4
+ constructor(typeBodies) {
5
+ this.typeBodies = typeBodies;
6
+ }
7
+ parse(reflect) {
8
+ return this.typeBodies
9
+ .map((rawBody) => reflect(rawBody))
10
+ .filter((reflectionResult) => {
11
+ return reflectionResult.typeMirror;
12
+ })
13
+ .map((reflectionResult) => reflectionResult.typeMirror);
14
+ }
15
+ }
16
+ exports.RawBodyParser = RawBodyParser;
17
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/service/parser.ts"],"names":[],"mappings":";;AAMA,MAAa,aAAa;IACxB,YAAmB,UAAoB;QAApB,eAAU,GAAV,UAAU,CAAU;IAAG,CAAC;IAE3C,KAAK,CAAC,OAA+C;QACnD,OAAO,IAAI,CAAC,UAAU;aACnB,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aAClC,MAAM,CAAC,CAAC,gBAAgB,EAAE,EAAE;YAC3B,OAAO,gBAAgB,CAAC,UAAU,CAAC;QACrC,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,UAAW,CAAC,CAAC;IAC7D,CAAC;CACF;AAXD,sCAWC"}
@@ -0,0 +1,4 @@
1
+ import { Walker, WalkerListener } from './walker';
2
+ export declare class ClassWalker extends Walker {
3
+ walk(listener: WalkerListener): void;
4
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const walker_1 = require("./walker");
4
+ class ClassWalker extends walker_1.Walker {
5
+ walk(listener) {
6
+ listener.onTypeDeclaration(this.type);
7
+ const classMirror = this.type;
8
+ if (classMirror.constructors.length) {
9
+ listener.onConstructorDeclaration(this.type.name, classMirror.constructors);
10
+ }
11
+ if (classMirror.fields.length) {
12
+ listener.onFieldsDeclaration(classMirror.fields);
13
+ }
14
+ if (classMirror.properties.length) {
15
+ listener.onPropertiesDeclaration(classMirror.properties);
16
+ }
17
+ if (classMirror.methods.length) {
18
+ listener.onMethodsDeclaration(classMirror.methods);
19
+ }
20
+ if (classMirror.enums.length) {
21
+ listener.onInnerEnumsDeclaration(classMirror.enums);
22
+ }
23
+ if (classMirror.classes.length) {
24
+ listener.onInnerClassesDeclaration(classMirror.classes);
25
+ }
26
+ if (classMirror.interfaces.length) {
27
+ listener.onInnerInterfacesDeclaration(classMirror.interfaces);
28
+ }
29
+ }
30
+ }
31
+ exports.ClassWalker = ClassWalker;
32
+ //# sourceMappingURL=class-walker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class-walker.js","sourceRoot":"","sources":["../../../src/service/walkers/class-walker.ts"],"names":[],"mappings":";;AAAA,qCAAkD;AAGlD,MAAa,WAAY,SAAQ,eAAM;IACrC,IAAI,CAAC,QAAwB;QAC3B,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAmB,CAAC;QAE7C,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE;YACnC,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;SAC7E;QACD,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE;YAC7B,QAAQ,CAAC,mBAAmB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;SAClD;QACD,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,EAAE;YACjC,QAAQ,CAAC,uBAAuB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;SAC1D;QACD,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE;YAC9B,QAAQ,CAAC,oBAAoB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SACpD;QACD,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE;YAC5B,QAAQ,CAAC,uBAAuB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACrD;QACD,IAAI,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE;YAC9B,QAAQ,CAAC,yBAAyB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SACzD;QACD,IAAI,WAAW,CAAC,UAAU,CAAC,MAAM,EAAE;YACjC,QAAQ,CAAC,4BAA4B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;SAC/D;IACH,CAAC;CACF;AA3BD,kCA2BC"}
@@ -0,0 +1,4 @@
1
+ import { Walker, WalkerListener } from './walker';
2
+ export declare class EnumWalker extends Walker {
3
+ walk(listener: WalkerListener): void;
4
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const walker_1 = require("./walker");
4
+ class EnumWalker extends walker_1.Walker {
5
+ walk(listener) {
6
+ listener.onTypeDeclaration(this.type);
7
+ }
8
+ }
9
+ exports.EnumWalker = EnumWalker;
10
+ //# sourceMappingURL=enum-walker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-walker.js","sourceRoot":"","sources":["../../../src/service/walkers/enum-walker.ts"],"names":[],"mappings":";;AAAA,qCAAkD;AAGlD,MAAa,UAAW,SAAQ,eAAM;IACpC,IAAI,CAAC,QAAwB;QAC3B,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAJD,gCAIC"}
@@ -0,0 +1,4 @@
1
+ import { Walker, WalkerListener } from './walker';
2
+ export declare class InterfaceWalker extends Walker {
3
+ walk(listener: WalkerListener): void;
4
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const walker_1 = require("./walker");
4
+ class InterfaceWalker extends walker_1.Walker {
5
+ walk(listener) {
6
+ listener.onTypeDeclaration(this.type);
7
+ const interfaceMirror = this.type;
8
+ if (interfaceMirror.methods.length) {
9
+ listener.onMethodsDeclaration(interfaceMirror.methods);
10
+ }
11
+ }
12
+ }
13
+ exports.InterfaceWalker = InterfaceWalker;
14
+ //# sourceMappingURL=interface-walker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface-walker.js","sourceRoot":"","sources":["../../../src/service/walkers/interface-walker.ts"],"names":[],"mappings":";;AAAA,qCAAkD;AAGlD,MAAa,eAAgB,SAAQ,eAAM;IACzC,IAAI,CAAC,QAAwB;QAC3B,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAuB,CAAC;QACrD,IAAI,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE;YAClC,QAAQ,CAAC,oBAAoB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;SACxD;IACH,CAAC;CACF;AARD,0CAQC"}
@@ -0,0 +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
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const class_walker_1 = require("./class-walker");
4
+ const enum_walker_1 = require("./enum-walker");
5
+ const interface_walker_1 = require("./interface-walker");
6
+ class WalkerFactory {
7
+ static get(type) {
8
+ switch (type.type_name) {
9
+ case 'class':
10
+ return new class_walker_1.ClassWalker(type);
11
+ case 'enum':
12
+ return new enum_walker_1.EnumWalker(type);
13
+ case 'interface':
14
+ return new interface_walker_1.InterfaceWalker(type);
15
+ }
16
+ throw Error('Walker not found for type.');
17
+ }
18
+ }
19
+ exports.WalkerFactory = WalkerFactory;
20
+ //# sourceMappingURL=walker-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walker-factory.js","sourceRoot":"","sources":["../../../src/service/walkers/walker-factory.ts"],"names":[],"mappings":";;AAEA,iDAA6C;AAC7C,+CAA2C;AAC3C,yDAAqD;AAErD,MAAa,aAAa;IACxB,MAAM,CAAC,GAAG,CAAC,IAAU;QACnB,QAAQ,IAAI,CAAC,SAAS,EAAE;YACtB,KAAK,OAAO;gBACV,OAAO,IAAI,0BAAW,CAAC,IAAI,CAAC,CAAC;YAC/B,KAAK,MAAM;gBACT,OAAO,IAAI,wBAAU,CAAC,IAAI,CAAC,CAAC;YAC9B,KAAK,WAAW;gBACd,OAAO,IAAI,kCAAe,CAAC,IAAI,CAAC,CAAC;SACpC;QACD,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC5C,CAAC;CACF;AAZD,sCAYC"}