@cparra/apexdocs 2.24.0 → 2.25.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +12 -12
- package/.github/workflows/ci.yaml +22 -0
- package/.github/workflows/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +742 -718
- package/apexdocs.config.ts +13 -13
- package/docs/{README.md → __old/README.md} +1 -1
- package/docs/{restapi.json → __old/restapi.json} +589 -589
- package/docs/{types → __old/types}/Classes/nspc.ChildClass.md +97 -97
- package/docs/{types → __old/types}/Main/nspc.SampleClass.md +189 -189
- package/examples/force-app/main/default/classes/AnotherInterface.cls +16 -16
- package/examples/force-app/main/default/classes/ChildClass.cls +42 -42
- package/examples/force-app/main/default/classes/EscapedAnnotations.cls +5 -5
- package/examples/force-app/main/default/classes/GrandparentClass.cls +4 -4
- package/examples/force-app/main/default/classes/GroupedClass.cls +8 -8
- package/examples/force-app/main/default/classes/MemberGrouping.cls +17 -17
- package/examples/force-app/main/default/classes/ParentClass.cls +16 -16
- package/examples/force-app/main/default/classes/SampleClass.cls +166 -166
- package/examples/force-app/main/default/classes/SampleClass.cls-meta.xml +5 -5
- package/examples/force-app/main/default/classes/SampleClassWithoutModifier.cls +9 -9
- package/examples/force-app/main/default/classes/SampleInterface.cls +16 -16
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -195
- package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -35
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -24
- package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -15
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference2.cls +9 -9
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -3
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -6
- package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -3
- package/examples/includes/header.md +3 -3
- package/examples/plain-markdown/.forceignore +12 -0
- package/examples/plain-markdown/README.md +301 -0
- package/examples/plain-markdown/config/project-scratch-def.json +5 -0
- package/examples/plain-markdown/force-app/classes/BaseClass.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ParentInterface.cls +3 -0
- package/examples/plain-markdown/force-app/classes/ReferencedEnum.cls +3 -0
- package/examples/plain-markdown/force-app/classes/SampleClass.cls +35 -0
- package/examples/plain-markdown/force-app/classes/SampleEnum.cls +30 -0
- package/examples/plain-markdown/force-app/classes/SampleException.cls +1 -0
- package/examples/plain-markdown/force-app/classes/SampleInterface.cls +46 -0
- package/examples/plain-markdown/package-lock.json +665 -0
- package/examples/plain-markdown/package.json +24 -0
- package/examples/plain-markdown/sfdx-project.json +12 -0
- package/examples/plain-markdown/template.md +3 -0
- package/jest.config.js +5 -5
- package/lib/adapters/apex-types.d.ts +5 -0
- package/lib/adapters/apex-types.js +34 -0
- package/lib/adapters/apex-types.js.map +1 -0
- package/lib/adapters/documentables.d.ts +6 -0
- package/lib/adapters/documentables.js +41 -0
- package/lib/adapters/documentables.js.map +1 -0
- package/lib/adapters/fields-and-properties.d.ts +3 -0
- package/lib/adapters/fields-and-properties.js +10 -0
- package/lib/adapters/fields-and-properties.js.map +1 -0
- package/lib/adapters/methods-and-constructors.d.ts +4 -0
- package/lib/adapters/methods-and-constructors.js +49 -0
- package/lib/adapters/methods-and-constructors.js.map +1 -0
- package/lib/adapters/references.d.ts +5 -0
- package/lib/adapters/references.js +82 -0
- package/lib/adapters/references.js.map +1 -0
- package/lib/adapters/type-utils.d.ts +2 -0
- package/lib/adapters/type-utils.js +8 -0
- package/lib/adapters/type-utils.js.map +1 -0
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +79 -76
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +156 -130
- package/lib/cli/generate.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +17 -17
- package/lib/model/apex-bundle.d.ts +6 -6
- package/lib/model/apex-bundle.js +10 -10
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +13 -13
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.d.ts +7 -7
- package/lib/model/apex-type-wrappers/MethodMirrorWrapper.js +11 -11
- package/lib/model/inheritance.d.ts +8 -8
- package/lib/model/inheritance.js +2 -2
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +46 -46
- package/lib/model/manifest.js.map +1 -1
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +109 -106
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.d.ts +8 -8
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js +46 -43
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/field-declaration-util.js +54 -54
- package/lib/model/markdown-generation-util/index.d.ts +3 -3
- package/lib/model/markdown-generation-util/index.js +19 -19
- package/lib/model/markdown-generation-util/method-declaration-util.d.ts +4 -4
- package/lib/model/markdown-generation-util/method-declaration-util.js +114 -114
- package/lib/model/markdown-generation-util/type-declaration-util.d.ts +3 -3
- package/lib/model/markdown-generation-util/type-declaration-util.js +81 -81
- package/lib/model/markdown-home-file.d.ts +11 -11
- package/lib/model/markdown-home-file.js +56 -53
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +136 -133
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/apex-doc-types.d.ts +19 -19
- package/lib/model/openapi/apex-doc-types.js +4 -4
- package/lib/model/openapi/open-api-types.d.ts +93 -93
- package/lib/model/openapi/open-api-types.js +2 -2
- package/lib/model/openapi/open-api.d.ts +16 -16
- package/lib/model/openapi/open-api.js +33 -33
- package/lib/model/openapi/openapi-type-file.d.ts +7 -7
- package/lib/model/openapi/openapi-type-file.js +16 -16
- package/lib/model/outputFile.d.ts +10 -10
- package/lib/model/outputFile.js +28 -28
- package/lib/model/types-repository.d.ts +16 -16
- package/lib/model/types-repository.js +53 -53
- package/lib/service/apex-file-reader.d.ts +14 -14
- package/lib/service/apex-file-reader.js +48 -45
- package/lib/service/apex-file-reader.js.map +1 -1
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +47 -24
- package/lib/service/file-system.js.map +1 -1
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +56 -33
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +16 -13
- package/lib/service/manifest-factory.js.map +1 -1
- package/lib/service/metadata-processor.d.ts +3 -3
- package/lib/service/metadata-processor.js +16 -16
- package/lib/service/parser.d.ts +21 -21
- package/lib/service/parser.js +137 -134
- package/lib/service/parser.js.map +1 -1
- package/lib/service/state.d.ts +9 -9
- package/lib/service/state.js +19 -19
- package/lib/service/walkers/class-walker.d.ts +4 -4
- package/lib/service/walkers/class-walker.js +32 -32
- package/lib/service/walkers/enum-walker.d.ts +4 -4
- package/lib/service/walkers/enum-walker.js +10 -10
- package/lib/service/walkers/interface-walker.d.ts +4 -4
- package/lib/service/walkers/interface-walker.js +14 -14
- package/lib/service/walkers/walker-factory.d.ts +5 -5
- package/lib/service/walkers/walker-factory.js +20 -20
- package/lib/service/walkers/walker.d.ts +19 -19
- package/lib/service/walkers/walker.js +16 -16
- package/lib/settings.d.ts +70 -64
- package/lib/settings.js +99 -88
- package/lib/settings.js.map +1 -1
- package/lib/templating/compile.d.ts +7 -0
- package/lib/templating/compile.js +98 -0
- package/lib/templating/compile.js.map +1 -0
- package/lib/templating/helpers.d.ts +2 -0
- package/lib/templating/helpers.js +18 -0
- package/lib/templating/helpers.js.map +1 -0
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -12
- package/lib/test-helpers/AnnotationBuilder.js +30 -30
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/ClassMirrorBuilder.js +53 -53
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +8 -8
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +25 -25
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -12
- package/lib/test-helpers/DocCommentBuilder.js +37 -37
- package/lib/test-helpers/FieldMirrorBuilder.d.ts +18 -18
- package/lib/test-helpers/FieldMirrorBuilder.js +53 -53
- package/lib/test-helpers/InterfaceMirrorBuilder.d.ts +16 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js +43 -0
- package/lib/test-helpers/InterfaceMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +29 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +71 -36
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -1
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -8
- package/lib/test-helpers/SettingsBuilder.js +26 -26
- package/lib/transpiler/factory.d.ts +6 -6
- package/lib/transpiler/factory.js +34 -31
- package/lib/transpiler/factory.js.map +1 -1
- package/lib/transpiler/file-container.d.ts +6 -6
- package/lib/transpiler/file-container.js +15 -15
- package/lib/transpiler/generator-choices.d.ts +1 -1
- package/lib/transpiler/generator-choices.js +2 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.d.ts +11 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +74 -55
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.d.ts +6 -6
- package/lib/transpiler/markdown/docsify/docsify-docs-processor.js +12 -12
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.d.ts +11 -11
- package/lib/transpiler/markdown/jekyll/jekyll-docsProcessor.js +50 -50
- package/lib/transpiler/markdown/markdown-transpiler-base.d.ts +11 -11
- package/lib/transpiler/markdown/markdown-transpiler-base.js +26 -23
- package/lib/transpiler/markdown/markdown-transpiler-base.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/class-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js +36 -0
- package/lib/transpiler/markdown/plain-markdown/class-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js +39 -0
- package/lib/transpiler/markdown/plain-markdown/constructors-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js +25 -0
- package/lib/transpiler/markdown/plain-markdown/documentable-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js +15 -0
- package/lib/transpiler/markdown/plain-markdown/enum-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js +24 -0
- package/lib/transpiler/markdown/plain-markdown/fieldsPartialTemplate.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js +20 -0
- package/lib/transpiler/markdown/plain-markdown/interface-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js +49 -0
- package/lib/transpiler/markdown/plain-markdown/methods-partial-template.js.map +1 -0
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +13 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +121 -13
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js.map +1 -1
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.d.ts +1 -0
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js +31 -0
- package/lib/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.js.map +1 -0
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +77 -74
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +189 -166
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +10 -10
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +39 -39
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +248 -225
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -10
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +19 -19
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -7
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +21 -21
- package/lib/transpiler/processor-type-transpiler.d.ts +10 -10
- package/lib/transpiler/processor-type-transpiler.js +8 -8
- package/lib/transpiler/transpiler.d.ts +5 -5
- package/lib/transpiler/transpiler.js +29 -26
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/error-logger.js.map +1 -1
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +60 -57
- package/lib/util/logger.js.map +1 -1
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/package.json +79 -78
- package/src/adapters/__tests__/interface-adapter.spec.ts +76 -0
- package/src/adapters/__tests__/references.spec.ts +115 -0
- package/src/adapters/apex-types.ts +67 -0
- package/src/adapters/documentables.ts +58 -0
- package/src/adapters/fields-and-properties.ts +14 -0
- package/src/adapters/methods-and-constructors.ts +78 -0
- package/src/adapters/references.ts +113 -0
- package/src/adapters/type-utils.ts +5 -0
- package/src/adapters/types.d.ts +8 -0
- package/src/cli/generate.ts +3 -0
- package/src/model/__tests__/manifest.spec.ts +1 -0
- package/src/model/manifest.ts +3 -3
- package/src/model/markdown-file.ts +1 -1
- package/src/model/openapi/open-api-types.ts +2 -2
- package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
- package/src/service/__tests__/manifest-factory.spec.ts +1 -2
- package/src/settings.ts +15 -0
- package/src/templating/__tests__/compile.spec.ts +741 -0
- package/src/templating/compile.ts +187 -0
- package/src/templating/helpers.ts +14 -0
- package/src/templating/types.d.ts +104 -0
- package/src/test-helpers/FieldMirrorBuilder.ts +1 -1
- package/src/test-helpers/InterfaceMirrorBuilder.ts +44 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +46 -6
- package/src/transpiler/markdown/class-file-generatorHelper.ts +22 -2
- package/src/transpiler/markdown/plain-markdown/class-template.ts +32 -0
- package/src/transpiler/markdown/plain-markdown/constructors-partial-template.ts +35 -0
- package/src/transpiler/markdown/plain-markdown/documentable-partial-template.ts +21 -0
- package/src/transpiler/markdown/plain-markdown/enum-template.ts +11 -0
- package/src/transpiler/markdown/plain-markdown/fieldsPartialTemplate.ts +20 -0
- package/src/transpiler/markdown/plain-markdown/interface-template.ts +16 -0
- package/src/transpiler/markdown/plain-markdown/methods-partial-template.ts +45 -0
- package/src/transpiler/markdown/plain-markdown/plain-docsProcessor.ts +122 -0
- package/src/transpiler/markdown/plain-markdown/type-level-apex-doc-partial-template.ts +27 -0
- package/src/transpiler/openapi/parsers/Builder.ts +1 -1
- package/src/transpiler/openapi/parsers/MethodParser.ts +1 -1
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
- package/src/util/error-logger.ts +4 -4
- package/src/util/logger.ts +3 -3
- package/tsconfig.json +21 -20
- package/tslint.json +5 -5
- package/lib/model/manifest-diff.d.ts +0 -27
- package/lib/model/manifest-diff.js +0 -69
- package/lib/model/manifest-diff.js.map +0 -1
- package/src/model/__tests__/manifest-diff.spec.ts +0 -139
- package/src/model/manifest-diff.ts +0 -94
- /package/docs/{index.html → __old/index.html} +0 -0
- /package/docs/{types → __old/types}/Classes/nspc.AnotherInterface.md +0 -0
- /package/docs/{types → __old/types}/Main/nspc.GroupedClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.EscapedAnnotations.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.GrandparentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.InterfaceWithInheritance.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.MemberGrouping.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.ParentClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference1.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference2.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference3.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference4.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference5.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference6.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.Reference7.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleClassWithoutModifier.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResource.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithInnerClass.md +0 -0
- /package/docs/{types → __old/types}/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +0 -0
- /package/docs/{types → __old/types}/README.md +0 -0
- /package/docs/{types → __old/types}/Sample-Interfaces/nspc.SampleInterface.md +0 -0
|
@@ -1,34 +1,57 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FileWriter = void 0;
|
|
27
|
+
const fs = __importStar(require("fs"));
|
|
28
|
+
const path = __importStar(require("path"));
|
|
29
|
+
const settings_1 = require("../settings");
|
|
30
|
+
class FileWriter {
|
|
31
|
+
static write(files, onWriteCallback) {
|
|
32
|
+
const onBeforeFileWrite = (file) => settings_1.Settings.getInstance().onBeforeFileWrite(file);
|
|
33
|
+
files.forEach((file) => {
|
|
34
|
+
const resolvedFile = this.getTargetLocation(file, onBeforeFileWrite);
|
|
35
|
+
const fullDir = path.join(resolvedFile.dir.baseDir, resolvedFile.dir.fileDir);
|
|
36
|
+
if (!fs.existsSync(fullDir)) {
|
|
37
|
+
fs.mkdirSync(fullDir, { recursive: true });
|
|
38
|
+
}
|
|
39
|
+
const filePath = path.join(fullDir, `${resolvedFile.name}${resolvedFile.extension}`);
|
|
40
|
+
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
41
|
+
onWriteCallback(resolvedFile);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
static getTargetLocation(file, onBeforeFileWrite) {
|
|
45
|
+
const targetFile = {
|
|
46
|
+
name: file.fileName,
|
|
47
|
+
extension: file.fileExtension(),
|
|
48
|
+
dir: {
|
|
49
|
+
baseDir: settings_1.Settings.getInstance().outputDir,
|
|
50
|
+
fileDir: file.dir,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
return onBeforeFileWrite(targetFile);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.FileWriter = FileWriter;
|
|
34
57
|
//# sourceMappingURL=file-writer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,0CAAsE;AAEtE,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,KAAmB,EAAE,eAA2C;QAC3E,MAAM,iBAAiB,GAAsB,CAAC,IAAgB,EAAE,EAAE,CAAC,mBAAQ,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAClH,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YACrE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC5C;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;YACrF,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9C,eAAe,CAAC,YAAY,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,iBAAiB,CAAC,IAAgB,EAAE,iBAAoC;QACrF,MAAM,UAAU,GAAe;YAC7B,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE;YAC/B,GAAG,EAAE;gBACH,OAAO,EAAE,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS;gBACzC,OAAO,EAAE,IAAI,CAAC,GAAG;aAClB;SACF,CAAC;QAEF,OAAO,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;CACF;AA5BD,gCA4BC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Manifest from '../model/manifest';
|
|
2
|
-
import { TypeParser } from './parser';
|
|
3
|
-
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
4
|
-
import ApexBundle from '../model/apex-bundle';
|
|
5
|
-
/**
|
|
6
|
-
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
|
7
|
-
* @param typeParser In charge of returning the list of reflected types.
|
|
8
|
-
* @param reflect Reflection function.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createManifest(typeParser: TypeParser, reflect: (apexBundle: ApexBundle) => ReflectionResult): Manifest;
|
|
1
|
+
import Manifest from '../model/manifest';
|
|
2
|
+
import { TypeParser } from './parser';
|
|
3
|
+
import { ReflectionResult } from '@cparra/apex-reflection';
|
|
4
|
+
import ApexBundle from '../model/apex-bundle';
|
|
5
|
+
/**
|
|
6
|
+
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
|
7
|
+
* @param typeParser In charge of returning the list of reflected types.
|
|
8
|
+
* @param reflect Reflection function.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createManifest(typeParser: TypeParser, reflect: (apexBundle: ApexBundle) => ReflectionResult): Manifest;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createManifest = void 0;
|
|
7
|
+
const manifest_1 = __importDefault(require("../model/manifest"));
|
|
8
|
+
/**
|
|
9
|
+
* Builds a new Manifest object, sourcing its types from the received TypeParser.
|
|
10
|
+
* @param typeParser In charge of returning the list of reflected types.
|
|
11
|
+
* @param reflect Reflection function.
|
|
12
|
+
*/
|
|
13
|
+
function createManifest(typeParser, reflect) {
|
|
14
|
+
return new manifest_1.default(typeParser.parse(reflect));
|
|
15
|
+
}
|
|
16
|
+
exports.createManifest = createManifest;
|
|
14
17
|
//# sourceMappingURL=manifest-factory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-factory.js","sourceRoot":"","sources":["../../src/service/manifest-factory.ts"],"names":[],"mappings":";;;;;;AAAA,iEAAyC;AAKzC;;;;GAIG;AACH,SAAgB,cAAc,CAC5B,UAAsB,EACtB,OAAqD;IAErD,OAAO,IAAI,kBAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACjD,CAAC;AALD,wCAKC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default class MetadataProcessor {
|
|
2
|
-
static process(input: string): Map<string, string>;
|
|
3
|
-
}
|
|
1
|
+
export default class MetadataProcessor {
|
|
2
|
+
static process(input: string): Map<string, string>;
|
|
3
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
4
|
-
class MetadataProcessor {
|
|
5
|
-
static process(input) {
|
|
6
|
-
var _a;
|
|
7
|
-
const map = new Map();
|
|
8
|
-
const xml = new fast_xml_parser_1.XMLParser().parse(input);
|
|
9
|
-
map.set('apiVersion', (_a = xml.ApexClass.apiVersion) !== null && _a !== void 0 ? _a : '');
|
|
10
|
-
if (xml.ApexClass.status) {
|
|
11
|
-
map.set('status', xml.ApexClass.status);
|
|
12
|
-
}
|
|
13
|
-
return map;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = MetadataProcessor;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
4
|
+
class MetadataProcessor {
|
|
5
|
+
static process(input) {
|
|
6
|
+
var _a;
|
|
7
|
+
const map = new Map();
|
|
8
|
+
const xml = new fast_xml_parser_1.XMLParser().parse(input);
|
|
9
|
+
map.set('apiVersion', (_a = xml.ApexClass.apiVersion) !== null && _a !== void 0 ? _a : '');
|
|
10
|
+
if (xml.ApexClass.status) {
|
|
11
|
+
map.set('status', xml.ApexClass.status);
|
|
12
|
+
}
|
|
13
|
+
return map;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = MetadataProcessor;
|
|
17
17
|
//# sourceMappingURL=metadata-processor.js.map
|
package/lib/service/parser.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ClassMirror, InterfaceMirror, ReflectionResult, Type } from '@cparra/apex-reflection';
|
|
2
|
-
import ApexBundle from '../model/apex-bundle';
|
|
3
|
-
export interface TypeParser {
|
|
4
|
-
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
5
|
-
}
|
|
6
|
-
type NameAware = {
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class RawBodyParser implements TypeParser {
|
|
10
|
-
typeBundles: ApexBundle[];
|
|
11
|
-
constructor(typeBundles: ApexBundle[]);
|
|
12
|
-
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
13
|
-
addFieldsFromParent(types: Type[]): Type[];
|
|
14
|
-
addMembersFromParent(currentClass: ClassMirror, allTypes: Type[]): ClassMirror;
|
|
15
|
-
addMethodsFromParent(currentInterface: InterfaceMirror, allTypes: Type[]): InterfaceMirror;
|
|
16
|
-
private getInheritedFields;
|
|
17
|
-
private getInheritedProperties;
|
|
18
|
-
private getInheritedMethods;
|
|
19
|
-
memberExists(members: NameAware[], fieldName: string): boolean;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
1
|
+
import { ClassMirror, InterfaceMirror, ReflectionResult, Type } from '@cparra/apex-reflection';
|
|
2
|
+
import ApexBundle from '../model/apex-bundle';
|
|
3
|
+
export interface TypeParser {
|
|
4
|
+
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
5
|
+
}
|
|
6
|
+
type NameAware = {
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class RawBodyParser implements TypeParser {
|
|
10
|
+
typeBundles: ApexBundle[];
|
|
11
|
+
constructor(typeBundles: ApexBundle[]);
|
|
12
|
+
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
13
|
+
addFieldsFromParent(types: Type[]): Type[];
|
|
14
|
+
addMembersFromParent(currentClass: ClassMirror, allTypes: Type[]): ClassMirror;
|
|
15
|
+
addMethodsFromParent(currentInterface: InterfaceMirror, allTypes: Type[]): InterfaceMirror;
|
|
16
|
+
private getInheritedFields;
|
|
17
|
+
private getInheritedProperties;
|
|
18
|
+
private getInheritedMethods;
|
|
19
|
+
memberExists(members: NameAware[], fieldName: string): boolean;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
package/lib/service/parser.js
CHANGED
|
@@ -1,135 +1,138 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RawBodyParser = void 0;
|
|
7
|
+
const metadata_processor_1 = __importDefault(require("./metadata-processor"));
|
|
8
|
+
const logger_1 = require("../util/logger");
|
|
9
|
+
class RawBodyParser {
|
|
10
|
+
constructor(typeBundles) {
|
|
11
|
+
this.typeBundles = typeBundles;
|
|
12
|
+
}
|
|
13
|
+
parse(reflect) {
|
|
14
|
+
const types = this.typeBundles
|
|
15
|
+
.map((currentBundle) => {
|
|
16
|
+
logger_1.Logger.log(`Parsing file: ${currentBundle.filePath}`);
|
|
17
|
+
const result = reflect(currentBundle);
|
|
18
|
+
if (!!result.typeMirror && !!currentBundle.rawMetadataContent) {
|
|
19
|
+
// If successful and there is a metadata file
|
|
20
|
+
const metadataParams = metadata_processor_1.default.process(currentBundle.rawMetadataContent);
|
|
21
|
+
metadataParams.forEach((value, key) => {
|
|
22
|
+
var _a;
|
|
23
|
+
const declaration = `${key}: ${value}`;
|
|
24
|
+
(_a = result.typeMirror) === null || _a === void 0 ? void 0 : _a.annotations.push({
|
|
25
|
+
rawDeclaration: declaration,
|
|
26
|
+
name: declaration,
|
|
27
|
+
type: declaration,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
})
|
|
33
|
+
.filter((reflectionResult) => {
|
|
34
|
+
return reflectionResult.typeMirror;
|
|
35
|
+
})
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
|
+
.map((reflectionResult) => reflectionResult.typeMirror);
|
|
38
|
+
return this.addFieldsFromParent(types);
|
|
39
|
+
}
|
|
40
|
+
addFieldsFromParent(types) {
|
|
41
|
+
const typesWithFields = [];
|
|
42
|
+
for (const currentType of types) {
|
|
43
|
+
if (currentType.type_name !== 'class' && currentType.type_name !== 'interface') {
|
|
44
|
+
typesWithFields.push(currentType);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (currentType.type_name === 'class') {
|
|
48
|
+
let typeAsClass = currentType;
|
|
49
|
+
if (!typeAsClass.extended_class) {
|
|
50
|
+
typesWithFields.push(currentType);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
typeAsClass = this.addMembersFromParent(typeAsClass, types);
|
|
54
|
+
typesWithFields.push(typeAsClass);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
// If reaching here then we are dealing with an interface
|
|
58
|
+
let typeAsInterface = currentType;
|
|
59
|
+
if (!typeAsInterface.extended_interfaces.length) {
|
|
60
|
+
typesWithFields.push(currentType);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
typeAsInterface = this.addMethodsFromParent(typeAsInterface, types);
|
|
64
|
+
typesWithFields.push(typeAsInterface);
|
|
65
|
+
}
|
|
66
|
+
return typesWithFields;
|
|
67
|
+
}
|
|
68
|
+
addMembersFromParent(currentClass, allTypes) {
|
|
69
|
+
if (!currentClass.extended_class) {
|
|
70
|
+
return currentClass;
|
|
71
|
+
}
|
|
72
|
+
const parent = allTypes.find((currentType) => currentType.name === currentClass.extended_class);
|
|
73
|
+
if (!parent || parent.type_name !== 'class') {
|
|
74
|
+
return currentClass;
|
|
75
|
+
}
|
|
76
|
+
let parentAsClass = parent;
|
|
77
|
+
if (parentAsClass.extended_class) {
|
|
78
|
+
parentAsClass = this.addMembersFromParent(parentAsClass, allTypes);
|
|
79
|
+
}
|
|
80
|
+
currentClass.fields = [...currentClass.fields, ...this.getInheritedFields(parentAsClass, currentClass)];
|
|
81
|
+
currentClass.properties = [...currentClass.properties, ...this.getInheritedProperties(parentAsClass, currentClass)];
|
|
82
|
+
currentClass.methods = [...currentClass.methods, ...this.getInheritedMethods(parentAsClass, currentClass)];
|
|
83
|
+
return currentClass;
|
|
84
|
+
}
|
|
85
|
+
addMethodsFromParent(currentInterface, allTypes) {
|
|
86
|
+
if (!currentInterface.extended_interfaces.length) {
|
|
87
|
+
return currentInterface;
|
|
88
|
+
}
|
|
89
|
+
const parents = [];
|
|
90
|
+
for (const currentInterfaceName of currentInterface.extended_interfaces) {
|
|
91
|
+
const parent = allTypes.find((currentType) => currentType.name === currentInterfaceName);
|
|
92
|
+
if (parent) {
|
|
93
|
+
parents.push(parent);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
for (const parent of parents) {
|
|
97
|
+
let parentAsInterface = parent;
|
|
98
|
+
if (parentAsInterface.extended_interfaces.length) {
|
|
99
|
+
parentAsInterface = this.addMethodsFromParent(parentAsInterface, allTypes);
|
|
100
|
+
}
|
|
101
|
+
currentInterface.methods = [
|
|
102
|
+
...currentInterface.methods,
|
|
103
|
+
...this.getInheritedMethods(parentAsInterface, currentInterface),
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
return currentInterface;
|
|
107
|
+
}
|
|
108
|
+
getInheritedFields(parentAsClass, currentClass) {
|
|
109
|
+
return (parentAsClass.fields
|
|
110
|
+
// Filter out private fields
|
|
111
|
+
.filter((currentField) => currentField.access_modifier.toLowerCase() !== 'private')
|
|
112
|
+
// Filter out fields that also exist on the child
|
|
113
|
+
.filter((currentField) => !this.memberExists(currentClass.fields, currentField.name))
|
|
114
|
+
.map((currentField) => (Object.assign(Object.assign({}, currentField), { inherited: true }))));
|
|
115
|
+
}
|
|
116
|
+
getInheritedProperties(parentAsClass, currentClass) {
|
|
117
|
+
return (parentAsClass.properties
|
|
118
|
+
// Filter out private properties
|
|
119
|
+
.filter((currentProperty) => currentProperty.access_modifier.toLowerCase() !== 'private')
|
|
120
|
+
// Filter out properties that also exist on the child
|
|
121
|
+
.filter((currentProperty) => !this.memberExists(currentClass.properties, currentProperty.name))
|
|
122
|
+
.map((currentProperty) => (Object.assign(Object.assign({}, currentProperty), { inherited: true }))));
|
|
123
|
+
}
|
|
124
|
+
getInheritedMethods(parentAsClass, currentClass) {
|
|
125
|
+
return (parentAsClass.methods
|
|
126
|
+
// Filter out private methods
|
|
127
|
+
.filter((currentMethod) => currentMethod.access_modifier.toLowerCase() !== 'private')
|
|
128
|
+
// Filter out methods that also exist on the child
|
|
129
|
+
.filter((currentMethod) => !this.memberExists(currentClass.methods, currentMethod.name))
|
|
130
|
+
.map((currentMethod) => (Object.assign(Object.assign({}, currentMethod), { inherited: true }))));
|
|
131
|
+
}
|
|
132
|
+
memberExists(members, fieldName) {
|
|
133
|
+
const fieldNames = members.map((currentMember) => currentMember.name);
|
|
134
|
+
return fieldNames.includes(fieldName);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.RawBodyParser = RawBodyParser;
|
|
135
138
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/service/parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/service/parser.ts"],"names":[],"mappings":";;;;;;AAEA,8EAAqD;AACrD,2CAAwC;AAQxC,MAAa,aAAa;IACxB,YAAmB,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IAAG,CAAC;IAEhD,KAAK,CAAC,OAAqD;QACzD,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW;aAC3B,GAAG,CAAC,CAAC,aA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Aa,CAAC,IAAI,CAAC,CAAC;aACvF,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,iCACnB,aAAa,KAChB,SAAS,EAAE,IAAI,IACf,CAAC,CACN,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,OAAoB,EAAE,SAAiB;QAClD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACtE,OAAO,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AAlKD,sCAkKC"}
|
package/lib/service/state.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Type } from '@cparra/apex-reflection';
|
|
2
|
-
export default class State {
|
|
3
|
-
private static instance;
|
|
4
|
-
private typeBeingProcessed?;
|
|
5
|
-
private constructor();
|
|
6
|
-
static getInstance(): State;
|
|
7
|
-
setTypeBeingProcessed(typeToSet: Type): void;
|
|
8
|
-
getTypeBeingProcessed(): Type | undefined;
|
|
9
|
-
}
|
|
1
|
+
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
export default class State {
|
|
3
|
+
private static instance;
|
|
4
|
+
private typeBeingProcessed?;
|
|
5
|
+
private constructor();
|
|
6
|
+
static getInstance(): State;
|
|
7
|
+
setTypeBeingProcessed(typeToSet: Type): void;
|
|
8
|
+
getTypeBeingProcessed(): Type | undefined;
|
|
9
|
+
}
|
package/lib/service/state.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class State {
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
-
constructor() { }
|
|
6
|
-
static getInstance() {
|
|
7
|
-
if (!State.instance) {
|
|
8
|
-
State.instance = new State();
|
|
9
|
-
}
|
|
10
|
-
return State.instance;
|
|
11
|
-
}
|
|
12
|
-
setTypeBeingProcessed(typeToSet) {
|
|
13
|
-
this.typeBeingProcessed = typeToSet;
|
|
14
|
-
}
|
|
15
|
-
getTypeBeingProcessed() {
|
|
16
|
-
return this.typeBeingProcessed;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.default = State;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class State {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
5
|
+
constructor() { }
|
|
6
|
+
static getInstance() {
|
|
7
|
+
if (!State.instance) {
|
|
8
|
+
State.instance = new State();
|
|
9
|
+
}
|
|
10
|
+
return State.instance;
|
|
11
|
+
}
|
|
12
|
+
setTypeBeingProcessed(typeToSet) {
|
|
13
|
+
this.typeBeingProcessed = typeToSet;
|
|
14
|
+
}
|
|
15
|
+
getTypeBeingProcessed() {
|
|
16
|
+
return this.typeBeingProcessed;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = State;
|
|
20
20
|
//# sourceMappingURL=state.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Walker, WalkerListener } from './walker';
|
|
2
|
-
export declare class ClassWalker extends Walker {
|
|
3
|
-
walk(listener: WalkerListener): void;
|
|
4
|
-
}
|
|
1
|
+
import { Walker, WalkerListener } from './walker';
|
|
2
|
+
export declare class ClassWalker extends Walker {
|
|
3
|
+
walk(listener: WalkerListener): void;
|
|
4
|
+
}
|