@cparra/apexdocs 2.23.0 → 2.24.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/close_stale.yml +22 -22
- package/.prettierrc.js +7 -7
- package/LICENSE +21 -21
- package/README.md +718 -718
- package/apexdocs.config.ts +13 -13
- package/docs/README.md +1 -1
- package/docs/restapi.json +589 -589
- package/docs/types/Classes/nspc.ChildClass.md +97 -97
- package/docs/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/jest.config.js +5 -5
- package/lib/application/Apexdocs.d.ts +13 -13
- package/lib/application/Apexdocs.js +76 -76
- package/lib/cli/generate.d.ts +2 -2
- package/lib/cli/generate.js +130 -130
- 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-diff.d.ts +27 -27
- package/lib/model/manifest-diff.js +68 -68
- package/lib/model/manifest.d.ts +22 -22
- package/lib/model/manifest.js +46 -46
- package/lib/model/markdown-file.d.ts +16 -16
- package/lib/model/markdown-file.js +106 -106
- 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 +43 -43
- 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 +53 -53
- package/lib/model/markdown-type-file.d.ts +26 -26
- package/lib/model/markdown-type-file.js +133 -133
- 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 +45 -45
- package/lib/service/file-system.d.ts +14 -14
- package/lib/service/file-system.js +24 -24
- package/lib/service/file-writer.d.ts +6 -6
- package/lib/service/file-writer.js +33 -33
- package/lib/service/manifest-factory.d.ts +10 -10
- package/lib/service/manifest-factory.js +13 -13
- 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 +134 -134
- 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 +64 -64
- package/lib/settings.js +88 -88
- 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/MethodMirrorBuilder.d.ts +10 -10
- package/lib/test-helpers/MethodMirrorBuilder.js +36 -36
- 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 +31 -31
- 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 +8 -8
- package/lib/transpiler/markdown/class-file-generatorHelper.js +55 -55
- 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 +23 -23
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.d.ts +6 -6
- package/lib/transpiler/markdown/plain-markdown/plain-docsProcessor.js +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +13 -13
- package/lib/transpiler/openapi/open-api-docs-processor.js +74 -74
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -16
- package/lib/transpiler/openapi/parsers/Builder.js +29 -29
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +20 -20
- package/lib/transpiler/openapi/parsers/MethodParser.js +166 -166
- 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 +225 -225
- 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 +26 -26
- package/lib/util/error-logger.d.ts +8 -8
- package/lib/util/error-logger.js +89 -89
- package/lib/util/logger.d.ts +21 -21
- package/lib/util/logger.js +57 -57
- package/lib/util/string-utils.d.ts +2 -2
- package/lib/util/string-utils.js +14 -14
- package/package.json +78 -78
- package/tsconfig.json +20 -20
- package/tslint.json +5 -5
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApexFileReader = void 0;
|
|
4
|
-
const settings_1 = require("../settings");
|
|
5
|
-
const apex_bundle_1 = require("../model/apex-bundle");
|
|
6
|
-
const APEX_FILE_EXTENSION = '.cls';
|
|
7
|
-
/**
|
|
8
|
-
* Reads from .cls files and returns their raw body.
|
|
9
|
-
*/
|
|
10
|
-
class ApexFileReader {
|
|
11
|
-
/**
|
|
12
|
-
* Reads from .cls files and returns their raw body.
|
|
13
|
-
*/
|
|
14
|
-
static processFiles(fileSystem, rootPath = this.sourceDirectory) {
|
|
15
|
-
let bundles = [];
|
|
16
|
-
const directoryContents = fileSystem.readDirectory(rootPath);
|
|
17
|
-
directoryContents.forEach((currentFilePath) => {
|
|
18
|
-
const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
|
|
19
|
-
if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
|
|
20
|
-
bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
|
|
21
|
-
}
|
|
22
|
-
if (!this.isApexFile(currentFilePath)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const rawApexFile = fileSystem.readFile(currentPath);
|
|
26
|
-
const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
|
|
27
|
-
let rawMetadataFile = null;
|
|
28
|
-
if (settings_1.Settings.getInstance().includeMetadata()) {
|
|
29
|
-
rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
|
|
30
|
-
}
|
|
31
|
-
bundles.push(new apex_bundle_1.default(currentFilePath, rawApexFile, rawMetadataFile));
|
|
32
|
-
});
|
|
33
|
-
return bundles;
|
|
34
|
-
}
|
|
35
|
-
static isApexFile(currentFile) {
|
|
36
|
-
return currentFile.endsWith(APEX_FILE_EXTENSION);
|
|
37
|
-
}
|
|
38
|
-
static get sourceDirectory() {
|
|
39
|
-
return settings_1.Settings.getInstance().sourceDirectory;
|
|
40
|
-
}
|
|
41
|
-
static get readRecursively() {
|
|
42
|
-
return settings_1.Settings.getInstance().recursive;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.ApexFileReader = ApexFileReader;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApexFileReader = void 0;
|
|
4
|
+
const settings_1 = require("../settings");
|
|
5
|
+
const apex_bundle_1 = require("../model/apex-bundle");
|
|
6
|
+
const APEX_FILE_EXTENSION = '.cls';
|
|
7
|
+
/**
|
|
8
|
+
* Reads from .cls files and returns their raw body.
|
|
9
|
+
*/
|
|
10
|
+
class ApexFileReader {
|
|
11
|
+
/**
|
|
12
|
+
* Reads from .cls files and returns their raw body.
|
|
13
|
+
*/
|
|
14
|
+
static processFiles(fileSystem, rootPath = this.sourceDirectory) {
|
|
15
|
+
let bundles = [];
|
|
16
|
+
const directoryContents = fileSystem.readDirectory(rootPath);
|
|
17
|
+
directoryContents.forEach((currentFilePath) => {
|
|
18
|
+
const currentPath = fileSystem.joinPath(rootPath, currentFilePath);
|
|
19
|
+
if (this.readRecursively && fileSystem.isDirectory(currentPath)) {
|
|
20
|
+
bundles = bundles.concat(this.processFiles(fileSystem, currentPath));
|
|
21
|
+
}
|
|
22
|
+
if (!this.isApexFile(currentFilePath)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const rawApexFile = fileSystem.readFile(currentPath);
|
|
26
|
+
const metadataPath = fileSystem.joinPath(rootPath, `${currentFilePath}-meta.xml`);
|
|
27
|
+
let rawMetadataFile = null;
|
|
28
|
+
if (settings_1.Settings.getInstance().includeMetadata()) {
|
|
29
|
+
rawMetadataFile = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
|
|
30
|
+
}
|
|
31
|
+
bundles.push(new apex_bundle_1.default(currentFilePath, rawApexFile, rawMetadataFile));
|
|
32
|
+
});
|
|
33
|
+
return bundles;
|
|
34
|
+
}
|
|
35
|
+
static isApexFile(currentFile) {
|
|
36
|
+
return currentFile.endsWith(APEX_FILE_EXTENSION);
|
|
37
|
+
}
|
|
38
|
+
static get sourceDirectory() {
|
|
39
|
+
return settings_1.Settings.getInstance().sourceDirectory;
|
|
40
|
+
}
|
|
41
|
+
static get readRecursively() {
|
|
42
|
+
return settings_1.Settings.getInstance().recursive;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ApexFileReader = ApexFileReader;
|
|
46
46
|
//# sourceMappingURL=apex-file-reader.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export interface FileSystem {
|
|
2
|
-
readDirectory: (sourceDirectory: string) => string[];
|
|
3
|
-
isDirectory: (path: string) => boolean;
|
|
4
|
-
readFile: (path: string) => string;
|
|
5
|
-
joinPath: (...paths: string[]) => string;
|
|
6
|
-
exists: (path: string) => boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class DefaultFileSystem implements FileSystem {
|
|
9
|
-
isDirectory(pathToRead: string): boolean;
|
|
10
|
-
readDirectory(sourceDirectory: string): string[];
|
|
11
|
-
readFile(pathToRead: string): string;
|
|
12
|
-
joinPath(...paths: string[]): string;
|
|
13
|
-
exists(path: string): boolean;
|
|
14
|
-
}
|
|
1
|
+
export interface FileSystem {
|
|
2
|
+
readDirectory: (sourceDirectory: string) => string[];
|
|
3
|
+
isDirectory: (path: string) => boolean;
|
|
4
|
+
readFile: (path: string) => string;
|
|
5
|
+
joinPath: (...paths: string[]) => string;
|
|
6
|
+
exists: (path: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class DefaultFileSystem implements FileSystem {
|
|
9
|
+
isDirectory(pathToRead: string): boolean;
|
|
10
|
+
readDirectory(sourceDirectory: string): string[];
|
|
11
|
+
readFile(pathToRead: string): string;
|
|
12
|
+
joinPath(...paths: string[]): string;
|
|
13
|
+
exists(path: string): boolean;
|
|
14
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultFileSystem = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
class DefaultFileSystem {
|
|
7
|
-
isDirectory(pathToRead) {
|
|
8
|
-
return fs.statSync(pathToRead).isDirectory();
|
|
9
|
-
}
|
|
10
|
-
readDirectory(sourceDirectory) {
|
|
11
|
-
return fs.readdirSync(sourceDirectory);
|
|
12
|
-
}
|
|
13
|
-
readFile(pathToRead) {
|
|
14
|
-
const rawFile = fs.readFileSync(pathToRead);
|
|
15
|
-
return rawFile.toString();
|
|
16
|
-
}
|
|
17
|
-
joinPath(...paths) {
|
|
18
|
-
return path.join(...paths);
|
|
19
|
-
}
|
|
20
|
-
exists(path) {
|
|
21
|
-
return fs.existsSync(path);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.DefaultFileSystem = DefaultFileSystem;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultFileSystem = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
class DefaultFileSystem {
|
|
7
|
+
isDirectory(pathToRead) {
|
|
8
|
+
return fs.statSync(pathToRead).isDirectory();
|
|
9
|
+
}
|
|
10
|
+
readDirectory(sourceDirectory) {
|
|
11
|
+
return fs.readdirSync(sourceDirectory);
|
|
12
|
+
}
|
|
13
|
+
readFile(pathToRead) {
|
|
14
|
+
const rawFile = fs.readFileSync(pathToRead);
|
|
15
|
+
return rawFile.toString();
|
|
16
|
+
}
|
|
17
|
+
joinPath(...paths) {
|
|
18
|
+
return path.join(...paths);
|
|
19
|
+
}
|
|
20
|
+
exists(path) {
|
|
21
|
+
return fs.existsSync(path);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DefaultFileSystem = DefaultFileSystem;
|
|
25
25
|
//# sourceMappingURL=file-system.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OutputFile } from '../model/outputFile';
|
|
2
|
-
import { TargetFile } from '../settings';
|
|
3
|
-
export declare class FileWriter {
|
|
4
|
-
static write(files: OutputFile[], onWriteCallback: (file: TargetFile) => void): void;
|
|
5
|
-
private static getTargetLocation;
|
|
6
|
-
}
|
|
1
|
+
import { OutputFile } from '../model/outputFile';
|
|
2
|
+
import { TargetFile } from '../settings';
|
|
3
|
+
export declare class FileWriter {
|
|
4
|
+
static write(files: OutputFile[], onWriteCallback: (file: TargetFile) => void): void;
|
|
5
|
+
private static getTargetLocation;
|
|
6
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileWriter = void 0;
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const settings_1 = require("../settings");
|
|
7
|
-
class FileWriter {
|
|
8
|
-
static write(files, onWriteCallback) {
|
|
9
|
-
const onBeforeFileWrite = (file) => settings_1.Settings.getInstance().onBeforeFileWrite(file);
|
|
10
|
-
files.forEach((file) => {
|
|
11
|
-
const resolvedFile = this.getTargetLocation(file, onBeforeFileWrite);
|
|
12
|
-
const fullDir = path.join(resolvedFile.dir.baseDir, resolvedFile.dir.fileDir);
|
|
13
|
-
if (!fs.existsSync(fullDir)) {
|
|
14
|
-
fs.mkdirSync(fullDir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
const filePath = path.join(fullDir, `${resolvedFile.name}${resolvedFile.extension}`);
|
|
17
|
-
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
18
|
-
onWriteCallback(resolvedFile);
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
static getTargetLocation(file, onBeforeFileWrite) {
|
|
22
|
-
const targetFile = {
|
|
23
|
-
name: file.fileName,
|
|
24
|
-
extension: file.fileExtension(),
|
|
25
|
-
dir: {
|
|
26
|
-
baseDir: settings_1.Settings.getInstance().outputDir,
|
|
27
|
-
fileDir: file.dir,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
return onBeforeFileWrite(targetFile);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.FileWriter = FileWriter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileWriter = void 0;
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const settings_1 = require("../settings");
|
|
7
|
+
class FileWriter {
|
|
8
|
+
static write(files, onWriteCallback) {
|
|
9
|
+
const onBeforeFileWrite = (file) => settings_1.Settings.getInstance().onBeforeFileWrite(file);
|
|
10
|
+
files.forEach((file) => {
|
|
11
|
+
const resolvedFile = this.getTargetLocation(file, onBeforeFileWrite);
|
|
12
|
+
const fullDir = path.join(resolvedFile.dir.baseDir, resolvedFile.dir.fileDir);
|
|
13
|
+
if (!fs.existsSync(fullDir)) {
|
|
14
|
+
fs.mkdirSync(fullDir, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
const filePath = path.join(fullDir, `${resolvedFile.name}${resolvedFile.extension}`);
|
|
17
|
+
fs.writeFileSync(filePath, file.body, 'utf8');
|
|
18
|
+
onWriteCallback(resolvedFile);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
static getTargetLocation(file, onBeforeFileWrite) {
|
|
22
|
+
const targetFile = {
|
|
23
|
+
name: file.fileName,
|
|
24
|
+
extension: file.fileExtension(),
|
|
25
|
+
dir: {
|
|
26
|
+
baseDir: settings_1.Settings.getInstance().outputDir,
|
|
27
|
+
fileDir: file.dir,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
return onBeforeFileWrite(targetFile);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.FileWriter = FileWriter;
|
|
34
34
|
//# sourceMappingURL=file-writer.js.map
|
|
@@ -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,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createManifest = void 0;
|
|
4
|
-
const manifest_1 = require("../model/manifest");
|
|
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
|
-
function createManifest(typeParser, reflect) {
|
|
11
|
-
return new manifest_1.default(typeParser.parse(reflect));
|
|
12
|
-
}
|
|
13
|
-
exports.createManifest = createManifest;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createManifest = void 0;
|
|
4
|
+
const manifest_1 = require("../model/manifest");
|
|
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
|
+
function createManifest(typeParser, reflect) {
|
|
11
|
+
return new manifest_1.default(typeParser.parse(reflect));
|
|
12
|
+
}
|
|
13
|
+
exports.createManifest = createManifest;
|
|
14
14
|
//# sourceMappingURL=manifest-factory.js.map
|
|
@@ -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 {};
|