@cparra/apexdocs 2.8.0 → 2.9.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/docs/Main/SampleClass.md +188 -188
- package/docs/openapi.json +351 -0
- package/examples/force-app/main/default/classes/ChildClass.cls +3 -1
- package/examples/force-app/main/default/classes/ParentClass.cls +4 -4
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +189 -0
- package/lib/application/Apexdocs.d.ts +1 -0
- package/lib/application/Apexdocs.js +33 -9
- package/lib/application/Apexdocs.js.map +1 -1
- package/lib/cli/generate.js +11 -3
- package/lib/cli/generate.js.map +1 -1
- package/lib/index.js +6 -2
- package/lib/index.js.map +1 -1
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.d.ts +7 -0
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js +14 -0
- package/lib/model/apex-type-wrappers/ClassMirrorWrapper.js.map +1 -0
- package/lib/model/inheritance.d.ts +5 -5
- package/lib/model/manifest.d.ts +1 -1
- package/lib/model/markdown-file.d.ts +2 -2
- package/lib/model/markdown-file.js +2 -2
- package/lib/model/markdown-file.js.map +1 -1
- package/lib/model/markdown-generation-util/doc-comment-annotation-util.js.map +1 -1
- package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/index.js +6 -2
- package/lib/model/markdown-generation-util/index.js.map +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js +1 -1
- package/lib/model/markdown-generation-util/method-declaration-util.js.map +1 -1
- package/lib/model/markdown-generation-util/type-declaration-util.js +2 -2
- package/lib/model/markdown-generation-util/type-declaration-util.js.map +1 -1
- package/lib/model/markdown-home-file.js +1 -1
- package/lib/model/markdown-home-file.js.map +1 -1
- package/lib/model/markdown-type-file.js +5 -5
- package/lib/model/markdown-type-file.js.map +1 -1
- package/lib/model/openapi/apex-doc-types.d.ts +18 -0
- package/lib/model/openapi/apex-doc-types.js +5 -0
- package/lib/model/openapi/apex-doc-types.js.map +1 -0
- package/lib/model/openapi/open-api-types.d.ts +87 -0
- package/lib/model/openapi/open-api-types.js +3 -0
- package/lib/model/openapi/open-api-types.js.map +1 -0
- package/lib/model/openapi/open-api.d.ts +15 -0
- package/lib/model/openapi/open-api.js +33 -0
- package/lib/model/openapi/open-api.js.map +1 -0
- package/lib/model/openapi/openapi-type-file.d.ts +7 -0
- package/lib/model/openapi/openapi-type-file.js +16 -0
- package/lib/model/openapi/openapi-type-file.js.map +1 -0
- package/lib/model/{file.d.ts → outputFile.d.ts} +1 -1
- package/lib/model/{file.js → outputFile.js} +4 -4
- package/lib/model/outputFile.js.map +1 -0
- package/lib/model/types-repository.d.ts +6 -3
- package/lib/model/types-repository.js +12 -5
- package/lib/model/types-repository.js.map +1 -1
- package/lib/service/file-writer.d.ts +2 -2
- package/lib/service/file-writer.js.map +1 -1
- package/lib/service/metadata-processor.js.map +1 -1
- package/lib/service/parser.d.ts +1 -1
- package/lib/settings.d.ts +4 -5
- package/lib/settings.js +5 -23
- package/lib/settings.js.map +1 -1
- package/lib/test-helpers/AnnotationBuilder.d.ts +12 -0
- package/lib/test-helpers/AnnotationBuilder.js +31 -0
- package/lib/test-helpers/AnnotationBuilder.js.map +1 -0
- package/lib/test-helpers/ClassMirrorBuilder.d.ts +14 -0
- package/lib/test-helpers/ClassMirrorBuilder.js +44 -0
- package/lib/test-helpers/ClassMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +6 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.js +21 -0
- package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +1 -0
- package/lib/test-helpers/DocCommentBuilder.d.ts +12 -0
- package/lib/test-helpers/DocCommentBuilder.js +38 -0
- package/lib/test-helpers/DocCommentBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +10 -0
- package/lib/test-helpers/MethodMirrorBuilder.js +34 -0
- package/lib/test-helpers/MethodMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/SettingsBuilder.d.ts +8 -0
- package/lib/test-helpers/SettingsBuilder.js +24 -0
- package/lib/test-helpers/SettingsBuilder.js.map +1 -0
- package/lib/transpiler/factory.d.ts +6 -0
- package/lib/transpiler/factory.js +32 -0
- package/lib/transpiler/factory.js.map +1 -0
- package/lib/transpiler/file-container.d.ts +4 -4
- package/lib/transpiler/file-container.js.map +1 -1
- package/lib/transpiler/generator-choices.d.ts +1 -0
- package/lib/transpiler/generator-choices.js +3 -0
- package/lib/transpiler/generator-choices.js.map +1 -0
- package/lib/transpiler/markdown/class-file-generatorHelper.js +4 -2
- package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
- package/lib/transpiler/openapi/open-api-docs-processor.d.ts +12 -0
- package/lib/transpiler/openapi/open-api-docs-processor.js +62 -0
- package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -0
- package/lib/transpiler/openapi/parsers/Builder.d.ts +16 -0
- package/lib/transpiler/openapi/parsers/Builder.js +30 -0
- package/lib/transpiler/openapi/parsers/Builder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/MethodParser.d.ts +17 -0
- package/lib/transpiler/openapi/parsers/MethodParser.js +104 -0
- package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.d.ts +7 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js +11 -0
- package/lib/transpiler/openapi/parsers/ParameterObjectBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +16 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +65 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.d.ts +10 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js +20 -0
- package/lib/transpiler/openapi/parsers/RequestBodyBuilder.js.map +1 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.d.ts +7 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js +18 -0
- package/lib/transpiler/openapi/parsers/ResponsesBuilder.js.map +1 -0
- package/lib/transpiler/processor-type-transpiler.d.ts +2 -2
- package/lib/transpiler/processor-type-transpiler.js +3 -0
- package/lib/transpiler/processor-type-transpiler.js.map +1 -1
- package/lib/transpiler/transpiler.js.map +1 -1
- package/lib/util/error-logger.js.map +1 -1
- package/package.json +8 -5
- package/src/application/Apexdocs.ts +37 -16
- package/src/cli/generate.ts +13 -4
- package/src/model/apex-type-wrappers/ClassMirrorWrapper.ts +12 -0
- package/src/model/apex-type-wrappers/__tests__/ClassMirrorWrapper.spec.ts +15 -0
- package/src/model/markdown-file.ts +2 -2
- package/src/model/markdown-generation-util/type-declaration-util.ts +1 -1
- package/src/model/openapi/__tests__/open-api.spec.ts +22 -0
- package/src/model/openapi/apex-doc-types.ts +25 -0
- package/src/model/openapi/open-api-types.ts +112 -0
- package/src/model/openapi/open-api.ts +39 -0
- package/src/model/openapi/openapi-type-file.ts +13 -0
- package/src/model/{file.ts → outputFile.ts} +1 -1
- package/src/model/types-repository.ts +14 -5
- package/src/service/__tests__/apex-file-reader.spec.ts +4 -4
- package/src/service/__tests__/manifest-factory.spec.ts +2 -1
- package/src/service/file-writer.ts +2 -2
- package/src/settings.ts +8 -29
- package/src/test-helpers/AnnotationBuilder.ts +29 -0
- package/src/test-helpers/ClassMirrorBuilder.ts +44 -0
- package/src/test-helpers/DocCommentAnnotationBuilder.ts +18 -0
- package/src/test-helpers/DocCommentBuilder.ts +36 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +34 -0
- package/src/test-helpers/SettingsBuilder.ts +21 -0
- package/src/transpiler/factory.ts +33 -0
- package/src/transpiler/file-container.ts +4 -4
- package/src/transpiler/generator-choices.ts +1 -0
- package/src/transpiler/markdown/class-file-generatorHelper.ts +4 -2
- package/src/transpiler/openapi/__tests__/open-api-docs-processor.spec.ts +41 -0
- package/src/transpiler/openapi/open-api-docs-processor.ts +76 -0
- package/src/transpiler/openapi/parsers/Builder.ts +40 -0
- package/src/transpiler/openapi/parsers/MethodParser.ts +140 -0
- package/src/transpiler/openapi/parsers/ParameterObjectBuilder.ts +13 -0
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +80 -0
- package/src/transpiler/openapi/parsers/RequestBodyBuilder.ts +19 -0
- package/src/transpiler/openapi/parsers/ResponsesBuilder.ts +17 -0
- package/src/transpiler/openapi/parsers/__tests__/MethodParser.spec.ts +44 -0
- package/src/transpiler/openapi/parsers/__tests__/ParameterObjectBuilder.spec.ts +64 -0
- package/src/transpiler/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +14 -0
- package/src/transpiler/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +60 -0
- package/src/transpiler/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +51 -0
- package/src/transpiler/processor-type-transpiler.ts +3 -1
- package/tsconfig.json +4 -1
- package/lib/model/file.js.map +0 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
2
|
export declare class TypesRepository {
|
|
3
3
|
private static instance;
|
|
4
|
-
private
|
|
4
|
+
private scopedTypes;
|
|
5
|
+
private allTypes;
|
|
5
6
|
static getInstance(): TypesRepository;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
populateAll(types: Type[]): void;
|
|
8
|
+
getFromAllByName(typeName: string): Type | undefined;
|
|
9
|
+
populateScoped(types: Type[]): void;
|
|
10
|
+
getFromScopedByName(typeName: string): Type | undefined;
|
|
8
11
|
}
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TypesRepository = void 0;
|
|
4
4
|
class TypesRepository {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.
|
|
6
|
+
this.scopedTypes = [];
|
|
7
|
+
this.allTypes = [];
|
|
7
8
|
}
|
|
8
9
|
static getInstance() {
|
|
9
10
|
if (!TypesRepository.instance) {
|
|
@@ -11,11 +12,17 @@ class TypesRepository {
|
|
|
11
12
|
}
|
|
12
13
|
return TypesRepository.instance;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
this.
|
|
15
|
+
populateAll(types) {
|
|
16
|
+
this.allTypes = types;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
return this.
|
|
18
|
+
getFromAllByName(typeName) {
|
|
19
|
+
return this.allTypes.find((currentType) => currentType.name === typeName);
|
|
20
|
+
}
|
|
21
|
+
populateScoped(types) {
|
|
22
|
+
this.scopedTypes = types;
|
|
23
|
+
}
|
|
24
|
+
getFromScopedByName(typeName) {
|
|
25
|
+
return this.scopedTypes.find((currentType) => currentType.name === typeName);
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
exports.TypesRepository = TypesRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-repository.js","sourceRoot":"","sources":["../../src/model/types-repository.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAe;IAA5B;QAEU,
|
|
1
|
+
{"version":3,"file":"types-repository.js","sourceRoot":"","sources":["../../src/model/types-repository.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAe;IAA5B;QAEU,gBAAW,GAAW,EAAE,CAAC;QACzB,aAAQ,GAAW,EAAE,CAAC;IAwBhC,CAAC;IAtBQ,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;YAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;SAClD;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAEM,WAAW,CAAC,KAAa;QAC9B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IAClF,CAAC;IAEM,cAAc,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEM,mBAAmB,CAAC,QAAgB;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IACrF,CAAC;CACF;AA3BD,0CA2BC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OutputFile } from '../model/outputFile';
|
|
2
2
|
export declare class FileWriter {
|
|
3
|
-
static write(files:
|
|
3
|
+
static write(files: OutputFile[], onWriteCallback: (fileName: string) => void): void;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,0CAAuC;AAEvC,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"file-writer.js","sourceRoot":"","sources":["../../src/service/file-writer.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAE7B,0CAAuC;AAEvC,MAAa,UAAU;IACrB,MAAM,CAAC,KAAK,CAAC,KAAmB,EAAE,eAA2C;QAC3E,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,CAAC;QACnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC7B,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SACzB;QAED,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAC3B,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;aACvB;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;YAC/E,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;gBAC7C,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,gCAmBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-processor.js","sourceRoot":"","sources":["../../src/service/metadata-processor.ts"],"names":[],"mappings":";;AAAA,qDAA4C;AAE5C,MAAqB,iBAAiB;IAC7B,MAAM,CAAC,OAAO,CAAC,KAAa;;QACjC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,2BAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEzC,GAAG,CAAC,GAAG,CAAC,YAAY,
|
|
1
|
+
{"version":3,"file":"metadata-processor.js","sourceRoot":"","sources":["../../src/service/metadata-processor.ts"],"names":[],"mappings":";;AAAA,qDAA4C;AAE5C,MAAqB,iBAAiB;IAC7B,MAAM,CAAC,OAAO,CAAC,KAAa;;QACjC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;QACtC,MAAM,GAAG,GAAG,IAAI,2BAAS,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,MAAA,GAAG,CAAC,SAAS,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC;QAEtD,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SACzC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAbD,oCAaC"}
|
package/lib/service/parser.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import ApexBundle from '../model/apex-bundle';
|
|
|
3
3
|
export interface TypeParser {
|
|
4
4
|
parse(reflect: (apexBundle: ApexBundle) => ReflectionResult): Type[];
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type NameAware = {
|
|
7
7
|
name: string;
|
|
8
8
|
};
|
|
9
9
|
export declare class RawBodyParser implements TypeParser {
|
package/lib/settings.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown';
|
|
1
|
+
import { GeneratorChoices } from './transpiler/generator-choices';
|
|
3
2
|
export interface SettingsConfig {
|
|
4
3
|
sourceDirectory: string;
|
|
5
4
|
recursive: boolean;
|
|
@@ -9,6 +8,7 @@ export interface SettingsConfig {
|
|
|
9
8
|
indexOnly: boolean;
|
|
10
9
|
defaultGroupName: string;
|
|
11
10
|
sanitizeHtml: boolean;
|
|
11
|
+
openApiTitle?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare class Settings {
|
|
14
14
|
config: SettingsConfig;
|
|
@@ -20,10 +20,9 @@ export declare class Settings {
|
|
|
20
20
|
get recursive(): boolean;
|
|
21
21
|
get scope(): string[];
|
|
22
22
|
get outputDir(): string;
|
|
23
|
-
|
|
24
|
-
get typeTranspiler(): ProcessorTypeTranspiler;
|
|
23
|
+
get targetGenerator(): GeneratorChoices;
|
|
25
24
|
get indexOnly(): boolean;
|
|
26
25
|
get sanitizeHtml(): boolean;
|
|
27
|
-
get numberOfVisibleDescriptionLinesOnHomePage(): number;
|
|
28
26
|
getDefaultGroupName(): string;
|
|
27
|
+
getOpenApiTitle(): string | undefined;
|
|
29
28
|
}
|
package/lib/settings.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Settings = void 0;
|
|
4
|
-
const jekyll_docsProcessor_1 = require("./transpiler/markdown/jekyll/jekyll-docsProcessor");
|
|
5
|
-
const docsify_docs_processor_1 = require("./transpiler/markdown/docsify/docsify-docs-processor");
|
|
6
|
-
const plain_docsProcessor_1 = require("./transpiler/markdown/plain-markdown/plain-docsProcessor");
|
|
7
4
|
class Settings {
|
|
8
5
|
constructor(config) {
|
|
9
6
|
this.config = config;
|
|
@@ -29,23 +26,8 @@ class Settings {
|
|
|
29
26
|
get outputDir() {
|
|
30
27
|
return this.config.outputDir;
|
|
31
28
|
}
|
|
32
|
-
get
|
|
33
|
-
|
|
34
|
-
return Settings.typeTranspilerCache;
|
|
35
|
-
}
|
|
36
|
-
switch (this.config.targetGenerator) {
|
|
37
|
-
case 'jekyll':
|
|
38
|
-
Settings.typeTranspilerCache = new jekyll_docsProcessor_1.JekyllDocsProcessor();
|
|
39
|
-
return Settings.typeTranspilerCache;
|
|
40
|
-
case 'docsify':
|
|
41
|
-
Settings.typeTranspilerCache = new docsify_docs_processor_1.default();
|
|
42
|
-
return Settings.typeTranspilerCache;
|
|
43
|
-
case 'plain-markdown':
|
|
44
|
-
Settings.typeTranspilerCache = new plain_docsProcessor_1.PlainMarkdownDocsProcessor();
|
|
45
|
-
return Settings.typeTranspilerCache;
|
|
46
|
-
default:
|
|
47
|
-
throw Error('Invalid target generator');
|
|
48
|
-
}
|
|
29
|
+
get targetGenerator() {
|
|
30
|
+
return this.config.targetGenerator;
|
|
49
31
|
}
|
|
50
32
|
get indexOnly() {
|
|
51
33
|
return this.config.indexOnly;
|
|
@@ -53,12 +35,12 @@ class Settings {
|
|
|
53
35
|
get sanitizeHtml() {
|
|
54
36
|
return this.config.sanitizeHtml;
|
|
55
37
|
}
|
|
56
|
-
get numberOfVisibleDescriptionLinesOnHomePage() {
|
|
57
|
-
return 5;
|
|
58
|
-
}
|
|
59
38
|
getDefaultGroupName() {
|
|
60
39
|
return this.config.defaultGroupName;
|
|
61
40
|
}
|
|
41
|
+
getOpenApiTitle() {
|
|
42
|
+
return this.config.openApiTitle;
|
|
43
|
+
}
|
|
62
44
|
}
|
|
63
45
|
exports.Settings = Settings;
|
|
64
46
|
//# sourceMappingURL=settings.js.map
|
package/lib/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":";;;AAcA,MAAa,QAAQ;IAGnB,YAA2B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C,MAAM,CAAC,KAAK,CAAC,MAAsB;QACxC,QAAQ,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;SACtD;QACD,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IAClC,CAAC;IAEM,mBAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACtC,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;IAClC,CAAC;CACF;AAnDD,4BAmDC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Annotation, AnnotationElementValue } from '@cparra/apex-reflection';
|
|
2
|
+
/**
|
|
3
|
+
* Builder class to create Annotation objects.
|
|
4
|
+
* For testing purposes only.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnnotationBuilder {
|
|
7
|
+
private name;
|
|
8
|
+
private elementValues;
|
|
9
|
+
withName(name: string): AnnotationBuilder;
|
|
10
|
+
addElementValue(elementValue: AnnotationElementValue): AnnotationBuilder;
|
|
11
|
+
build(): Annotation;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnnotationBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builder class to create Annotation objects.
|
|
6
|
+
* For testing purposes only.
|
|
7
|
+
*/
|
|
8
|
+
class AnnotationBuilder {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.name = 'restresource';
|
|
11
|
+
this.elementValues = [];
|
|
12
|
+
}
|
|
13
|
+
withName(name) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
addElementValue(elementValue) {
|
|
18
|
+
this.elementValues.push(elementValue);
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
build() {
|
|
22
|
+
return {
|
|
23
|
+
rawDeclaration: '',
|
|
24
|
+
name: this.name,
|
|
25
|
+
type: this.name,
|
|
26
|
+
elementValues: this.elementValues,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.AnnotationBuilder = AnnotationBuilder;
|
|
31
|
+
//# sourceMappingURL=AnnotationBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnotationBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/AnnotationBuilder.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,iBAAiB;IAA9B;QACU,SAAI,GAAG,cAAc,CAAC;QACtB,kBAAa,GAA6B,EAAE,CAAC;IAoBvD,CAAC;IAlBC,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CAAC,YAAoC;QAClD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,cAAc,EAAE,EAAE;YAClB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC;IACJ,CAAC;CACF;AAtBD,8CAsBC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Annotation, ClassMirror, DocComment, MethodMirror } from '@cparra/apex-reflection';
|
|
2
|
+
/**
|
|
3
|
+
* Builder class to create ClassMirror objects.
|
|
4
|
+
* For testing purposes only.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ClassMirrorBuilder {
|
|
7
|
+
private annotations;
|
|
8
|
+
private docComment?;
|
|
9
|
+
private methods;
|
|
10
|
+
addAnnotation(annotation: Annotation): ClassMirrorBuilder;
|
|
11
|
+
withDocComment(docComment: DocComment): ClassMirrorBuilder;
|
|
12
|
+
addMethod(method: MethodMirror): ClassMirrorBuilder;
|
|
13
|
+
build(): ClassMirror;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClassMirrorBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builder class to create ClassMirror objects.
|
|
6
|
+
* For testing purposes only.
|
|
7
|
+
*/
|
|
8
|
+
class ClassMirrorBuilder {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.annotations = [];
|
|
11
|
+
this.methods = [];
|
|
12
|
+
}
|
|
13
|
+
addAnnotation(annotation) {
|
|
14
|
+
this.annotations.push(annotation);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
withDocComment(docComment) {
|
|
18
|
+
this.docComment = docComment;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
addMethod(method) {
|
|
22
|
+
this.methods.push(method);
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
build() {
|
|
26
|
+
return {
|
|
27
|
+
annotations: this.annotations,
|
|
28
|
+
name: 'SampleClass',
|
|
29
|
+
type_name: 'class',
|
|
30
|
+
methods: this.methods,
|
|
31
|
+
implemented_interfaces: [],
|
|
32
|
+
properties: [],
|
|
33
|
+
fields: [],
|
|
34
|
+
constructors: [],
|
|
35
|
+
enums: [],
|
|
36
|
+
interfaces: [],
|
|
37
|
+
classes: [],
|
|
38
|
+
access_modifier: 'public',
|
|
39
|
+
docComment: this.docComment,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ClassMirrorBuilder = ClassMirrorBuilder;
|
|
44
|
+
//# sourceMappingURL=ClassMirrorBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassMirrorBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/ClassMirrorBuilder.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,kBAAkB;IAA/B;QACU,gBAAW,GAAiB,EAAE,CAAC;QAE/B,YAAO,GAAmB,EAAE,CAAC;IAkCvC,CAAC;IAhCC,aAAa,CAAC,UAAsB;QAClC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CAAC,UAAsB;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,MAAoB;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,aAAa;YACnB,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,sBAAsB,EAAE,EAAE;YAC1B,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE,EAAE;YACT,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,QAAQ;YACzB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;CACF;AArCD,gDAqCC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocCommentAnnotationBuilder = void 0;
|
|
4
|
+
class DocCommentAnnotationBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = '';
|
|
7
|
+
}
|
|
8
|
+
withName(name) {
|
|
9
|
+
this.name = name;
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
build() {
|
|
13
|
+
return {
|
|
14
|
+
name: this.name,
|
|
15
|
+
body: '',
|
|
16
|
+
bodyLines: [],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DocCommentAnnotationBuilder = DocCommentAnnotationBuilder;
|
|
21
|
+
//# sourceMappingURL=DocCommentAnnotationBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocCommentAnnotationBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/DocCommentAnnotationBuilder.ts"],"names":[],"mappings":";;;AAEA,MAAa,2BAA2B;IAAxC;QACU,SAAI,GAAG,EAAE,CAAC;IAcpB,CAAC;IAZC,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,EAAE;YACR,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;CACF;AAfD,kEAeC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DocComment, DocCommentAnnotation } from '@cparra/apex-reflection';
|
|
2
|
+
/**
|
|
3
|
+
* Builder class to create DocComment objects.
|
|
4
|
+
* For testing purposes only.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DocCommentBuilder {
|
|
7
|
+
private description?;
|
|
8
|
+
private annotations;
|
|
9
|
+
addAnnotation(annotation: DocCommentAnnotation): DocCommentBuilder;
|
|
10
|
+
withDescription(description: string): DocCommentBuilder;
|
|
11
|
+
build(): DocComment;
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DocCommentBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builder class to create DocComment objects.
|
|
6
|
+
* For testing purposes only.
|
|
7
|
+
*/
|
|
8
|
+
class DocCommentBuilder {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.annotations = [];
|
|
11
|
+
}
|
|
12
|
+
addAnnotation(annotation) {
|
|
13
|
+
this.annotations.push(annotation);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
withDescription(description) {
|
|
17
|
+
this.description = description;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
build() {
|
|
21
|
+
var _a;
|
|
22
|
+
return {
|
|
23
|
+
paramAnnotations: [],
|
|
24
|
+
returnAnnotation: {
|
|
25
|
+
bodyLines: [],
|
|
26
|
+
},
|
|
27
|
+
exampleAnnotation: {
|
|
28
|
+
bodyLines: [],
|
|
29
|
+
},
|
|
30
|
+
throwsAnnotations: [],
|
|
31
|
+
annotations: this.annotations,
|
|
32
|
+
descriptionLines: [],
|
|
33
|
+
description: (_a = this.description) !== null && _a !== void 0 ? _a : 'Sample Description',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.DocCommentBuilder = DocCommentBuilder;
|
|
38
|
+
//# sourceMappingURL=DocCommentBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocCommentBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/DocCommentBuilder.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,iBAAiB;IAA9B;QAEU,gBAAW,GAA2B,EAAE,CAAC;IA2BnD,CAAC;IAzBC,aAAa,CAAC,UAAgC;QAC5C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CAAC,WAAmB;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;;QACH,OAAO;YACL,gBAAgB,EAAE,EAAE;YACpB,gBAAgB,EAAE;gBAChB,SAAS,EAAE,EAAE;aACd;YACD,iBAAiB,EAAE;gBACjB,SAAS,EAAE,EAAE;aACd;YACD,iBAAiB,EAAE,EAAE;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,EAAE;YACpB,WAAW,EAAE,MAAA,IAAI,CAAC,WAAW,mCAAI,oBAAoB;SACtD,CAAC;IACJ,CAAC;CACF;AA7BD,8CA6BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Annotation, DocComment, MethodMirror } from '@cparra/apex-reflection';
|
|
2
|
+
export declare class MethodMirrorBuilder {
|
|
3
|
+
private name;
|
|
4
|
+
private annotations;
|
|
5
|
+
private docComment?;
|
|
6
|
+
withName(name: string): MethodMirrorBuilder;
|
|
7
|
+
addAnnotation(annotation: Annotation): MethodMirrorBuilder;
|
|
8
|
+
withDocComment(docComment: DocComment): MethodMirrorBuilder;
|
|
9
|
+
build(): MethodMirror;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MethodMirrorBuilder = void 0;
|
|
4
|
+
class MethodMirrorBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'sampleMethod';
|
|
7
|
+
this.annotations = [];
|
|
8
|
+
}
|
|
9
|
+
withName(name) {
|
|
10
|
+
this.name = name;
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
addAnnotation(annotation) {
|
|
14
|
+
this.annotations.push(annotation);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
withDocComment(docComment) {
|
|
18
|
+
this.docComment = docComment;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
build() {
|
|
22
|
+
return {
|
|
23
|
+
access_modifier: 'public',
|
|
24
|
+
annotations: this.annotations,
|
|
25
|
+
name: this.name,
|
|
26
|
+
memberModifiers: [],
|
|
27
|
+
type: 'void',
|
|
28
|
+
parameters: [],
|
|
29
|
+
docComment: this.docComment,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.MethodMirrorBuilder = MethodMirrorBuilder;
|
|
34
|
+
//# sourceMappingURL=MethodMirrorBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodMirrorBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/MethodMirrorBuilder.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAAhC;QACU,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAiB,EAAE,CAAC;IA6BzC,CAAC;IA1BC,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,UAAsB;QAClC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CAAC,UAAsB;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,eAAe,EAAE,QAAQ;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,eAAe,EAAE,EAAE;YACnB,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC;CACF;AA/BD,kDA+BC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingsBuilder = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builder class to create SettingsConfig objects.
|
|
6
|
+
* For testing purposes only.
|
|
7
|
+
*/
|
|
8
|
+
class SettingsBuilder {
|
|
9
|
+
build() {
|
|
10
|
+
return {
|
|
11
|
+
sourceDirectory: './',
|
|
12
|
+
recursive: true,
|
|
13
|
+
scope: [],
|
|
14
|
+
outputDir: './',
|
|
15
|
+
targetGenerator: 'openapi',
|
|
16
|
+
indexOnly: false,
|
|
17
|
+
defaultGroupName: 'Misc',
|
|
18
|
+
sanitizeHtml: true,
|
|
19
|
+
openApiTitle: 'Apex API',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.SettingsBuilder = SettingsBuilder;
|
|
24
|
+
//# sourceMappingURL=SettingsBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsBuilder.js","sourceRoot":"","sources":["../../src/test-helpers/SettingsBuilder.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,eAAe;IAC1B,KAAK;QACH,OAAO;YACL,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,SAAS;YAC1B,SAAS,EAAE,KAAK;YAChB,gBAAgB,EAAE,MAAM;YACxB,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,UAAU;SACzB,CAAC;IACJ,CAAC;CACF;AAdD,0CAcC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ProcessorTypeTranspiler from './processor-type-transpiler';
|
|
2
|
+
import { GeneratorChoices } from './generator-choices';
|
|
3
|
+
export declare class TypeTranspilerFactory {
|
|
4
|
+
private static typeTranspilerCache?;
|
|
5
|
+
static get(generator: GeneratorChoices): ProcessorTypeTranspiler;
|
|
6
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeTranspilerFactory = void 0;
|
|
4
|
+
const jekyll_docsProcessor_1 = require("./markdown/jekyll/jekyll-docsProcessor");
|
|
5
|
+
const docsify_docs_processor_1 = require("./markdown/docsify/docsify-docs-processor");
|
|
6
|
+
const plain_docsProcessor_1 = require("./markdown/plain-markdown/plain-docsProcessor");
|
|
7
|
+
const open_api_docs_processor_1 = require("./openapi/open-api-docs-processor");
|
|
8
|
+
class TypeTranspilerFactory {
|
|
9
|
+
static get(generator) {
|
|
10
|
+
if (this.typeTranspilerCache) {
|
|
11
|
+
return this.typeTranspilerCache;
|
|
12
|
+
}
|
|
13
|
+
switch (generator) {
|
|
14
|
+
case 'jekyll':
|
|
15
|
+
this.typeTranspilerCache = new jekyll_docsProcessor_1.JekyllDocsProcessor();
|
|
16
|
+
return this.typeTranspilerCache;
|
|
17
|
+
case 'docsify':
|
|
18
|
+
this.typeTranspilerCache = new docsify_docs_processor_1.default();
|
|
19
|
+
return this.typeTranspilerCache;
|
|
20
|
+
case 'plain-markdown':
|
|
21
|
+
this.typeTranspilerCache = new plain_docsProcessor_1.PlainMarkdownDocsProcessor();
|
|
22
|
+
return this.typeTranspilerCache;
|
|
23
|
+
case 'openapi':
|
|
24
|
+
this.typeTranspilerCache = new open_api_docs_processor_1.OpenApiDocsProcessor();
|
|
25
|
+
return this.typeTranspilerCache;
|
|
26
|
+
default:
|
|
27
|
+
throw Error('Invalid target generator');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.TypeTranspilerFactory = TypeTranspilerFactory;
|
|
32
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src/transpiler/factory.ts"],"names":[],"mappings":";;;AAEA,iFAA6E;AAC7E,sFAA6E;AAC7E,uFAA2F;AAC3F,+EAAyE;AAEzE,MAAa,qBAAqB;IAGzB,MAAM,CAAC,GAAG,CAAC,SAA2B;QAC3C,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC5B,OAAO,IAAI,CAAC,mBAAmB,CAAC;SACjC;QAED,QAAQ,SAAS,EAAE;YACjB,KAAK,QAAQ;gBACX,IAAI,CAAC,mBAAmB,GAAG,IAAI,0CAAmB,EAAE,CAAC;gBACrD,OAAO,IAAI,CAAC,mBAAmB,CAAC;YAClC,KAAK,SAAS;gBACZ,IAAI,CAAC,mBAAmB,GAAG,IAAI,gCAAoB,EAAE,CAAC;gBACtD,OAAO,IAAI,CAAC,mBAAmB,CAAC;YAClC,KAAK,gBAAgB;gBACnB,IAAI,CAAC,mBAAmB,GAAG,IAAI,gDAA0B,EAAE,CAAC;gBAC5D,OAAO,IAAI,CAAC,mBAAmB,CAAC;YAClC,KAAK,SAAS;gBACZ,IAAI,CAAC,mBAAmB,GAAG,IAAI,8CAAoB,EAAE,CAAC;gBACtD,OAAO,IAAI,CAAC,mBAAmB,CAAC;YAClC;gBACE,MAAM,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC3C;IACH,CAAC;CACF;AAzBD,sDAyBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OutputFile } from '../model/outputFile';
|
|
2
2
|
export declare class FileContainer {
|
|
3
|
-
_files:
|
|
4
|
-
files():
|
|
5
|
-
pushFile(file:
|
|
3
|
+
_files: OutputFile[];
|
|
4
|
+
files(): OutputFile[];
|
|
5
|
+
pushFile(file: OutputFile): void;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-container.js","sourceRoot":"","sources":["../../src/transpiler/file-container.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAA1B;QACE,WAAM,
|
|
1
|
+
{"version":3,"file":"file-container.js","sourceRoot":"","sources":["../../src/transpiler/file-container.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAA1B;QACE,WAAM,GAAiB,EAAE,CAAC;IAS5B,CAAC;IAPC,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,QAAQ,CAAC,IAAgB;QACvB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF;AAVD,sCAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type GeneratorChoices = 'jekyll' | 'docsify' | 'plain-markdown' | 'openapi';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-choices.js","sourceRoot":"","sources":["../../src/transpiler/generator-choices.ts"],"names":[],"mappings":""}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const types_repository_1 = require("../../model/types-repository");
|
|
4
4
|
const settings_1 = require("../../settings");
|
|
5
5
|
const state_1 = require("../../service/state");
|
|
6
|
+
const factory_1 = require("../factory");
|
|
6
7
|
class ClassFileGeneratorHelper {
|
|
7
8
|
static getSanitizedGroup(classModel) {
|
|
8
9
|
return this.getClassGroup(classModel).replace(/ /g, '-').replace('.', '');
|
|
@@ -12,7 +13,7 @@ class ClassFileGeneratorHelper {
|
|
|
12
13
|
return `[${classModel.name}](${directoryRoot}${classModel.name}.md)`;
|
|
13
14
|
}
|
|
14
15
|
static getFileLinkByTypeName(typeName) {
|
|
15
|
-
const type = types_repository_1.TypesRepository.getInstance().
|
|
16
|
+
const type = types_repository_1.TypesRepository.getInstance().getFromScopedByName(typeName);
|
|
16
17
|
if (!type) {
|
|
17
18
|
// If the type is not found we return a Markdown hyperlink with whatever we received.
|
|
18
19
|
return `[${typeName}](${typeName})`;
|
|
@@ -21,7 +22,8 @@ class ClassFileGeneratorHelper {
|
|
|
21
22
|
}
|
|
22
23
|
static getDirectoryRoot(classModel) {
|
|
23
24
|
// root-relative links start from the root by using a leading '/'
|
|
24
|
-
|
|
25
|
+
const generator = settings_1.Settings.getInstance().targetGenerator;
|
|
26
|
+
if (factory_1.TypeTranspilerFactory.get(generator).getLinkingStrategy() === 'root-relative') {
|
|
25
27
|
return `/${this.getSanitizedGroup(classModel)}/`;
|
|
26
28
|
}
|
|
27
29
|
// path-relative links traverse the directory structure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAC1C,+CAAwC;
|
|
1
|
+
{"version":3,"file":"class-file-generatorHelper.js","sourceRoot":"","sources":["../../../src/transpiler/markdown/class-file-generatorHelper.ts"],"names":[],"mappings":";;AACA,mEAA+D;AAC/D,6CAA0C;AAC1C,+CAAwC;AACxC,wCAAmD;AAEnD,MAAqB,wBAAwB;IACpC,MAAM,CAAC,iBAAiB,CAAC,UAAgB;QAC9C,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAgB;QACxC,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxD,OAAO,IAAI,UAAU,CAAC,IAAI,KAAK,aAAa,GAAG,UAAU,CAAC,IAAI,MAAM,CAAC;IACvE,CAAC;IAEM,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,MAAM,IAAI,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,EAAE;YACT,qFAAqF;YACrF,OAAO,IAAI,QAAQ,KAAK,QAAQ,GAAG,CAAC;SACrC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAEO,MAAM,CAAC,gBAAgB,CAAC,UAAgB;QAC9C,iEAAiE;QACjE,MAAM,SAAS,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC;QACzD,IAAI,+BAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,KAAK,eAAe,EAAE;YACjF,OAAO,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;SAClD;QAED,uDAAuD;QACvD,MAAM,kBAAkB,GAAG,eAAK,CAAC,WAAW,EAAE,CAAC,qBAAqB,EAAE,CAAC;QACvE,IAAI,kBAAkB,EAAE;YACtB,IAAI,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;gBAC7E,yEAAyE;gBACzE,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,uEAAuE;gBACvE,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;aACpD;SACF;aAAM;YACL,sGAAsG;YACtG,OAAO,KAAK,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC;SACnD;IACH,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,UAAgB;;QAC3C,MAAM,eAAe,GAAG,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAC7D,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAC1D,CAAC;QACF,OAAO,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,mCAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAAC;IAC/E,CAAC;CACF;AAjDD,2CAiDC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ProcessorTypeTranspiler from '../processor-type-transpiler';
|
|
2
|
+
import { FileContainer } from '../file-container';
|
|
3
|
+
import { Type } from '@cparra/apex-reflection';
|
|
4
|
+
import { OpenApi } from '../../model/openapi/open-api';
|
|
5
|
+
export declare class OpenApiDocsProcessor extends ProcessorTypeTranspiler {
|
|
6
|
+
protected readonly _fileContainer: FileContainer;
|
|
7
|
+
openApiModel: OpenApi;
|
|
8
|
+
constructor();
|
|
9
|
+
fileBuilder(): FileContainer;
|
|
10
|
+
onProcess(type: Type): void;
|
|
11
|
+
private getEndpointPath;
|
|
12
|
+
}
|