@cparra/apexdocs 2.24.0 → 2.25.0-alpha.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 (317) hide show
  1. package/.eslintrc.js +12 -12
  2. package/.github/workflows/ci.yaml +22 -0
  3. package/.github/workflows/close_stale.yml +22 -22
  4. package/.prettierrc.js +7 -7
  5. package/LICENSE +21 -21
  6. package/README.md +742 -718
  7. package/apexdocs.config.ts +13 -13
  8. package/docs/{README.md → __old/README.md} +1 -1
  9. package/docs/{restapi.json → __old/restapi.json} +589 -589
  10. package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
  11. package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
  12. package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
  13. package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
  14. package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
  15. package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
  16. package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
  17. package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
  18. package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
  19. package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
  20. package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
  21. package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
  22. package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
  23. package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
  24. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
  25. package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
  26. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
  27. package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
  28. package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
  29. package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
  30. package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
  31. package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
  32. package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
  33. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
  34. package/examples/includes/header.md +3 -3
  35. package/examples/plain-markdown/.forceignore +12 -0
  36. package/examples/plain-markdown/README.md +301 -0
  37. package/examples/plain-markdown/config/project-scratch-def.json +5 -0
  38. package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
  39. package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
  40. package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
  41. package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
  42. package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
  43. package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
  44. package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
  45. package/examples/plain-markdown/package-lock.json +665 -0
  46. package/examples/plain-markdown/package.json +24 -0
  47. package/examples/plain-markdown/sfdx-project.json +12 -0
  48. package/examples/plain-markdown/template.md +3 -0
  49. package/jest.config.js +5 -5
  50. package/lib/adapters/apex-types.d.ts +5 -0
  51. package/lib/adapters/apex-types.js +34 -0
  52. package/lib/adapters/apex-types.js.map +1 -0
  53. package/lib/adapters/documentables.d.ts +6 -0
  54. package/lib/adapters/documentables.js +41 -0
  55. package/lib/adapters/documentables.js.map +1 -0
  56. package/lib/adapters/fields-and-properties.d.ts +3 -0
  57. package/lib/adapters/fields-and-properties.js +10 -0
  58. package/lib/adapters/fields-and-properties.js.map +1 -0
  59. package/lib/adapters/methods-and-constructors.d.ts +4 -0
  60. package/lib/adapters/methods-and-constructors.js +49 -0
  61. package/lib/adapters/methods-and-constructors.js.map +1 -0
  62. package/lib/adapters/references.d.ts +5 -0
  63. package/lib/adapters/references.js +82 -0
  64. package/lib/adapters/references.js.map +1 -0
  65. package/lib/adapters/type-utils.d.ts +2 -0
  66. package/lib/adapters/type-utils.js +8 -0
  67. package/lib/adapters/type-utils.js.map +1 -0
  68. package/lib/application/Apexdocs.d.ts +13 -13
  69. package/lib/application/Apexdocs.js +79 -76
  70. package/lib/application/Apexdocs.js.map +1 -1
  71. package/lib/cli/generate.d.ts +2 -2
  72. package/lib/cli/generate.js +156 -130
  73. package/lib/cli/generate.js.map +1 -1
  74. package/lib/index.d.ts +1 -1
  75. package/lib/index.js +17 -17
  76. package/lib/model/apex-bundle.d.ts +6 -6
  77. package/lib/model/apex-bundle.js +10 -10
  78. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
  79. package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
  80. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
  81. package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
  82. package/lib/model/inheritance.d.ts +8 -8
  83. package/lib/model/inheritance.js +2 -2
  84. package/lib/model/manifest.d.ts +22 -22
  85. package/lib/model/manifest.js +46 -46
  86. package/lib/model/manifest.js.map +1 -1
  87. package/lib/model/markdown-file.d.ts +16 -16
  88. package/lib/model/markdown-file.js +109 -106
  89. package/lib/model/markdown-file.js.map +1 -1
  90. package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
  91. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
  92. package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
  93. package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
  94. package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
  95. package/lib/model/markdown-generation-util/index.d.ts +3 -3
  96. package/lib/model/markdown-generation-util/index.js +19 -19
  97. package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
  98. package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
  99. package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
  100. package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
  101. package/lib/model/markdown-home-file.d.ts +11 -11
  102. package/lib/model/markdown-home-file.js +56 -53
  103. package/lib/model/markdown-home-file.js.map +1 -1
  104. package/lib/model/markdown-type-file.d.ts +26 -26
  105. package/lib/model/markdown-type-file.js +136 -133
  106. package/lib/model/markdown-type-file.js.map +1 -1
  107. package/lib/model/openapi/apex-doc-types.d.ts +19 -19
  108. package/lib/model/openapi/apex-doc-types.js +4 -4
  109. package/lib/model/openapi/open-api-types.d.ts +93 -93
  110. package/lib/model/openapi/open-api-types.js +2 -2
  111. package/lib/model/openapi/open-api.d.ts +16 -16
  112. package/lib/model/openapi/open-api.js +33 -33
  113. package/lib/model/openapi/openapi-type-file.d.ts +7 -7
  114. package/lib/model/openapi/openapi-type-file.js +16 -16
  115. package/lib/model/outputFile.d.ts +10 -10
  116. package/lib/model/outputFile.js +28 -28
  117. package/lib/model/types-repository.d.ts +16 -16
  118. package/lib/model/types-repository.js +53 -53
  119. package/lib/service/apex-file-reader.d.ts +14 -14
  120. package/lib/service/apex-file-reader.js +48 -45
  121. package/lib/service/apex-file-reader.js.map +1 -1
  122. package/lib/service/file-system.d.ts +14 -14
  123. package/lib/service/file-system.js +47 -24
  124. package/lib/service/file-system.js.map +1 -1
  125. package/lib/service/file-writer.d.ts +6 -6
  126. package/lib/service/file-writer.js +56 -33
  127. package/lib/service/file-writer.js.map +1 -1
  128. package/lib/service/manifest-factory.d.ts +10 -10
  129. package/lib/service/manifest-factory.js +16 -13
  130. package/lib/service/manifest-factory.js.map +1 -1
  131. package/lib/service/metadata-processor.d.ts +3 -3
  132. package/lib/service/metadata-processor.js +16 -16
  133. package/lib/service/parser.d.ts +21 -21
  134. package/lib/service/parser.js +137 -134
  135. package/lib/service/parser.js.map +1 -1
  136. package/lib/service/state.d.ts +9 -9
  137. package/lib/service/state.js +19 -19
  138. package/lib/service/walkers/class-walker.d.ts +4 -4
  139. package/lib/service/walkers/class-walker.js +32 -32
  140. package/lib/service/walkers/enum-walker.d.ts +4 -4
  141. package/lib/service/walkers/enum-walker.js +10 -10
  142. package/lib/service/walkers/interface-walker.d.ts +4 -4
  143. package/lib/service/walkers/interface-walker.js +14 -14
  144. package/lib/service/walkers/walker-factory.d.ts +5 -5
  145. package/lib/service/walkers/walker-factory.js +20 -20
  146. package/lib/service/walkers/walker.d.ts +19 -19
  147. package/lib/service/walkers/walker.js +16 -16
  148. package/lib/settings.d.ts +70 -64
  149. package/lib/settings.js +99 -88
  150. package/lib/settings.js.map +1 -1
  151. package/lib/templating/compile.d.ts +7 -0
  152. package/lib/templating/compile.js +98 -0
  153. package/lib/templating/compile.js.map +1 -0
  154. package/lib/templating/helpers.d.ts +2 -0
  155. package/lib/templating/helpers.js +18 -0
  156. package/lib/templating/helpers.js.map +1 -0
  157. package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
  158. package/lib/test-helpers/AnnotationBuilder.js +30 -30
  159. package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
  160. package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
  161. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
  162. package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
  163. package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
  164. package/lib/test-helpers/DocCommentBuilder.js +37 -37
  165. package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
  166. package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
  167. package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
  168. package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
  169. package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
  170. package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
  171. package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
  172. package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
  173. package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
  174. package/lib/test-helpers/SettingsBuilder.js +26 -26
  175. package/lib/transpiler/factory.d.ts +6 -6
  176. package/lib/transpiler/factory.js +34 -31
  177. package/lib/transpiler/factory.js.map +1 -1
  178. package/lib/transpiler/file-container.d.ts +6 -6
  179. package/lib/transpiler/file-container.js +15 -15
  180. package/lib/transpiler/generator-choices.d.ts +1 -1
  181. package/lib/transpiler/generator-choices.js +2 -2
  182. package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
  183. package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
  184. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  185. package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
  186. package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
  187. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
  188. package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
  189. package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
  190. package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
  191. package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
  192. package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
  193. package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
  194. package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
  195. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
  196. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
  197. package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
  198. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
  199. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
  200. package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
  201. package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
  202. package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
  203. package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
  204. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
  205. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
  206. package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
  207. package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
  208. package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
  209. package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
  210. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
  211. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
  212. package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
  213. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
  214. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
  215. package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
  216. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
  217. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
  218. package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
  219. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
  220. package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
  221. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  222. package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
  223. package/lib/transpiler/openapi/parsers/Builder.js +29 -29
  224. package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
  225. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
  226. package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
  227. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  228. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
  229. package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
  230. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
  231. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
  232. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  233. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
  234. package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
  235. package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
  236. package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
  237. package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
  238. package/lib/transpiler/processor-type-transpiler.js +8 -8
  239. package/lib/transpiler/transpiler.d.ts +5 -5
  240. package/lib/transpiler/transpiler.js +29 -26
  241. package/lib/transpiler/transpiler.js.map +1 -1
  242. package/lib/util/error-logger.d.ts +8 -8
  243. package/lib/util/error-logger.js +89 -89
  244. package/lib/util/error-logger.js.map +1 -1
  245. package/lib/util/logger.d.ts +21 -21
  246. package/lib/util/logger.js +60 -57
  247. package/lib/util/logger.js.map +1 -1
  248. package/lib/util/string-utils.d.ts +2 -2
  249. package/lib/util/string-utils.js +14 -14
  250. package/package.json +79 -78
  251. package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
  252. package/src/adapters/__tests__/references.spec.ts +115 -0
  253. package/src/adapters/apex-types.ts +67 -0
  254. package/src/adapters/documentables.ts +58 -0
  255. package/src/adapters/fields-and-properties.ts +14 -0
  256. package/src/adapters/methods-and-constructors.ts +78 -0
  257. package/src/adapters/references.ts +113 -0
  258. package/src/adapters/type-utils.ts +5 -0
  259. package/src/adapters/types.d.ts +8 -0
  260. package/src/cli/generate.ts +3 -0
  261. package/src/model/__tests__/manifest.spec.ts +1 -0
  262. package/src/model/manifest.ts +3 -3
  263. package/src/model/markdown-file.ts +1 -1
  264. package/src/model/openapi/open-api-types.ts +2 -2
  265. package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
  266. package/src/service/__tests__/manifest-factory.spec.ts +1 -2
  267. package/src/settings.ts +15 -0
  268. package/src/templating/__tests__/compile.spec.ts +741 -0
  269. package/src/templating/compile.ts +187 -0
  270. package/src/templating/helpers.ts +14 -0
  271. package/src/templating/types.d.ts +104 -0
  272. package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
  273. package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
  274. package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
  275. package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
  276. package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
  277. package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
  278. package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
  279. package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
  280. package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
  281. package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
  282. package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
  283. package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
  284. package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
  285. package/src/transpiler/openapi/parsers/Builder.ts +1 -1
  286. package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
  287. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
  288. package/src/util/error-logger.ts +4 -4
  289. package/src/util/logger.ts +3 -3
  290. package/tsconfig.json +21 -20
  291. package/tslint.json +5 -5
  292. package/lib/model/manifest-diff.d.ts +0 -27
  293. package/lib/model/manifest-diff.js +0 -69
  294. package/lib/model/manifest-diff.js.map +0 -1
  295. package/src/model/__tests__/manifest-diff.spec.ts +0 -139
  296. package/src/model/manifest-diff.ts +0 -94
  297. /package/docs/{index.html → __old/index.html} +0 -0
  298. /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
  299. /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
  300. /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
  301. /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
  302. /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
  303. /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
  304. /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
  305. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
  306. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
  307. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
  308. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
  309. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
  310. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
  311. /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
  312. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
  313. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
  314. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
  315. /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
  316. /package/docs/{types → __old/types}/README.md +0 -0
  317. /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
@@ -1,34 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenApi = void 0;
4
- const OPEN_API_VERSION = '3.1.0';
5
- const SERVER_URL = '/services/apexrest/';
6
- /**
7
- * Represents the OpenApi 3.1.0 spec
8
- * https://spec.openapis.org/oas/v3.1.0
9
- */
10
- class OpenApi {
11
- constructor(title, version, namespace) {
12
- this.namespace = namespace;
13
- this.openapi = OPEN_API_VERSION;
14
- this.info = {
15
- title: title,
16
- version: version,
17
- };
18
- this.servers = [
19
- {
20
- url: this.getServerUrl(),
21
- },
22
- ];
23
- this.paths = {};
24
- this.tags = [];
25
- }
26
- getServerUrl() {
27
- if (!this.namespace) {
28
- return SERVER_URL;
29
- }
30
- return `${SERVER_URL}${this.namespace}/`;
31
- }
32
- }
33
- exports.OpenApi = OpenApi;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenApi = void 0;
4
+ const OPEN_API_VERSION = '3.1.0';
5
+ const SERVER_URL = '/services/apexrest/';
6
+ /**
7
+ * Represents the OpenApi 3.1.0 spec
8
+ * https://spec.openapis.org/oas/v3.1.0
9
+ */
10
+ class OpenApi {
11
+ constructor(title, version, namespace) {
12
+ this.namespace = namespace;
13
+ this.openapi = OPEN_API_VERSION;
14
+ this.info = {
15
+ title: title,
16
+ version: version,
17
+ };
18
+ this.servers = [
19
+ {
20
+ url: this.getServerUrl(),
21
+ },
22
+ ];
23
+ this.paths = {};
24
+ this.tags = [];
25
+ }
26
+ getServerUrl() {
27
+ if (!this.namespace) {
28
+ return SERVER_URL;
29
+ }
30
+ return `${SERVER_URL}${this.namespace}/`;
31
+ }
32
+ }
33
+ exports.OpenApi = OpenApi;
34
34
  //# sourceMappingURL=open-api.js.map
@@ -1,7 +1,7 @@
1
- import { OutputFile } from '../outputFile';
2
- import { OpenApi } from './open-api';
3
- export declare class OpenapiTypeFile extends OutputFile {
4
- openApiModel: OpenApi;
5
- constructor(openApiModel: OpenApi);
6
- fileExtension(): string;
7
- }
1
+ import { OutputFile } from '../outputFile';
2
+ import { OpenApi } from './open-api';
3
+ export declare class OpenapiTypeFile extends OutputFile {
4
+ openApiModel: OpenApi;
5
+ constructor(openApiModel: OpenApi);
6
+ fileExtension(): string;
7
+ }
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenapiTypeFile = void 0;
4
- const outputFile_1 = require("../outputFile");
5
- const settings_1 = require("../../settings");
6
- class OpenapiTypeFile extends outputFile_1.OutputFile {
7
- constructor(openApiModel) {
8
- super(settings_1.Settings.getInstance().openApiFileName(), '');
9
- this.openApiModel = openApiModel;
10
- this.addText(JSON.stringify(Object.assign(Object.assign({}, openApiModel), { namespace: undefined }), null, 2));
11
- }
12
- fileExtension() {
13
- return '.json';
14
- }
15
- }
16
- exports.OpenapiTypeFile = OpenapiTypeFile;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenapiTypeFile = void 0;
4
+ const outputFile_1 = require("../outputFile");
5
+ const settings_1 = require("../../settings");
6
+ class OpenapiTypeFile extends outputFile_1.OutputFile {
7
+ constructor(openApiModel) {
8
+ super(settings_1.Settings.getInstance().openApiFileName(), '');
9
+ this.openApiModel = openApiModel;
10
+ this.addText(JSON.stringify(Object.assign(Object.assign({}, openApiModel), { namespace: undefined }), null, 2));
11
+ }
12
+ fileExtension() {
13
+ return '.json';
14
+ }
15
+ }
16
+ exports.OpenapiTypeFile = OpenapiTypeFile;
17
17
  //# sourceMappingURL=openapi-type-file.js.map
@@ -1,10 +1,10 @@
1
- export declare abstract class OutputFile {
2
- fileName: string;
3
- dir: string;
4
- _contents: string;
5
- constructor(fileName: string, dir: string);
6
- abstract fileExtension(): string;
7
- get body(): string;
8
- addText(text: string, encodeHtml?: boolean): void;
9
- addBlankLine(): void;
10
- }
1
+ export declare abstract class OutputFile {
2
+ fileName: string;
3
+ dir: string;
4
+ _contents: string;
5
+ constructor(fileName: string, dir: string);
6
+ abstract fileExtension(): string;
7
+ get body(): string;
8
+ addText(text: string, encodeHtml?: boolean): void;
9
+ addBlankLine(): void;
10
+ }
@@ -1,29 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OutputFile = void 0;
4
- const xss = require("xss");
5
- const settings_1 = require("../settings");
6
- const xssFilter = new xss.FilterXSS({
7
- whiteList: { br: [], p: [], ul: [], li: [], code: [], pre: [] },
8
- });
9
- class OutputFile {
10
- constructor(fileName, dir) {
11
- this.fileName = fileName;
12
- this.dir = dir;
13
- this._contents = '';
14
- }
15
- get body() {
16
- return this._contents;
17
- }
18
- addText(text, encodeHtml = true) {
19
- const shouldEncode = encodeHtml && settings_1.Settings.getInstance().sanitizeHtml;
20
- const textToAdd = shouldEncode ? xssFilter.process(text) : text;
21
- this._contents += textToAdd;
22
- this.addBlankLine();
23
- }
24
- addBlankLine() {
25
- this._contents += '\n';
26
- }
27
- }
28
- exports.OutputFile = OutputFile;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OutputFile = void 0;
4
+ const xss = require("xss");
5
+ const settings_1 = require("../settings");
6
+ const xssFilter = new xss.FilterXSS({
7
+ whiteList: { br: [], p: [], ul: [], li: [], code: [], pre: [] },
8
+ });
9
+ class OutputFile {
10
+ constructor(fileName, dir) {
11
+ this.fileName = fileName;
12
+ this.dir = dir;
13
+ this._contents = '';
14
+ }
15
+ get body() {
16
+ return this._contents;
17
+ }
18
+ addText(text, encodeHtml = true) {
19
+ const shouldEncode = encodeHtml && settings_1.Settings.getInstance().sanitizeHtml;
20
+ const textToAdd = shouldEncode ? xssFilter.process(text) : text;
21
+ this._contents += textToAdd;
22
+ this.addBlankLine();
23
+ }
24
+ addBlankLine() {
25
+ this._contents += '\n';
26
+ }
27
+ }
28
+ exports.OutputFile = OutputFile;
29
29
  //# sourceMappingURL=outputFile.js.map
@@ -1,16 +1,16 @@
1
- import { Type } from '@cparra/apex-reflection';
2
- export type TypeBundle = {
3
- type: Type;
4
- isChild: boolean;
5
- parentType?: Type;
6
- };
7
- export declare class TypesRepository {
8
- private static instance;
9
- private scopedTypes;
10
- private allTypes;
11
- static getInstance(): TypesRepository;
12
- populateAll(types: Type[]): void;
13
- getFromAllByName(typeName: string): TypeBundle | undefined;
14
- populateScoped(types: Type[]): void;
15
- getFromScopedByName(typeName: string): Type | undefined;
16
- }
1
+ import { Type } from '@cparra/apex-reflection';
2
+ export type TypeBundle = {
3
+ type: Type;
4
+ isChild: boolean;
5
+ parentType?: Type;
6
+ };
7
+ export declare class TypesRepository {
8
+ private static instance;
9
+ private scopedTypes;
10
+ private allTypes;
11
+ static getInstance(): TypesRepository;
12
+ populateAll(types: Type[]): void;
13
+ getFromAllByName(typeName: string): TypeBundle | undefined;
14
+ populateScoped(types: Type[]): void;
15
+ getFromScopedByName(typeName: string): Type | undefined;
16
+ }
@@ -1,54 +1,54 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TypesRepository = void 0;
4
- class TypesRepository {
5
- constructor() {
6
- this.scopedTypes = [];
7
- this.allTypes = [];
8
- }
9
- static getInstance() {
10
- if (!TypesRepository.instance) {
11
- TypesRepository.instance = new TypesRepository();
12
- }
13
- return TypesRepository.instance;
14
- }
15
- populateAll(types) {
16
- this.allTypes = types;
17
- }
18
- getFromAllByName(typeName) {
19
- if (typeName.includes('.')) {
20
- // If it includes a dot we are assuming we are dealing with an inner class.
21
- const [parentTypeName, childTypeName] = typeName.split('.');
22
- const parentReference = this.allTypes.find((currentType) => currentType.name.toLowerCase() === parentTypeName.toLowerCase());
23
- if (!parentReference || parentReference.type_name !== 'class') {
24
- // If the parent is not found, no reason to keep searching, instead we return undefined.
25
- // Similarly, if the parent is not a class, it means it cannot have children, so we return early.
26
- return undefined;
27
- }
28
- const parentReferenceAsClass = parentReference;
29
- const childTypes = [
30
- ...parentReferenceAsClass.classes,
31
- ...parentReferenceAsClass.interfaces,
32
- ...parentReferenceAsClass.enums,
33
- ];
34
- const foundType = childTypes.find((currentType) => currentType.name.toLowerCase() === childTypeName);
35
- if (!foundType) {
36
- return undefined;
37
- }
38
- return { type: foundType, isChild: true, parentType: parentReference };
39
- }
40
- const foundType = this.allTypes.find((currentType) => currentType.name.toLowerCase() === typeName.toLowerCase());
41
- if (!foundType) {
42
- return undefined;
43
- }
44
- return { type: foundType, isChild: false };
45
- }
46
- populateScoped(types) {
47
- this.scopedTypes = types;
48
- }
49
- getFromScopedByName(typeName) {
50
- return this.scopedTypes.find((currentType) => currentType.name === typeName);
51
- }
52
- }
53
- exports.TypesRepository = TypesRepository;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypesRepository = void 0;
4
+ class TypesRepository {
5
+ constructor() {
6
+ this.scopedTypes = [];
7
+ this.allTypes = [];
8
+ }
9
+ static getInstance() {
10
+ if (!TypesRepository.instance) {
11
+ TypesRepository.instance = new TypesRepository();
12
+ }
13
+ return TypesRepository.instance;
14
+ }
15
+ populateAll(types) {
16
+ this.allTypes = types;
17
+ }
18
+ getFromAllByName(typeName) {
19
+ if (typeName.includes('.')) {
20
+ // If it includes a dot we are assuming we are dealing with an inner class.
21
+ const [parentTypeName, childTypeName] = typeName.split('.');
22
+ const parentReference = this.allTypes.find((currentType) => currentType.name.toLowerCase() === parentTypeName.toLowerCase());
23
+ if (!parentReference || parentReference.type_name !== 'class') {
24
+ // If the parent is not found, no reason to keep searching, instead we return undefined.
25
+ // Similarly, if the parent is not a class, it means it cannot have children, so we return early.
26
+ return undefined;
27
+ }
28
+ const parentReferenceAsClass = parentReference;
29
+ const childTypes = [
30
+ ...parentReferenceAsClass.classes,
31
+ ...parentReferenceAsClass.interfaces,
32
+ ...parentReferenceAsClass.enums,
33
+ ];
34
+ const foundType = childTypes.find((currentType) => currentType.name.toLowerCase() === childTypeName);
35
+ if (!foundType) {
36
+ return undefined;
37
+ }
38
+ return { type: foundType, isChild: true, parentType: parentReference };
39
+ }
40
+ const foundType = this.allTypes.find((currentType) => currentType.name.toLowerCase() === typeName.toLowerCase());
41
+ if (!foundType) {
42
+ return undefined;
43
+ }
44
+ return { type: foundType, isChild: false };
45
+ }
46
+ populateScoped(types) {
47
+ this.scopedTypes = types;
48
+ }
49
+ getFromScopedByName(typeName) {
50
+ return this.scopedTypes.find((currentType) => currentType.name === typeName);
51
+ }
52
+ }
53
+ exports.TypesRepository = TypesRepository;
54
54
  //# sourceMappingURL=types-repository.js.map
@@ -1,14 +1,14 @@
1
- import { FileSystem } from './file-system';
2
- import ApexBundle from '../model/apex-bundle';
3
- /**
4
- * Reads from .cls files and returns their raw body.
5
- */
6
- export declare class ApexFileReader {
7
- /**
8
- * Reads from .cls files and returns their raw body.
9
- */
10
- static processFiles(fileSystem: FileSystem, rootPath?: string): ApexBundle[];
11
- private static isApexFile;
12
- private static get sourceDirectory();
13
- private static get readRecursively();
14
- }
1
+ import { FileSystem } from './file-system';
2
+ import ApexBundle from '../model/apex-bundle';
3
+ /**
4
+ * Reads from .cls files and returns their raw body.
5
+ */
6
+ export declare class ApexFileReader {
7
+ /**
8
+ * Reads from .cls files and returns their raw body.
9
+ */
10
+ static processFiles(fileSystem: FileSystem, rootPath?: string): ApexBundle[];
11
+ private static isApexFile;
12
+ private static get sourceDirectory();
13
+ private static get readRecursively();
14
+ }
@@ -1,46 +1,49 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApexFileReader = void 0;
4
- const settings_1 = require("../settings");
5
- const apex_bundle_1 = require("../model/apex-bundle");
6
- const APEX_FILE_EXTENSION = '.cls';
7
- /**
8
- * Reads from .cls files and returns their raw body.
9
- */
10
- class ApexFileReader {
11
- /**
12
- * Reads from .cls files and returns their raw body.
13
- */
14
- static processFiles(fileSystem, rootPath = this.sourceDirectory) {
15
- let bundles = [];
16
- const directoryContents = fileSystem.readDirectory(rootPath);
17
- directoryContents.forEach((currentFilePath) => {
18
- const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
19
- if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
20
- bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
21
- }
22
- if (!this.isApexFile(currentFilePath)) {
23
- return;
24
- }
25
- const rawApexFile = fileSystem.readFile(currentPath);
26
- const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
27
- let rawMetadataFile = null;
28
- if (settings_1.Settings.getInstance().includeMetadata()) {
29
- rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
30
- }
31
- bundles.push(new apex_bundle_1.default(currentFilePath, rawApexFile, rawMetadataFile));
32
- });
33
- return bundles;
34
- }
35
- static isApexFile(currentFile) {
36
- return currentFile.endsWith(APEX_FILE_EXTENSION);
37
- }
38
- static get sourceDirectory() {
39
- return settings_1.Settings.getInstance().sourceDirectory;
40
- }
41
- static get readRecursively() {
42
- return settings_1.Settings.getInstance().recursive;
43
- }
44
- }
45
- exports.ApexFileReader = ApexFileReader;
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.ApexFileReader = void 0;
7
+ const settings_1 = require("../settings");
8
+ const apex_bundle_1 = __importDefault(require("../model/apex-bundle"));
9
+ const APEX_FILE_EXTENSION = '.cls';
10
+ /**
11
+ * Reads from .cls files and returns their raw body.
12
+ */
13
+ class ApexFileReader {
14
+ /**
15
+ * Reads from .cls files and returns their raw body.
16
+ */
17
+ static processFiles(fileSystem, rootPath = this.sourceDirectory) {
18
+ let bundles = [];
19
+ const directoryContents = fileSystem.readDirectory(rootPath);
20
+ directoryContents.forEach((currentFilePath) => {
21
+ const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
22
+ if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
23
+ bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
24
+ }
25
+ if (!this.isApexFile(currentFilePath)) {
26
+ return;
27
+ }
28
+ const rawApexFile = fileSystem.readFile(currentPath);
29
+ const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
30
+ let rawMetadataFile = null;
31
+ if (settings_1.Settings.getInstance().includeMetadata()) {
32
+ rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
33
+ }
34
+ bundles.push(new apex_bundle_1.default(currentFilePath, rawApexFile, rawMetadataFile));
35
+ });
36
+ return bundles;
37
+ }
38
+ static isApexFile(currentFile) {
39
+ return currentFile.endsWith(APEX_FILE_EXTENSION);
40
+ }
41
+ static get sourceDirectory() {
42
+ return settings_1.Settings.getInstance().sourceDirectory;
43
+ }
44
+ static get readRecursively() {
45
+ return settings_1.Settings.getInstance().recursive;
46
+ }
47
+ }
48
+ exports.ApexFileReader = ApexFileReader;
46
49
  //# sourceMappingURL=apex-file-reader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apex-file-reader.js","sourceRoot":"","sources":["../../src/service/apex-file-reader.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAEvC,sDAA8C;AAE9C,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,UAAsB,EAAE,WAAmB,IAAI,CAAC,eAAe;QACjF,IAAI,OAAO,GAAiB,EAAE,CAAC;QAE/B,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7D,iBAAiB,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;YACnE,IAAI,IAAI,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;gBAC/D,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;aACtE;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;gBACrC,OAAO;aACR;YAED,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,eAAe,WAAW,CAAC,CAAC;YAClF,IAAI,eAAe,GAAG,IAAI,CAAC;YAC3B,IAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,EAAE;gBAC5C,eAAe,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;aAC9F;YAED,OAAO,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,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;AAzCD,wCAyCC"}
1
+ {"version":3,"file":"apex-file-reader.js","sourceRoot":"","sources":["../../src/service/apex-file-reader.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAuC;AAEvC,uEAA8C;AAE9C,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAa,cAAc;IACzB;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,UAAsB,EAAE,WAAmB,IAAI,CAAC,eAAe;QACjF,IAAI,OAAO,GAAiB,EAAE,CAAC;QAE/B,MAAM,iBAAiB,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7D,iBAAiB,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,EAAE;YAC5C,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;YACnE,IAAI,IAAI,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;gBAC/D,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC;aACtE;YAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE;gBACrC,OAAO;aACR;YAED,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACrD,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,eAAe,WAAW,CAAC,CAAC;YAClF,IAAI,eAAe,GAAG,IAAI,CAAC;YAC3B,IAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,EAAE;gBAC5C,eAAe,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;aAC9F;YAED,OAAO,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;QAC9E,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,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;AAzCD,wCAyCC"}
@@ -1,14 +1,14 @@
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
- exists: (path: string) => boolean;
7
- }
8
- export declare class DefaultFileSystem implements FileSystem {
9
- isDirectory(pathToRead: string): boolean;
10
- readDirectory(sourceDirectory: string): string[];
11
- readFile(pathToRead: string): string;
12
- joinPath(...paths: string[]): string;
13
- exists(path: string): boolean;
14
- }
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
+ exists: (path: string) => boolean;
7
+ }
8
+ export declare class DefaultFileSystem implements FileSystem {
9
+ isDirectory(pathToRead: string): boolean;
10
+ readDirectory(sourceDirectory: string): string[];
11
+ readFile(pathToRead: string): string;
12
+ joinPath(...paths: string[]): string;
13
+ exists(path: string): boolean;
14
+ }
@@ -1,25 +1,48 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultFileSystem = void 0;
4
- const fs = require("fs");
5
- const path = require("path");
6
- class DefaultFileSystem {
7
- isDirectory(pathToRead) {
8
- return fs.statSync(pathToRead).isDirectory();
9
- }
10
- readDirectory(sourceDirectory) {
11
- return fs.readdirSync(sourceDirectory);
12
- }
13
- readFile(pathToRead) {
14
- const rawFile = fs.readFileSync(pathToRead);
15
- return rawFile.toString();
16
- }
17
- joinPath(...paths) {
18
- return path.join(...paths);
19
- }
20
- exists(path) {
21
- return fs.existsSync(path);
22
- }
23
- }
24
- exports.DefaultFileSystem = DefaultFileSystem;
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.DefaultFileSystem = void 0;
27
+ const fs = __importStar(require("fs"));
28
+ const path = __importStar(require("path"));
29
+ class DefaultFileSystem {
30
+ isDirectory(pathToRead) {
31
+ return fs.statSync(pathToRead).isDirectory();
32
+ }
33
+ readDirectory(sourceDirectory) {
34
+ return fs.readdirSync(sourceDirectory);
35
+ }
36
+ readFile(pathToRead) {
37
+ const rawFile = fs.readFileSync(pathToRead);
38
+ return rawFile.toString();
39
+ }
40
+ joinPath(...paths) {
41
+ return path.join(...paths);
42
+ }
43
+ exists(path) {
44
+ return fs.existsSync(path);
45
+ }
46
+ }
47
+ exports.DefaultFileSystem = DefaultFileSystem;
25
48
  //# sourceMappingURL=file-system.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/service/file-system.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAU7B,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;IAED,MAAM,CAAC,IAAY;QACjB,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AArBD,8CAqBC"}
1
+ {"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/service/file-system.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAU7B,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;IAED,MAAM,CAAC,IAAY;QACjB,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AArBD,8CAqBC"}
@@ -1,6 +1,6 @@
1
- import { OutputFile } from '../model/outputFile';
2
- import { TargetFile } from '../settings';
3
- export declare class FileWriter {
4
- static write(files: OutputFile[], onWriteCallback: (file: TargetFile) => void): void;
5
- private static getTargetLocation;
6
- }
1
+ import { OutputFile } from '../model/outputFile';
2
+ import { TargetFile } from '../settings';
3
+ export declare class FileWriter {
4
+ static write(files: OutputFile[], onWriteCallback: (file: TargetFile) => void): void;
5
+ private static getTargetLocation;
6
+ }