@cparra/apexdocs 2.10.0 → 2.12.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.
Files changed (26) hide show
  1. package/docs/Main/nspc.SampleClass.md +192 -189
  2. package/docs/Misc-Group/nspc.MemberGrouping.md +13 -0
  3. package/docs/Misc-Group/nspc.SampleRestResource.md +106 -109
  4. package/docs/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md +14 -0
  5. package/docs/README.md +81 -72
  6. package/docs/restapi.json +67 -2
  7. package/examples/force-app/main/default/classes/MemberGrouping.cls +16 -0
  8. package/examples/force-app/main/default/classes/SampleClass.cls +3 -0
  9. package/examples/force-app/main/default/restapi/SampleRestResourceWithoutApexDocs.cls +15 -0
  10. package/lib/model/markdown-generation-util/field-declaration-util.js +6 -1
  11. package/lib/model/markdown-generation-util/field-declaration-util.js.map +1 -1
  12. package/lib/model/markdown-type-file.js +8 -3
  13. package/lib/model/markdown-type-file.js.map +1 -1
  14. package/lib/transpiler/openapi/open-api-docs-processor.js +1 -1
  15. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  16. package/lib/transpiler/openapi/parsers/MethodParser.d.ts +3 -0
  17. package/lib/transpiler/openapi/parsers/MethodParser.js +80 -19
  18. package/lib/transpiler/openapi/parsers/MethodParser.js.map +1 -1
  19. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +8 -2
  20. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/model/markdown-generation-util/field-declaration-util.ts +8 -3
  23. package/src/model/markdown-type-file.ts +11 -5
  24. package/src/transpiler/openapi/open-api-docs-processor.ts +1 -1
  25. package/src/transpiler/openapi/parsers/MethodParser.ts +134 -30
  26. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi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,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC;iBAChE;gBACD,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,iCAAM,cAAc,KAAE,YAAY,EAAE,KAAK,IAAG,CAAC;gBAC1F,OAAO;oBACL,MAAM,EAAE,SAAS,CAAC,yBAAyB;oBAC3C,mBAAmB,EAAE,CAAC,GAAG,SAAS,CAAC,mBAAmB,CAAC;iBACxD,CAAC;SACL;IACH,CAAC;IAEO,mBAAmB,CAAC,YAA4B;QACtD,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAE,YAA+B,CAAC,MAAM,CAAC,CAAC;QACtF,OAAO;YACL,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE;YACvD,mBAAmB,EAAE,CAAC,GAAG,cAAc,CAAC,mBAAmB,CAAC;SAC7D,CAAC;IACJ,CAAC;CAKF;AA3MD,4CA2MC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.10.0",
3
+ "version": "2.12.0-alpha.0",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -66,7 +66,7 @@
66
66
  ]
67
67
  },
68
68
  "dependencies": {
69
- "@cparra/apex-reflection": "2.0.2",
69
+ "@cparra/apex-reflection": "2.2.0",
70
70
  "chalk": "^4.1.2",
71
71
  "fast-xml-parser": "^4.0.1",
72
72
  "js-yaml": "^4.1.0",
@@ -64,9 +64,14 @@ function addFieldSection(
64
64
  if (mirrorModel.docComment?.description) {
65
65
  description = ` - ${mirrorModel.docComment?.description}`;
66
66
  }
67
- markdownFile.addListItem(
68
- `\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\` (*Inherited*) ${annotations} ${description}`,
69
- );
67
+
68
+ let listItemText = `\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\``;
69
+ if (mirrorModel.inherited) {
70
+ listItemText += '(*Inherited*)';
71
+ }
72
+ listItemText += `${annotations} ${description}`;
73
+
74
+ markdownFile.addListItem(listItemText);
70
75
  markdownFile.addBlankLine();
71
76
  }
72
77
  }
@@ -16,6 +16,7 @@ import { Settings } from '../settings';
16
16
 
17
17
  interface GroupAware {
18
18
  group?: string;
19
+ groupDescription?: string;
19
20
  }
20
21
 
21
22
  interface GroupMap {
@@ -109,8 +110,9 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
109
110
  } else {
110
111
  const groupedConstructors = this.group(methods);
111
112
  for (const key in groupedConstructors) {
112
- this.startGroup(key);
113
- const constructorsForGroup = groupedConstructors[key] as ConstructorMirror[];
113
+ // For the group description, we can take the first one, since they all have the same description.
114
+ this.startGroup(key, groupedConstructors[key][0].groupDescription);
115
+ const constructorsForGroup = groupedConstructors[key] as (ConstructorMirror | MethodMirrorWithInheritance)[];
114
116
  declareMethod(this, constructorsForGroup, this.headingLevel, className);
115
117
  this.endGroup();
116
118
  }
@@ -126,17 +128,21 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
126
128
  } else {
127
129
  const groupedFields = this.group(fieldsOrProperties);
128
130
  for (const key in groupedFields) {
129
- this.startGroup(key);
130
- const fieldsForGroup = groupedFields[key] as FieldMirrorWithInheritance[];
131
+ // For the group description, we can take the first one, since they all have the same description.
132
+ this.startGroup(key, groupedFields[key][0].groupDescription);
133
+ const fieldsForGroup = groupedFields[key] as (FieldMirrorWithInheritance | PropertyMirrorWithInheritance)[];
131
134
  declareField(this, fieldsForGroup, this.headingLevel, true);
132
135
  this.endGroup();
133
136
  }
134
137
  }
135
138
  }
136
139
 
137
- private startGroup(groupName: string) {
140
+ private startGroup(groupName: string, groupDescription?: string) {
138
141
  this.headingLevel = this.headingLevel + 2;
139
142
  this.addTitle(groupName, this.headingLevel);
143
+ if (groupDescription) {
144
+ this.addText(groupDescription);
145
+ }
140
146
  }
141
147
 
142
148
  private endGroup() {
@@ -73,6 +73,6 @@ export class OpenApiDocsProcessor extends ProcessorTypeTranspiler {
73
73
  return null;
74
74
  }
75
75
 
76
- return urlMapping.value.replaceAll('"', '').replaceAll("'", '');
76
+ return urlMapping.value.replaceAll('"', '').replaceAll("'", '').replaceAll('/*', '/');
77
77
  }
78
78
  }
@@ -2,7 +2,7 @@ import { ClassMirror, MethodMirror } from '@cparra/apex-reflection';
2
2
  import { OpenApi } from '../../../model/openapi/open-api';
3
3
  import * as yaml from 'js-yaml';
4
4
  import { ClassMirrorWrapper } from '../../../model/apex-type-wrappers/ClassMirrorWrapper';
5
- import { Reference } from './ReferenceBuilder';
5
+ import { Reference, ReferenceBuilder } from './ReferenceBuilder';
6
6
  import { ParameterObjectBuilder } from './ParameterObjectBuilder';
7
7
  import { ResponsesBuilder } from './ResponsesBuilder';
8
8
  import {
@@ -11,8 +11,11 @@ import {
11
11
  ApexDocParameterObject,
12
12
  } from '../../../model/openapi/apex-doc-types';
13
13
  import { RequestBodyBuilder } from './RequestBodyBuilder';
14
+ import { ApexDocSchemaAware } from './Builder';
15
+ import { PropertiesObject, ReferenceObject } from '../../../model/openapi/open-api-types';
14
16
 
15
- type AddToOpenApi = (inYaml: string, urlValue: string) => void;
17
+ type FallbackMethodParser = (methodMirror: MethodMirror) => void;
18
+ type AddToOpenApi<T extends ApexDocSchemaAware> = (input: T, urlValue: string, httpMethodKey: HttpOperations) => void;
16
19
 
17
20
  type HttpOperations = 'get' | 'put' | 'post' | 'delete' | 'patch';
18
21
 
@@ -39,28 +42,47 @@ export class MethodParser {
39
42
  this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.description = httpMethod.docComment.description;
40
43
  }
41
44
 
42
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-request-body', (inYaml, urlValue) =>
43
- this.addRequestBodyToOpenApi(inYaml, urlValue, httpMethodKey),
45
+ this.parseHttpAnnotation<ApexDocHttpRequestBody>(
46
+ httpMethod,
47
+ httpUrlEndpoint,
48
+ httpMethodKey,
49
+ 'http-request-body',
50
+ this.addRequestBodyToOpenApi.bind(this),
51
+ this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey),
44
52
  );
45
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-parameter', (inYaml, urlValue) =>
46
- this.addParametersToOpenApi(inYaml, urlValue, httpMethodKey),
53
+
54
+ this.parseHttpAnnotation<ApexDocParameterObject>(
55
+ httpMethod,
56
+ httpUrlEndpoint,
57
+ httpMethodKey,
58
+ 'http-parameter',
59
+ this.addParametersToOpenApi.bind(this),
47
60
  );
48
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-response', (inYaml, urlValue) =>
49
- this.addHttpResponsesToOpenApi(inYaml, urlValue, httpMethodKey),
61
+
62
+ this.parseHttpAnnotation<ApexDocHttpResponse>(
63
+ httpMethod,
64
+ httpUrlEndpoint,
65
+ httpMethodKey,
66
+ 'http-response',
67
+ this.addHttpResponsesToOpenApi.bind(this),
68
+ this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey),
50
69
  );
51
70
  }
52
71
 
53
- private parseHttpAnnotation(
54
- httpGetMethod: MethodMirror,
72
+ private parseHttpAnnotation<T extends ApexDocSchemaAware>(
73
+ httpMethod: MethodMirror,
55
74
  urlValue: string,
75
+ httpMethodKey: HttpOperations,
56
76
  annotationName: string,
57
- addToOpenApi: AddToOpenApi,
77
+ addToOpenApi: AddToOpenApi<T>,
78
+ fallbackParser?: FallbackMethodParser,
58
79
  ) {
59
- const annotations = httpGetMethod.docComment?.annotations.filter(
60
- (annotation) => annotation.name === annotationName,
61
- );
80
+ const annotations = httpMethod.docComment?.annotations.filter((annotation) => annotation.name === annotationName);
62
81
 
63
82
  if (!annotations?.length) {
83
+ if (fallbackParser) {
84
+ fallbackParser(httpMethod);
85
+ }
64
86
  return;
65
87
  }
66
88
 
@@ -72,46 +94,128 @@ export class MethodParser {
72
94
  return;
73
95
  }
74
96
 
75
- addToOpenApi(inYaml, urlValue);
97
+ this.addToOpenApiStrategy<T>(inYaml, urlValue, httpMethodKey, addToOpenApi);
76
98
  }
77
99
  }
78
100
 
79
- private addRequestBodyToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
101
+ private addToOpenApiStrategy<T extends ApexDocSchemaAware>(
102
+ inYaml: string,
103
+ urlValue: string,
104
+ httpMethodKey: HttpOperations,
105
+ addToOpenApi: AddToOpenApi<T>,
106
+ ): void {
80
107
  // Convert the YAML into a JSON object.
81
- const inJson = yaml.load(inYaml) as ApexDocHttpRequestBody;
108
+ const inJson = yaml.load(inYaml) as T;
82
109
  const requestBodyResponse = new RequestBodyBuilder().build(inJson);
83
110
 
84
- this.openApiModel.paths[urlValue][httpMethodKey]!.requestBody = requestBodyResponse.body;
111
+ addToOpenApi(inJson, urlValue, httpMethodKey);
85
112
 
86
113
  this.addReference(requestBodyResponse);
87
114
  }
88
115
 
89
- private addParametersToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
90
- // Convert the YAML into a JSON object.
91
- const inJson = yaml.load(inYaml) as ApexDocParameterObject;
92
- const parameterObjectResponse = new ParameterObjectBuilder().build(inJson);
116
+ private addRequestBodyToOpenApi(
117
+ input: ApexDocHttpRequestBody,
118
+ urlValue: string,
119
+ httpMethodKey: HttpOperations,
120
+ ): void {
121
+ const requestBodyResponse = new RequestBodyBuilder().build(input);
122
+ this.openApiModel.paths[urlValue][httpMethodKey]!.requestBody = requestBodyResponse.body;
123
+ }
124
+
125
+ private addParametersToOpenApi(input: ApexDocParameterObject, urlValue: string, httpMethodKey: HttpOperations): void {
126
+ const parameterObjectResponse = new ParameterObjectBuilder().build(input);
93
127
 
94
128
  if (this.openApiModel.paths[urlValue][httpMethodKey]!.parameters === undefined) {
95
129
  // If no parameters have been defined yet, initialize the list.
96
130
  this.openApiModel.paths[urlValue][httpMethodKey]!.parameters = [];
97
131
  }
98
132
  this.openApiModel.paths[urlValue][httpMethodKey]!.parameters!.push(parameterObjectResponse.body);
99
-
100
- this.addReference(parameterObjectResponse);
101
133
  }
102
134
 
103
- private addHttpResponsesToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
104
- // Convert the YAML into a JSON object.
105
- const inJson = yaml.load(inYaml) as ApexDocHttpResponse;
106
- const responseObjectResponse = new ResponsesBuilder().build(inJson);
135
+ private addHttpResponsesToOpenApi(input: ApexDocHttpResponse, urlValue: string, httpMethodKey: HttpOperations): void {
136
+ const responseObjectResponse = new ResponsesBuilder().build(input);
107
137
 
108
138
  if (this.openApiModel.paths[urlValue][httpMethodKey]!.responses === undefined) {
109
139
  this.openApiModel.paths[urlValue][httpMethodKey]!.responses = {};
110
140
  }
111
141
 
112
- this.openApiModel.paths[urlValue][httpMethodKey]!.responses![inJson.statusCode] = responseObjectResponse.body;
142
+ this.openApiModel.paths[urlValue][httpMethodKey]!.responses![input.statusCode] = responseObjectResponse.body;
143
+ }
144
+
145
+ private fallbackHttpRequestBodyParser(
146
+ httpUrlEndpoint: string,
147
+ httpMethodKey: 'get' | 'put' | 'post' | 'delete' | 'patch',
148
+ ) {
149
+ return (methodMirror: MethodMirror) => {
150
+ // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
151
+ // object, with each key of the object being the parameter name.
152
+ const parameters = methodMirror.parameters;
153
+
154
+ if (!parameters.length) {
155
+ return;
156
+ }
157
+
158
+ const propertiesObject: PropertiesObject = {};
159
+ parameters.forEach((currentParameter) => {
160
+ const propertyKey = currentParameter.name;
161
+ const propertyReference = new ReferenceBuilder().getReferenceType(currentParameter.typeReference);
162
+
163
+ propertiesObject[propertyKey] = propertyReference.schema;
164
+
165
+ this.addReference({
166
+ reference: {
167
+ entrypointReferenceObject: propertyReference.schema as ReferenceObject,
168
+ referenceComponents: propertyReference.referenceComponents,
169
+ },
170
+ });
171
+ });
172
+
173
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.requestBody = {
174
+ content: {
175
+ 'application/json': {
176
+ schema: {
177
+ type: 'object',
178
+ properties: propertiesObject,
179
+ },
180
+ },
181
+ },
182
+ };
183
+ };
184
+ }
185
+
186
+ private getFallbackHttpResponseParser(
187
+ httpUrlEndpoint: string,
188
+ httpMethodKey: 'get' | 'put' | 'post' | 'delete' | 'patch',
189
+ ) {
190
+ return (methodMirror: MethodMirror) => {
191
+ // Parses methods that return an object (as opposed to void).
192
+ const returnType = methodMirror.typeReference;
193
+
194
+ if (returnType.type.toLowerCase() === 'void') {
195
+ return;
196
+ }
197
+
198
+ const reference = new ReferenceBuilder().getReferenceType(returnType);
199
+
200
+ this.addReference({
201
+ reference: {
202
+ entrypointReferenceObject: reference.schema as ReferenceObject,
203
+ referenceComponents: reference.referenceComponents,
204
+ },
205
+ });
206
+
207
+ if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses === undefined) {
208
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses = {};
209
+ }
113
210
 
114
- this.addReference(responseObjectResponse);
211
+ // Successful responses with a non-void return type always return a status code of 2000
212
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses!['200'] = {
213
+ description: methodMirror.docComment?.description ?? 'Status code 200',
214
+ content: {
215
+ 'application/json': { schema: reference.schema },
216
+ },
217
+ };
218
+ };
115
219
  }
116
220
 
117
221
  private addReference(referenceHolder: { reference?: Reference }): void {
@@ -159,7 +159,7 @@ export class ReferenceBuilder {
159
159
  ];
160
160
  }
161
161
 
162
- private getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair {
162
+ public getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair {
163
163
  // Returns a valid type supported by OpenApi from a received Apex type.
164
164
  const typeName = typeInMirror.type.toLowerCase();
165
165
  switch (typeName) {