@cparra/apexdocs 2.25.0-alpha.2 → 2.25.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/cli/generate.js +291 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleException.md +18 -0
- package/examples/plain-markdown/docs/Miscellaneous/ns.SampleInterface.md +6 -2
- package/examples/plain-markdown/docs/Miscellaneous/ns.Url.md +320 -0
- package/examples/plain-markdown/docs/Sample-Enums/ns.SampleEnum.md +3 -1
- package/examples/plain-markdown/docs/SampleGroup/ns.SampleClass.md +1 -1
- package/examples/plain-markdown/docs/index.md +84 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +16 -0
- package/examples/plain-markdown/force-app/classes/Url.cls +194 -0
- package/examples/plain-markdown/package.json +2 -1
- package/jest.config.js +1 -1
- package/package.json +11 -13
- package/src/__spec__/core/generating-class-docs.spec.ts +57 -37
- package/src/__spec__/core/generating-enum-docs.spec.ts +25 -22
- package/src/__spec__/core/generating-interface-docs.spec.ts +33 -30
- package/src/__spec__/core/generating-reference-guide.spec.ts +8 -7
- package/src/__spec__/core/test-helpers.ts +9 -0
- package/src/application/Apexdocs.ts +34 -5
- package/src/application/{flows → generators}/generate-markdown-files.ts +19 -13
- package/src/cli/args.ts +138 -0
- package/src/cli/generate.ts +12 -138
- package/src/core/adapters/__tests__/documentables.spec.ts +109 -0
- package/src/{adapters → core/adapters}/__tests__/interface-adapter.spec.ts +13 -11
- package/src/{adapters → core/adapters}/__tests__/references.spec.ts +23 -2
- package/src/{adapters → core/adapters}/apex-types.ts +18 -15
- package/src/{adapters → core/adapters}/documentables.ts +54 -12
- package/src/{adapters → core/adapters}/fields-and-properties.ts +17 -10
- package/src/{adapters/references.ts → core/adapters/inline.ts} +43 -13
- package/src/{adapters → core/adapters}/methods-and-constructors.ts +21 -9
- package/src/core/adapters/type-utils.ts +13 -0
- package/src/core/{renderable → adapters}/types.d.ts +42 -4
- package/src/core/generate-docs.ts +55 -19
- package/src/core/template.ts +15 -9
- package/src/core/templates/reference-guide.ts +1 -1
- package/src/model/__tests__/manifest.spec.ts +1 -1
- package/src/model/markdown-generation-util/field-declaration-util.ts +1 -1
- package/src/model/markdown-generation-util/method-declaration-util.ts +1 -1
- package/src/model/markdown-type-file.ts +5 -1
- package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
- package/src/service/apex-file-reader.ts +2 -6
- package/src/service/manifest-factory.ts +2 -2
- package/src/service/parser.ts +1 -1
- package/src/settings.ts +6 -10
- package/src/test-helpers/SettingsBuilder.ts +1 -2
- package/src/transpiler/factory.ts +2 -4
- package/src/transpiler/markdown/class-file-generatorHelper.ts +1 -18
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +2 -2
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +6 -4
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +1 -1
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +2 -2
- package/src/util/fp.ts +3 -0
- package/tsconfig.json +1 -1
- 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/lib/__spec__/core/expect-extensions.d.ts +0 -3
- package/lib/__spec__/core/expect-extensions.js +0 -54
- package/lib/__spec__/core/expect-extensions.js.map +0 -1
- package/lib/__spec__/core/generating-class-docs.spec.d.ts +0 -1
- package/lib/__spec__/core/generating-class-docs.spec.js +0 -427
- package/lib/__spec__/core/generating-class-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-enum-docs.spec.d.ts +0 -1
- package/lib/__spec__/core/generating-enum-docs.spec.js +0 -303
- package/lib/__spec__/core/generating-enum-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-interface-docs.spec.d.ts +0 -1
- package/lib/__spec__/core/generating-interface-docs.spec.js +0 -361
- package/lib/__spec__/core/generating-interface-docs.spec.js.map +0 -1
- package/lib/__spec__/core/generating-reference-guide.spec.d.ts +0 -1
- package/lib/__spec__/core/generating-reference-guide.spec.js +0 -161
- package/lib/__spec__/core/generating-reference-guide.spec.js.map +0 -1
- package/lib/adapters/apex-types.d.ts +0 -5
- package/lib/adapters/apex-types.js +0 -109
- package/lib/adapters/apex-types.js.map +0 -1
- package/lib/adapters/documentables.d.ts +0 -7
- package/lib/adapters/documentables.js +0 -56
- package/lib/adapters/documentables.js.map +0 -1
- package/lib/adapters/fields-and-properties.d.ts +0 -4
- package/lib/adapters/fields-and-properties.js +0 -31
- package/lib/adapters/fields-and-properties.js.map +0 -1
- package/lib/adapters/methods-and-constructors.d.ts +0 -5
- package/lib/adapters/methods-and-constructors.js +0 -91
- 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 -7
- package/lib/adapters/type-utils.js.map +0 -1
- package/lib/application/Apexdocs.d.ts +0 -13
- package/lib/application/Apexdocs.js +0 -86
- package/lib/application/Apexdocs.js.map +0 -1
- package/lib/application/flows/generate-markdown-files.d.ts +0 -3
- package/lib/application/flows/generate-markdown-files.js +0 -57
- package/lib/application/flows/generate-markdown-files.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/core/__test__/inheritance-chain.test.d.ts +0 -1
- package/lib/core/__test__/inheritance-chain.test.js +0 -42
- package/lib/core/__test__/inheritance-chain.test.js.map +0 -1
- package/lib/core/generate-docs.d.ts +0 -24
- package/lib/core/generate-docs.js +0 -267
- package/lib/core/generate-docs.js.map +0 -1
- package/lib/core/inheritance-chain.d.ts +0 -2
- package/lib/core/inheritance-chain.js +0 -35
- package/lib/core/inheritance-chain.js.map +0 -1
- package/lib/core/template.d.ts +0 -10
- package/lib/core/template.js +0 -92
- package/lib/core/template.js.map +0 -1
- package/lib/core/templates/reference-guide.d.ts +0 -1
- package/lib/core/templates/reference-guide.js +0 -18
- package/lib/core/templates/reference-guide.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -29
- 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 -11
- 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 -53
- package/lib/model/manifest.js.map +0 -1
- package/lib/model/markdown-file.d.ts +0 -16
- package/lib/model/markdown-file.js +0 -111
- 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 -46
- 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 -54
- 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 -114
- 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 -81
- 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 -22
- 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 -16
- 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 -64
- package/lib/settings.js +0 -89
- package/lib/settings.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 -22
- package/lib/test-helpers/ClassMirrorBuilder.js +0 -64
- 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 -77
- 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 -36
- 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 -28
- 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 -16
- 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 -27
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.js +0 -10
- package/lib/transpiler/markdown/plain-markdown/grouped-members-partial-template.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 -47
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +0 -9
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +0 -42
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.d.ts +0 -1
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.js +0 -31
- package/lib/transpiler/markdown/plain-markdown/type-doc-partial.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 -250
- 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/type-utils.ts +0 -5
- package/src/adapters/types.d.ts +0 -8
- package/src/model/inheritance.ts +0 -8
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +0 -42
- /package/src/{model → core}/apex-bundle.ts +0 -0
- /package/src/{model → core}/manifest.ts +0 -0
package/README.md
CHANGED
|
@@ -292,6 +292,43 @@ public static Object call(String action) {
|
|
|
292
292
|
}
|
|
293
293
|
```
|
|
294
294
|
|
|
295
|
+
### Using custom tags
|
|
296
|
+
|
|
297
|
+
You can use custom tags to document your code. Custom tags can be added with at symbol (`@`) followed by the name
|
|
298
|
+
of the tag. Apexdocs will automatically format tags which words are separated by a dash (`-`) by separating them with a
|
|
299
|
+
space and uppercasing them. For example, `@custom-tag` will be displayed as `Custom Tag`.
|
|
300
|
+
|
|
301
|
+
Within a custom tag, you can also add code blocks by using the triple backtick syntax. This is useful when you want to
|
|
302
|
+
display code snippets within your documentation.
|
|
303
|
+
|
|
304
|
+
**Example**
|
|
305
|
+
|
|
306
|
+
```apex
|
|
307
|
+
/**
|
|
308
|
+
* @custom-tag This is a custom tag
|
|
309
|
+
* @custom-tag-with-code
|
|
310
|
+
* ```
|
|
311
|
+
* System.debug('Hello World');
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
public class MyClass {
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Note that the language of the code block will be set to `apex` by default, but you can change it by adding the language
|
|
319
|
+
name after the triple backticks. For example, to display a JavaScript code block you can use:
|
|
320
|
+
|
|
321
|
+
```apex
|
|
322
|
+
/**
|
|
323
|
+
* @custom-tag-with-code
|
|
324
|
+
* ```javascript
|
|
325
|
+
* console.log('Hello World');
|
|
326
|
+
* ```
|
|
327
|
+
*/
|
|
328
|
+
public class MyClass {
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
295
332
|
### Grouping Declarations Within A Class
|
|
296
333
|
|
|
297
334
|
A class might have members that should be grouped together. For example, you can have a class for constants with
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";var On=Object.defineProperty;var a=(n,e)=>On(n,"name",{value:e,configurable:!0});var An=require("fs"),xn=require("path"),Lt=require("@cparra/apex-reflection"),Ot=require("chalk"),At=require("log-update"),In=require("fast-xml-parser"),En=require("js-yaml"),Dn=require("fp-ts/Option"),b=require("fp-ts/function"),Sn=require("fp-ts/Either"),g=require("handlebars"),Rn=require("cosmiconfig"),jn=require("yargs");function D(n){var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if(t!=="default"){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,Object.freeze(e)}a(D,"_interopNamespaceDefault");var P=D(An),oe=D(xn),xt=D(En),w=D(Dn),y=D(Sn),Bn=D(jn);const A=class A{constructor(e){this.config=e}static build(e){A.instance=new A(e)}static getInstance(){if(!A.instance)throw new Error("Settings has not been initialized");return A.instance}get sourceDirectory(){return this.config.sourceDirectory}get scope(){return this.config.scope}get outputDir(){return this.config.outputDir}get targetGenerator(){return this.config.targetGenerator}get indexOnly(){return this.config.indexOnly}getDefaultGroupName(){return this.config.defaultGroupName}getOpenApiTitle(){var e;return(e=this.config.openApiTitle)!=null?e:this.config.title}getTitle(){return this.config.title}getNamespace(){return this.config.namespace}getNamespacePrefix(){return this.config.namespace?`${this.config.namespace}.`:""}openApiFileName(){return this.config.openApiFileName}includeMetadata(){return this.config.includeMetadata}sortMembersAlphabetically(){var e;return(e=this.config.sortMembersAlphabetically)!=null?e:!1}getRootDir(){return this.config.rootDir}onAfterProcess(e){this.config.onAfterProcess&&this.config.onAfterProcess(e)}onBeforeFileWrite(e){return this.config.onBeforeFileWrite?this.config.onBeforeFileWrite(e):e}frontMatterHeader(e){return this.config.frontMatterHeader?this.config.frontMatterHeader(e):[]}getLinkingStrategy(){return this.config.linkingStrategy}};a(A,"Settings");let u=A;const We=class We{constructor(e,t,r){this.filePath=e,this.rawTypeContent=t,this.rawMetadataContent=r}};a(We,"ApexBundle");let ce=We;const Nn=".cls",Ve=class Ve{static processFiles(e,t=this.sourceDirectory){let r=[];return e.readDirectory(t).forEach(s=>{const o=e.joinPath(t,s);if(e.isDirectory(o)&&(r=r.concat(this.processFiles(e,o))),!this.isApexFile(s))return;const c=e.readFile(o),l=e.joinPath(t,`${s}-meta.xml`);let d=null;u.getInstance().includeMetadata()&&(d=e.exists(l)?e.readFile(l):null),r.push(new ce(s,c,d))}),r}static isApexFile(e){return e.endsWith(Nn)}static get sourceDirectory(){return u.getInstance().sourceDirectory}};a(Ve,"ApexFileReader");let le=Ve;const Ue=class Ue{isDirectory(e){return P.statSync(e).isDirectory()}readDirectory(e){return P.readdirSync(e)}readFile(e){return P.readFileSync(e).toString()}joinPath(...e){return oe.join(...e)}exists(e){return P.existsSync(e)}};a(Ue,"DefaultFileSystem");let de=Ue;const Xe=class Xe{static log(e,...t){this.logSingle(e),t.forEach(r=>{this.logSingle(r)})}static error(e,...t){this.logSingle(e,!1,"red",!1),t.forEach(()=>{this.logSingle(e,!1,"red",!1)})}static logSingle(e,t=!0,r="green",i=!0){this.currentFrame>9&&(this.currentFrame=0);const s=t?`${this.frames[this.currentFrame++]}`:"";let o;r==="green"?o=`${Ot.green(new Date().toLocaleString()+": ")}${e}
|
|
3
|
+
`:o=`${Ot.red(new Date().toLocaleString()+": ")}${e}
|
|
4
|
+
`,i?At(`${s} ${o}`):process.stdout.write(`${s} ${o}`)}static clear(){At.clear()}};a(Xe,"Logger");let p=Xe;p.currentFrame=0,p.frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];var Mn=Object.defineProperty,Fn=Object.defineProperties,Gn=Object.getOwnPropertyDescriptors,It=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,kn=Object.prototype.propertyIsEnumerable,Et=a((n,e,t)=>e in n?Mn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$9"),pe=a((n,e)=>{for(var t in e||(e={}))zn.call(e,t)&&Et(n,t,e[t]);if(It)for(var t of It(e))kn.call(e,t)&&Et(n,t,e[t]);return n},"__spreadValues$9"),ue=a((n,e)=>Fn(n,Gn(e)),"__spreadProps$8");const ie=class ie{constructor(e,t=!1){this.types=e,this.isForInnerTypes=t}filteredByAccessModifierAndAnnotations(e){const t=this.filterAccessibleModifier(this.types,e),r=[];for(const i of t){const s=i;if(s.type_name==="enum"){r.push(s);continue}if(s.type_name==="interface"){const l=s;r.push(ue(pe({},s),{methods:this.filterAccessibleModifier(l.methods,e)}));continue}const o=s;let c=ue(pe({},s),{methods:this.filterAccessibleModifier(o.methods,e),properties:this.filterAccessibleModifier(o.properties,e),fields:this.filterAccessibleModifier(o.fields,e),constructors:this.filterAccessibleModifier(o.constructors,e)});this.isForInnerTypes||(c=ue(pe({},c),{enums:this.filterAccessibleModifier(o.enums,e),interfaces:this.filterAccessibleModifier(o.interfaces,e),classes:new ie(o.classes,!0).filteredByAccessModifierAndAnnotations(e)})),r.push(c)}return r}filterAccessibleModifier(e,t){return e.filter(r=>{var i;return((i=r.docComment)==null?void 0:i.annotations.some(o=>o.name.toLowerCase()==="ignore"))?!1:t.includes(r.access_modifier)||r.annotations.some(o=>t.includes(o.type.toLowerCase()))})}};a(ie,"Manifest");let z=ie;function qn(n,e){return new z(n.parse(e))}a(qn,"createManifest");const Ye=class Ye{static process(e){var t;const r=new Map,i=new In.XMLParser().parse(e);return r.set("apiVersion",(t=i.ApexClass.apiVersion)!=null?t:""),i.ApexClass.status&&r.set("status",i.ApexClass.status),r}};a(Ye,"MetadataProcessor");let k=Ye;var Wn=Object.defineProperty,Vn=Object.defineProperties,Un=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,Xn=Object.prototype.hasOwnProperty,Yn=Object.prototype.propertyIsEnumerable,St=a((n,e,t)=>e in n?Wn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$8"),fe=a((n,e)=>{for(var t in e||(e={}))Xn.call(e,t)&&St(n,t,e[t]);if(Dt)for(var t of Dt(e))Yn.call(e,t)&&St(n,t,e[t]);return n},"__spreadValues$8"),he=a((n,e)=>Vn(n,Un(e)),"__spreadProps$7");const Ze=class Ze{constructor(e){this.typeBundles=e}parse(e){const t=this.typeBundles.map(r=>{p.log(`Parsing file: ${r.filePath}`);const i=e(r);return i.typeMirror&&r.rawMetadataContent&&k.process(r.rawMetadataContent).forEach((o,c)=>{var l;const d=`${c}: ${o}`;(l=i.typeMirror)==null||l.annotations.push({rawDeclaration:d,name:d,type:d})}),i}).filter(r=>r.typeMirror).map(r=>r.typeMirror);return this.addFieldsFromParent(t)}addFieldsFromParent(e){const t=[];for(const r of e){if(r.type_name!=="class"&&r.type_name!=="interface"){t.push(r);continue}if(r.type_name==="class"){let s=r;if(!s.extended_class){t.push(r);continue}s=this.addMembersFromParent(s,e),t.push(s);continue}let i=r;if(!i.extended_interfaces.length){t.push(r);continue}i=this.addMethodsFromParent(i,e),t.push(i)}return t}addMembersFromParent(e,t){if(!e.extended_class)return e;const r=t.find(s=>s.name===e.extended_class);if(!r||r.type_name!=="class")return e;let i=r;return i.extended_class&&(i=this.addMembersFromParent(i,t)),e.fields=[...e.fields,...this.getInheritedFields(i,e)],e.properties=[...e.properties,...this.getInheritedProperties(i,e)],e.methods=[...e.methods,...this.getInheritedMethods(i,e)],e}addMethodsFromParent(e,t){if(!e.extended_interfaces.length)return e;const r=[];for(const i of e.extended_interfaces){const s=t.find(o=>o.name===i);s&&r.push(s)}for(const i of r){let s=i;s.extended_interfaces.length&&(s=this.addMethodsFromParent(s,t)),e.methods=[...e.methods,...this.getInheritedMethods(s,e)]}return e}getInheritedFields(e,t){return e.fields.filter(r=>r.access_modifier.toLowerCase()!=="private").filter(r=>!this.memberExists(t.fields,r.name)).map(r=>he(fe({},r),{inherited:!0}))}getInheritedProperties(e,t){return e.properties.filter(r=>r.access_modifier.toLowerCase()!=="private").filter(r=>!this.memberExists(t.properties,r.name)).map(r=>he(fe({},r),{inherited:!0}))}getInheritedMethods(e,t){return e.methods.filter(r=>r.access_modifier.toLowerCase()!=="private").filter(r=>!this.memberExists(t.methods,r.name)).map(r=>he(fe({},r),{inherited:!0}))}memberExists(e,t){return e.map(i=>i.name).includes(t)}};a(Ze,"RawBodyParser");let me=Ze;const x=class x{constructor(){}static getInstance(){return x.instance||(x.instance=new x),x.instance}setTypeBeingProcessed(e){this.typeBeingProcessed=e}getTypeBeingProcessed(){return this.typeBeingProcessed}};a(x,"State");let q=x;const Je=class Je{static generate(e,t){var r,i;const s=e.sort((o,c)=>o.name<c.name?-1:o.name>c.name?1:0);(r=t.onBeforeProcess)==null||r.call(t,s),!u.getInstance().indexOnly&&(s.forEach(o=>{q.getInstance().setTypeBeingProcessed(o),t.onProcess(o)}),(i=t.onAfterProcess)==null||i.call(t,s))}};a(Je,"Transpiler");let ge=Je;const Qe=class Qe{static write(e,t){const r=a(i=>u.getInstance().onBeforeFileWrite(i),"onBeforeFileWrite");e.forEach(i=>{const s=this.getTargetLocation(i,r),o=oe.join(s.dir.baseDir,s.dir.fileDir);P.existsSync(o)||P.mkdirSync(o,{recursive:!0});const c=oe.join(o,`${s.name}${s.extension}`);P.writeFileSync(c,i.body,"utf8"),t(s)})}static getTargetLocation(e,t){const r={name:e.fileName,extension:e.fileExtension(),dir:{baseDir:u.getInstance().outputDir,fileDir:e.dir}};return t(r)}};a(Qe,"FileWriter");let W=Qe;const He=class He{static logErrors(e){e.forEach(t=>{this.logErrorsForSingleType(t)})}static logErrorsForSingleType(e){this.logTypeErrors(e),e.type_name==="class"?this.logErrorsForClass(e):e.type_name==="interface"&&this.logErrorsForInterface(e)}static logTypeErrors(e,t){var r;if((r=e.docComment)!=null&&r.error){const i=t?`${t.name}.${e.name}`:e.name;p.error(`${i} - Doc comment parsing error. Level: Type`),p.error(`Comment:
|
|
5
|
+
${e.docComment.rawDeclaration}`),p.error(e.docComment.error),p.error("=================================")}}static logErrorsForClass(e,t){const r=t?`${t.name}.${e.name}`:e.name;e.constructors.forEach(i=>{var s;(s=i.docComment)!=null&&s.error&&(p.error(`${r} - Doc comment parsing error. Level: Constructor`),p.error(`Comment:
|
|
6
|
+
${i.docComment.rawDeclaration}`),p.error(i.docComment.error),p.error("================================="))}),e.fields.forEach(i=>{var s;(s=i.docComment)!=null&&s.error&&(p.error(`${r} - Doc comment parsing error. Level: Field`),p.error(`Comment:
|
|
7
|
+
${i.docComment.rawDeclaration}`),p.error(i.docComment.error),p.error("================================="))}),e.properties.forEach(i=>{var s;(s=i.docComment)!=null&&s.error&&(p.error(`${r} - Doc comment parsing error. Level: Property`),p.error(`Comment:
|
|
8
|
+
${i.docComment.rawDeclaration}`),p.error(i.docComment.error),p.error("================================="))}),e.methods.forEach(i=>{var s;(s=i.docComment)!=null&&s.error&&(p.error(`${r} - Doc comment parsing error. Level: Method`),p.error(`Comment:
|
|
9
|
+
${i.docComment.rawDeclaration}`),p.error(i.docComment.error),p.error("================================="))}),e.enums.forEach(i=>{this.logErrorsForSingleType(i)}),e.interfaces.forEach(i=>{this.logErrorsForSingleType(i)}),e.classes.forEach(i=>{this.logErrorsForSingleType(i)})}static logErrorsForInterface(e){e.methods.forEach(t=>{var r;(r=t.docComment)!=null&&r.error&&(p.error(`${e.name} - Doc comment parsing error. Level: Method`),p.error(`Comment: ${t.docComment.rawDeclaration}`),p.error(t.docComment.error),p.error("================================="))})}};a(He,"ErrorLogger");let ye=He;const I=class I{constructor(){this.scopedTypes=[],this.allTypes=[]}static getInstance(){return I.instance||(I.instance=new I),I.instance}populateAll(e){this.allTypes=e}getFromAllByName(e){if(e.includes(".")){const[r,i]=e.split("."),s=this.allTypes.find(d=>d.name.toLowerCase()===r.toLowerCase());if(!s||s.type_name!=="class")return;const o=s,l=[...o.classes,...o.interfaces,...o.enums].find(d=>d.name.toLowerCase()===i);return l?{type:l,isChild:!0,parentType:s}:void 0}const t=this.allTypes.find(r=>r.name.toLowerCase()===e.toLowerCase());if(t)return{type:t,isChild:!1}}populateScoped(e){this.scopedTypes=e}getFromScopedByName(e){return this.scopedTypes.find(t=>t.name===e)}};a(I,"TypesRepository");let $=I;const Ke=class Ke{getLinkingStrategy(){return"root-relative"}};a(Ke,"ProcessorTypeTranspiler");let V=Ke;const et=class et{constructor(){this._files=[]}files(){return this._files}pushFile(e){this._files.push(e)}};a(et,"FileContainer");let U=et;const se=class se{static getSanitizedGroup(e){return this.getClassGroup(e).replace(/ /g,"-").replace(".","")}static getFileLink(e){const[t,r]=se.getFileLinkTuple(e);return`[${t}](${r})`}static getFileLinkTuple(e){var t;const i=`${(t=u.getInstance().getRootDir())!=null?t:""}${this.getDirectoryRoot(e)}`,s=`${u.getInstance().getNamespacePrefix()}${e.name}`;return[s,`${i}${s}.md`]}static getFileLinkByTypeName(e){const t=$.getInstance().getFromScopedByName(e);return t?this.getFileLink(t):`[${e}](${e})`}static getDirectoryRoot(e){if(u.getInstance().getLinkingStrategy()==="root-relative")return`/${this.getSanitizedGroup(e)}/`;const t=q.getInstance().getTypeBeingProcessed();return t?this.getClassGroup(t)===this.getClassGroup(e)?"./":`../${this.getSanitizedGroup(e)}/`:`./${this.getSanitizedGroup(e)}/`}static getClassGroup(e){var t,r;const i=(t=e.docComment)==null?void 0:t.annotations.find(s=>s.name.toLowerCase()==="group");return(r=i==null?void 0:i.body)!=null?r:u.getInstance().getDefaultGroupName()}};a(se,"ClassFileGeneratorHelper");let T=se;const tt=class tt{constructor(e,t){this.fileName=e,this.dir=t,this._contents=""}get body(){return this._contents}addText(e){this._contents+=e,this.addBlankLine()}addBlankLine(){this._contents+=`
|
|
10
|
+
`}};a(tt,"OutputFile");let X=tt;const G=class G extends X{fileExtension(){return".md"}addTitle(e,t=1){let r="";for(let i=0;i<t;i++)r+="#";r+=" ",r+=e,this._contents+=r,this.addBlankLine()}addText(e){return super.addText(e),this}addLink(e){this.addText(`{@link ${e}}`)}startCodeBlock(e="apex"){this.addText(`\`\`\`${e}`)}endCodeBlock(){this.addText("```"),this.addBlankLine()}addHorizontalRule(){this._contents+="---",this.addBlankLine()}initializeTable(...e){this.addBlankLine(),this._contents+="|",e.forEach(t=>{this._contents+=t+"|"}),this.addBlankLine(),this._contents+="|",e.forEach(()=>{this._contents+="---|"}),this.addBlankLine()}addTableRow(...e){this._contents+="|",e.forEach(t=>{this._contents+=this._replaceInlineReferences(t)+"|"}),this.addBlankLine()}addListItem(e){this._contents+=`* ${e}`}static replaceInlineLinks(e){const t=e.match(/<<.*?>>/g);t==null||t.forEach(c=>{const l=c.replace("<<","").replace(">>","");e=e.replace(c,T.getFileLinkByTypeName(l))});const r="{@link (.*?)}",i=new RegExp(r,"gi");let s;const o=[];do s=i.exec(e),s&&o.push(s);while(s);for(const c of o)e=e.replace(c[0],T.getFileLinkByTypeName(c[1]));return e}static replaceInlineEmails(e){const t="{@email (.*?)}",r=new RegExp(t,"gi");let i;const s=[];do i=r.exec(e),i&&s.push(i);while(i);for(const o of s)e=e.replace(o[0],`[${o[1]}](mailto:${o[1]})`);return e}_replaceInlineReferences(e){return e=G.replaceInlineLinks(e),e=G.replaceInlineEmails(e),e}};a(G,"MarkdownFile");let S=G;function Zn(n,e){return n.length>e?n.substr(0,e-1)+"…":n}a(Zn,"truncate");const Jn=a(n=>n.replace(/\//g," ").replace(/([A-Z])/g,e=>` ${e}`).replace(/\b\w/g,e=>e.toUpperCase()).replace(/^./,e=>e.toUpperCase()).trim(),"camel2title"),nt=class nt extends S{constructor(e,t,r){super(e,""),this.fileName=e,this.types=t,r&&this.addText(r),this.addTitle(u.getInstance().getTitle()),this.addTypeEntries(t)}addTypeEntries(e){this.group(e).forEach((r,i)=>{this.addTitle(i,2),r.forEach(s=>{this.addTypeEntry(s)})})}addTypeEntry(e){var t;if(this.addBlankLine(),this.addTitle(T.getFileLink(e),3),this.addBlankLine(),(t=e.docComment)!=null&&t.descriptionLines){const r=e.docComment.descriptionLines.reduce((i,s)=>i+s+`
|
|
11
|
+
`,"");this.addText(Zn(r,300)),this.addBlankLine()}}group(e){return e.reduce((t,r)=>{const i=this.getClassGroup(r),s=t.get(i)||[];return s.push(r),t.set(i,s),t},new Map)}getClassGroup(e){var t,r,i;return(i=(r=(t=e.docComment)==null?void 0:t.annotations.find(s=>s.name==="group"))==null?void 0:r.body)!=null?i:u.getInstance().getDefaultGroupName()}};a(nt,"MarkdownHomeFile");let Y=nt;const rt=class rt{constructor(e){this.type=e}sortType(e){return u.getInstance().sortMembersAlphabetically()?e.sort((t,r)=>t.name.localeCompare(r.name)):e}};a(rt,"Walker");let B=rt;const it=class it extends B{walk(e){e.onTypeDeclaration(this.type);const t=this.type;t.constructors.length&&e.onConstructorDeclaration(this.type.name,t.constructors),t.fields.length&&e.onFieldsDeclaration(this.sortType(t.fields)),t.properties.length&&e.onPropertiesDeclaration(this.sortType(t.properties)),t.methods.length&&e.onMethodsDeclaration(this.sortType(t.methods)),t.enums.length&&e.onInnerEnumsDeclaration(this.sortType(t.enums)),t.classes.length&&e.onInnerClassesDeclaration(this.sortType(t.classes)),t.interfaces.length&&e.onInnerInterfacesDeclaration(this.sortType(t.interfaces))}};a(it,"ClassWalker");let ve=it;const st=class st extends B{walk(e){e.onTypeDeclaration(this.type)}};a(st,"EnumWalker");let _e=st;const at=class at extends B{walk(e){e.onTypeDeclaration(this.type);const t=this.type;t.methods.length&&e.onMethodsDeclaration(this.sortType(t.methods))}};a(at,"InterfaceWalker");let Ce=at;const ot=class ot{static get(e){switch(e.type_name){case"class":return new ve(e);case"enum":return new _e(e);case"interface":return new Ce(e)}throw Error("Walker not found for type.")}};a(ot,"WalkerFactory");let be=ot;function Rt(n,e){var t;const r=(t=e.docComment)==null?void 0:t.annotations.find(i=>i.name==="mermaid");r&&(n.addBlankLine(),n.startCodeBlock("mermaid"),r.bodyLines.forEach(i=>{n.addText(i)}),n.endCodeBlock(),n.addBlankLine())}a(Rt,"addMermaid");function jt(n,e){var t;(t=e.docComment)==null||t.annotations.filter(s=>s.name!=="description").filter(s=>s.name!=="mermaid").forEach(s=>{n.addBlankLine(),n.addText(i(s)),n.addBlankLine()});function r(s){const o=s.split(/[-_]+/),c=[];for(const l of o)c.push(l.charAt(0).toUpperCase()+l.slice(1));return c.join(" ")}a(r,"splitAndCapitalize");function i(s){let o=s.body;return s.name.toLowerCase()==="see"&&(o=T.getFileLinkByTypeName(s.body)),`**${r(s.name)}** ${o}`}a(i,"buildDocAnnotationText")}a(jt,"addCustomDocCommentAnnotations");function Qn(n,e){var t;if(e.annotations.forEach(r=>{n.addBlankLine(),n.addText(`\`${r.type.toUpperCase()}\``)}),(t=e.docComment)!=null&&t.descriptionLines){n.addBlankLine();for(const r of e.docComment.descriptionLines)n.addText(r);n.addBlankLine()}e.type_name==="class"&&Hn(e,n),e.type_name==="interface"&&Kn(e,n),jt(n,e),Rt(n,e)}a(Qn,"declareType");function Hn(n,e){const t=n;if(t.extended_class&&(e.addBlankLine(),e.addText("**Inheritance**"),e.addBlankLine(),Bt(e,t),e.addText(n.name),e.addBlankLine()),t.implemented_interfaces.length){e.addBlankLine(),e.addText("**Implemented types**"),e.addBlankLine();for(let r=0;r<t.implemented_interfaces.length;r++){const i=t.implemented_interfaces[r];e.addLink(i),r<t.implemented_interfaces.length-1&&e.addText(", ")}e.addBlankLine()}}a(Hn,"addInheritanceSectionForClass");function Kn(n,e){const t=n;if(t.extended_interfaces.length){e.addBlankLine(),e.addText("**Extended types**"),e.addBlankLine();for(let r=0;r<t.extended_interfaces.length;r++){const i=t.extended_interfaces[r];e.addLink(i),r<t.extended_interfaces.length-1&&e.addText(", ")}}}a(Kn,"addInheritanceSectionForInterface");function Bt(n,e){if(!e.extended_class)return;const t=$.getInstance().getFromScopedByName(e.extended_class);t&&(t.type_name==="class"&&Bt(n,t),n.addLink(t.name),n.addText(" > "))}a(Bt,"addParent");function Nt(n,e,t,r=""){e.forEach(i=>{var s,o;const c=Z(i)?`${i.typeReference.rawDeclaration} ${i.name}`:r;n.addTitle(`\`${er(i.access_modifier,c,i)}\``,t+2),Z(i)&&i.inherited&&(n.addBlankLine(),n.addText("*Inherited*"),n.addBlankLine()),i.annotations.forEach(l=>{n.addBlankLine(),n.addText(`\`${l.type.toUpperCase()}\``)}),(s=i.docComment)!=null&&s.description&&(n.addBlankLine(),n.addText(i.docComment.description),n.addBlankLine()),i.parameters.length&&tr(n,i,t),Z(i)&&nr(n,i,t),rr(n,i,t),jt(n,i),Rt(n,i),(o=i.docComment)!=null&&o.exampleAnnotation&&ir(n,i,t)}),n.addHorizontalRule()}a(Nt,"declareMethod");function er(n,e,t){let r=`${e}(`;Z(t)&&t.memberModifiers.length?r=n+" "+t.memberModifiers.join(" ")+" "+r:r=n+" "+r;const i=t.parameters.map(s=>`${s.typeReference.rawDeclaration} ${s.name}`);return r+=i.join(", "),`${r})`}a(er,"buildSignature");function tr(n,e,t){var r,i;(r=e.docComment)!=null&&r.paramAnnotations.length&&(n.addTitle("Parameters",t+3),n.initializeTable("Param","Description"),(i=e.docComment)==null||i.paramAnnotations.forEach(s=>{const o=s.paramName,c=s.bodyLines.join(" ");n.addTableRow(`\`${o}\``,c)}),n.addBlankLine())}a(tr,"addParameters");function nr(n,e,t){var r,i;(r=e.docComment)!=null&&r.returnAnnotation&&(n.addTitle("Returns",t+3),n.initializeTable("Type","Description"),n.addTableRow(`\`${e.typeReference.rawDeclaration}\``,(i=e.docComment)==null?void 0:i.returnAnnotation.bodyLines.join(" ")),n.addBlankLine())}a(nr,"addReturns");function rr(n,e,t){var r,i;(r=e.docComment)!=null&&r.throwsAnnotations.length&&(n.addTitle("Throws",t+3),n.initializeTable("Exception","Description"),(i=e.docComment)==null||i.throwsAnnotations.forEach(s=>{const o=s.exceptionName,c=s.bodyLines.join(" ");n.addTableRow(`\`${o}\``,c)}),n.addBlankLine())}a(rr,"addThrowsBlock");function ir(n,e,t){var r;n.addTitle("Example",t+3),n.startCodeBlock(),(r=e.docComment)==null||r.exampleAnnotation.bodyLines.forEach(i=>{n.addText(i)}),n.endCodeBlock(),n.addBlankLine()}a(ir,"addExample");function Z(n){return n.typeReference!==void 0}a(Z,"isMethod");function Mt(n,e,t,r=!1){n.addBlankLine(),e.forEach(i=>{sr(n,i,t,r)}),n.addHorizontalRule()}a(Mt,"declareField");function sr(n,e,t,r){var i,s,o;if(!r)n.addTitle(`\`${e.access_modifier} ${e.name}\` \u2192 \`${e.typeReference.rawDeclaration}\``,t+2),n.addBlankLine(),e.inherited&&n.addText("*Inherited*"),e.annotations.forEach(c=>{n.addText(`\`${c.type.toUpperCase()}\` `)}),(i=e.docComment)!=null&&i.description&&(n.addBlankLine(),n.addText(e.docComment.description)),n.addBlankLine();else{let c="";const l=!!e.annotations.length;l&&(c+=" ["),e.annotations.forEach(h=>{c+=`\`${h.type.toUpperCase()}\` `}),l&&(c+="]");let d="";(s=e.docComment)!=null&&s.description&&(d=` - ${(o=e.docComment)==null?void 0:o.description}`);let f=`\`${e.access_modifier} ${e.name}\` \u2192 \`${e.typeReference.rawDeclaration}\``;e.inherited&&(f+="(*Inherited*)"),f+=`${c} ${d}`,n.addListItem(f),n.addBlankLine()}}a(sr,"addFieldSection");const ae=class ae extends S{constructor(e,t=1,r,i=!1){super(`${u.getInstance().getNamespacePrefix()}${e.name}`,T.getSanitizedGroup(e)),this.type=e,this.headingLevel=t,this.isInner=i,r&&this.addText(r),be.get(e).walk(this)}onTypeDeclaration(e){let t;this.isInner?t=e.name:this.isClass(e)&&e.classModifier?t=`${e.classModifier} ${u.getInstance().getNamespacePrefix()}${e.name}`:t=`${u.getInstance().getNamespacePrefix()}${e.name}`,this.addTitle(t,this.headingLevel),Qn(this,e)}isClass(e){return e.type_name==="class"}onConstructorDeclaration(e,t){this.addTitle("Constructors",this.headingLevel+1),this.declareMethodWithGroupings(t,e)}onFieldsDeclaration(e){this.addTitle("Fields",this.headingLevel+1),this.declareFieldOrProperty(e)}onPropertiesDeclaration(e){this.addTitle("Properties",this.headingLevel+1),this.declareFieldOrProperty(e)}onMethodsDeclaration(e){this.addTitle("Methods",this.headingLevel+1),this.declareMethodWithGroupings(e)}onInnerEnumsDeclaration(e){this.addInnerTypes("Enums",e)}onInnerClassesDeclaration(e){this.addInnerTypes("Classes",e)}onInnerInterfacesDeclaration(e){this.addInnerTypes("Interfaces",e,!1)}addInnerTypes(e,t,r=!0){this.addTitle(e,this.headingLevel+1),t.forEach(i=>{const s=new ae(i,this.headingLevel+2,void 0,!0);this.addText(s._contents)}),r&&this.addHorizontalRule()}hasGroupings(e){return!!e.find(t=>!!t.group)}declareMethodWithGroupings(e,t=""){if(!this.hasGroupings(e))Nt(this,e,this.headingLevel,t);else{const i=this.group(e);for(const s in i){this.startGroup(s,i[s][0].groupDescription);const o=i[s];Nt(this,o,this.headingLevel,t),this.endGroup()}}}declareFieldOrProperty(e){if(!this.hasGroupings(e))Mt(this,e,this.headingLevel,!1);else{const r=this.group(e);for(const i in r){this.startGroup(i,r[i][0].groupDescription);const s=r[i];Mt(this,s,this.headingLevel,!0),this.endGroup()}}}startGroup(e,t){this.headingLevel=this.headingLevel+2,this.addTitle(e,this.headingLevel),t&&this.addText(t)}endGroup(){this.headingLevel=this.headingLevel-2}group(e){return e.reduce((t,r)=>{var i;const s=(i=r.group)!=null?i:"Other",o=t[s]||[];return o.push(r),t[s]=o,t},{})}};a(ae,"MarkdownTypeFile");let J=ae;const ct=class ct extends V{constructor(){super(),this.onBeforeProcess=e=>{this._fileContainer.pushFile(new Y(this.homeFileName(),e))},this._fileContainer=new U}fileBuilder(){return this._fileContainer}onProcess(e){this._fileContainer.pushFile(new J(e))}};a(ct,"MarkdownTranspilerBase");let Q=ct;const lt=class lt extends Q{constructor(){super(...arguments),this.onBeforeProcess=e=>{this._fileContainer.pushFile(new Y(this.homeFileName(),e,this.frontMatterForHomeFile))}}homeFileName(){return"index"}onProcess(e){this._fileContainer.pushFile(new J(e,1,this.getFrontMatterHeader(e)))}get frontMatterForHomeFile(){return`---
|
|
12
|
+
layout: default
|
|
13
|
+
---`}getFrontMatterHeader(e){var t;const r=["---"];r.push("layout: default");const i={name:e.name,typeName:e.type_name,accessModifier:e.access_modifier,group:e.group,description:(t=e.docComment)==null?void 0:t.description},s=u.getInstance().frontMatterHeader(i);return s&&s.forEach(o=>{r.push(o)}),r.push("---"),r.join(`
|
|
14
|
+
`)}getLinkingStrategy(){return"path-relative"}};a(lt,"JekyllDocsProcessor");let $e=lt;const dt=class dt extends Q{homeFileName(){return"README"}getLinkingStrategy(){return"root-relative"}};a(dt,"DocsifyDocsProcessor");let Pe=dt;var ar=Object.defineProperty,or=Object.defineProperties,cr=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,lr=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,Gt=a((n,e,t)=>e in n?ar(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$7"),pr=a((n,e)=>{for(var t in e||(e={}))lr.call(e,t)&&Gt(n,t,e[t]);if(Ft)for(var t of Ft(e))dr.call(e,t)&&Gt(n,t,e[t]);return n},"__spreadValues$7"),ur=a((n,e)=>or(n,cr(e)),"__spreadProps$6");const pt=class pt extends X{constructor(e){super(u.getInstance().openApiFileName(),""),this.openApiModel=e,this.addText(JSON.stringify(ur(pr({},e),{namespace:void 0}),null,2))}fileExtension(){return".json"}};a(pt,"OpenapiTypeFile");let we=pt;const fr="3.1.0",zt="/services/apexrest/",ut=class ut{constructor(e,t,r){this.namespace=r,this.openapi=fr,this.info={title:e,version:t},this.servers=[{url:this.getServerUrl()}],this.paths={},this.tags=[]}getServerUrl(){return this.namespace?`${zt}${this.namespace}/`:zt}};a(ut,"OpenApi");let Te=ut;const ft=class ft{constructor(e){this.classMirror=e,this.hasAnnotation=(t,r)=>t.annotations.some(i=>i.name.toLowerCase()===r)}getMethodsByAnnotation(e){return this.classMirror.methods.filter(t=>this.hasAnnotation(t,e))}};a(ft,"ClassMirrorWrapper");let Le=ft;var hr=Object.defineProperty,mr=Object.defineProperties,gr=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertySymbols,yr=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable,qt=a((n,e,t)=>e in n?hr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$6"),Oe=a((n,e)=>{for(var t in e||(e={}))yr.call(e,t)&&qt(n,t,e[t]);if(kt)for(var t of kt(e))vr.call(e,t)&&qt(n,t,e[t]);return n},"__spreadValues$6"),Ae=a((n,e)=>mr(n,gr(e)),"__spreadProps$5");const ht=class ht{constructor(){this.isReferenceString=e=>typeof e=="string"||e instanceof String}build(e){const t=e,r=/\[(.*?)]/g,i=e.match(r);let s=[];i&&i.length>0&&(s=xe.build(i[0]),e=e.replace(r,""));const[o,c]=this.handlePossibleCollectionReference(e),l=$.getInstance().getFromAllByName(o);if(!l)throw new Error(`The referenced type ${e} was not found.`);if(l.type.type_name!=="class")throw new Error(`Expected the referenced type to be a class, but found a ${l.type.type_name}.`);const d=Ae(Oe({},l),{originalTypeName:t,isCollection:c,referenceOverrides:s});return this.buildReferenceFromType(d)}handlePossibleCollectionReference(e){return e=e.toLowerCase(),e.startsWith("list<")&&e.endsWith(">")?(e=e.replace("list<",""),e=e.replace(">",""),[e,!0]):e.startsWith("set<")&&e.endsWith(">")?(e=e.replace("set<",""),e=e.replace(">",""),[e,!0]):[e,!1]}buildReferenceFromType(e){const t=[...e.type.properties,...e.type.fields].filter(o=>!o.memberModifiers.includes("static")).filter(o=>!o.memberModifiers.includes("transient")),r={};let i=[];return t.forEach(o=>{var c,l;const d=e.referenceOverrides.find(f=>f.propertyName.toLowerCase()===o.name.toLowerCase());if(d){const f=this.build(d.referenceName);r[o.name]=f.entrypointReferenceObject,f.referenceComponents.forEach(h=>i.push(h))}else{const f=(c=o.docComment)==null?void 0:c.annotations.find(h=>h.name.toLowerCase()==="http-schema");if(f)this.handleOverriddenSchema(f,r,o,i);else{const h=this.getReferenceType(o.typeReference);r[o.name]=h.schema,i.push(...h.referenceComponents)}}r[o.name].description=(l=o.docComment)==null?void 0:l.description}),i=[...this.buildMainReferenceComponent(e,r),...i],{entrypointReferenceObject:{$ref:`#/components/schemas/${this.getReferenceName(e)}`},referenceComponents:i}}handleOverriddenSchema(e,t,r,i){const s=e==null?void 0:e.bodyLines.reduce((l,d)=>l+`
|
|
15
|
+
`+d),o=xt.load(s);if(this.isReferenceString(o)){const l=this.build(o);t[r.name]=l.entrypointReferenceObject,l.referenceComponents.forEach(d=>i.push(d))}else t[r.name]=o}getReferenceName(e){var t;let r=e.type.name;return e.isChild&&(r=`${(t=e.parentType)==null?void 0:t.name}.${e.type.name}`),e.isCollection&&(r=`${r}_array`),e.referenceOverrides.length&&(r=`${r}_${e.originalTypeName}`),r}buildMainReferenceComponent(e,t){const r=this.getReferenceName(Ae(Oe({},e),{isCollection:!1})),s=[{referencedClass:r,schema:{type:"object",properties:t}}];return e.isCollection?[{referencedClass:this.getReferenceName(e),schema:{type:"array",items:{$ref:`#/components/schemas/${r}`}}},...s]:s}getReferenceType(e){const t=e.type.toLowerCase();switch(t){case"boolean":return{schema:{type:"boolean"},referenceComponents:[]};case"date":return{schema:{type:"string",format:"date"},referenceComponents:[]};case"datetime":return{schema:{type:"string",format:"date-time"},referenceComponents:[]};case"decimal":return{schema:{type:"number"},referenceComponents:[]};case"double":return{schema:{type:"number"},referenceComponents:[]};case"id":return{schema:{type:"string"},referenceComponents:[]};case"integer":return{schema:{type:"integer"},referenceComponents:[]};case"long":return{schema:{type:"integer",format:"int64"},referenceComponents:[]};case"string":return{schema:{type:"string"},referenceComponents:[]};case"time":return{schema:{type:"string",format:"time"},referenceComponents:[]};case"list":return this.buildCollectionPair(e);case"set":return this.buildCollectionPair(e);case"map":return{schema:{type:"object"},referenceComponents:[]};case"object":return{schema:{type:"object"},referenceComponents:[]};default:{const r=$.getInstance().getFromAllByName(t);if(!r)return{schema:{type:"object"},referenceComponents:[]};const i=this.buildReferenceFromType(Ae(Oe({},r),{isCollection:!1,referenceOverrides:[],originalTypeName:t}));return{schema:i.entrypointReferenceObject,referenceComponents:[...i.referenceComponents]}}}}buildCollectionPair(e){const t=this.getReferenceType(e.ofType);return{schema:{type:"array",items:t.schema},referenceComponents:[...t.referenceComponents]}}};a(ht,"ReferenceBuilder");let N=ht;const mt=class mt{static build(e){return e.replace(/[[\]]/g,"").split(",").map(i=>i.replace(/\s/g,"")).map(i=>{const[s,o]=i.split(":");return{propertyName:s,referenceName:o}})}};a(mt,"ReferenceOverrides");let xe=mt;const gt=class gt{constructor(){this.isReferenceString=e=>typeof e=="string"||e instanceof String}build(e){let t;return this.isReferenceString(e.schema)&&(t=new N().build(e.schema)),{reference:t,body:this.buildBody(e,t)}}getOpenApiSchemaFromApexDocSchema(e,t){return this.isReferenceString(e.schema)?t.entrypointReferenceObject:e.schema}};a(gt,"Builder");let M=gt;var _r=Object.defineProperty,Cr=Object.defineProperties,br=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,$r=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Vt=a((n,e,t)=>e in n?_r(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$5"),wr=a((n,e)=>{for(var t in e||(e={}))$r.call(e,t)&&Vt(n,t,e[t]);if(Wt)for(var t of Wt(e))Pr.call(e,t)&&Vt(n,t,e[t]);return n},"__spreadValues$5"),Tr=a((n,e)=>Cr(n,br(e)),"__spreadProps$4");const yt=class yt extends M{buildBody(e,t){return Tr(wr({},e),{schema:this.getOpenApiSchemaFromApexDocSchema(e,t)})}};a(yt,"ParameterObjectBuilder");let Ie=yt;const vt=class vt extends M{buildBody(e,t){let r=`Status code ${e.statusCode}`;return e.description&&(r=e.description),{description:r,content:{"application/json":{schema:this.getOpenApiSchemaFromApexDocSchema(e,t)}}}}};a(vt,"ResponsesBuilder");let Ee=vt;const _t=class _t extends M{buildBody(e,t){return{description:e.description,content:{"application/json":{schema:this.getOpenApiSchemaFromApexDocSchema(e,t)}},required:e.required}}};a(_t,"RequestBodyBuilder");let H=_t;const Ct=class Ct{constructor(e){this.methodMirror=e,this.hasDocCommentAnnotation=t=>{var r;return(r=this.methodMirror.docComment)==null?void 0:r.annotations.some(i=>i.name.toLowerCase()===t)},this.getDocCommentAnnotation=t=>{var r;return(r=this.methodMirror.docComment)==null?void 0:r.annotations.find(i=>i.name.toLowerCase()===t)}}};a(Ct,"MethodMirrorWrapper");let De=Ct;const bt=class bt{constructor(e){this.openApiModel=e}parseMethod(e,t,r,i){var s,o;const l=new Le(e).getMethodsByAnnotation(`http${r}`);if(!l.length)return;const d=l[0];this.openApiModel.paths[t][r]={},this.openApiModel.paths[t][r].tags=[i],(s=d.docComment)!=null&&s.description&&(this.openApiModel.paths[t][r].description=d.docComment.description);const f=new De(d);f.hasDocCommentAnnotation("summary")&&(this.openApiModel.paths[t][r].summary=(o=f.getDocCommentAnnotation("summary"))==null?void 0:o.body),this.parseHttpAnnotation(d,t,r,"http-request-body",this.addRequestBodyToOpenApi.bind(this),this.fallbackHttpRequestBodyParser(t,r)),this.parseHttpAnnotation(d,t,r,"http-parameter",this.addParametersToOpenApi.bind(this)),this.parseHttpAnnotation(d,t,r,"http-response",this.addHttpResponsesToOpenApi.bind(this),this.getFallbackHttpResponseParser(t,r))}parseHttpAnnotation(e,t,r,i,s,o){var c;const l=(c=e.docComment)==null?void 0:c.annotations.filter(d=>d.name===i);if(!(l!=null&&l.length)){o&&o(e);return}for(const d of l){const f=d==null?void 0:d.bodyLines.reduce((h,m)=>h+`
|
|
16
|
+
`+m);if(!f)return;this.addToOpenApiStrategy(f,t,r,s)}}addToOpenApiStrategy(e,t,r,i){const s=xt.load(e),o=new H().build(s);i(s,t,r),this.addReference(o)}addRequestBodyToOpenApi(e,t,r){const i=new H().build(e);this.openApiModel.paths[t][r].requestBody=i.body}addParametersToOpenApi(e,t,r){const i=new Ie().build(e);this.openApiModel.paths[t][r].parameters===void 0&&(this.openApiModel.paths[t][r].parameters=[]),this.openApiModel.paths[t][r].parameters.push(i.body)}addHttpResponsesToOpenApi(e,t,r){const i=new Ee().build(e);this.openApiModel.paths[t][r].responses===void 0&&(this.openApiModel.paths[t][r].responses={}),this.openApiModel.paths[t][r].responses[e.statusCode]=i.body}fallbackHttpRequestBodyParser(e,t){return r=>{const i=r.parameters;if(!i.length)return;const s={};i.forEach(o=>{const c=o.name,l=new N().getReferenceType(o.typeReference);s[c]=l.schema,this.addReference({reference:{entrypointReferenceObject:l.schema,referenceComponents:l.referenceComponents}})}),this.openApiModel.paths[e][t].requestBody={content:{"application/json":{schema:{type:"object",properties:s}}}}}}getFallbackHttpResponseParser(e,t){return r=>{var i,s;const o=r.typeReference;if(o.type.toLowerCase()==="void")return;const c=new N().getReferenceType(o);this.addReference({reference:{entrypointReferenceObject:c.schema,referenceComponents:c.referenceComponents}}),this.openApiModel.paths[e][t].responses===void 0&&(this.openApiModel.paths[e][t].responses={}),this.openApiModel.paths[e][t].responses[200]={description:(s=(i=r.docComment)==null?void 0:i.description)!=null?s:"Status code 200",content:{"application/json":{schema:c.schema}}}}}addReference(e){if(e.reference){if(this.openApiModel.components===void 0&&(this.openApiModel.components={schemas:{}}),!e.reference.referenceComponents.length)return;e.reference.referenceComponents.forEach(t=>{this.openApiModel.components.schemas[t.referencedClass]=t.schema})}}};a(bt,"MethodParser");let Se=bt;const $t=class $t extends V{constructor(){super(),this.onAfterProcess=()=>{this._fileContainer.pushFile(new we(this.openApiModel))},this._fileContainer=new U;const e=u.getInstance().getOpenApiTitle();if(!e)throw Error("No OpenApi title was provided.");this.openApiModel=new Te(e,"1.0.0",u.getInstance().getNamespace())}fileBuilder(){return this._fileContainer}onProcess(e){var t,r;p.logSingle(`Processing ${e.name}`,!1,"green",!1);const i=this.getEndpointPath(e);if(!i)return;this.openApiModel.paths[i]={},(t=e.docComment)!=null&&t.description&&(this.openApiModel.paths[i].description=e.docComment.description);const s=e,o=Jn(i);this.openApiModel.tags.push({name:o,description:(r=e.docComment)==null?void 0:r.description});const c=new Se(this.openApiModel);c.parseMethod(s,i,"get",o),c.parseMethod(s,i,"patch",o),c.parseMethod(s,i,"post",o),c.parseMethod(s,i,"put",o),c.parseMethod(s,i,"delete",o)}getEndpointPath(e){var t;const r=e.annotations.find(o=>o.name.toLowerCase()==="restresource"),i=(t=r==null?void 0:r.elementValues)==null?void 0:t.find(o=>o.key.toLowerCase()==="urlmapping");if(!i)return p.error(`Type does not contain urlMapping annotation ${e.name}`),null;let s=i.value.replaceAll('"',"").replaceAll("'","").replaceAll("/*","/");return s.startsWith("/")&&(s=s.substring(1)),s}};a($t,"OpenApiDocsProcessor");let Re=$t;const Pt=class Pt{static get(e){if(this.typeTranspilerCache)return this.typeTranspilerCache;switch(e){case"jekyll":return this.typeTranspilerCache=new $e,this.typeTranspilerCache;case"docsify":return this.typeTranspilerCache=new Pe,this.typeTranspilerCache;case"openapi":return this.typeTranspilerCache=new Re,this.typeTranspilerCache;case"plain-markdown":throw Error("Plain Markdown processor is not supported through this factory anymore.");default:throw Error("Invalid target generator")}}};a(Pt,"TypeTranspilerFactory");let K=Pt;function Ut(n,...e){return(...t)=>n(...e,...t)}a(Ut,"apply");function Lr(n){return{__type:"link",title:n,url:`mailto:${n}`}}a(Lr,"defaultGetEmailByReference");function Or(n,e,t=Lr){const r=Ut(Ir,e),i=Ut(Dr,t);return b.pipe(Ar([n]),r,i)}a(Or,"replaceInlineReferences");function Ar(n){return n.flatMap(e=>xr(e))}a(Ar,"inlineCode$1");function xr(n){if(typeof n!="string")return[n];function e(s){return{__type:"inline-code",content:s}}a(e,"inlineCodeLink");const t=n,i=je("`([^`]*)`",t);return Be(i,t,e)}a(xr,"inlineCodeContent");function Ir(n,e){return e.flatMap(t=>Er(t,n))}a(Ir,"replaceInlineLinks");function Er(n,e){if(typeof n!="string")return[n];const t=n,i=je("{@link (.*?)}|<<([^>]+)>>",t);return Be(i,t,e)}a(Er,"inlineLinkContent");function Dr(n,e){return e.flatMap(t=>Sr(t,n))}a(Dr,"replaceInlineEmails");function Sr(n,e){if(typeof n!="string")return[n];const t=n,i=je("{@email (.*?)}",t);return Be(i,t,e)}a(Sr,"inlineEmailContent");function je(n,e){const t=new RegExp(n,"gi");let r;const i=[];do r=t.exec(e),r&&i.push(r);while(r);return i}a(je,"match");function Be(n,e,t){if(n.length===0)return[e];const r=[];let i=0;for(const s of n){const o=s.index,c=s[0].length,l=s.slice(1).find(d=>d);l&&(r.push(e.slice(i,o)),r.push(t(l)),i=o+c)}return i<e.length&&r.push(e.slice(i)),r}a(Be,"createRenderableContents");function Xt(n){return Object.keys(n).includes("__type")&&n.__type==="empty-line"}a(Xt,"isEmptyLine");function Rr(n){return Object.keys(n).includes("__type")&&n.__type==="code-block"}a(Rr,"isCodeBlock");function jr(n){return Object.keys(n).includes("__type")&&n.__type==="inline-code"}a(jr,"isInlineCode");var Br=Object.defineProperty,Nr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,Gr=Object.prototype.propertyIsEnumerable,Zt=a((n,e,t)=>e in n?Br(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$4"),Jt=a((n,e)=>{for(var t in e||(e={}))Fr.call(e,t)&&Zt(n,t,e[t]);if(Yt)for(var t of Yt(e))Gr.call(e,t)&&Zt(n,t,e[t]);return n},"__spreadValues$4"),Qt=a((n,e)=>Nr(n,Mr(e)),"__spreadProps$3");function L(n,e){function t(r){if(!r)return;let i=[];for(let s=0;s<r.length;s++){const o=r[s],c=o.match(/^```([a-zA-Z]*)$/);if(c){const l=c[1]||"apex",d=[];for(s++;s<r.length;){const f=r[s];if(f.trim()==="```")break;d.push(f),s++}i=[...i,{__type:"code-block",language:l,content:d},{__type:"empty-line"}];continue}i=[...i,...Or(o,e),{__type:"empty-line"}]}return i.filter((s,o,c)=>!(Xt(s)&&o===c.length-1))}return a(t,"describableToRenderableContent"),{description:t(n)}}a(L,"adaptDescribable");function ee(n,e,t){var r,i,s;function o(h){var m,v;const _=["description","group","author","date","see","example","mermaid","throws","exception"];return(v=(m=h.docComment)==null?void 0:m.annotations.filter(C=>!_.includes(C.name.toLowerCase())).map(C=>Qt(Jt({},L(C.bodyLines,e)),{name:C.name})))!=null?v:[]}a(o,"extractCustomTags");function c(h,m){var v,_;return(_=(v=h.docComment)==null?void 0:v.annotations.find(C=>C.name.toLowerCase()===m))==null?void 0:_.bodyLines}a(c,"extractAnnotationBodyLines");function l(h,m){var v,_;return(_=(v=h.docComment)==null?void 0:v.annotations.find(C=>C.name.toLowerCase()===m))==null?void 0:_.body}a(l,"extractAnnotationBody");function d(h){var m,v;return(v=(m=h.docComment)==null?void 0:m.annotations.filter(_=>_.name.toLowerCase()==="see").map(_=>_.body))!=null?v:[]}a(d,"extractSeeAnnotations");function f(h,m){if(m)return{__type:"code-block",language:h,content:m}}return a(f,"bodyLinesToCodeBlock"),Qt(Jt({},L((r=n.docComment)==null?void 0:r.descriptionLines,e)),{annotations:n.annotations.map(h=>h.type.toUpperCase()),customTags:o(n),mermaid:{headingLevel:t,heading:"Diagram",value:f("mermaid",c(n,"mermaid"))},example:{headingLevel:t,heading:"Example",value:f("apex",(s=(i=n.docComment)==null?void 0:i.exampleAnnotation)==null?void 0:s.bodyLines)},group:l(n,"group"),author:l(n,"author"),date:l(n,"date"),sees:d(n).map(e)})}a(ee,"adaptDocumentable");var zr=Object.defineProperty,kr=Object.defineProperties,qr=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,Wr=Object.prototype.hasOwnProperty,Vr=Object.prototype.propertyIsEnumerable,Kt=a((n,e,t)=>e in n?zr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$3"),Ne=a((n,e)=>{for(var t in e||(e={}))Wr.call(e,t)&&Kt(n,t,e[t]);if(Ht)for(var t of Ht(e))Vr.call(e,t)&&Kt(n,t,e[t]);return n},"__spreadValues$3"),Me=a((n,e)=>kr(n,qr(e)),"__spreadProps$2");function en(n,e,t){var r,i,s;function o(l){const{name:d,parameters:f}=l,h=f.map(m=>m.name).join(", ");return`${d}(${h})`}a(o,"buildTitle");function c(l){const{access_modifier:d,typeReference:f,name:h,memberModifiers:m}=l,v=l.parameters.map(C=>`${C.typeReference.rawDeclaration} ${C.name}`).join(", "),_=m.length>0?`${m.join(" ")} `:"";return{__type:"code-block",language:"apex",content:[`${d} ${_}${f.rawDeclaration} ${h}(${v})`]}}return a(c,"buildSignature"),{headingLevel:t,doc:ee(n,e,t+1),heading:o(n),signature:{headingLevel:t+1,heading:"Signature",value:c(n)},returnType:{headingLevel:t+1,heading:"Return Type",value:Me(Ne({},L((i=(r=n.docComment)==null?void 0:r.returnAnnotation)==null?void 0:i.bodyLines,e)),{type:e(n.typeReference.rawDeclaration)})},throws:{headingLevel:t+1,heading:"Throws",value:(s=n.docComment)==null?void 0:s.throwsAnnotations.map(l=>nn(l,e))},parameters:{headingLevel:t+1,heading:"Parameters",value:n.parameters.map(l=>tn(n,l,e))},inherited:n.inherited}}a(en,"adaptMethod");function Ur(n,e,t,r){var i;function s(c,l){const{parameters:d}=l,f=d.map(h=>h.name).join(", ");return`${c}(${f})`}a(s,"buildTitle");function o(c,l){const{access_modifier:d}=l,f=l.parameters.map(h=>`${h.typeReference.rawDeclaration} ${h.name}`).join(", ");return{__type:"code-block",language:"apex",content:[`${d} ${c}(${f})`]}}return a(o,"buildSignature"),{doc:ee(e,t,r+1),headingLevel:r,heading:s(n,e),signature:{headingLevel:r+1,heading:"Signature",value:o(n,e)},parameters:{headingLevel:r+1,heading:"Parameters",value:e.parameters.map(c=>tn(e,c,t))},throws:{headingLevel:r+1,heading:"Throws",value:(i=e.docComment)==null?void 0:i.throwsAnnotations.map(c=>nn(c,t))}}}a(Ur,"adaptConstructor");function tn(n,e,t){var r;const i=(r=n.docComment)==null?void 0:r.paramAnnotations.find(s=>s.paramName.toLowerCase()===e.name.toLowerCase());return Me(Ne({},L(i==null?void 0:i.bodyLines,t)),{name:e.name,type:t(e.typeReference.rawDeclaration)})}a(tn,"mapParameters");function nn(n,e){return Me(Ne({},L(n.bodyLines,e)),{type:e(n.exceptionName)})}a(nn,"mapThrows");function rn(n,e,t){function r(){const{access_modifier:i,name:s}=n,o=n.memberModifiers.join(" ");return{__type:"code-block",language:"apex",content:[`${i} ${o} ${s}`.replace(/ {2}/g," ")]}}return a(r,"buildSignature"),{headingLevel:t,doc:ee(n,e,t+1),heading:n.name,type:{headingLevel:t+1,heading:"Type",value:e(n.typeReference.rawDeclaration)},inherited:n.inherited,accessModifier:n.access_modifier,signature:{headingLevel:t+1,heading:"Signature",value:r()}}}a(rn,"adaptFieldOrProperty");var Xr=Object.defineProperty,Yr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptors,sn=Object.getOwnPropertySymbols,Jr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,an=a((n,e,t)=>e in n?Xr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$2"),R=a((n,e)=>{for(var t in e||(e={}))Jr.call(e,t)&&an(n,t,e[t]);if(sn)for(var t of sn(e))Qr.call(e,t)&&an(n,t,e[t]);return n},"__spreadValues$2"),j=a((n,e)=>Yr(n,Zr(e)),"__spreadProps$1");function Hr(n,e,t){function r(){switch(n.type_name){case"enum":return on(n,e);case"interface":return cn(n,e);case"class":return ln(n,e)}}return a(r,"getRenderable"),j(R({},r()),{namespace:t})}a(Hr,"typeToRenderable");function Fe(n,e,t){function r(i){const s={class:"Class",interface:"Interface",enum:"Enum"};return`${i.name} ${s[i.type_name]}`}return a(r,"getHeading"),{headingLevel:t,heading:r(n),doc:ee(n,e,t+1),name:n.name,meta:{accessModifier:n.access_modifier}}}a(Fe,"baseTypeAdapter");function on(n,e,t=1){return j(R({type:"enum"},Fe(n,e,t)),{values:{headingLevel:t+1,heading:"Values",value:n.values.map(r=>{var i;return j(R({},L((i=r.docComment)==null?void 0:i.descriptionLines,e)),{value:r.name})})}})}a(on,"enumTypeToEnumSource");function cn(n,e,t=1){return j(R({type:"interface"},Fe(n,e,t)),{extends:n.extended_interfaces.map(e),methods:{headingLevel:t+1,heading:"Methods",value:n.methods.map(r=>en(r,e,t+2))}})}a(cn,"interfaceTypeToInterfaceSource");function ln(n,e,t=1){return j(R({type:"class"},Fe(n,e,t)),{classModifier:n.classModifier,sharingModifier:n.sharingModifier,implements:n.implemented_interfaces.map(e),extends:n.inheritanceChain.map(e),methods:te("Methods",n.methods,en,e,t+1),constructors:te("Constructors",n.constructors,(r,i,s)=>Ur(n.name,r,i,s),e,t+1),fields:te("Fields",n.fields,rn,e,t+1),properties:te("Properties",n.properties,rn,e,t+1),innerClasses:{headingLevel:t+1,heading:"Classes",value:n.classes.map(r=>ln(j(R({},r),{inheritanceChain:[]}),e,t+2))},innerEnums:{headingLevel:t+1,heading:"Enums",value:n.enums.map(r=>on(r,e,t+2))},innerInterfaces:{headingLevel:t+1,heading:"Interfaces",value:n.interfaces.map(r=>cn(r,e,t+2))}})}a(ln,"classTypeToClassSource");function te(n,e,t,r,i){return{headingLevel:i,heading:n,isGrouped:dn(e),value:dn(e)?Kr(e,t,r,i+1):pn(e,t,r,i+1)}}a(te,"adaptMembers");function dn(n){return n.some(e=>e.group)}a(dn,"hasGroup");function pn(n,e,t,r){return n.map(i=>e(i,t,r))}a(pn,"toFlat");function Kr(n,e,t,r){const i=ei(n);return Object.entries(i).map(([s,o])=>ti(r,s,e,o,t))}a(Kr,"toGroupedMembers");function ei(n){return n.reduce((e,t)=>{var r,i;const s=(r=t.group)!=null?r:"Other";return e[s]=(i=e[s])!=null?i:[],e[s].push(t),e},{})}a(ei,"groupByGroupName");function ti(n,e,t,r,i){return{headingLevel:n,heading:e,groupDescription:r[0].groupDescription,value:pn(r,t,i,n+1)}}a(ti,"singleGroup");const ni=`
|
|
17
|
+
{{#> documentablePartialTemplate}}
|
|
18
|
+
|
|
19
|
+
{{#if doc.group}}
|
|
20
|
+
**Group** {{doc.group}}
|
|
21
|
+
{{/if}}
|
|
22
|
+
|
|
23
|
+
{{#if doc.author}}
|
|
24
|
+
**Author** {{doc.author}}
|
|
25
|
+
{{/if}}
|
|
26
|
+
|
|
27
|
+
{{#if doc.date}}
|
|
28
|
+
**Date** {{doc.date}}
|
|
29
|
+
{{/if}}
|
|
30
|
+
|
|
31
|
+
{{#each doc.sees}}
|
|
32
|
+
**See** {{link this}}
|
|
33
|
+
|
|
34
|
+
{{/each}}
|
|
35
|
+
|
|
36
|
+
{{#if namespace}}
|
|
37
|
+
## Namespace
|
|
38
|
+
{{namespace}}
|
|
39
|
+
{{/if}}
|
|
40
|
+
|
|
41
|
+
{{/documentablePartialTemplate}}
|
|
42
|
+
`.trim(),ri=`
|
|
43
|
+
{{#each doc.annotations}}
|
|
44
|
+
\`{{this}}\`
|
|
45
|
+
{{/each}}
|
|
46
|
+
|
|
47
|
+
{{{renderContent doc.description}}}
|
|
48
|
+
|
|
49
|
+
{{#each doc.customTags}}
|
|
50
|
+
**{{splitAndCapitalize name}}**
|
|
51
|
+
|
|
52
|
+
{{{renderContent description}}}
|
|
53
|
+
|
|
54
|
+
{{/each}}
|
|
55
|
+
|
|
56
|
+
{{> @partial-block}}
|
|
57
|
+
|
|
58
|
+
{{#if doc.mermaid.value}}
|
|
59
|
+
{{ heading doc.mermaid.headingLevel doc.mermaid.heading }}
|
|
60
|
+
{{code doc.mermaid.value}}
|
|
61
|
+
{{/if}}
|
|
62
|
+
|
|
63
|
+
{{#if doc.example.value}}
|
|
64
|
+
{{ heading doc.example.headingLevel doc.example.heading }}
|
|
65
|
+
{{code doc.example.value}}
|
|
66
|
+
{{/if}}
|
|
67
|
+
`.trim(),ii=`
|
|
68
|
+
{{ heading headingLevel heading }}
|
|
69
|
+
{{#each value}}
|
|
70
|
+
{{{ heading headingLevel (inlineCode heading) }}}
|
|
71
|
+
|
|
72
|
+
{{#if inherited}}
|
|
73
|
+
*Inherited*
|
|
74
|
+
{{/if}}
|
|
75
|
+
|
|
76
|
+
{{#> documentablePartialTemplate}}
|
|
77
|
+
|
|
78
|
+
{{ heading signature.headingLevel signature.heading }}
|
|
79
|
+
{{ code signature.value }}
|
|
80
|
+
|
|
81
|
+
{{#if parameters.value}}
|
|
82
|
+
{{ heading parameters.headingLevel parameters.heading }}
|
|
83
|
+
| Name | Type | Description |
|
|
84
|
+
|------|------|-------------|
|
|
85
|
+
{{#each parameters.value}}
|
|
86
|
+
| {{name}} | {{link type}} | {{{renderContent description}}} |
|
|
87
|
+
{{/each}}
|
|
88
|
+
{{/if}}
|
|
89
|
+
|
|
90
|
+
{{ heading returnType.headingLevel returnType.heading }}
|
|
91
|
+
**{{link returnType.value.type}}**
|
|
92
|
+
|
|
93
|
+
{{#if returnType.value.description}}
|
|
94
|
+
{{returnType.value.description}}
|
|
95
|
+
{{/if}}
|
|
96
|
+
|
|
97
|
+
{{#if throws.value}}
|
|
98
|
+
{{ heading throws.headingLevel throws.heading }}
|
|
99
|
+
{{#each throws.value}}
|
|
100
|
+
{{link this.type}}: {{this.description}}
|
|
101
|
+
|
|
102
|
+
{{/each}}
|
|
103
|
+
{{/if}}
|
|
104
|
+
{{/documentablePartialTemplate}}
|
|
105
|
+
|
|
106
|
+
{{#unless @last}}---{{/unless}}
|
|
107
|
+
|
|
108
|
+
{{/each}}
|
|
109
|
+
`.trim(),si=`
|
|
110
|
+
{{ heading headingLevel heading }}
|
|
111
|
+
{{#each value}}
|
|
112
|
+
{{{ heading headingLevel (inlineCode heading) }}}
|
|
113
|
+
|
|
114
|
+
{{#> documentablePartialTemplate}}
|
|
115
|
+
|
|
116
|
+
{{ heading signature.headingLevel signature.heading }}
|
|
117
|
+
{{ code signature.value }}
|
|
118
|
+
|
|
119
|
+
{{#if parameters.value}}
|
|
120
|
+
{{ heading parameters.headingLevel parameters.heading }}
|
|
121
|
+
| Name | Type | Description |
|
|
122
|
+
|------|------|-------------|
|
|
123
|
+
{{#each parameters.value}}
|
|
124
|
+
| {{name}} | {{link type}} | {{description}} |
|
|
125
|
+
{{/each}}
|
|
126
|
+
{{/if}}
|
|
127
|
+
|
|
128
|
+
{{#if throws.value}}
|
|
129
|
+
{{ heading throws.headingLevel throws.heading }}
|
|
130
|
+
{{#each throws.value}}
|
|
131
|
+
{{link this.type}}: {{this.description}}
|
|
132
|
+
|
|
133
|
+
{{/each}}
|
|
134
|
+
{{/if}}
|
|
135
|
+
{{/documentablePartialTemplate}}
|
|
136
|
+
|
|
137
|
+
{{#unless @last}}---{{/unless}}
|
|
138
|
+
|
|
139
|
+
{{/each}}
|
|
140
|
+
`.trim(),ai=`
|
|
141
|
+
{{ heading headingLevel heading }}
|
|
142
|
+
{{#each value}}
|
|
143
|
+
{{{ heading headingLevel (inlineCode heading) }}}
|
|
144
|
+
|
|
145
|
+
{{#if inherited}}
|
|
146
|
+
*Inherited*
|
|
147
|
+
{{/if}}
|
|
148
|
+
|
|
149
|
+
{{#> documentablePartialTemplate }}
|
|
150
|
+
|
|
151
|
+
{{ heading signature.headingLevel signature.heading }}
|
|
152
|
+
{{ code signature.value }}
|
|
153
|
+
|
|
154
|
+
{{ heading type.headingLevel type.heading }}
|
|
155
|
+
{{link type.value}}
|
|
156
|
+
|
|
157
|
+
{{/documentablePartialTemplate}}
|
|
158
|
+
|
|
159
|
+
{{#unless @last}}---{{/unless}}
|
|
160
|
+
|
|
161
|
+
{{/each}}
|
|
162
|
+
`.trim(),un=`
|
|
163
|
+
{{ heading headingLevel heading }}
|
|
164
|
+
{{#if classModifier}}
|
|
165
|
+
\`{{classModifier}}\`
|
|
166
|
+
{{/if}}
|
|
167
|
+
|
|
168
|
+
{{> typeDocumentation}}
|
|
169
|
+
|
|
170
|
+
{{#if extends.length}}
|
|
171
|
+
**Inheritance**
|
|
172
|
+
{{#each extends}}{{link this}}{{#unless @last}} < {{/unless}}{{/each}}
|
|
173
|
+
{{/if}}
|
|
174
|
+
|
|
175
|
+
{{#if implements}}
|
|
176
|
+
**Implements**
|
|
177
|
+
{{#each implements}}
|
|
178
|
+
{{link this}}{{#unless @last}}, {{/unless}}
|
|
179
|
+
{{/each}}
|
|
180
|
+
{{/if}}
|
|
181
|
+
|
|
182
|
+
{{#if fields.value}}
|
|
183
|
+
{{#if fields.isGrouped}}
|
|
184
|
+
{{> groupedMembersPartialTemplate fields subTemplate="fieldsPartialTemplate"}}
|
|
185
|
+
{{else}}
|
|
186
|
+
{{> fieldsPartialTemplate fields}}
|
|
187
|
+
{{/if}}
|
|
188
|
+
{{/if}}
|
|
189
|
+
|
|
190
|
+
{{#if properties.value}}
|
|
191
|
+
{{#if properties.isGrouped}}
|
|
192
|
+
{{> groupedMembersPartialTemplate properties subTemplate="fieldsPartialTemplate"}}
|
|
193
|
+
{{else}}
|
|
194
|
+
{{> fieldsPartialTemplate properties}}
|
|
195
|
+
{{/if}}
|
|
196
|
+
{{/if}}
|
|
197
|
+
|
|
198
|
+
{{#if constructors.value}}
|
|
199
|
+
{{#if constructors.isGrouped}}
|
|
200
|
+
{{> groupedMembersPartialTemplate constructors subTemplate="constructorsPartialTemplate"}}
|
|
201
|
+
{{else}}
|
|
202
|
+
{{> constructorsPartialTemplate constructors}}
|
|
203
|
+
{{/if}}
|
|
204
|
+
{{/if}}
|
|
205
|
+
|
|
206
|
+
{{#if methods.value}}
|
|
207
|
+
{{#if methods.isGrouped}}
|
|
208
|
+
{{> groupedMembersPartialTemplate methods subTemplate="methodsPartialTemplate"}}
|
|
209
|
+
{{else}}
|
|
210
|
+
{{> methodsPartialTemplate methods}}
|
|
211
|
+
{{/if}}
|
|
212
|
+
{{/if}}
|
|
213
|
+
|
|
214
|
+
{{#if innerClasses.value}}
|
|
215
|
+
{{ heading innerClasses.headingLevel innerClasses.heading }}
|
|
216
|
+
{{#each innerClasses.value}}
|
|
217
|
+
{{> classTemplate this}}
|
|
218
|
+
{{/each}}
|
|
219
|
+
{{/if}}
|
|
220
|
+
|
|
221
|
+
{{#if innerEnums.value}}
|
|
222
|
+
{{ heading innerEnums.headingLevel innerEnums.heading }}
|
|
223
|
+
{{#each innerEnums.value}}
|
|
224
|
+
{{> enumTemplate this}}
|
|
225
|
+
{{/each}}
|
|
226
|
+
{{/if}}
|
|
227
|
+
|
|
228
|
+
{{#if innerInterfaces.value}}
|
|
229
|
+
{{ heading innerInterfaces.headingLevel innerInterfaces.heading }}
|
|
230
|
+
{{#each innerInterfaces.value}}
|
|
231
|
+
{{> interfaceTemplate this}}
|
|
232
|
+
{{/each}}
|
|
233
|
+
{{/if}}
|
|
234
|
+
`.trim(),fn=`
|
|
235
|
+
{{ heading headingLevel heading }}
|
|
236
|
+
|
|
237
|
+
{{> typeDocumentation }}
|
|
238
|
+
|
|
239
|
+
{{ heading values.headingLevel values.heading }}
|
|
240
|
+
| Value | Description |
|
|
241
|
+
|-------|-------------|
|
|
242
|
+
{{#each values.value}}
|
|
243
|
+
| {{value}} | {{description}} |
|
|
244
|
+
{{/each}}
|
|
245
|
+
`.trim(),hn=`
|
|
246
|
+
{{ heading headingLevel heading }}
|
|
247
|
+
|
|
248
|
+
{{> typeDocumentation }}
|
|
249
|
+
|
|
250
|
+
{{#if extends}}
|
|
251
|
+
**Extends**
|
|
252
|
+
{{#each extends}}
|
|
253
|
+
{{link this}}{{#unless @last}}, {{/unless}}
|
|
254
|
+
{{/each}}
|
|
255
|
+
{{/if}}
|
|
256
|
+
|
|
257
|
+
{{#if methods}}
|
|
258
|
+
{{> methodsPartialTemplate methods}}
|
|
259
|
+
{{/if}}
|
|
260
|
+
`.trim(),oi=`
|
|
261
|
+
{{ heading headingLevel heading }}
|
|
262
|
+
{{#each value}}
|
|
263
|
+
{{> (lookup .. "subTemplate") this}}
|
|
264
|
+
{{/each}}
|
|
265
|
+
`.trim(),E=class E{constructor(){g.registerPartial("typeDocumentation",ni),g.registerPartial("documentablePartialTemplate",ri),g.registerPartial("methodsPartialTemplate",ii),g.registerPartial("constructorsPartialTemplate",si),g.registerPartial("groupedMembersPartialTemplate",oi),g.registerPartial("fieldsPartialTemplate",ai),g.registerPartial("classTemplate",un),g.registerPartial("enumTemplate",fn),g.registerPartial("interfaceTemplate",hn),g.registerHelper("link",yn),g.registerHelper("code",gn),g.registerHelper("renderContent",di),g.registerHelper("heading",li),g.registerHelper("inlineCode",mn),g.registerHelper("splitAndCapitalize",ci)}static getInstance(){return E.instance||(E.instance=new E),E.instance}compile(e){return g.compile(e.template)(e.source).trim().replace(/\n{3,}/g,`
|
|
266
|
+
|
|
267
|
+
`)}};a(E,"Template");let Ge=E;const ci=a(n=>{const e=n.split(/[-_]+/),t=[];for(const r of e)t.push(r.charAt(0).toUpperCase()+r.slice(1));return t.join(" ")},"splitAndCapitalize"),li=a((n,e)=>`${"#".repeat(n)} ${e}`,"heading"),mn=a(n=>new g.SafeString(`\`${n}\``),"inlineCode"),gn=a(n=>new g.SafeString(`
|
|
268
|
+
\`\`\`${n.language}
|
|
269
|
+
${n.content.join(`
|
|
270
|
+
`)}
|
|
271
|
+
\`\`\`
|
|
272
|
+
`.trim()),"convertCodeBlock"),di=a(n=>{if(!n)return"";function e(t,r){return Xt(r)?t+`
|
|
273
|
+
|
|
274
|
+
`:Rr(r)?t+gn(r)+`
|
|
275
|
+
`:jr(r)?t+mn(r.content).toString()+" ":t+g.escapeExpression(yn(r)).trim()+" "}return a(e,"reduceDescription"),n.reduce(e,"").trim()},"resolveRenderableContent"),yn=a(n=>typeof n=="string"?n:`[${n.title}](${n.url})`,"link"),pi=`
|
|
276
|
+
# Apex Reference Guide
|
|
277
|
+
|
|
278
|
+
{{#each this}}
|
|
279
|
+
## {{@key}}
|
|
280
|
+
|
|
281
|
+
{{#each this}}
|
|
282
|
+
### {{link title}}
|
|
283
|
+
|
|
284
|
+
{{{renderContent description}}}
|
|
285
|
+
|
|
286
|
+
{{/each}}
|
|
287
|
+
{{/each}}
|
|
288
|
+
`.trim();function vn(n,e){return b.pipe(w.fromNullable(e.extended_class),w.match(()=>[],t=>ui(n,t)))}a(vn,"createInheritanceChain");function ui(n,e){return b.pipe(w.fromNullable(n.find(t=>t.name.toLowerCase()===e.toLowerCase())),w.match(()=>[e],t=>[e,...vn(n,t)]))}a(ui,"inheritanceChainFromParentClassName");var fi=Object.defineProperty,hi=Object.defineProperties,mi=Object.getOwnPropertyDescriptors,_n=Object.getOwnPropertySymbols,gi=Object.prototype.hasOwnProperty,yi=Object.prototype.propertyIsEnumerable,Cn=a((n,e,t)=>e in n?fi(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp$1"),O=a((n,e)=>{for(var t in e||(e={}))gi.call(e,t)&&Cn(n,t,e[t]);if(_n)for(var t of _n(e))yi.call(e,t)&&Cn(n,t,e[t]);return n},"__spreadValues$1"),F=a((n,e)=>hi(n,mi(e)),"__spreadProps");const vi={scope:["public"],outputDir:"docs",defaultGroupName:"Miscellaneous",referenceGuideTemplate:pi};function _i(n,e){const t=O(O({},vi),e);return b.pipe(n,r=>r.map(i=>Li(i)),wi,y.map(r=>Pi(r,t.scope)),y.map(r=>r.map(i=>Ai(i,r))),y.map(r=>r.map(i=>xi(i,r))),y.map(r=>Ci(r,t)),y.map(({references:r,renderables:i})=>({referenceGuide:b.pipe($i(r,t.referenceGuideTemplate)),docs:i.map(s=>bi(Object.values(r).flat(),s))})),y.map(({referenceGuide:r,docs:i})=>({format:"markdown",referenceGuide:r,docs:i})))}a(_i,"generateDocs");function Ci(n,e){return n.reduce((t,r)=>{var i;const s=Hr(r,d=>Di(r,n,d,e),e.namespace);t.renderables.push(s);const o=(i=r.docComment)==null?void 0:i.descriptionLines,c={typeName:r.name,directory:qe(e,r),title:ji(e,r),description:L(o,d=>Ri(e,d,$n(n,d))).description},l=ne(r,e);return t.references[l]||(t.references[l]=[]),t.references[l].push(c),t},{references:{},renderables:[]})}a(Ci,"typesToRenderableBundle");function bi(n,e){function t(r,i){return{directory:n.find(o=>o.typeName.toLowerCase()===r.name.toLowerCase()).directory,docContents:i,typeName:r.name,type:r.type}}return a(t,"buildDocOutput"),b.pipe(e,Oi,bn,r=>t(e,r))}a(bi,"renderableToOutputDoc");function $i(n,e){function t(r){return Object.keys(r).sort((i,s)=>i.localeCompare(s)).reduce((i,s)=>(i[s]=r[s].sort((o,c)=>o.title.toString().localeCompare(c.title.toString())),i),{})}return a(t,"alphabetizeReferences"),b.pipe(n,t,r=>bn({template:e,source:r}))}a($i,"referencesToReferenceGuide");function Pi(n,e){return new z(n).filteredByAccessModifierAndAnnotations(e)}a(Pi,"filterTypesOutOfScope");function wi(n){function e(t){return t.reduce((r,i)=>(y.isLeft(i)?r.errors.push(i.left):r.types.push(i.right),r),{errors:[],types:[]})}return a(e,"reduceReflectionResultIntoSingleEither"),b.pipe(n,e,({errors:t,types:r})=>t.length?y.left(t):y.right(r))}a(wi,"checkForReflectionErrors");function Ti(n,e){return b.pipe(w.fromNullable(e),w.map(t=>(k.process(t).forEach((i,s)=>{const o=`${s}: ${i}`;n.annotations.push({rawDeclaration:o,name:o,type:o})}),n)),w.getOrElse(()=>n))}a(Ti,"addFileMetadataToTypeAnnotation");const wt=class wt{constructor(e,t){this.file=e,this.message=t}};a(wt,"ReflectionError");let ze=wt;function Li(n){const{filePath:e,rawTypeContent:t,rawMetadataContent:r}=n,i=Lt.reflect(t);return i.error?y.left(new ze(e,i.error.message)):y.right(Ti(i.typeMirror,r))}a(Li,"reflectSourceBody");function Oi(n){function e(t){switch(t.type){case"enum":return fn;case"interface":return hn;case"class":return un}}return a(e,"getTemplate"),{template:e(n),source:n}}a(Oi,"resolveApexTypeTemplate");function bn(n){return Ge.getInstance().compile(n)}a(bn,"compile");function $n(n,e){return n.find(t=>t.name.toLowerCase()===e.toLowerCase())}a($n,"findType");function Ai(n,e){return n.type_name==="enum"?n:n.type_name==="interface"?Ii(n,e):Ei(n,e)}a(Ai,"addInheritedMembers");function xi(n,e){if(n.type_name==="enum"||n.type_name==="interface")return n;{const t=vn(e,n);return F(O({},n),{inheritanceChain:t})}}a(xi,"addInheritanceChain");function ke(n,e,t){return b.pipe(n(e),r=>r.map(i=>t.find(s=>s.name===i)),(r=[])=>r.filter(i=>i!==void 0),r=>r.reduce((i,s)=>[...i,...ke(n,s,t)],r))}a(ke,"getParents");function Ii(n,e){function t(s,o){return o.some(c=>c.name.toLowerCase()===s.toLowerCase())}a(t,"methodAlreadyExists");function r(s){return s.extended_interfaces}a(r,"parentExtractor");const i=ke(r,n,e);return F(O({},n),{methods:i.reduce((s,o)=>[...s,...o.methods.filter(c=>!t(c.name,s)).map(c=>F(O({},c),{inherited:!0}))],n.methods)})}a(Ii,"addInheritedInterfaceMethods");function Ei(n,e){function t(o,c){return c.some(l=>l.name.toLowerCase()===o.toLowerCase())}a(t,"memberAlreadyExists");function r(o){return o.extended_class?[o.extended_class]:[]}a(r,"parentExtractor");function i(o,c){return o.filter(l=>l.access_modifier.toLowerCase()!=="private").filter(l=>!t(l.name,c)).map(l=>F(O({},l),{inherited:!0}))}a(i,"filterMember");const s=ke(r,n,e);return F(O({},n),{fields:s.reduce((o,c)=>[...o,...i(c.fields,o)],n.fields),properties:s.reduce((o,c)=>[...o,...i(c.properties,o)],n.properties),methods:s.reduce((o,c)=>[...o,...i(c.methods,o)],n.methods)})}a(Ei,"addInheritedClassMembers");function Di(n,e,t,r){const i=$n(e,t);if(!i)return t;const[s,o]=Si(n,i,r);return{__type:"link",title:s,url:o}}a(Di,"linkFromTypeNameGenerator");function Si(n,e,t){const r=t.namespace?`${t.namespace}.`:"",i=`${Bi(n,e,t)}`,s=`${r}${e.name}`;return[s,`${i}${s}.md`]}a(Si,"getFileLinkTuple");function qe(n,e){return e?`./${Pn(e,n)}`:""}a(qe,"getDirectoryFromRoot");function Ri(n,e,t){if(!t)return e;const i=`${n.namespace?`${n.namespace}.`:""}${t.name}`;return{__type:"link",title:i,url:`${qe(n,t)}/${i}.md`}}a(Ri,"getPossibleLinkFromRoot");function ji(n,e){const r=`${n.namespace?`${n.namespace}.`:""}${e.name}`;return{__type:"link",title:r,url:`${qe(n,e)}/${r}.md`}}a(ji,"getLinkFromRoot");function Bi(n,e,t){return ne(n,t)===ne(e,t)?"./":`../${Pn(e,t)}/`}a(Bi,"getDirectoryRoot");function ne(n,e){var t,r;const i=(t=n.docComment)==null?void 0:t.annotations.find(s=>s.name.toLowerCase()==="group");return(r=i==null?void 0:i.body)!=null?r:e.defaultGroupName}a(ne,"getTypeGroup");function Pn(n,e){return ne(n,e).replace(/ /g,"-").replace(".","")}a(Pn,"getSanitizedGroup");const Ni=b.flow(Mi,y.map(Fi),y.map(Gi),y.mapLeft(n=>{const e=["Error(s) occurred while parsing files. Please review the following issues:",...n.map(zi)].join(`
|
|
289
|
+
`);p.error(e)}));function Mi(n){return _i(n,{scope:u.getInstance().scope,outputDir:u.getInstance().outputDir,namespace:u.getInstance().getNamespace(),sortMembersAlphabetically:u.getInstance().sortMembersAlphabetically(),defaultGroupName:u.getInstance().getDefaultGroupName()})}a(Mi,"generateDocumentationBundle");function Fi(n){return[new S("index","").addText(n.referenceGuide),...n.docs.map(e=>new S(`${u.getInstance().getNamespacePrefix()}${e.typeName}`,e.directory).addText(e.docContents))]}a(Fi,"convertToMarkdownFiles");function Gi(n){W.write(n,e=>{p.logSingle(`${e.name} processed.`,!1,"green",!1)})}a(Gi,"writeFilesToSystem");function zi(n){return`Source file: ${n.file}
|
|
290
|
+
${n.message}
|
|
291
|
+
`}a(zi,"formatReflectionError");const Tt=class Tt{static generate(e){p.logSingle("Initializing...",!1),this.initializeSettings(e);const t=le.processFiles(new de);if(u.getInstance().targetGenerator==="plain-markdown")Ni(t);else{const r=qn(new me(t),this._reflectionWithLogger);$.getInstance().populateAll(r.types);const i=this.filterByScopes(r);$.getInstance().populateScoped(i);const s=K.get(u.getInstance().targetGenerator);ge.generate(i,s);const o=s.fileBuilder().files(),c=[];W.write(o,l=>{p.logSingle(`${l.name} processed.`,!1,"green",!1),c.push(l)}),u.getInstance().onAfterProcess(c),ye.logErrors(i)}}static initializeSettings(e){const t=e.targetGenerator;u.build({sourceDirectory:e.sourceDir,scope:e.scope,outputDir:e.targetDir,targetGenerator:t,indexOnly:e.indexOnly,defaultGroupName:e.defaultGroupName,openApiTitle:e.openApiTitle,title:e.title,namespace:e.namespace,openApiFileName:e.openApiFileName,sortMembersAlphabetically:e.sortMembersAlphabetically,includeMetadata:e.includeMetadata,rootDir:e.documentationRootDir,onAfterProcess:e.onAfterProcess,onBeforeFileWrite:e.onBeforeFileWrite,frontMatterHeader:e.frontMatterHeader,linkingStrategy:t==="plain-markdown"?"path-relative":K.get(t).getLinkingStrategy()})}static filterByScopes(e){let t,r;return u.getInstance().config.targetGenerator!=="openapi"?(t=e.filteredByAccessModifierAndAnnotations(u.getInstance().scope),r=`Filtered ${e.types.length-t.length} file(s) based on scope: ${u.getInstance().scope}`):(t=e.filteredByAccessModifierAndAnnotations(["restresource","httpdelete","httpget","httppatch","httppost","httpput"]),r=`Filtered ${e.types.length-t.length} file(s), only keeping classes annotated as @RestResource.`),p.clear(),p.logSingle(r,!1,"green",!1),p.logSingle(`Creating documentation for ${t.length} file(s)`,!1,"green",!1),t}};a(Tt,"Apexdocs");let re=Tt;re._reflectionWithLogger=n=>{var e;const t=Lt.reflect(n.rawTypeContent);return t.error&&p.error(`${n.filePath} - Parsing error ${(e=t.error)==null?void 0:e.message}`),t};var ki=Object.defineProperty,wn=Object.getOwnPropertySymbols,qi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable,Tn=a((n,e,t)=>e in n?ki(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,"__defNormalProp"),Ln=a((n,e)=>{for(var t in e||(e={}))qi.call(e,t)&&Tn(n,t,e[t]);if(wn)for(var t of wn(e))Wi.call(e,t)&&Tn(n,t,e[t]);return n},"__spreadValues"),Vi=a((n,e,t)=>new Promise((r,i)=>{var s=a(l=>{try{c(t.next(l))}catch(d){i(d)}},"fulfilled"),o=a(l=>{try{c(t.throw(l))}catch(d){i(d)}},"rejected"),c=a(l=>l.done?r(l.value):Promise.resolve(l.value).then(s,o),"step");c((t=t.apply(n,e)).next())}),"__async");function Ui(){return Rn.cosmiconfig("apexdocs").search()}a(Ui,"_extractConfig");function Xi(n){return Bn.config(n==null?void 0:n.config).options({sourceDir:{type:"string",alias:"s",demandOption:!0,describe:"The directory location which contains your apex .cls classes."},targetDir:{type:"string",alias:"t",default:"./docs/",describe:"The directory location where documentation will be generated to."},recursive:{type:"boolean",alias:"r",default:!0,deprecated:"This option is no longer needed as the recursive search is always on.",describe:"Whether .cls classes will be searched for recursively in the directory provided."},scope:{type:"string",array:!0,alias:"p",default:["global"],describe:"A list of scopes to document. Values should be separated by a space, e.g --scope global public namespaceaccessible. Annotations are supported and should be passed lowercased and without the @ symbol, e.g. namespaceaccessible auraenabled. Note that this setting is ignored if generating an OpenApi REST specification since that looks for classes annotated with @RestResource."},targetGenerator:{type:"string",alias:"g",default:"jekyll",choices:["jekyll","docsify","plain-markdown","openapi"],describe:"Define the static file generator for which the documents will be created. Currently supports jekyll, docsify, plain markdown, and OpenAPI v3.1.0."},indexOnly:{type:"boolean",default:!1,describe:"Defines whether only the index file should be generated."},defaultGroupName:{type:"string",default:"Miscellaneous",describe:"Defines the @group name to be used when a file does not specify it."},sanitizeHtml:{type:"boolean",default:!0,deprecated:"This option is no longer needed as the sanitization is always on.",describe:'When on, any special character within your ApexDocs is converted into its HTML code representation. This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" because otherwise the content within < and > would be treated as HTML tags and not shown in the output. Content in @example blocks are never sanitized.'},openApiTitle:{type:"string",default:"Apex REST Api",describe:'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.'},title:{type:"string",describe:"Allows you to specify the title of the generated documentation's home file.",default:"Classes"},namespace:{type:"string",describe:"The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. If generating an OpenApi definition, it will be added to the file's Server Url."},openApiFileName:{type:"string",describe:'If using "openapi" as the target generator, this allows you to specify the name of the output file.',default:"openapi"},sortMembersAlphabetically:{type:"boolean",describe:"Whether to sort members alphabetically.",default:!1},includeMetadata:{type:"boolean",describe:"Whether to include the file's meta.xml information: Whether it is active and and the API version",default:!1},documentationRootDir:{type:"string",describe:"Allows you to specify the root documentation directory where the files are being generated. This can be helpful when embedding the generated docs into an existing site so that the links are generated correctly."}}).parseSync()}a(Xi,"_extractYargs");function Yi(){return Vi(this,null,function*(){const n=yield Ui(),e=Xi(n);return Ln(Ln({},n==null?void 0:n.config),e)})}a(Yi,"extractArgs");function Zi(){Yi().then(n=>re.generate(n)).catch(n=>{console.error(n),process.exit(1)})}a(Zi,"main"),Zi();
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=(e,t)=>a(e,"name",{value:t,configurable:!0});var f=require("@cparra/apex-reflection");function i(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}c(i,"_interopNamespaceDefault");var u=i(f);exports.reflection=u;
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# SampleException Class
|
|
2
2
|
|
|
3
|
+
This is a sample exception.
|
|
4
|
+
|
|
5
|
+
**Usage**
|
|
6
|
+
|
|
7
|
+
You can use the exception the following way.
|
|
8
|
+
|
|
9
|
+
You can also take a look at [ns.SampleClass](../SampleGroup/ns.SampleClass.md) to see how it is used.
|
|
10
|
+
|
|
11
|
+
This is a dangerous HTML tag: <script>alert('Hello');</script>
|
|
12
|
+
|
|
13
|
+
```apex
|
|
14
|
+
try {
|
|
15
|
+
throw new SampleException();
|
|
16
|
+
} catch (SampleException e) {
|
|
17
|
+
System.debug('Caught exception');
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
3
21
|
## Namespace
|
|
4
22
|
ns
|
|
5
23
|
|
|
@@ -39,9 +39,13 @@ sampleInterface.sampleMethod();
|
|
|
39
39
|
|
|
40
40
|
This is a sample method
|
|
41
41
|
|
|
42
|
-
**Custom Tag**
|
|
42
|
+
**Custom Tag**
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
This is a custom tag
|
|
45
|
+
|
|
46
|
+
**Another Custom Tag**
|
|
47
|
+
|
|
48
|
+
This is another custom tag
|
|
45
49
|
|
|
46
50
|
#### Signature
|
|
47
51
|
```apex
|