@cparra/apexdocs 2.25.0-alpha.0 → 2.25.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/__mocks__/chalk.js +12 -0
- package/__mocks__/log-update.js +6 -0
- package/dist/cli/generate.js +2963 -0
- package/dist/defaults-DUwru49Q.js +12 -0
- package/dist/defaults-SH0Rsi5E.js +11 -0
- package/dist/defaults-jLXD2y8-.js +13 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +36 -0
- package/eslint.config.mjs +10 -0
- package/examples/markdown/docs/index.md +109 -0
- package/examples/markdown/docs/miscellaneous/BaseClass.md +16 -0
- package/examples/markdown/docs/miscellaneous/MultiInheritanceClass.md +72 -0
- package/examples/markdown/docs/miscellaneous/ParentInterface.md +15 -0
- package/examples/markdown/docs/miscellaneous/ReferencedEnum.md +8 -0
- package/examples/markdown/docs/miscellaneous/SampleException.md +24 -0
- package/examples/markdown/docs/miscellaneous/SampleInterface.md +112 -0
- package/examples/markdown/docs/miscellaneous/Url.md +309 -0
- package/examples/markdown/docs/sample-enums/SampleEnum.md +36 -0
- package/examples/markdown/docs/samplegroup/SampleClass.md +170 -0
- package/examples/markdown/force-app/classes/MultiInheritanceClass.cls +1 -0
- package/examples/{plain-markdown → markdown}/force-app/classes/SampleClass.cls +37 -0
- package/examples/markdown/force-app/classes/SampleException.cls +17 -0
- package/examples/markdown/force-app/classes/Url.cls +194 -0
- package/examples/{plain-markdown → markdown}/package.json +4 -8
- package/examples/vitepress/.forceignore +12 -0
- package/examples/vitepress/apexdocs.config.ts +106 -0
- package/examples/vitepress/config/project-scratch-def.json +13 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js +259 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/@theme_index.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/_metadata.json +40 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js +11474 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-574YRH25.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js +9172 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/chunk-E5DZZB2I.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/package.json +3 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4339 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +567 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js +323 -0
- package/examples/vitepress/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/examples/vitepress/docs/.vitepress/config.mts +21 -0
- package/examples/vitepress/docs/.vitepress/sidebar.json +119 -0
- package/examples/vitepress/docs/api-examples.md +49 -0
- package/examples/vitepress/docs/index-frontmatter.md +16 -0
- package/examples/vitepress/docs/index.md +56 -0
- package/examples/vitepress/docs/markdown-examples.md +85 -0
- package/examples/vitepress/docs/miscellaneous/BaseClass.md +20 -0
- package/examples/vitepress/docs/miscellaneous/MultiInheritanceClass.md +76 -0
- package/examples/vitepress/docs/miscellaneous/ParentInterface.md +19 -0
- package/examples/vitepress/docs/miscellaneous/ReferencedEnum.md +15 -0
- package/examples/vitepress/docs/miscellaneous/SampleException.md +28 -0
- package/examples/vitepress/docs/miscellaneous/SampleInterface.md +116 -0
- package/examples/vitepress/docs/miscellaneous/Url.md +317 -0
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +40 -0
- package/examples/vitepress/docs/samplegroup/SampleClass.md +174 -0
- package/examples/vitepress/force-app/main/default/classes/BaseClass.cls +3 -0
- package/examples/vitepress/force-app/main/default/classes/MultiInheritanceClass.cls +1 -0
- package/examples/vitepress/force-app/main/default/classes/ParentInterface.cls +3 -0
- package/examples/vitepress/force-app/main/default/classes/ReferencedEnum.cls +5 -0
- package/examples/vitepress/force-app/main/default/classes/SampleClass.cls +72 -0
- package/examples/vitepress/force-app/main/default/classes/SampleEnum.cls +30 -0
- package/examples/vitepress/force-app/main/default/classes/SampleException.cls +17 -0
- package/examples/vitepress/force-app/main/default/classes/SampleInterface.cls +46 -0
- package/examples/vitepress/force-app/main/default/classes/Url.cls +198 -0
- package/examples/vitepress/package-lock.json +2574 -0
- package/examples/vitepress/package.json +18 -0
- package/examples/vitepress/sfdx-project.json +12 -0
- package/jest.config.js +6 -1
- package/jest.d.ts +7 -0
- package/package.json +29 -30
- package/src/application/Apexdocs.ts +17 -70
- package/src/application/__tests__/apex-file-reader.spec.ts +104 -0
- package/src/application/apex-file-reader.ts +42 -0
- package/src/application/file-writer.ts +21 -0
- package/src/application/generators/markdown.ts +58 -0
- package/src/application/generators/openapi.ts +56 -0
- package/src/cli/args.ts +43 -0
- package/src/cli/commands/markdown.ts +52 -0
- package/src/cli/generate.ts +10 -134
- package/src/core/manifest.ts +90 -0
- package/src/core/markdown/__test__/expect-extensions.ts +32 -0
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +735 -0
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +385 -0
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +461 -0
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +180 -0
- package/src/core/markdown/__test__/inheritance-chain.test.ts +54 -0
- package/src/core/markdown/__test__/test-helpers.ts +23 -0
- package/src/core/markdown/adapters/__tests__/documentables.spec.ts +109 -0
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +148 -0
- package/src/{adapters → core/markdown/adapters}/__tests__/references.spec.ts +23 -2
- package/src/core/markdown/adapters/apex-types.ts +238 -0
- package/src/core/markdown/adapters/documentables.ts +116 -0
- package/src/core/markdown/adapters/fields-and-properties.ts +45 -0
- package/src/{adapters/references.ts → core/markdown/adapters/inline.ts} +43 -13
- package/src/core/markdown/adapters/methods-and-constructors.ts +133 -0
- package/src/core/markdown/adapters/reference-guide.ts +35 -0
- package/src/core/markdown/adapters/renderable-bundle.ts +78 -0
- package/src/core/markdown/adapters/renderable-to-page-data.ts +89 -0
- package/src/core/markdown/adapters/type-utils.ts +13 -0
- package/src/core/markdown/adapters/types.d.ts +180 -0
- package/src/core/markdown/generate-docs.ts +216 -0
- package/src/core/markdown/reflection/error-handling.ts +37 -0
- package/src/core/markdown/reflection/filter-scope.ts +13 -0
- package/src/core/markdown/reflection/inheritance-chain-expanion.ts +22 -0
- package/src/core/markdown/reflection/inheritance-chain.ts +23 -0
- package/src/core/markdown/reflection/inherited-member-expansion.ts +105 -0
- package/src/core/markdown/reflection/reflect-source.ts +45 -0
- package/src/core/markdown/reflection/sort-members.ts +59 -0
- package/src/core/markdown/templates/class-template.ts +75 -0
- package/src/core/markdown/templates/constructors-partial-template.ts +32 -0
- package/src/core/markdown/templates/documentable-partial-template.ts +26 -0
- package/src/core/markdown/templates/enum-template.ts +12 -0
- package/src/core/markdown/templates/fieldsPartialTemplate.ts +23 -0
- package/src/core/markdown/templates/grouped-members-partial-template.ts +6 -0
- package/src/core/markdown/templates/hookable.ts +7 -0
- package/src/{transpiler/markdown/plain-markdown → core/markdown/templates}/interface-template.ts +4 -4
- package/src/core/markdown/templates/methods-partial-template.ts +43 -0
- package/src/core/markdown/templates/reference-guide.ts +14 -0
- package/src/core/markdown/templates/template.ts +114 -0
- package/src/core/markdown/templates/type-doc-partial.ts +27 -0
- package/src/core/markdown/utils.ts +3 -0
- package/src/{transpiler → core}/openapi/__tests__/open-api-docs-processor.spec.ts +1 -1
- package/src/{model → core/openapi}/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +3 -3
- package/src/core/openapi/file-container.ts +13 -0
- package/src/{service → core/openapi}/manifest-factory.ts +3 -3
- package/src/{transpiler → core}/openapi/open-api-docs-processor.ts +9 -10
- package/src/core/openapi/openapi-type-file.ts +12 -0
- package/src/{service → core/openapi}/parser.ts +9 -9
- package/src/{transpiler → core}/openapi/parsers/Builder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/MethodParser.ts +5 -5
- package/src/{transpiler → core}/openapi/parsers/ParameterObjectBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/ReferenceBuilder.ts +6 -5
- package/src/{transpiler → core}/openapi/parsers/RequestBodyBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/ResponsesBuilder.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/MethodParser.spec.ts +1 -1
- package/src/{transpiler → core}/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +2 -2
- package/src/{transpiler → core}/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +1 -1
- package/src/{transpiler → core/openapi}/transpiler.ts +2 -6
- package/src/{model → core/openapi}/types-repository.ts +0 -9
- package/src/core/parse-apex-metadata.ts +14 -0
- package/src/core/settings.ts +56 -0
- package/src/core/shared/types.d.ts +131 -0
- package/src/core/shared/utils.ts +5 -0
- package/src/defaults.ts +9 -0
- package/src/index.ts +41 -1
- package/src/test-helpers/ClassMirrorBuilder.ts +14 -1
- package/src/test-helpers/InterfaceMirrorBuilder.ts +0 -5
- package/src/test-helpers/SettingsBuilder.ts +1 -4
- package/src/util/fp.ts +3 -0
- package/src/util/logger.ts +3 -3
- package/src/util/string-utils.ts +0 -4
- package/tsconfig.json +7 -3
- package/.eslintrc.js +0 -12
- package/apexdocs.config.ts +0 -13
- package/docs/.nojekyll +0 -0
- package/docs/__old/README.md +0 -1
- package/docs/__old/index.html +0 -22
- package/docs/__old/restapi.json +0 -589
- package/docs/__old/types/Classes/nspc.AnotherInterface.md +0 -22
- package/docs/__old/types/Classes/nspc.ChildClass.md +0 -97
- package/docs/__old/types/Main/nspc.GroupedClass.md +0 -10
- package/docs/__old/types/Main/nspc.SampleClass.md +0 -189
- package/docs/__old/types/Misc-Group/nspc.EscapedAnnotations.md +0 -4
- package/docs/__old/types/Misc-Group/nspc.GrandparentClass.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.InterfaceWithInheritance.md +0 -29
- package/docs/__old/types/Misc-Group/nspc.MemberGrouping.md +0 -13
- package/docs/__old/types/Misc-Group/nspc.ParentClass.md +0 -37
- package/docs/__old/types/Misc-Group/nspc.Reference1.md +0 -18
- package/docs/__old/types/Misc-Group/nspc.Reference2.md +0 -12
- package/docs/__old/types/Misc-Group/nspc.Reference3.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference4.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference5.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.Reference6.md +0 -9
- package/docs/__old/types/Misc-Group/nspc.Reference7.md +0 -7
- package/docs/__old/types/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -11
- package/docs/__old/types/Misc-Group/nspc.SampleRestResource.md +0 -104
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -33
- package/docs/__old/types/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -14
- package/docs/__old/types/README.md +0 -97
- package/docs/__old/types/Sample-Interfaces/nspc.SampleInterface.md +0 -23
- package/examples/includes/header.md +0 -3
- package/examples/plain-markdown/README.md +0 -301
- package/examples/plain-markdown/force-app/classes/SampleException.cls +0 -1
- package/examples/plain-markdown/template.md +0 -3
- package/lib/adapters/apex-types.d.ts +0 -5
- package/lib/adapters/apex-types.js +0 -34
- package/lib/adapters/apex-types.js.map +0 -1
- package/lib/adapters/documentables.d.ts +0 -6
- package/lib/adapters/documentables.js +0 -41
- package/lib/adapters/documentables.js.map +0 -1
- package/lib/adapters/fields-and-properties.d.ts +0 -3
- package/lib/adapters/fields-and-properties.js +0 -10
- package/lib/adapters/fields-and-properties.js.map +0 -1
- package/lib/adapters/methods-and-constructors.d.ts +0 -4
- package/lib/adapters/methods-and-constructors.js +0 -49
- package/lib/adapters/methods-and-constructors.js.map +0 -1
- package/lib/adapters/references.d.ts +0 -5
- package/lib/adapters/references.js +0 -82
- package/lib/adapters/references.js.map +0 -1
- package/lib/adapters/type-utils.d.ts +0 -2
- package/lib/adapters/type-utils.js +0 -8
- package/lib/adapters/type-utils.js.map +0 -1
- package/lib/application/Apexdocs.d.ts +0 -13
- package/lib/application/Apexdocs.js +0 -80
- package/lib/application/Apexdocs.js.map +0 -1
- package/lib/cli/generate.d.ts +0 -2
- package/lib/cli/generate.js +0 -157
- package/lib/cli/generate.js.map +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -18
- package/lib/index.js.map +0 -1
- package/lib/model/apex-bundle.d.ts +0 -6
- package/lib/model/apex-bundle.js +0 -11
- package/lib/model/apex-bundle.js.map +0 -1
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +0 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +0 -14
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js.map +0 -1
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +0 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +0 -12
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js.map +0 -1
- package/lib/model/inheritance.d.ts +0 -8
- package/lib/model/inheritance.js +0 -3
- package/lib/model/inheritance.js.map +0 -1
- package/lib/model/manifest.d.ts +0 -22
- package/lib/model/manifest.js +0 -47
- package/lib/model/manifest.js.map +0 -1
- package/lib/model/markdown-file.d.ts +0 -16
- package/lib/model/markdown-file.js +0 -110
- package/lib/model/markdown-file.js.map +0 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +0 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +0 -47
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +0 -1
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +0 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +0 -55
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/index.d.ts +0 -3
- package/lib/model/markdown-generation-util/index.js +0 -20
- package/lib/model/markdown-generation-util/index.js.map +0 -1
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +0 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +0 -115
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +0 -1
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +0 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +0 -82
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +0 -1
- package/lib/model/markdown-home-file.d.ts +0 -11
- package/lib/model/markdown-home-file.js +0 -57
- package/lib/model/markdown-home-file.js.map +0 -1
- package/lib/model/markdown-type-file.d.ts +0 -26
- package/lib/model/markdown-type-file.js +0 -137
- package/lib/model/markdown-type-file.js.map +0 -1
- package/lib/model/openapi/apex-doc-types.d.ts +0 -19
- package/lib/model/openapi/apex-doc-types.js +0 -5
- package/lib/model/openapi/apex-doc-types.js.map +0 -1
- package/lib/model/openapi/open-api-types.d.ts +0 -93
- package/lib/model/openapi/open-api-types.js +0 -3
- package/lib/model/openapi/open-api-types.js.map +0 -1
- package/lib/model/openapi/open-api.d.ts +0 -16
- package/lib/model/openapi/open-api.js +0 -34
- package/lib/model/openapi/open-api.js.map +0 -1
- package/lib/model/openapi/openapi-type-file.d.ts +0 -7
- package/lib/model/openapi/openapi-type-file.js +0 -17
- package/lib/model/openapi/openapi-type-file.js.map +0 -1
- package/lib/model/outputFile.d.ts +0 -10
- package/lib/model/outputFile.js +0 -29
- package/lib/model/outputFile.js.map +0 -1
- package/lib/model/types-repository.d.ts +0 -16
- package/lib/model/types-repository.js +0 -54
- package/lib/model/types-repository.js.map +0 -1
- package/lib/service/apex-file-reader.d.ts +0 -14
- package/lib/service/apex-file-reader.js +0 -49
- package/lib/service/apex-file-reader.js.map +0 -1
- package/lib/service/file-system.d.ts +0 -14
- package/lib/service/file-system.js +0 -48
- package/lib/service/file-system.js.map +0 -1
- package/lib/service/file-writer.d.ts +0 -6
- package/lib/service/file-writer.js +0 -57
- package/lib/service/file-writer.js.map +0 -1
- package/lib/service/manifest-factory.d.ts +0 -10
- package/lib/service/manifest-factory.js +0 -17
- package/lib/service/manifest-factory.js.map +0 -1
- package/lib/service/metadata-processor.d.ts +0 -3
- package/lib/service/metadata-processor.js +0 -17
- package/lib/service/metadata-processor.js.map +0 -1
- package/lib/service/parser.d.ts +0 -21
- package/lib/service/parser.js +0 -138
- package/lib/service/parser.js.map +0 -1
- package/lib/service/state.d.ts +0 -9
- package/lib/service/state.js +0 -20
- package/lib/service/state.js.map +0 -1
- package/lib/service/walkers/class-walker.d.ts +0 -4
- package/lib/service/walkers/class-walker.js +0 -33
- package/lib/service/walkers/class-walker.js.map +0 -1
- package/lib/service/walkers/enum-walker.d.ts +0 -4
- package/lib/service/walkers/enum-walker.js +0 -11
- package/lib/service/walkers/enum-walker.js.map +0 -1
- package/lib/service/walkers/interface-walker.d.ts +0 -4
- package/lib/service/walkers/interface-walker.js +0 -15
- package/lib/service/walkers/interface-walker.js.map +0 -1
- package/lib/service/walkers/walker-factory.d.ts +0 -5
- package/lib/service/walkers/walker-factory.js +0 -21
- package/lib/service/walkers/walker-factory.js.map +0 -1
- package/lib/service/walkers/walker.d.ts +0 -19
- package/lib/service/walkers/walker.js +0 -17
- package/lib/service/walkers/walker.js.map +0 -1
- package/lib/settings.d.ts +0 -70
- package/lib/settings.js +0 -100
- package/lib/settings.js.map +0 -1
- package/lib/templating/compile.d.ts +0 -7
- package/lib/templating/compile.js +0 -98
- package/lib/templating/compile.js.map +0 -1
- package/lib/templating/helpers.d.ts +0 -2
- package/lib/templating/helpers.js +0 -18
- package/lib/templating/helpers.js.map +0 -1
- package/lib/test-helpers/AnnotationBuilder.d.ts +0 -12
- package/lib/test-helpers/AnnotationBuilder.js +0 -31
- package/lib/test-helpers/AnnotationBuilder.js.map +0 -1
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +0 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +0 -54
- package/lib/test-helpers/ClassMirrorBuilder.js.map +0 -1
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +0 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +0 -26
- package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +0 -1
- package/lib/test-helpers/DocCommentBuilder.d.ts +0 -12
- package/lib/test-helpers/DocCommentBuilder.js +0 -38
- package/lib/test-helpers/DocCommentBuilder.js.map +0 -1
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +0 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +0 -54
- package/lib/test-helpers/FieldMirrorBuilder.js.map +0 -1
- package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +0 -16
- package/lib/test-helpers/InterfaceMirrorBuilder.js +0 -43
- package/lib/test-helpers/InterfaceMirrorBuilder.js.map +0 -1
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +0 -29
- package/lib/test-helpers/MethodMirrorBuilder.js +0 -72
- package/lib/test-helpers/MethodMirrorBuilder.js.map +0 -1
- package/lib/test-helpers/SettingsBuilder.d.ts +0 -8
- package/lib/test-helpers/SettingsBuilder.js +0 -27
- package/lib/test-helpers/SettingsBuilder.js.map +0 -1
- package/lib/transpiler/factory.d.ts +0 -6
- package/lib/transpiler/factory.js +0 -35
- package/lib/transpiler/factory.js.map +0 -1
- package/lib/transpiler/file-container.d.ts +0 -6
- package/lib/transpiler/file-container.js +0 -16
- package/lib/transpiler/file-container.js.map +0 -1
- package/lib/transpiler/generator-choices.d.ts +0 -1
- package/lib/transpiler/generator-choices.js +0 -3
- package/lib/transpiler/generator-choices.js.map +0 -1
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +0 -11
- package/lib/transpiler/markdown/class-file-generatorHelper.js +0 -75
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +0 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +0 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +0 -13
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js.map +0 -1
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +0 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +0 -51
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js.map +0 -1
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +0 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +0 -27
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.js +0 -36
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +0 -39
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +0 -25
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +0 -15
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +0 -24
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +0 -20
- package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +0 -49
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -13
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -122
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +0 -31
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +0 -1
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +0 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +0 -78
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +0 -1
- package/lib/transpiler/openapi/parsers/Builder.d.ts +0 -16
- package/lib/transpiler/openapi/parsers/Builder.js +0 -30
- package/lib/transpiler/openapi/parsers/Builder.js.map +0 -1
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +0 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +0 -190
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +0 -1
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +0 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +0 -11
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +0 -1
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +0 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +0 -249
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +0 -1
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +0 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +0 -20
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js.map +0 -1
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +0 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +0 -22
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +0 -1
- package/lib/transpiler/processor-type-transpiler.d.ts +0 -10
- package/lib/transpiler/processor-type-transpiler.js +0 -9
- package/lib/transpiler/processor-type-transpiler.js.map +0 -1
- package/lib/transpiler/transpiler.d.ts +0 -5
- package/lib/transpiler/transpiler.js +0 -30
- package/lib/transpiler/transpiler.js.map +0 -1
- package/lib/util/error-logger.d.ts +0 -8
- package/lib/util/error-logger.js +0 -90
- package/lib/util/error-logger.js.map +0 -1
- package/lib/util/logger.d.ts +0 -21
- package/lib/util/logger.js +0 -61
- package/lib/util/logger.js.map +0 -1
- package/lib/util/string-utils.d.ts +0 -2
- package/lib/util/string-utils.js +0 -15
- package/lib/util/string-utils.js.map +0 -1
- package/src/adapters/__tests__/interface-adapter.spec.ts +0 -76
- package/src/adapters/apex-types.ts +0 -67
- package/src/adapters/documentables.ts +0 -58
- package/src/adapters/fields-and-properties.ts +0 -14
- package/src/adapters/methods-and-constructors.ts +0 -78
- package/src/adapters/type-utils.ts +0 -5
- package/src/adapters/types.d.ts +0 -8
- package/src/model/apex-bundle.ts +0 -3
- package/src/model/inheritance.ts +0 -7
- package/src/model/manifest.ts +0 -74
- package/src/model/markdown-file.ts +0 -121
- package/src/model/markdown-generation-util/doc-comment-annotation-util.ts +0 -50
- package/src/model/markdown-generation-util/field-declaration-util.ts +0 -71
- package/src/model/markdown-generation-util/index.ts +0 -3
- package/src/model/markdown-generation-util/method-declaration-util.ts +0 -166
- package/src/model/markdown-generation-util/type-declaration-util.ts +0 -91
- package/src/model/markdown-home-file.ts +0 -58
- package/src/model/markdown-type-file.ts +0 -165
- package/src/model/openapi/openapi-type-file.ts +0 -14
- package/src/model/outputFile.ts +0 -29
- package/src/service/__tests__/apex-file-reader.spec.ts +0 -92
- package/src/service/apex-file-reader.ts +0 -51
- package/src/service/file-writer.ts +0 -34
- package/src/service/metadata-processor.ts +0 -16
- package/src/service/state.ts +0 -24
- package/src/service/walkers/class-walker.ts +0 -30
- package/src/service/walkers/enum-walker.ts +0 -7
- package/src/service/walkers/interface-walker.ts +0 -12
- package/src/service/walkers/walker-factory.ts +0 -19
- package/src/service/walkers/walker.ts +0 -42
- package/src/settings.ts +0 -162
- package/src/templating/__tests__/compile.spec.ts +0 -741
- package/src/templating/compile.ts +0 -187
- package/src/templating/helpers.ts +0 -14
- package/src/templating/types.d.ts +0 -104
- package/src/transpiler/factory.ts +0 -33
- package/src/transpiler/file-container.ts +0 -13
- package/src/transpiler/generator-choices.ts +0 -1
- package/src/transpiler/markdown/class-file-generatorHelper.ts +0 -78
- package/src/transpiler/markdown/docsify/docsify-docs-processor.ts +0 -12
- package/src/transpiler/markdown/jekyll/jekyll-docsProcessor.ts +0 -50
- package/src/transpiler/markdown/markdown-transpiler-base.ts +0 -28
- package/src/transpiler/markdown/plain-markdown/class-template.ts +0 -32
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +0 -35
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +0 -21
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +0 -11
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +0 -20
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +0 -45
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -134
- package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +0 -27
- package/src/transpiler/processor-type-transpiler.ts +0 -18
- /package/examples/{plain-markdown → markdown}/.forceignore +0 -0
- /package/examples/{plain-markdown → markdown}/config/project-scratch-def.json +0 -0
- /package/examples/{plain-markdown → markdown}/force-app/classes/BaseClass.cls +0 -0
- /package/examples/{plain-markdown → markdown}/force-app/classes/ParentInterface.cls +0 -0
- /package/examples/{plain-markdown → markdown}/force-app/classes/ReferencedEnum.cls +0 -0
- /package/examples/{plain-markdown → markdown}/force-app/classes/SampleEnum.cls +0 -0
- /package/examples/{plain-markdown → markdown}/force-app/classes/SampleInterface.cls +0 -0
- /package/examples/{plain-markdown → markdown}/package-lock.json +0 -0
- /package/examples/{plain-markdown → markdown}/sfdx-project.json +0 -0
- /package/src/{service → application}/file-system.ts +0 -0
- /package/src/{model/__tests__ → core/__test__}/manifest.spec.ts +0 -0
- /package/src/{service → core/openapi}/__tests__/manifest-factory.spec.ts +0 -0
- /package/src/{model → core}/openapi/__tests__/open-api.spec.ts +0 -0
- /package/src/{model → core}/openapi/apex-doc-types.ts +0 -0
- /package/src/{model → core/openapi}/apex-type-wrappers/ClassMirrorWrapper.ts +0 -0
- /package/src/{model → core/openapi}/apex-type-wrappers/MethodMirrorWrapper.ts +0 -0
- /package/src/{model → core}/openapi/open-api-types.ts +0 -0
- /package/src/{model → core}/openapi/open-api.ts +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SchemaObjectArray, SchemaObjectObject } from './open-api-types';
|
|
2
|
-
export type ApexDocHttpResponse = {
|
|
3
|
-
statusCode: number;
|
|
4
|
-
description?: string;
|
|
5
|
-
schema: ApexDocSchemaObject;
|
|
6
|
-
};
|
|
7
|
-
export type ApexDocHttpRequestBody = {
|
|
8
|
-
description?: string;
|
|
9
|
-
schema: ApexDocSchemaObject;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export type ApexDocParameterObject = {
|
|
13
|
-
name: string;
|
|
14
|
-
in: 'query' | 'header' | 'path' | 'cookie';
|
|
15
|
-
description?: string;
|
|
16
|
-
required?: boolean;
|
|
17
|
-
schema: ApexDocSchemaObject;
|
|
18
|
-
};
|
|
19
|
-
export type ApexDocSchemaObject = SchemaObjectObject | SchemaObjectArray | string;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// These are types that represent how the data is expected to be created in the ApexDoc (as YAML), which
|
|
3
|
-
// in some cases might be different from the official OpenApi spec for simplicity when writing the ApexDoc.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
//# sourceMappingURL=apex-doc-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apex-doc-types.js","sourceRoot":"","sources":["../../../src/model/openapi/apex-doc-types.ts"],"names":[],"mappings":";AAAA,wGAAwG;AACxG,2GAA2G"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export type InfoObject = {
|
|
2
|
-
title: string;
|
|
3
|
-
version: string;
|
|
4
|
-
};
|
|
5
|
-
export type ServerObject = {
|
|
6
|
-
url: string;
|
|
7
|
-
};
|
|
8
|
-
export type PathsObject = {
|
|
9
|
-
[index: string]: PathItemObject;
|
|
10
|
-
};
|
|
11
|
-
export type PathItemObject = {
|
|
12
|
-
description?: string;
|
|
13
|
-
get?: OperationObject;
|
|
14
|
-
put?: OperationObject;
|
|
15
|
-
post?: OperationObject;
|
|
16
|
-
delete?: OperationObject;
|
|
17
|
-
patch?: OperationObject;
|
|
18
|
-
};
|
|
19
|
-
export type OperationObject = {
|
|
20
|
-
tags?: string[];
|
|
21
|
-
description?: string;
|
|
22
|
-
summary?: string;
|
|
23
|
-
requestBody?: RequestBody;
|
|
24
|
-
parameters?: ParameterObject[];
|
|
25
|
-
responses?: ResponsesObject;
|
|
26
|
-
};
|
|
27
|
-
export type ParameterObject = {
|
|
28
|
-
name: string;
|
|
29
|
-
in: 'query' | 'header' | 'path' | 'cookie';
|
|
30
|
-
description?: string;
|
|
31
|
-
required?: boolean;
|
|
32
|
-
schema?: SchemaObject;
|
|
33
|
-
};
|
|
34
|
-
export type RequestBody = {
|
|
35
|
-
description?: string;
|
|
36
|
-
content: RequestBodyContent;
|
|
37
|
-
required?: boolean;
|
|
38
|
-
};
|
|
39
|
-
export type RequestBodyContent = {
|
|
40
|
-
[index: string]: MediaTypeObject;
|
|
41
|
-
};
|
|
42
|
-
export type MediaTypeObject = {
|
|
43
|
-
schema?: SchemaObject;
|
|
44
|
-
example?: unknown;
|
|
45
|
-
examples?: {
|
|
46
|
-
[index: string]: ExampleObject;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
export type ExampleObject = {
|
|
50
|
-
summary?: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
value?: unknown;
|
|
53
|
-
};
|
|
54
|
-
export type ResponsesObject = {
|
|
55
|
-
[index: string]: ResponseObject;
|
|
56
|
-
};
|
|
57
|
-
export type ResponseObject = {
|
|
58
|
-
description: string;
|
|
59
|
-
content?: ContentObject;
|
|
60
|
-
};
|
|
61
|
-
export type ContentObject = {
|
|
62
|
-
[index: string]: {
|
|
63
|
-
schema: SchemaObject;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export type SchemaObject = SchemaObjectObject | SchemaObjectArray | ReferenceObject;
|
|
67
|
-
export type SchemaObjectObject = {
|
|
68
|
-
type: string;
|
|
69
|
-
properties?: PropertiesObject;
|
|
70
|
-
format?: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
};
|
|
73
|
-
export type PropertiesObject = {
|
|
74
|
-
[index: string]: SchemaObject;
|
|
75
|
-
};
|
|
76
|
-
export type SchemaObjectArray = {
|
|
77
|
-
type: 'array';
|
|
78
|
-
items: SchemaObject;
|
|
79
|
-
description?: string;
|
|
80
|
-
};
|
|
81
|
-
export type ReferenceObject = {
|
|
82
|
-
$ref: string;
|
|
83
|
-
description?: string;
|
|
84
|
-
};
|
|
85
|
-
export type ComponentsObject = {
|
|
86
|
-
schemas: {
|
|
87
|
-
[index: string]: SchemaObject;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
export type TagObject = {
|
|
91
|
-
name: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-api-types.js","sourceRoot":"","sources":["../../../src/model/openapi/open-api-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentsObject, InfoObject, PathsObject, ServerObject, TagObject } from './open-api-types';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the OpenApi 3.1.0 spec
|
|
4
|
-
* https://spec.openapis.org/oas/v3.1.0
|
|
5
|
-
*/
|
|
6
|
-
export declare class OpenApi {
|
|
7
|
-
private namespace?;
|
|
8
|
-
openapi: string;
|
|
9
|
-
info: InfoObject;
|
|
10
|
-
tags: TagObject[];
|
|
11
|
-
paths: PathsObject;
|
|
12
|
-
servers: ServerObject[];
|
|
13
|
-
components?: ComponentsObject;
|
|
14
|
-
constructor(title: string, version: string, namespace?: string | undefined);
|
|
15
|
-
private getServerUrl;
|
|
16
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=open-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-api.js","sourceRoot":"","sources":["../../../src/model/openapi/open-api.ts"],"names":[],"mappings":";;;AAEA,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAEzC;;;GAGG;AACH,MAAa,OAAO;IAQlB,YAAY,KAAa,EAAE,OAAe,EAAU,SAAkB;QAAlB,cAAS,GAAT,SAAS,CAAS;QAPtE,YAAO,GAAG,gBAAgB,CAAC;QAQzB,IAAI,CAAC,IAAI,GAAG;YACV,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,OAAO;SACjB,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG;YACb;gBACE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE;aACzB;SACF,CAAC;QAEF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,OAAO,UAAU,CAAC;SACnB;QAED,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC;IAC3C,CAAC;CACF;AA/BD,0BA+BC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=openapi-type-file.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-type-file.js","sourceRoot":"","sources":["../../../src/model/openapi/openapi-type-file.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAE3C,6CAA0C;AAE1C,MAAa,eAAgB,SAAQ,uBAAU;IAC7C,YAAmB,YAAqB;QACtC,KAAK,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,EAAE,EAAE,EAAE,CAAC,CAAC;QADnC,iBAAY,GAAZ,YAAY,CAAS;QAEtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,iCAAM,YAAY,KAAE,SAAS,EAAE,SAAS,KAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACnF,CAAC;IAED,aAAa;QACX,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AATD,0CASC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
package/lib/model/outputFile.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=outputFile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outputFile.js","sourceRoot":"","sources":["../../src/model/outputFile.ts"],"names":[],"mappings":";;;AAAA,2BAA4B;AAC5B,0CAAuC;AAEvC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC;IAClC,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CAChE,CAAC,CAAC;AAEH,MAAsB,UAAU;IAG9B,YAAmB,QAAgB,EAAS,GAAW;QAApC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAFvD,cAAS,GAAG,EAAE,CAAC;IAE2C,CAAC;IAI3D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,IAAI;QACrC,MAAM,YAAY,GAAG,UAAU,IAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC;QACvE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzB,CAAC;CACF;AArBD,gCAqBC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=types-repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-repository.js","sourceRoot":"","sources":["../../src/model/types-repository.ts"],"names":[],"mappings":";;;AAIA,MAAa,eAAe;IAA5B;QAEU,gBAAW,GAAW,EAAE,CAAC;QACzB,aAAQ,GAAW,EAAE,CAAC;IAuDhC,CAAC;IArDQ,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;YAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;SAClD;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAEM,WAAW,CAAC,KAAa;QAC9B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACtC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC1B,2EAA2E;YAC3E,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5D,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CACxC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,WAAW,EAAE,CACvF,CAAC;YACF,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,SAAS,KAAK,OAAO,EAAE;gBAC7D,wFAAwF;gBACxF,iGAAiG;gBACjG,OAAO,SAAS,CAAC;aAClB;YAED,MAAM,sBAAsB,GAAG,eAA8B,CAAC;YAC9D,MAAM,UAAU,GAAG;gBACjB,GAAG,sBAAsB,CAAC,OAAO;gBACjC,GAAG,sBAAsB,CAAC,UAAU;gBACpC,GAAG,sBAAsB,CAAC,KAAK;aAChC,CAAC;YACF,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC,CAAC;YAC3G,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO,SAAS,CAAC;aAClB;YACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;SACxE;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAClC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,CACjF,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC;IAEM,cAAc,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEM,mBAAmB,CAAC,QAAgB;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IACrF,CAAC;CACF;AA1DD,0CA0DC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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,49 +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.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;
|
|
49
|
-
//# sourceMappingURL=apex-file-reader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,48 +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.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;
|
|
48
|
-
//# sourceMappingURL=file-system.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,57 +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.FileWriter = void 0;
|
|
27
|
-
const fs = __importStar(require("fs"));
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const settings_1 = require("../settings");
|
|
30
|
-
class FileWriter {
|
|
31
|
-
static write(files, onWriteCallback) {
|
|
32
|
-
const onBeforeFileWrite = (file) => settings_1.Settings.getInstance().onBeforeFileWrite(file);
|
|
33
|
-
files.forEach((file) => {
|
|
34
|
-
const resolvedFile = this.getTargetLocation(file, onBeforeFileWrite);
|
|
35
|
-
const fullDir = path.join(resolvedFile.dir.baseDir, resolvedFile.dir.fileDir);
|
|
36
|
-
if (!fs.existsSync(fullDir)) {
|
|
37
|
-
fs.mkdirSync(fullDir, { recursive: true });
|
|
38
|
-
}
|
|
39
|
-
const filePath = path.join(fullDir, `${resolvedFile.name}${resolvedFile.extension}`);
|
|
40
|
-
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
41
|
-
onWriteCallback(resolvedFile);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
static getTargetLocation(file, onBeforeFileWrite) {
|
|
45
|
-
const targetFile = {
|
|
46
|
-
name: file.fileName,
|
|
47
|
-
extension: file.fileExtension(),
|
|
48
|
-
dir: {
|
|
49
|
-
baseDir: settings_1.Settings.getInstance().outputDir,
|
|
50
|
-
fileDir: file.dir,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
return onBeforeFileWrite(targetFile);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.FileWriter = FileWriter;
|
|
57
|
-
//# sourceMappingURL=file-writer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,0CAAsE;AAEtE,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,KAAmB,EAAE,eAA2C;QAC3E,MAAM,iBAAiB,GAAsB,CAAC,IAAgB,EAAE,EAAE,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAClH,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YACrE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC5C;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;YACrF,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9C,eAAe,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,iBAAiB,CAAC,IAAgB,EAAE,iBAAoC;QACrF,MAAM,UAAU,GAAe;YAC7B,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE;YAC/B,GAAG,EAAE;gBACH,OAAO,EAAE,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS;gBACzC,OAAO,EAAE,IAAI,CAAC,GAAG;aAClB;SACF,CAAC;QAEF,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACF;AA5BD,gCA4BC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Manifest from '../model/manifest';
|
|
2
|
-
import { TypeParser } from './parser';
|
|
3
|
-
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
4
|
-
import ApexBundle from '../model/apex-bundle';
|
|
5
|
-
/**
|
|
6
|
-
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
|
7
|
-
* @param typeParser In charge of returning the list of reflected types.
|
|
8
|
-
* @param reflect Reflection function.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createManifest(typeParser: TypeParser, reflect: (apexBundle: ApexBundle) => ReflectionResult): Manifest;
|
|
@@ -1,17 +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.createManifest = void 0;
|
|
7
|
-
const manifest_1 = __importDefault(require("../model/manifest"));
|
|
8
|
-
/**
|
|
9
|
-
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
|
10
|
-
* @param typeParser In charge of returning the list of reflected types.
|
|
11
|
-
* @param reflect Reflection function.
|
|
12
|
-
*/
|
|
13
|
-
function createManifest(typeParser, reflect) {
|
|
14
|
-
return new manifest_1.default(typeParser.parse(reflect));
|
|
15
|
-
}
|
|
16
|
-
exports.createManifest = createManifest;
|
|
17
|
-
//# sourceMappingURL=manifest-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":";;;;;;AAAA,iEAAyC;AAKzC;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,UAAsB,EACtB,OAAqD;IAErD,OAAO,IAAI,kBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AALD,wCAKC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
4
|
-
class MetadataProcessor {
|
|
5
|
-
static process(input) {
|
|
6
|
-
var _a;
|
|
7
|
-
const map = new Map();
|
|
8
|
-
const xml = new fast_xml_parser_1.XMLParser().parse(input);
|
|
9
|
-
map.set('apiVersion', (_a = xml.ApexClass.apiVersion) !== null && _a !== void 0 ? _a : '');
|
|
10
|
-
if (xml.ApexClass.status) {
|
|
11
|
-
map.set('status', xml.ApexClass.status);
|
|
12
|
-
}
|
|
13
|
-
return map;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = MetadataProcessor;
|
|
17
|
-
//# sourceMappingURL=metadata-processor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-processor.js","sourceRoot":"","sources":["../../src/service/metadata-processor.ts"],"names":[],"mappings":";;AAAA,qDAA4C;AAE5C,MAAqB,iBAAiB;IAC7B,MAAM,CAAC,OAAO,CAAC,KAAa;;QACjC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,2BAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,MAAA,GAAG,CAAC,SAAS,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC;QAEtD,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACzC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAbD,oCAaC"}
|
package/lib/service/parser.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ClassMirror, InterfaceMirror, ReflectionResult, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import ApexBundle from '../model/apex-bundle';
|
|
3
|
-
export interface TypeParser {
|
|
4
|
-
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
5
|
-
}
|
|
6
|
-
type NameAware = {
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class RawBodyParser implements TypeParser {
|
|
10
|
-
typeBundles: ApexBundle[];
|
|
11
|
-
constructor(typeBundles: ApexBundle[]);
|
|
12
|
-
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
13
|
-
addFieldsFromParent(types: Type[]): Type[];
|
|
14
|
-
addMembersFromParent(currentClass: ClassMirror, allTypes: Type[]): ClassMirror;
|
|
15
|
-
addMethodsFromParent(currentInterface: InterfaceMirror, allTypes: Type[]): InterfaceMirror;
|
|
16
|
-
private getInheritedFields;
|
|
17
|
-
private getInheritedProperties;
|
|
18
|
-
private getInheritedMethods;
|
|
19
|
-
memberExists(members: NameAware[], fieldName: string): boolean;
|
|
20
|
-
}
|
|
21
|
-
export {};
|