@cparra/apexdocs 2.8.2 → 2.9.0-alpha.1
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/openapi.json +474 -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/classes/SampleClass.cls +3 -0
- package/examples/force-app/main/default/restapi/SampleRestResource.cls +195 -0
- package/examples/force-app/main/default/restapi/SampleRestResourceWithInnerClass.cls +24 -0
- package/examples/force-app/main/default/restapi/references/Reference1.cls +9 -0
- package/examples/force-app/main/default/restapi/references/Reference2.cls +3 -0
- package/examples/force-app/main/default/restapi/references/Reference3.cls +3 -0
- package/examples/force-app/main/default/restapi/references/Reference4.cls +3 -0
- package/examples/force-app/main/default/restapi/references/Reference5.cls +3 -0
- package/examples/force-app/main/default/restapi/references/Reference6.cls +6 -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 +2 -2
- 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 +4 -4
- 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 +11 -3
- package/lib/model/types-repository.js +37 -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 +18 -0
- package/lib/test-helpers/ClassMirrorBuilder.js +54 -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/FieldMirrorBuilder.d.ts +16 -0
- package/lib/test-helpers/FieldMirrorBuilder.js +48 -0
- package/lib/test-helpers/FieldMirrorBuilder.js.map +1 -0
- package/lib/test-helpers/MethodMirrorBuilder.d.ts +10 -0
- package/lib/test-helpers/MethodMirrorBuilder.js +37 -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 +106 -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 +31 -0
- package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +161 -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/field-declaration-util.ts +5 -2
- package/src/model/markdown-generation-util/method-declaration-util.ts +5 -3
- 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 +48 -6
- 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 +56 -0
- package/src/test-helpers/DocCommentAnnotationBuilder.ts +18 -0
- package/src/test-helpers/DocCommentBuilder.ts +36 -0
- package/src/test-helpers/FieldMirrorBuilder.ts +52 -0
- package/src/test-helpers/MethodMirrorBuilder.ts +37 -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 +142 -0
- package/src/transpiler/openapi/parsers/ParameterObjectBuilder.ts +13 -0
- package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +205 -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 +68 -0
- package/src/transpiler/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +622 -0
- package/src/transpiler/openapi/parsers/__tests__/RequestBodyBuilder.spec.ts +64 -0
- package/src/transpiler/openapi/parsers/__tests__/ResponsesBuilder.spec.ts +55 -0
- package/src/transpiler/processor-type-transpiler.ts +3 -1
- package/tsconfig.json +4 -1
- package/lib/model/file.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type InfoObject = {
|
|
2
|
+
title: string;
|
|
3
|
+
version: string;
|
|
4
|
+
};
|
|
5
|
+
export type ServerObject = {
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
export type PathsObject = {
|
|
9
|
+
[index: string]: PathItemObject;
|
|
10
|
+
};
|
|
11
|
+
export type PathItemObject = {
|
|
12
|
+
description?: string;
|
|
13
|
+
get?: OperationObject;
|
|
14
|
+
put?: OperationObject;
|
|
15
|
+
post?: OperationObject;
|
|
16
|
+
delete?: OperationObject;
|
|
17
|
+
patch?: OperationObject;
|
|
18
|
+
};
|
|
19
|
+
export type OperationObject = {
|
|
20
|
+
description?: string;
|
|
21
|
+
requestBody?: RequestBody;
|
|
22
|
+
parameters?: ParameterObject[];
|
|
23
|
+
responses?: ResponsesObject;
|
|
24
|
+
};
|
|
25
|
+
export type ParameterObject = {
|
|
26
|
+
name: string;
|
|
27
|
+
in: 'query' | 'header' | 'path' | 'cookie';
|
|
28
|
+
description?: string;
|
|
29
|
+
required?: boolean;
|
|
30
|
+
schema?: SchemaObject;
|
|
31
|
+
};
|
|
32
|
+
export type RequestBody = {
|
|
33
|
+
description?: string;
|
|
34
|
+
content: RequestBodyContent;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type RequestBodyContent = {
|
|
38
|
+
[index: string]: MediaTypeObject;
|
|
39
|
+
};
|
|
40
|
+
export type MediaTypeObject = {
|
|
41
|
+
schema?: SchemaObject;
|
|
42
|
+
example?: any;
|
|
43
|
+
examples?: {
|
|
44
|
+
[index: string]: ExampleObject;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type ExampleObject = {
|
|
48
|
+
summary?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
value?: any;
|
|
51
|
+
};
|
|
52
|
+
export type ResponsesObject = {
|
|
53
|
+
[index: string]: ResponseObject;
|
|
54
|
+
};
|
|
55
|
+
export type ResponseObject = {
|
|
56
|
+
description: string;
|
|
57
|
+
content?: ContentObject;
|
|
58
|
+
};
|
|
59
|
+
export type ContentObject = {
|
|
60
|
+
[index: string]: {
|
|
61
|
+
schema: SchemaObject;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type SchemaObject = SchemaObjectObject | SchemaObjectArray | ReferenceObject;
|
|
65
|
+
export type SchemaObjectObject = {
|
|
66
|
+
type: string;
|
|
67
|
+
properties?: PropertiesObject;
|
|
68
|
+
format?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
};
|
|
71
|
+
export type PropertiesObject = {
|
|
72
|
+
[index: string]: SchemaObject;
|
|
73
|
+
};
|
|
74
|
+
export type SchemaObjectArray = {
|
|
75
|
+
type: 'array';
|
|
76
|
+
items: SchemaObject;
|
|
77
|
+
description?: string;
|
|
78
|
+
};
|
|
79
|
+
export type ReferenceObject = {
|
|
80
|
+
$ref: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
};
|
|
83
|
+
export type ComponentsObject = {
|
|
84
|
+
schemas: {
|
|
85
|
+
[index: string]: SchemaObject;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-api-types.js","sourceRoot":"","sources":["../../../src/model/openapi/open-api-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentsObject, InfoObject, PathsObject, ServerObject } from './open-api-types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the OpenApi 3.1.0 spec
|
|
4
|
+
* https://spec.openapis.org/oas/v3.1.0
|
|
5
|
+
*/
|
|
6
|
+
export declare class OpenApi {
|
|
7
|
+
namespace?: string | undefined;
|
|
8
|
+
openapi: string;
|
|
9
|
+
info: InfoObject;
|
|
10
|
+
paths: PathsObject;
|
|
11
|
+
servers: ServerObject[];
|
|
12
|
+
components?: ComponentsObject;
|
|
13
|
+
constructor(title: string, version: string, namespace?: string | undefined);
|
|
14
|
+
private getServerUrl;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenApi = void 0;
|
|
4
|
+
const OPEN_API_VERSION = '3.1.0';
|
|
5
|
+
const SERVER_URL = '/services/apexrest/';
|
|
6
|
+
/**
|
|
7
|
+
* Represents the OpenApi 3.1.0 spec
|
|
8
|
+
* https://spec.openapis.org/oas/v3.1.0
|
|
9
|
+
*/
|
|
10
|
+
class OpenApi {
|
|
11
|
+
constructor(title, version, namespace) {
|
|
12
|
+
this.namespace = namespace;
|
|
13
|
+
this.openapi = OPEN_API_VERSION;
|
|
14
|
+
this.info = {
|
|
15
|
+
title: title,
|
|
16
|
+
version: version,
|
|
17
|
+
};
|
|
18
|
+
this.servers = [
|
|
19
|
+
{
|
|
20
|
+
url: this.getServerUrl(),
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
this.paths = {};
|
|
24
|
+
}
|
|
25
|
+
getServerUrl() {
|
|
26
|
+
if (!this.namespace) {
|
|
27
|
+
return SERVER_URL;
|
|
28
|
+
}
|
|
29
|
+
return `${SERVER_URL}${this.namespace}/`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.OpenApi = OpenApi;
|
|
33
|
+
//# sourceMappingURL=open-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-api.js","sourceRoot":"","sources":["../../../src/model/openapi/open-api.ts"],"names":[],"mappings":";;;AAEA,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAEzC;;;GAGG;AACH,MAAa,OAAO;IAOlB,YAAY,KAAa,EAAE,OAAe,EAAS,SAAkB;QAAlB,cAAS,GAAT,SAAS,CAAS;QANrE,YAAO,GAAG,gBAAgB,CAAC;QAOzB,IAAI,CAAC,IAAI,GAAG;YACV,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,OAAO;SACjB,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG;YACb;gBACE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE;aACzB;SACF,CAAC;QAEF,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,OAAO,UAAU,CAAC;SACnB;QAED,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC,SAAS,GAAG,CAAC;IAC3C,CAAC;CACF;AA7BD,0BA6BC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenapiTypeFile = void 0;
|
|
4
|
+
const outputFile_1 = require("../outputFile");
|
|
5
|
+
class OpenapiTypeFile extends outputFile_1.OutputFile {
|
|
6
|
+
constructor(openApiModel) {
|
|
7
|
+
super('openapi', '');
|
|
8
|
+
this.openApiModel = openApiModel;
|
|
9
|
+
this.addText(JSON.stringify(openApiModel, null, 2));
|
|
10
|
+
}
|
|
11
|
+
fileExtension() {
|
|
12
|
+
return '.json';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.OpenapiTypeFile = OpenapiTypeFile;
|
|
16
|
+
//# sourceMappingURL=openapi-type-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi-type-file.js","sourceRoot":"","sources":["../../../src/model/openapi/openapi-type-file.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAG3C,MAAa,eAAgB,SAAQ,uBAAU;IAC7C,YAAmB,YAAqB;QACtC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QADJ,iBAAY,GAAZ,YAAY,CAAS;QAEtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,aAAa;QACX,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AATD,0CASC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OutputFile = void 0;
|
|
4
4
|
const xss = require("xss");
|
|
5
5
|
const settings_1 = require("../settings");
|
|
6
6
|
const xssFilter = new xss.FilterXSS({
|
|
7
7
|
whiteList: { br: [], p: [], ul: [], li: [], code: [], pre: [] },
|
|
8
8
|
});
|
|
9
|
-
class
|
|
9
|
+
class OutputFile {
|
|
10
10
|
constructor(fileName, dir) {
|
|
11
11
|
this.fileName = fileName;
|
|
12
12
|
this.dir = dir;
|
|
@@ -25,5 +25,5 @@ class File {
|
|
|
25
25
|
this._contents += '\n';
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
exports.
|
|
29
|
-
//# sourceMappingURL=
|
|
28
|
+
exports.OutputFile = OutputFile;
|
|
29
|
+
//# sourceMappingURL=outputFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputFile.js","sourceRoot":"","sources":["../../src/model/outputFile.ts"],"names":[],"mappings":";;;AAAA,2BAA4B;AAC5B,0CAAuC;AAEvC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC;IAClC,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CAChE,CAAC,CAAC;AAEH,MAAsB,UAAU;IAG9B,YAAmB,QAAgB,EAAS,GAAW;QAApC,aAAQ,GAAR,QAAQ,CAAQ;QAAS,QAAG,GAAH,GAAG,CAAQ;QAFvD,cAAS,GAAG,EAAE,CAAC;IAE2C,CAAC;IAI3D,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,IAAY,EAAE,UAAU,GAAG,IAAI;QACrC,MAAM,YAAY,GAAG,UAAU,IAAI,mBAAQ,CAAC,WAAW,EAAE,CAAC,YAAY,CAAC;QACvE,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzB,CAAC;CACF;AArBD,gCAqBC"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { Type } from '@cparra/apex-reflection';
|
|
2
|
+
export type TypeBundle = {
|
|
3
|
+
type: Type;
|
|
4
|
+
isChild: boolean;
|
|
5
|
+
parentType?: Type;
|
|
6
|
+
};
|
|
2
7
|
export declare class TypesRepository {
|
|
3
8
|
private static instance;
|
|
4
|
-
private
|
|
9
|
+
private scopedTypes;
|
|
10
|
+
private allTypes;
|
|
5
11
|
static getInstance(): TypesRepository;
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
populateAll(types: Type[]): void;
|
|
13
|
+
getFromAllByName(typeName: string): TypeBundle | undefined;
|
|
14
|
+
populateScoped(types: Type[]): void;
|
|
15
|
+
getFromScopedByName(typeName: string): Type | undefined;
|
|
8
16
|
}
|
|
@@ -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,42 @@ 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
|
-
|
|
18
|
+
getFromAllByName(typeName) {
|
|
19
|
+
if (typeName.includes('.')) {
|
|
20
|
+
// If it includes a dot we are assuming we are dealing with an inner class.
|
|
21
|
+
const [parentTypeName, childTypeName] = typeName.split('.');
|
|
22
|
+
const parentReference = this.allTypes.find((currentType) => currentType.name.toLowerCase() === parentTypeName.toLowerCase());
|
|
23
|
+
if (!parentReference || parentReference.type_name !== 'class') {
|
|
24
|
+
// If the parent is not found, no reason to keep searching, instead we return undefined.
|
|
25
|
+
// Similarly, if the parent is not a class, it means it cannot have children, so we return early.
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const parentReferenceAsClass = parentReference;
|
|
29
|
+
const childTypes = [
|
|
30
|
+
...parentReferenceAsClass.classes,
|
|
31
|
+
...parentReferenceAsClass.interfaces,
|
|
32
|
+
...parentReferenceAsClass.enums,
|
|
33
|
+
];
|
|
34
|
+
const foundType = childTypes.find((currentType) => currentType.name.toLowerCase() === childTypeName);
|
|
35
|
+
if (!foundType) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
return { type: foundType, isChild: true, parentType: parentReference };
|
|
39
|
+
}
|
|
40
|
+
const foundType = this.allTypes.find((currentType) => currentType.name.toLowerCase() === typeName.toLowerCase());
|
|
41
|
+
if (!foundType) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return { type: foundType, isChild: false };
|
|
45
|
+
}
|
|
46
|
+
populateScoped(types) {
|
|
47
|
+
this.scopedTypes = types;
|
|
48
|
+
}
|
|
49
|
+
getFromScopedByName(typeName) {
|
|
50
|
+
return this.scopedTypes.find((currentType) => currentType.name === typeName);
|
|
19
51
|
}
|
|
20
52
|
}
|
|
21
53
|
exports.TypesRepository = TypesRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-repository.js","sourceRoot":"","sources":["../../src/model/types-repository.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types-repository.js","sourceRoot":"","sources":["../../src/model/types-repository.ts"],"names":[],"mappings":";;;AAIA,MAAa,eAAe;IAA5B;QAEU,gBAAW,GAAW,EAAE,CAAC;QACzB,aAAQ,GAAW,EAAE,CAAC;IAuDhC,CAAC;IArDQ,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;YAC7B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;SAClD;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAEM,WAAW,CAAC,KAAa;QAC9B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAEM,gBAAgB,CAAC,QAAgB;QACtC,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC1B,2EAA2E;YAC3E,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC5D,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CACxC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC,WAAW,EAAE,CACvF,CAAC;YACF,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,SAAS,KAAK,OAAO,EAAE;gBAC7D,wFAAwF;gBACxF,iGAAiG;gBACjG,OAAO,SAAS,CAAC;aAClB;YAED,MAAM,sBAAsB,GAAG,eAA8B,CAAC;YAC9D,MAAM,UAAU,GAAG;gBACjB,GAAG,sBAAsB,CAAC,OAAO;gBACjC,GAAG,sBAAsB,CAAC,UAAU;gBACpC,GAAG,sBAAsB,CAAC,KAAK;aAChC,CAAC;YACF,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC,CAAC;YAC3G,IAAI,CAAC,SAAS,EAAE;gBACd,OAAO,SAAS,CAAC;aAClB;YACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;SACxE;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAClC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC,WAAW,EAAE,CACjF,CAAC;QACF,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC;IAEM,cAAc,CAAC,KAAa;QACjC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAEM,mBAAmB,CAAC,QAAgB;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,WAAiB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IACrF,CAAC;CACF;AA1DD,0CA0DC"}
|
|
@@ -1,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,18 @@
|
|
|
1
|
+
import { Annotation, ClassMirror, DocComment, FieldMirror, 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 name;
|
|
8
|
+
private annotations;
|
|
9
|
+
private docComment?;
|
|
10
|
+
private methods;
|
|
11
|
+
private fields;
|
|
12
|
+
withName(name: string): ClassMirrorBuilder;
|
|
13
|
+
addAnnotation(annotation: Annotation): ClassMirrorBuilder;
|
|
14
|
+
withDocComment(docComment: DocComment): ClassMirrorBuilder;
|
|
15
|
+
addMethod(method: MethodMirror): ClassMirrorBuilder;
|
|
16
|
+
addFiled(field: FieldMirror): ClassMirrorBuilder;
|
|
17
|
+
build(): ClassMirror;
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.name = 'SampleClass';
|
|
11
|
+
this.annotations = [];
|
|
12
|
+
this.methods = [];
|
|
13
|
+
this.fields = [];
|
|
14
|
+
}
|
|
15
|
+
withName(name) {
|
|
16
|
+
this.name = name;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
addAnnotation(annotation) {
|
|
20
|
+
this.annotations.push(annotation);
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
withDocComment(docComment) {
|
|
24
|
+
this.docComment = docComment;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
addMethod(method) {
|
|
28
|
+
this.methods.push(method);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
addFiled(field) {
|
|
32
|
+
this.fields.push(field);
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
return {
|
|
37
|
+
annotations: this.annotations,
|
|
38
|
+
name: this.name,
|
|
39
|
+
type_name: 'class',
|
|
40
|
+
methods: this.methods,
|
|
41
|
+
implemented_interfaces: [],
|
|
42
|
+
properties: [],
|
|
43
|
+
fields: this.fields,
|
|
44
|
+
constructors: [],
|
|
45
|
+
enums: [],
|
|
46
|
+
interfaces: [],
|
|
47
|
+
classes: [],
|
|
48
|
+
access_modifier: 'public',
|
|
49
|
+
docComment: this.docComment,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.ClassMirrorBuilder = ClassMirrorBuilder;
|
|
54
|
+
//# 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,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAiB,EAAE,CAAC;QAE/B,YAAO,GAAmB,EAAE,CAAC;QAC7B,WAAM,GAAkB,EAAE,CAAC;IA4CrC,CAAC;IA1CC,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,SAAS,CAAC,MAAoB;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,KAAkB;QACzB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,sBAAsB,EAAE,EAAE;YAC1B,UAAU,EAAE,EAAE;YACd,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,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;AAjDD,gDAiDC"}
|
|
@@ -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"}
|