@cparra/apexdocs 2.25.0-alpha.3 → 2.25.0-alpha.4

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 (288) hide show
  1. package/dist/cli/generate.js +26 -26
  2. package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
  3. package/examples/plain-markdown/docs/index.md +82 -0
  4. package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
  5. package/examples/plain-markdown/package.json +2 -1
  6. package/package.json +1 -1
  7. package/src/application/Apexdocs.ts +0 -2
  8. package/src/cli/args.ts +3 -1
  9. package/src/cli/generate.ts +1 -3
  10. package/src/core/adapters/__tests__/documentables.spec.ts +109 -0
  11. package/src/core/adapters/__tests__/references.spec.ts +12 -1
  12. package/src/core/adapters/apex-types.ts +1 -1
  13. package/src/core/adapters/documentables.ts +2 -62
  14. package/src/core/adapters/fields-and-properties.ts +7 -2
  15. package/src/core/adapters/{references.ts → inline.ts} +43 -10
  16. package/src/core/adapters/methods-and-constructors.ts +7 -2
  17. package/src/core/adapters/type-utils.ts +5 -1
  18. package/src/core/adapters/types.d.ts +8 -1
  19. package/src/core/template.ts +4 -1
  20. package/src/service/apex-file-reader.ts +1 -5
  21. package/src/settings.ts +0 -10
  22. package/src/test-helpers/SettingsBuilder.ts +0 -2
  23. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +1 -1
  24. package/src/util/fp.ts +3 -0
  25. package/dist/__spec__/core/expect-extensions.d.ts +0 -3
  26. package/dist/__spec__/core/expect-extensions.js +0 -55
  27. package/dist/__spec__/core/expect-extensions.js.map +0 -1
  28. package/dist/__spec__/core/generating-class-docs.spec.d.ts +0 -1
  29. package/dist/__spec__/core/generating-class-docs.spec.js +0 -444
  30. package/dist/__spec__/core/generating-class-docs.spec.js.map +0 -1
  31. package/dist/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
  32. package/dist/__spec__/core/generating-enum-docs.spec.js +0 -306
  33. package/dist/__spec__/core/generating-enum-docs.spec.js.map +0 -1
  34. package/dist/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
  35. package/dist/__spec__/core/generating-interface-docs.spec.js +0 -364
  36. package/dist/__spec__/core/generating-interface-docs.spec.js.map +0 -1
  37. package/dist/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
  38. package/dist/__spec__/core/generating-reference-guide.spec.js +0 -162
  39. package/dist/__spec__/core/generating-reference-guide.spec.js.map +0 -1
  40. package/dist/__spec__/core/test-helpers.d.ts +0 -2
  41. package/dist/__spec__/core/test-helpers.js +0 -12
  42. package/dist/__spec__/core/test-helpers.js.map +0 -1
  43. package/dist/application/Apexdocs.d.ts +0 -15
  44. package/dist/application/Apexdocs.js +0 -113
  45. package/dist/application/Apexdocs.js.map +0 -1
  46. package/dist/application/generators/generate-markdown-files.d.ts +0 -3
  47. package/dist/application/generators/generate-markdown-files.js +0 -64
  48. package/dist/application/generators/generate-markdown-files.js.map +0 -1
  49. package/dist/cli/args.d.ts +0 -39
  50. package/dist/cli/args.js +0 -154
  51. package/dist/cli/args.js.map +0 -1
  52. package/dist/cli/generate.d.ts +0 -2
  53. package/dist/cli/generate.js.map +0 -1
  54. package/dist/core/__test__/inheritance-chain.test.d.ts +0 -1
  55. package/dist/core/__test__/inheritance-chain.test.js +0 -42
  56. package/dist/core/__test__/inheritance-chain.test.js.map +0 -1
  57. package/dist/core/adapters/apex-types.d.ts +0 -6
  58. package/dist/core/adapters/apex-types.js +0 -109
  59. package/dist/core/adapters/apex-types.js.map +0 -1
  60. package/dist/core/adapters/documentables.d.ts +0 -7
  61. package/dist/core/adapters/documentables.js +0 -154
  62. package/dist/core/adapters/documentables.js.map +0 -1
  63. package/dist/core/adapters/fields-and-properties.d.ts +0 -3
  64. package/dist/core/adapters/fields-and-properties.js +0 -37
  65. package/dist/core/adapters/fields-and-properties.js.map +0 -1
  66. package/dist/core/adapters/methods-and-constructors.d.ts +0 -5
  67. package/dist/core/adapters/methods-and-constructors.js +0 -100
  68. package/dist/core/adapters/methods-and-constructors.js.map +0 -1
  69. package/dist/core/adapters/references.d.ts +0 -4
  70. package/dist/core/adapters/references.js +0 -78
  71. package/dist/core/adapters/references.js.map +0 -1
  72. package/dist/core/adapters/type-utils.d.ts +0 -3
  73. package/dist/core/adapters/type-utils.js +0 -12
  74. package/dist/core/adapters/type-utils.js.map +0 -1
  75. package/dist/core/apex-bundle.d.ts +0 -6
  76. package/dist/core/apex-bundle.js +0 -11
  77. package/dist/core/apex-bundle.js.map +0 -1
  78. package/dist/core/generate-docs.d.ts +0 -28
  79. package/dist/core/generate-docs.js +0 -296
  80. package/dist/core/generate-docs.js.map +0 -1
  81. package/dist/core/inheritance-chain.d.ts +0 -2
  82. package/dist/core/inheritance-chain.js +0 -36
  83. package/dist/core/inheritance-chain.js.map +0 -1
  84. package/dist/core/manifest.d.ts +0 -22
  85. package/dist/core/manifest.js +0 -53
  86. package/dist/core/manifest.js.map +0 -1
  87. package/dist/core/template.d.ts +0 -10
  88. package/dist/core/template.js +0 -97
  89. package/dist/core/template.js.map +0 -1
  90. package/dist/core/templates/reference-guide.d.ts +0 -1
  91. package/dist/core/templates/reference-guide.js +0 -18
  92. package/dist/core/templates/reference-guide.js.map +0 -1
  93. package/dist/index.js.map +0 -1
  94. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
  95. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
  96. package/dist/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
  97. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
  98. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
  99. package/dist/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
  100. package/dist/model/markdown-file.d.ts +0 -16
  101. package/dist/model/markdown-file.js +0 -111
  102. package/dist/model/markdown-file.js.map +0 -1
  103. package/dist/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
  104. package/dist/model/markdown-generation-util/doc-comment-annotation-util.js +0 -47
  105. package/dist/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
  106. package/dist/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
  107. package/dist/model/markdown-generation-util/field-declaration-util.js +0 -55
  108. package/dist/model/markdown-generation-util/field-declaration-util.js.map +0 -1
  109. package/dist/model/markdown-generation-util/index.d.ts +0 -3
  110. package/dist/model/markdown-generation-util/index.js +0 -20
  111. package/dist/model/markdown-generation-util/index.js.map +0 -1
  112. package/dist/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
  113. package/dist/model/markdown-generation-util/method-declaration-util.js +0 -115
  114. package/dist/model/markdown-generation-util/method-declaration-util.js.map +0 -1
  115. package/dist/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
  116. package/dist/model/markdown-generation-util/type-declaration-util.js +0 -82
  117. package/dist/model/markdown-generation-util/type-declaration-util.js.map +0 -1
  118. package/dist/model/markdown-home-file.d.ts +0 -11
  119. package/dist/model/markdown-home-file.js +0 -57
  120. package/dist/model/markdown-home-file.js.map +0 -1
  121. package/dist/model/markdown-type-file.d.ts +0 -26
  122. package/dist/model/markdown-type-file.js +0 -137
  123. package/dist/model/markdown-type-file.js.map +0 -1
  124. package/dist/model/openapi/apex-doc-types.d.ts +0 -19
  125. package/dist/model/openapi/apex-doc-types.js +0 -5
  126. package/dist/model/openapi/apex-doc-types.js.map +0 -1
  127. package/dist/model/openapi/open-api-types.d.ts +0 -93
  128. package/dist/model/openapi/open-api-types.js +0 -3
  129. package/dist/model/openapi/open-api-types.js.map +0 -1
  130. package/dist/model/openapi/open-api.d.ts +0 -16
  131. package/dist/model/openapi/open-api.js +0 -34
  132. package/dist/model/openapi/open-api.js.map +0 -1
  133. package/dist/model/openapi/openapi-type-file.d.ts +0 -7
  134. package/dist/model/openapi/openapi-type-file.js +0 -17
  135. package/dist/model/openapi/openapi-type-file.js.map +0 -1
  136. package/dist/model/outputFile.d.ts +0 -10
  137. package/dist/model/outputFile.js +0 -22
  138. package/dist/model/outputFile.js.map +0 -1
  139. package/dist/model/types-repository.d.ts +0 -16
  140. package/dist/model/types-repository.js +0 -54
  141. package/dist/model/types-repository.js.map +0 -1
  142. package/dist/service/apex-file-reader.d.ts +0 -14
  143. package/dist/service/apex-file-reader.js +0 -49
  144. package/dist/service/apex-file-reader.js.map +0 -1
  145. package/dist/service/file-system.d.ts +0 -14
  146. package/dist/service/file-system.js +0 -48
  147. package/dist/service/file-system.js.map +0 -1
  148. package/dist/service/file-writer.d.ts +0 -6
  149. package/dist/service/file-writer.js +0 -57
  150. package/dist/service/file-writer.js.map +0 -1
  151. package/dist/service/manifest-factory.d.ts +0 -10
  152. package/dist/service/manifest-factory.js +0 -17
  153. package/dist/service/manifest-factory.js.map +0 -1
  154. package/dist/service/metadata-processor.d.ts +0 -3
  155. package/dist/service/metadata-processor.js +0 -17
  156. package/dist/service/metadata-processor.js.map +0 -1
  157. package/dist/service/parser.d.ts +0 -21
  158. package/dist/service/parser.js +0 -138
  159. package/dist/service/parser.js.map +0 -1
  160. package/dist/service/state.d.ts +0 -9
  161. package/dist/service/state.js +0 -20
  162. package/dist/service/state.js.map +0 -1
  163. package/dist/service/walkers/class-walker.d.ts +0 -4
  164. package/dist/service/walkers/class-walker.js +0 -33
  165. package/dist/service/walkers/class-walker.js.map +0 -1
  166. package/dist/service/walkers/enum-walker.d.ts +0 -4
  167. package/dist/service/walkers/enum-walker.js +0 -11
  168. package/dist/service/walkers/enum-walker.js.map +0 -1
  169. package/dist/service/walkers/interface-walker.d.ts +0 -4
  170. package/dist/service/walkers/interface-walker.js +0 -15
  171. package/dist/service/walkers/interface-walker.js.map +0 -1
  172. package/dist/service/walkers/walker-factory.d.ts +0 -5
  173. package/dist/service/walkers/walker-factory.js +0 -21
  174. package/dist/service/walkers/walker-factory.js.map +0 -1
  175. package/dist/service/walkers/walker.d.ts +0 -19
  176. package/dist/service/walkers/walker.js +0 -17
  177. package/dist/service/walkers/walker.js.map +0 -1
  178. package/dist/settings.d.ts +0 -67
  179. package/dist/settings.js +0 -92
  180. package/dist/settings.js.map +0 -1
  181. package/dist/test-helpers/AnnotationBuilder.d.ts +0 -12
  182. package/dist/test-helpers/AnnotationBuilder.js +0 -31
  183. package/dist/test-helpers/AnnotationBuilder.js.map +0 -1
  184. package/dist/test-helpers/ClassMirrorBuilder.d.ts +0 -22
  185. package/dist/test-helpers/ClassMirrorBuilder.js +0 -64
  186. package/dist/test-helpers/ClassMirrorBuilder.js.map +0 -1
  187. package/dist/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
  188. package/dist/test-helpers/DocCommentAnnotationBuilder.js +0 -26
  189. package/dist/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
  190. package/dist/test-helpers/DocCommentBuilder.d.ts +0 -12
  191. package/dist/test-helpers/DocCommentBuilder.js +0 -38
  192. package/dist/test-helpers/DocCommentBuilder.js.map +0 -1
  193. package/dist/test-helpers/FieldMirrorBuilder.d.ts +0 -18
  194. package/dist/test-helpers/FieldMirrorBuilder.js +0 -54
  195. package/dist/test-helpers/FieldMirrorBuilder.js.map +0 -1
  196. package/dist/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
  197. package/dist/test-helpers/InterfaceMirrorBuilder.js +0 -43
  198. package/dist/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
  199. package/dist/test-helpers/MethodMirrorBuilder.d.ts +0 -29
  200. package/dist/test-helpers/MethodMirrorBuilder.js +0 -72
  201. package/dist/test-helpers/MethodMirrorBuilder.js.map +0 -1
  202. package/dist/test-helpers/SettingsBuilder.d.ts +0 -8
  203. package/dist/test-helpers/SettingsBuilder.js +0 -28
  204. package/dist/test-helpers/SettingsBuilder.js.map +0 -1
  205. package/dist/transpiler/factory.d.ts +0 -6
  206. package/dist/transpiler/factory.js +0 -33
  207. package/dist/transpiler/factory.js.map +0 -1
  208. package/dist/transpiler/file-container.d.ts +0 -6
  209. package/dist/transpiler/file-container.js +0 -16
  210. package/dist/transpiler/file-container.js.map +0 -1
  211. package/dist/transpiler/generator-choices.d.ts +0 -1
  212. package/dist/transpiler/generator-choices.js +0 -3
  213. package/dist/transpiler/generator-choices.js.map +0 -1
  214. package/dist/transpiler/markdown/class-file-generatorHelper.d.ts +0 -9
  215. package/dist/transpiler/markdown/class-file-generatorHelper.js +0 -61
  216. package/dist/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
  217. package/dist/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
  218. package/dist/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
  219. package/dist/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
  220. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
  221. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
  222. package/dist/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
  223. package/dist/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
  224. package/dist/transpiler/markdown/markdown-transpiler-base.js +0 -27
  225. package/dist/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
  226. package/dist/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
  227. package/dist/transpiler/markdown/plain-markdown/class-template.js +0 -77
  228. package/dist/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
  229. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
  230. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -36
  231. package/dist/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
  232. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
  233. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -30
  234. package/dist/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
  235. package/dist/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
  236. package/dist/transpiler/markdown/plain-markdown/enum-template.js +0 -16
  237. package/dist/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
  238. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
  239. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -27
  240. package/dist/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
  241. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
  242. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
  243. package/dist/transpiler/markdown/plain-markdown/grouped-members-partial-template.js.map +0 -1
  244. package/dist/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
  245. package/dist/transpiler/markdown/plain-markdown/interface-template.js +0 -20
  246. package/dist/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
  247. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
  248. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -47
  249. package/dist/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
  250. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
  251. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
  252. package/dist/transpiler/markdown/plain-markdown/type-doc-partial.js.map +0 -1
  253. package/dist/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
  254. package/dist/transpiler/openapi/open-api-docs-processor.js +0 -78
  255. package/dist/transpiler/openapi/open-api-docs-processor.js.map +0 -1
  256. package/dist/transpiler/openapi/parsers/Builder.d.ts +0 -16
  257. package/dist/transpiler/openapi/parsers/Builder.js +0 -30
  258. package/dist/transpiler/openapi/parsers/Builder.js.map +0 -1
  259. package/dist/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
  260. package/dist/transpiler/openapi/parsers/MethodParser.js +0 -190
  261. package/dist/transpiler/openapi/parsers/MethodParser.js.map +0 -1
  262. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
  263. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
  264. package/dist/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
  265. package/dist/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
  266. package/dist/transpiler/openapi/parsers/ReferenceBuilder.js +0 -250
  267. package/dist/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
  268. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
  269. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
  270. package/dist/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
  271. package/dist/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
  272. package/dist/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
  273. package/dist/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
  274. package/dist/transpiler/processor-type-transpiler.d.ts +0 -10
  275. package/dist/transpiler/processor-type-transpiler.js +0 -9
  276. package/dist/transpiler/processor-type-transpiler.js.map +0 -1
  277. package/dist/transpiler/transpiler.d.ts +0 -5
  278. package/dist/transpiler/transpiler.js +0 -30
  279. package/dist/transpiler/transpiler.js.map +0 -1
  280. package/dist/util/error-logger.d.ts +0 -8
  281. package/dist/util/error-logger.js +0 -90
  282. package/dist/util/error-logger.js.map +0 -1
  283. package/dist/util/logger.d.ts +0 -21
  284. package/dist/util/logger.js +0 -61
  285. package/dist/util/logger.js.map +0 -1
  286. package/dist/util/string-utils.d.ts +0 -2
  287. package/dist/util/string-utils.js +0 -15
  288. package/dist/util/string-utils.js.map +0 -1
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typeDocPartial = void 0;
4
- exports.typeDocPartial = `
5
- {{#> documentablePartialTemplate}}
6
-
7
- {{#if doc.group}}
8
- **Group** {{doc.group}}
9
- {{/if}}
10
-
11
- {{#if doc.author}}
12
- **Author** {{doc.author}}
13
- {{/if}}
14
-
15
- {{#if doc.date}}
16
- **Date** {{doc.date}}
17
- {{/if}}
18
-
19
- {{#each doc.sees}}
20
- **See** {{link this}}
21
-
22
- {{/each}}
23
-
24
- {{#if namespace}}
25
- ## Namespace
26
- {{namespace}}
27
- {{/if}}
28
-
29
- {{/documentablePartialTemplate}}
30
- `.trim();
31
- //# sourceMappingURL=type-doc-partial.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-doc-partial.js","sourceRoot":"","sources":["../../../../src/transpiler/markdown/plain-markdown/type-doc-partial.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B7B,CAAC,IAAI,EAAE,CAAC"}
@@ -1,13 +0,0 @@
1
- import ProcessorTypeTranspiler from '../processor-type-transpiler';
2
- import { FileContainer } from '../file-container';
3
- import { Type } from '@cparra/apex-reflection';
4
- import { OpenApi } from '../../model/openapi/open-api';
5
- export declare class OpenApiDocsProcessor extends ProcessorTypeTranspiler {
6
- protected readonly _fileContainer: FileContainer;
7
- openApiModel: OpenApi;
8
- constructor();
9
- fileBuilder(): FileContainer;
10
- onProcess(type: Type): void;
11
- onAfterProcess: ((types: Type[]) => void) | undefined;
12
- private getEndpointPath;
13
- }
@@ -1,78 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.OpenApiDocsProcessor = void 0;
7
- const processor_type_transpiler_1 = __importDefault(require("../processor-type-transpiler"));
8
- const file_container_1 = require("../file-container");
9
- const openapi_type_file_1 = require("../../model/openapi/openapi-type-file");
10
- const logger_1 = require("../../util/logger");
11
- const open_api_1 = require("../../model/openapi/open-api");
12
- const settings_1 = require("../../settings");
13
- const MethodParser_1 = require("./parsers/MethodParser");
14
- const string_utils_1 = require("../../util/string-utils");
15
- class OpenApiDocsProcessor extends processor_type_transpiler_1.default {
16
- constructor() {
17
- super();
18
- this.onAfterProcess = () => {
19
- this._fileContainer.pushFile(new openapi_type_file_1.OpenapiTypeFile(this.openApiModel));
20
- };
21
- this._fileContainer = new file_container_1.FileContainer();
22
- const title = settings_1.Settings.getInstance().getOpenApiTitle();
23
- if (!title) {
24
- throw Error('No OpenApi title was provided.');
25
- }
26
- this.openApiModel = new open_api_1.OpenApi(title, '1.0.0', settings_1.Settings.getInstance().getNamespace());
27
- }
28
- fileBuilder() {
29
- return this._fileContainer;
30
- }
31
- onProcess(type) {
32
- var _a, _b;
33
- logger_1.Logger.logSingle(`Processing ${type.name}`, false, 'green', false);
34
- const endpointPath = this.getEndpointPath(type);
35
- if (!endpointPath) {
36
- return;
37
- }
38
- this.openApiModel.paths[endpointPath] = {};
39
- if ((_a = type.docComment) === null || _a === void 0 ? void 0 : _a.description) {
40
- this.openApiModel.paths[endpointPath].description = type.docComment.description;
41
- }
42
- // We can safely cast to a ClassMirror, since only these support the @RestResource annotation
43
- const typeAsClass = type;
44
- // Add tags for this Apex class to the OpenApi model
45
- const tagName = (0, string_utils_1.camel2title)(endpointPath);
46
- this.openApiModel.tags.push({
47
- name: tagName,
48
- description: (_b = type.docComment) === null || _b === void 0 ? void 0 : _b.description,
49
- });
50
- const parser = new MethodParser_1.MethodParser(this.openApiModel);
51
- // GET
52
- parser.parseMethod(typeAsClass, endpointPath, 'get', tagName);
53
- // PATCH
54
- parser.parseMethod(typeAsClass, endpointPath, 'patch', tagName);
55
- // POST
56
- parser.parseMethod(typeAsClass, endpointPath, 'post', tagName);
57
- // PUT
58
- parser.parseMethod(typeAsClass, endpointPath, 'put', tagName);
59
- // DELETE
60
- parser.parseMethod(typeAsClass, endpointPath, 'delete', tagName);
61
- }
62
- getEndpointPath(type) {
63
- var _a;
64
- const restResourceAnnotation = type.annotations.find((element) => element.name.toLowerCase() === 'restresource');
65
- const urlMapping = (_a = restResourceAnnotation === null || restResourceAnnotation === void 0 ? void 0 : restResourceAnnotation.elementValues) === null || _a === void 0 ? void 0 : _a.find((element) => element.key.toLowerCase() === 'urlmapping');
66
- if (!urlMapping) {
67
- logger_1.Logger.error(`Type does not contain urlMapping annotation ${type.name}`);
68
- return null;
69
- }
70
- let endpointPath = urlMapping.value.replaceAll('"', '').replaceAll("'", '').replaceAll('/*', '/');
71
- if (endpointPath.startsWith('/')) {
72
- endpointPath = endpointPath.substring(1);
73
- }
74
- return endpointPath;
75
- }
76
- }
77
- exports.OpenApiDocsProcessor = OpenApiDocsProcessor;
78
- //# sourceMappingURL=open-api-docs-processor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"open-api-docs-processor.js","sourceRoot":"","sources":["../../../src/transpiler/openapi/open-api-docs-processor.ts"],"names":[],"mappings":";;;;;;AAAA,6FAAmE;AACnE,sDAAkD;AAElD,6EAAwE;AACxE,8CAA2C;AAC3C,2DAAuD;AACvD,6CAA0C;AAC1C,yDAAsD;AACtD,0DAAsD;AAEtD,MAAa,oBAAqB,SAAQ,mCAAuB;IAI/D;QACE,KAAK,EAAE,CAAC;QAsDV,mBAAc,GAA0C,GAAG,EAAE;YAC3D,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,mCAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QACvE,CAAC,CAAC;QAvDA,IAAI,CAAC,cAAc,GAAG,IAAI,8BAAa,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,IAAI,kBAAO,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAQ,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,SAAS,CAAC,IAAU;;QAClB,eAAM,CAAC,SAAS,CAAC,cAA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CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAMO,eAAe,CAAC,IAAU;;QAChC,MAAM,sBAAsB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,CAAC;QACjH,MAAM,UAAU,GAAG,MAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,aAAa,0CAAE,IAAI,CAC5D,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,YAAY,CACxD,CAAC;QACF,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,eAAM,CAAC,KAAK,CAAC,+CAA+C,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;YACzE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAClG,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACjC,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3C,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AA/ED,oDA+EC"}
@@ -1,16 +0,0 @@
1
- import { Reference } from './ReferenceBuilder';
2
- import { ApexDocSchemaObject } from '../../../model/openapi/apex-doc-types';
3
- import { SchemaObject } from '../../../model/openapi/open-api-types';
4
- export type ApexDocSchemaAware = {
5
- schema: ApexDocSchemaObject;
6
- };
7
- export declare abstract class Builder<T, K> {
8
- build(schemaAware: ApexDocSchemaAware): Response<T>;
9
- abstract buildBody(apexDocObject: K, reference?: Reference): T;
10
- protected getOpenApiSchemaFromApexDocSchema(schemaAware: ApexDocSchemaAware, reference?: Reference): SchemaObject;
11
- private isReferenceString;
12
- }
13
- export interface Response<T> {
14
- reference?: Reference;
15
- body: T;
16
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Builder = void 0;
4
- const ReferenceBuilder_1 = require("./ReferenceBuilder");
5
- class Builder {
6
- constructor() {
7
- this.isReferenceString = (targetObject) => {
8
- return typeof targetObject === 'string' || targetObject instanceof String;
9
- };
10
- }
11
- build(schemaAware) {
12
- let reference;
13
- if (this.isReferenceString(schemaAware.schema)) {
14
- reference = new ReferenceBuilder_1.ReferenceBuilder().build(schemaAware.schema);
15
- }
16
- return {
17
- reference: reference,
18
- body: this.buildBody(schemaAware, reference),
19
- };
20
- }
21
- getOpenApiSchemaFromApexDocSchema(schemaAware, reference) {
22
- if (this.isReferenceString(schemaAware.schema)) {
23
- // We are dealing with a reference
24
- return reference.entrypointReferenceObject;
25
- }
26
- return schemaAware.schema;
27
- }
28
- }
29
- exports.Builder = Builder;
30
- //# sourceMappingURL=Builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/Builder.ts"],"names":[],"mappings":";;;AAAA,yDAAiE;AAQjE,MAAsB,OAAO;IAA7B;QAuBU,sBAAiB,GAAG,CAAC,YAAqB,EAA0B,EAAE;YAC5E,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,YAAY,MAAM,CAAC;QAC5E,CAAC,CAAC;IACJ,CAAC;IAzBC,KAAK,CAAC,WAA+B;QACnC,IAAI,SAAgC,CAAC;QACrC,IAAI,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/C,SAAS,GAAG,IAAI,mCAAgB,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO;YACL,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAgB,EAAE,SAAS,CAAC;SAClD,CAAC;IACJ,CAAC;IAIS,iCAAiC,CAAC,WAA+B,EAAE,SAAqB;QAChG,IAAI,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/C,kCAAkC;YAClC,OAAO,SAAU,CAAC,yBAAyB,CAAC;QAC9C,CAAC;QACD,OAAO,WAAW,CAAC,MAAM,CAAC;IAC5B,CAAC;CAKF;AA1BD,0BA0BC"}
@@ -1,20 +0,0 @@
1
- import { ClassMirror } from '@cparra/apex-reflection';
2
- import { OpenApi } from '../../../model/openapi/open-api';
3
- type HttpOperations = 'get' | 'put' | 'post' | 'delete' | 'patch';
4
- /**
5
- * Parses ApexDocs with HTTP REST annotations and turns them into an OpenApi specification.
6
- */
7
- export declare class MethodParser {
8
- openApiModel: OpenApi;
9
- constructor(openApiModel: OpenApi);
10
- parseMethod(classMirror: ClassMirror, httpUrlEndpoint: string, httpMethodKey: HttpOperations, tag: string): void;
11
- private parseHttpAnnotation;
12
- private addToOpenApiStrategy;
13
- private addRequestBodyToOpenApi;
14
- private addParametersToOpenApi;
15
- private addHttpResponsesToOpenApi;
16
- private fallbackHttpRequestBodyParser;
17
- private getFallbackHttpResponseParser;
18
- private addReference;
19
- }
20
- export {};
@@ -1,190 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MethodParser = void 0;
27
- const yaml = __importStar(require("js-yaml"));
28
- const ClassMirrorWrapper_1 = require("../../../model/apex-type-wrappers/ClassMirrorWrapper");
29
- const ReferenceBuilder_1 = require("./ReferenceBuilder");
30
- const ParameterObjectBuilder_1 = require("./ParameterObjectBuilder");
31
- const ResponsesBuilder_1 = require("./ResponsesBuilder");
32
- const RequestBodyBuilder_1 = require("./RequestBodyBuilder");
33
- const MethodMirrorWrapper_1 = require("../../../model/apex-type-wrappers/MethodMirrorWrapper");
34
- /**
35
- * Parses ApexDocs with HTTP REST annotations and turns them into an OpenApi specification.
36
- */
37
- class MethodParser {
38
- constructor(openApiModel) {
39
- this.openApiModel = openApiModel;
40
- }
41
- parseMethod(classMirror, httpUrlEndpoint, httpMethodKey, tag) {
42
- var _a, _b;
43
- const classMirrorWrapper = new ClassMirrorWrapper_1.ClassMirrorWrapper(classMirror);
44
- // Apex supports HttpGet, HttpPut, HttpPost, HttpDelete, and HttpPatch, so we search for a method
45
- // that has one of those annotations.
46
- const httpMethods = classMirrorWrapper.getMethodsByAnnotation(`http${httpMethodKey}`);
47
- if (!httpMethods.length) {
48
- return;
49
- }
50
- // We can assume there is at most one method per annotation, as this is an Apex rule.
51
- const httpMethod = httpMethods[0];
52
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey] = {};
53
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].tags = [tag];
54
- if ((_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
55
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].description = httpMethod.docComment.description;
56
- }
57
- const methodMirrorWrapper = new MethodMirrorWrapper_1.MethodMirrorWrapper(httpMethod);
58
- if (methodMirrorWrapper.hasDocCommentAnnotation('summary')) {
59
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].summary =
60
- (_b = methodMirrorWrapper.getDocCommentAnnotation('summary')) === null || _b === void 0 ? void 0 : _b.body;
61
- }
62
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-request-body', this.addRequestBodyToOpenApi.bind(this), this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey));
63
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-parameter', this.addParametersToOpenApi.bind(this));
64
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-response', this.addHttpResponsesToOpenApi.bind(this), this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey));
65
- }
66
- parseHttpAnnotation(httpMethod, urlValue, httpMethodKey, annotationName, addToOpenApi, fallbackParser) {
67
- var _a;
68
- const annotations = (_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((annotation) => annotation.name === annotationName);
69
- if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
70
- if (fallbackParser) {
71
- fallbackParser(httpMethod);
72
- }
73
- return;
74
- }
75
- for (const annotation of annotations) {
76
- // We expect the ApexDoc data representing this to be in YAML format.
77
- const inYaml = annotation === null || annotation === void 0 ? void 0 : annotation.bodyLines.reduce((prev, current) => prev + '\n' + current);
78
- if (!inYaml) {
79
- return;
80
- }
81
- this.addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi);
82
- }
83
- }
84
- addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi) {
85
- // Convert the YAML into a JSON object.
86
- const inJson = yaml.load(inYaml);
87
- const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(inJson);
88
- addToOpenApi(inJson, urlValue, httpMethodKey);
89
- this.addReference(requestBodyResponse);
90
- }
91
- addRequestBodyToOpenApi(input, urlValue, httpMethodKey) {
92
- const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(input);
93
- this.openApiModel.paths[urlValue][httpMethodKey].requestBody = requestBodyResponse.body;
94
- }
95
- addParametersToOpenApi(input, urlValue, httpMethodKey) {
96
- const parameterObjectResponse = new ParameterObjectBuilder_1.ParameterObjectBuilder().build(input);
97
- if (this.openApiModel.paths[urlValue][httpMethodKey].parameters === undefined) {
98
- // If no parameters have been defined yet, initialize the list.
99
- this.openApiModel.paths[urlValue][httpMethodKey].parameters = [];
100
- }
101
- this.openApiModel.paths[urlValue][httpMethodKey].parameters.push(parameterObjectResponse.body);
102
- }
103
- addHttpResponsesToOpenApi(input, urlValue, httpMethodKey) {
104
- const responseObjectResponse = new ResponsesBuilder_1.ResponsesBuilder().build(input);
105
- if (this.openApiModel.paths[urlValue][httpMethodKey].responses === undefined) {
106
- this.openApiModel.paths[urlValue][httpMethodKey].responses = {};
107
- }
108
- this.openApiModel.paths[urlValue][httpMethodKey].responses[input.statusCode] = responseObjectResponse.body;
109
- }
110
- fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey) {
111
- return (methodMirror) => {
112
- // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
113
- // object, with each key of the object being the parameter name.
114
- const parameters = methodMirror.parameters;
115
- if (!parameters.length) {
116
- return;
117
- }
118
- const propertiesObject = {};
119
- parameters.forEach((currentParameter) => {
120
- const propertyKey = currentParameter.name;
121
- const propertyReference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(currentParameter.typeReference);
122
- propertiesObject[propertyKey] = propertyReference.schema;
123
- this.addReference({
124
- reference: {
125
- entrypointReferenceObject: propertyReference.schema,
126
- referenceComponents: propertyReference.referenceComponents,
127
- },
128
- });
129
- });
130
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].requestBody = {
131
- content: {
132
- 'application/json': {
133
- schema: {
134
- type: 'object',
135
- properties: propertiesObject,
136
- },
137
- },
138
- },
139
- };
140
- };
141
- }
142
- getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey) {
143
- return (methodMirror) => {
144
- var _a, _b;
145
- // Parses methods that return an object (as opposed to void).
146
- const returnType = methodMirror.typeReference;
147
- if (returnType.type.toLowerCase() === 'void') {
148
- return;
149
- }
150
- const reference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(returnType);
151
- this.addReference({
152
- reference: {
153
- entrypointReferenceObject: reference.schema,
154
- referenceComponents: reference.referenceComponents,
155
- },
156
- });
157
- if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses === undefined) {
158
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses = {};
159
- }
160
- // Successful responses with a non-void return type always return a status code of 2000
161
- this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses['200'] = {
162
- description: (_b = (_a = methodMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : 'Status code 200',
163
- content: {
164
- 'application/json': { schema: reference.schema },
165
- },
166
- };
167
- };
168
- }
169
- addReference(referenceHolder) {
170
- if (referenceHolder.reference) {
171
- // If a reference is returned, we want to make sure to add it to the OpenApi object as well
172
- // Add to "component" section if it hasn't been already
173
- if (this.openApiModel.components === undefined) {
174
- this.openApiModel.components = {
175
- schemas: {},
176
- };
177
- }
178
- if (!referenceHolder.reference.referenceComponents.length) {
179
- return;
180
- }
181
- // Add all received references to the OpenApi components section.
182
- referenceHolder.reference.referenceComponents.forEach((current) => {
183
- // Check if the referenced object is already part of the OpenApi object
184
- this.openApiModel.components.schemas[current.referencedClass] = current.schema;
185
- });
186
- }
187
- }
188
- }
189
- exports.MethodParser = MethodParser;
190
- //# sourceMappingURL=MethodParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MethodParser.js","sourceRoot":"","sources":["../../../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AED,uFAAuF;YACvF,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAE,CAAC,SAAU,CAAC,KAAK,CAAC,GAAG;gBAC3E,WAAW,EAAE,MAAA,MAAA,YAAY,CAAC,UAAU,0CAAE,WAAW,mCAAI,iBAAiB;gBACtE,OAAO,EAAE;oBACP,kBAAkB,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE;iBACjD;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;IAEO,YAAY,CAAC,eAA0C;QAC7D,IAAI,eAAe,CAAC,SAAS,EAAE,CAAC;YAC9B,2FAA2F;YAC3F,uDAAuD;YACvD,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC/C,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG;oBAC7B,OAAO,EAAE,EAAE;iBACZ,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC;gBAC1D,OAAO;YACT,CAAC;YAED,iEAAiE;YACjE,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAChE,uEAAuE;gBACvE,IAAI,CAAC,YAAY,CAAC,UAAW,CAAC,OAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YACnF,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/ND,oCA+NC"}
@@ -1,7 +0,0 @@
1
- import { ParameterObject } from '../../../model/openapi/open-api-types';
2
- import { Reference } from './ReferenceBuilder';
3
- import { ApexDocParameterObject } from '../../../model/openapi/apex-doc-types';
4
- import { Builder } from './Builder';
5
- export declare class ParameterObjectBuilder extends Builder<ParameterObject, ApexDocParameterObject> {
6
- buildBody(apexDocObject: ApexDocParameterObject, reference?: Reference): ParameterObject;
7
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParameterObjectBuilder = void 0;
4
- const Builder_1 = require("./Builder");
5
- class ParameterObjectBuilder extends Builder_1.Builder {
6
- buildBody(apexDocObject, reference) {
7
- return Object.assign(Object.assign({}, apexDocObject), { schema: this.getOpenApiSchemaFromApexDocSchema(apexDocObject, reference) });
8
- }
9
- }
10
- exports.ParameterObjectBuilder = ParameterObjectBuilder;
11
- //# sourceMappingURL=ParameterObjectBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParameterObjectBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ParameterObjectBuilder.ts"],"names":[],"mappings":";;;AAGA,uCAAoC;AAEpC,MAAa,sBAAuB,SAAQ,iBAAgD;IAC1F,SAAS,CAAC,aAAqC,EAAE,SAAqB;QACpE,uCACK,aAAa,KAChB,MAAM,EAAE,IAAI,CAAC,iCAAiC,CAAC,aAAa,EAAE,SAAS,CAAC,IACxE;IACJ,CAAC;CACF;AAPD,wDAOC"}
@@ -1,39 +0,0 @@
1
- import { ReferenceObject, SchemaObject, SchemaObjectArray, SchemaObjectObject } from '../../../model/openapi/open-api-types';
2
- import { ReferencedType } from '@cparra/apex-reflection';
3
- export declare class ReferenceBuilder {
4
- build(referencedTypeName: string): Reference;
5
- /**
6
- * Returns a tuple where the first value is the name of the reference without any collection related values
7
- * and the second is a boolean representing if we are dealing with a collection or not.
8
- * @param referencedTypeName The received raw type name.
9
- * @private
10
- */
11
- private handlePossibleCollectionReference;
12
- private buildReferenceFromType;
13
- private handleOverriddenSchema;
14
- private getReferenceName;
15
- private buildMainReferenceComponent;
16
- getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair;
17
- private buildCollectionPair;
18
- private isReferenceString;
19
- }
20
- type SchemaObjectReferencePair = {
21
- schema: SchemaObject;
22
- referenceComponents: ReferenceComponent[];
23
- };
24
- /**
25
- * In case where the Request Body contains a reference, this contains information about the handled reference
26
- */
27
- export type Reference = {
28
- /** OpenApi style reference object for the parent caller */
29
- entrypointReferenceObject: ReferenceObject;
30
- /** List of objects that contain all component references identified by a call to this builder **/
31
- referenceComponents: ReferenceComponent[];
32
- };
33
- export type ReferenceComponent = {
34
- /** Name of the class being referenced */
35
- referencedClass: string;
36
- /** Parsed representation of the referenced object as an OpenApi Schema object */
37
- schema: SchemaObjectObject | SchemaObjectArray;
38
- };
39
- export {};