@cparra/apexdocs 2.13.0-alpha.4 → 2.13.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.
Files changed (30) hide show
  1. package/README.md +22 -2
  2. package/docs/Misc-Group/nspc.Reference7.md +7 -0
  3. package/docs/Misc-Group/nspc.SampleRestResource.md +6 -0
  4. package/docs/README.md +3 -0
  5. package/docs/restapi.json +589 -571
  6. package/examples/force-app/main/default/classes/AnotherInterface.cls +1 -1
  7. package/examples/force-app/main/default/restapi/SampleRestResource.cls +4 -1
  8. package/examples/force-app/main/default/restapi/SampleRestResourceToSkip.cls +35 -0
  9. package/examples/force-app/main/default/restapi/references/Reference7.cls +3 -0
  10. package/lib/cli/generate.js +7 -1
  11. package/lib/cli/generate.js.map +1 -1
  12. package/lib/model/manifest.d.ts +4 -4
  13. package/lib/model/manifest.js +7 -2
  14. package/lib/model/manifest.js.map +1 -1
  15. package/lib/model/markdown-home-file.js +1 -1
  16. package/lib/model/markdown-home-file.js.map +1 -1
  17. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +48 -13
  18. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  19. package/lib/util/string-utils.d.ts +1 -1
  20. package/lib/util/string-utils.js +3 -3
  21. package/lib/util/string-utils.js.map +1 -1
  22. package/package.json +2 -2
  23. package/src/cli/generate.ts +6 -1
  24. package/src/model/apex-type-wrappers/MethodMirrorWrapper.ts +1 -1
  25. package/src/model/manifest.ts +18 -4
  26. package/src/model/markdown-home-file.ts +2 -2
  27. package/src/transpiler/openapi/__tests__/open-api-docs-processor.spec.ts +2 -2
  28. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +76 -19
  29. package/src/transpiler/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +45 -1
  30. package/src/util/string-utils.ts +1 -1
@@ -1 +1 @@
1
- public interface AnotherInterface{}
1
+ public interface AnotherInterface{}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @description Account related operations
3
3
  */
4
- @RestResource(urlMapping='/AccountService/*')
4
+ @RestResource(UrlMapping='/AccountService/*')
5
5
  global with sharing class SampleRestResource {
6
6
  /**
7
7
  * @description Sample HTTP Delete method with references to other types.
@@ -26,6 +26,9 @@ global with sharing class SampleRestResource {
26
26
  * @http-response
27
27
  * statusCode: 306
28
28
  * schema: List<Reference1>
29
+ * @http-response
30
+ * statusCode: 307
31
+ * schema: Reference7[untypedObject:Reference2]
29
32
  */
30
33
  @HttpDelete
31
34
  global static void doDelete() {
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @description This rest resource should be skipped
3
+ * @ignore
4
+ */
5
+ @RestResource(UrlMapping='/ResourceToSkip/*')
6
+ global with sharing class SampleRestResourceToSkip {
7
+ @HttpDelete
8
+ global static void doDelete() {
9
+ RestRequest req = RestContext.request;
10
+ RestResponse res = RestContext.response;
11
+ String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1);
12
+ Account account = [SELECT Id FROM Account WHERE Id = :accountId];
13
+ delete account;
14
+ }
15
+
16
+ @HttpGet
17
+ global static Account doGet() {
18
+ RestRequest req = RestContext.request;
19
+ RestResponse res = RestContext.response;
20
+ String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1);
21
+ Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
22
+ return result;
23
+ }
24
+
25
+ @HttpPost
26
+ global static String doPost(String name,
27
+ String phone, String website) {
28
+ Account account = new Account();
29
+ account.Name = name;
30
+ account.phone = phone;
31
+ account.website = website;
32
+ insert account;
33
+ return account.Id;
34
+ }
35
+ }
@@ -0,0 +1,3 @@
1
+ public class Reference7 {
2
+ public Object untypedObject;
3
+ }
@@ -86,5 +86,11 @@ settings_1.Settings.build({
86
86
  namespace: argv.namespace,
87
87
  openApiFileName: argv.openApiFileName,
88
88
  });
89
- Apexdocs_1.Apexdocs.generate();
89
+ try {
90
+ Apexdocs_1.Apexdocs.generate();
91
+ }
92
+ catch (error) {
93
+ console.error(error);
94
+ process.exit(1);
95
+ }
90
96
  //# sourceMappingURL=generate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAE/B,0CAAuC;AACvC,sDAAmD;AAGnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,+DAA+D;KAC1E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,kEAAkE;KAC7E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,kFAAkF;KAC7F;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,QAAQ,EACN,sHAAsH;YACtH,4HAA4H;YAC5H,0IAA0I;KAC7I;IACD,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,SAAS,CAAC;QAC3D,QAAQ,EACN,4EAA4E;YAC5E,yEAAyE;KAC5E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,0DAA0D;KACrE;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,qEAAqE;KAChF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,SAAS;QACf,OAAO,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Q,CAAC,KAAK,CAAC;IACb,eAAe,EAAE,IAAI,CAAC,SAAS;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAmC;IACzD,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;IACvC,YAAY,EAAE,IAAI,CAAC,YAAY;IAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;IAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;IACzB,eAAe,EAAE,IAAI,CAAC,eAAe;CACtC,CAAC,CAAC;AAEH,IAAI;IACF,mBAAQ,CAAC,QAAQ,EAAE,CAAC;CACrB;AAAC,OAAO,KAAK,EAAE;IACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB"}
@@ -1,8 +1,8 @@
1
- import { Type, Annotation } from '@cparra/apex-reflection';
2
- type AccessAware = {
1
+ import { Type, Annotation, DocComment } from '@cparra/apex-reflection';
2
+ type AccessAndDocAware = {
3
3
  access_modifier: string;
4
- } & {
5
4
  annotations: Annotation[];
5
+ docComment?: DocComment;
6
6
  };
7
7
  /**
8
8
  * Represents the full library of Apex top-level types (classes, enums, and interface) for a Salesforce project.
@@ -17,6 +17,6 @@ export default class Manifest {
17
17
  */
18
18
  constructor(types: Type[], isForInnerTypes?: boolean);
19
19
  filteredByAccessModifierAndAnnotations(modifiers: string[]): Type[];
20
- filterAccessibleModifier(accessAware: AccessAware[], modifiers: string[]): AccessAware[];
20
+ filterAccessibleModifier(accessAndDocAwares: AccessAndDocAware[], modifiers: string[]): AccessAndDocAware[];
21
21
  }
22
22
  export {};
@@ -31,8 +31,13 @@ class Manifest {
31
31
  }
32
32
  return typesToReturn;
33
33
  }
34
- filterAccessibleModifier(accessAware, modifiers) {
35
- return accessAware.filter((currentType) => {
34
+ filterAccessibleModifier(accessAndDocAwares, modifiers) {
35
+ return accessAndDocAwares.filter((currentType) => {
36
+ var _a;
37
+ const hasIgnoreDocAnnotation = (_a = currentType.docComment) === null || _a === void 0 ? void 0 : _a.annotations.some((annotation) => annotation.name === 'ignore');
38
+ if (hasIgnoreDocAnnotation) {
39
+ return false;
40
+ }
36
41
  return (modifiers.includes(currentType.access_modifier) ||
37
42
  currentType.annotations.some((annotation) => modifiers.includes(annotation.type.toLowerCase())));
38
43
  });
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/model/manifest.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH,MAAqB,QAAQ;IAC3B;;;;OAIG;IACH,YAAmB,KAAa,EAAS,kBAA2B,KAAK;QAAtD,UAAK,GAAL,KAAK,CAAQ;QAAS,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAE7E,sCAAsC,CAAC,SAAmB;QACxD,MAAM,aAAa,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC3E,MAAM,aAAa,GAAW,EAAE,CAAC;QACjC,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;YACxC,MAAM,WAAW,GAAG,YAAoB,CAAC;YACzC,IAAI,WAAW,CAAC,SAAS,KAAK,OAAO,EAAE;gBACrC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAChC,SAAS;aACV;YAED,MAAM,YAAY,GAAG,WAA0B,CAAC;YAChD,IAAI,aAAa,mCACZ,WAAW,KACd,OAAO,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,EACvE,UAAU,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC,EAC7E,MAAM,EAAE,IAAI,CAAC,wBAAwB,CAAC,YAAY,CAAC,MAAM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E,EAAE;;YAC/C,MAAM,sBAAsB,GAAG,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CACrE,CAAC,UAAgC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,QAAQ,CACnE,CAAC;YACF,IAAI,sBAAsB,EAAE;gBAC1B,OAAO,KAAK,CAAC;aACd;YACD,OAAO,CACL,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,eAAe,CAAC;gBAC/C,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAC5G,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1DD,2BA0DC"}
@@ -32,7 +32,7 @@ class MarkdownHomeFile extends markdown_file_1.MarkdownFile {
32
32
  this.addBlankLine();
33
33
  if ((_a = typeMirror.docComment) === null || _a === void 0 ? void 0 : _a.descriptionLines) {
34
34
  const description = typeMirror.docComment.descriptionLines.reduce((previous, current) => previous + current + '\n', '');
35
- this.addText((0, string_utils_1.stringUtils)(description, 300));
35
+ this.addText((0, string_utils_1.truncate)(description, 300));
36
36
  this.addBlankLine();
37
37
  }
38
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-home-file.js","sourceRoot":"","sources":["../../src/model/markdown-home-file.ts"],"names":[],"mappings":";;;AACA,kGAAyF;AACzF,mDAA+C;AAC/C,uDAAmD;AACnD,0CAAuC;AAEvC,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAmB,QAAgB,EAAS,KAAa,EAAE,aAAsB;QAC/E,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QADH,aAAQ,GAAR,QAAQ,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAEvD,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7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AAC;IAEO,aAAa,CAAC,UAAgB;;QACpC,OAAO,CACL,MAAA,MAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,0CAAE,IAAI,mCAC1F,mBAAQ,CAAC,WAAW,EAAE,CAAC,mBAAmB,EAAE,CAC7C,CAAC;IACJ,CAAC;CACF;AAnDD,4CAmDC"}
@@ -10,15 +10,24 @@ class ReferenceBuilder {
10
10
  };
11
11
  }
12
12
  build(referencedTypeName) {
13
+ const originalTypeName = referencedTypeName;
14
+ // Checking for inline overrides of the type: [memberName:ClassOverrideName]
15
+ const regexForSchemaOverrides = /\[(.*?)]/g;
16
+ const schemaOverrides = referencedTypeName.match(regexForSchemaOverrides);
17
+ let referenceOverrides = [];
18
+ if (schemaOverrides && schemaOverrides.length > 0) {
19
+ referenceOverrides = ReferenceOverrides.build(schemaOverrides[0]);
20
+ referencedTypeName = referencedTypeName.replace(regexForSchemaOverrides, '');
21
+ }
13
22
  const [parsedReferencedType, isCollection] = this.handlePossibleCollectionReference(referencedTypeName);
14
23
  const referencedTypeBundle = types_repository_1.TypesRepository.getInstance().getFromAllByName(parsedReferencedType);
15
24
  if (!referencedTypeBundle) {
16
- throw new Error(`The referenced type "${parsedReferencedType}" was not found.`);
25
+ throw new Error(`The referenced type ${referencedTypeName} was not found.`);
17
26
  }
18
27
  if (referencedTypeBundle.type.type_name !== 'class') {
19
28
  throw new Error(`Expected the referenced type to be a class, but found a ${referencedTypeBundle.type.type_name}.`);
20
29
  }
21
- const typeBundleWithIsCollection = Object.assign(Object.assign({}, referencedTypeBundle), { isCollection: isCollection });
30
+ const typeBundleWithIsCollection = Object.assign(Object.assign({}, referencedTypeBundle), { originalTypeName: originalTypeName, isCollection: isCollection, referenceOverrides: referenceOverrides });
22
31
  return this.buildReferenceFromType(typeBundleWithIsCollection);
23
32
  }
24
33
  /**
@@ -56,16 +65,27 @@ class ReferenceBuilder {
56
65
  let referencedComponents = [];
57
66
  propertiesAndFields.forEach((current) => {
58
67
  var _a, _b;
59
- // Check for "@http-schema" annotations within properties themselves. If these are specified they
60
- // take precedence over the property type itself.
61
- const manuallyDefinedHttpSchema = (_a = current.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'http-schema');
62
- if (manuallyDefinedHttpSchema) {
63
- this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
68
+ // Check if there are reference overrides for the current property, this takes priority over anything else.
69
+ const referenceOverride = typeBundle.referenceOverrides.find((currentOverride) => {
70
+ return currentOverride.propertyName.toLowerCase() === current.name.toLowerCase();
71
+ });
72
+ if (referenceOverride) {
73
+ const reference = this.build(referenceOverride.referenceName);
74
+ properties[current.name] = reference.entrypointReferenceObject;
75
+ reference.referenceComponents.forEach((current) => referencedComponents.push(current));
64
76
  }
65
77
  else {
66
- const pair = this.getReferenceType(current.typeReference);
67
- properties[current.name] = pair.schema;
68
- pair.referenceComponents.forEach((current) => referencedComponents.push(current));
78
+ // Check for "@http-schema" annotations within properties themselves. If these are specified they
79
+ // take precedence over the property type itself.
80
+ const manuallyDefinedHttpSchema = (_a = current.docComment) === null || _a === void 0 ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === 'http-schema');
81
+ if (manuallyDefinedHttpSchema) {
82
+ this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
83
+ }
84
+ else {
85
+ const pair = this.getReferenceType(current.typeReference);
86
+ properties[current.name] = pair.schema;
87
+ referencedComponents.push(...pair.referenceComponents);
88
+ }
69
89
  }
70
90
  properties[current.name].description = (_b = current.docComment) === null || _b === void 0 ? void 0 : _b.description;
71
91
  });
@@ -83,8 +103,8 @@ class ReferenceBuilder {
83
103
  // This can be of type ApexDocSchemaObject
84
104
  const inYaml = manuallyDefinedHttpSchema === null || manuallyDefinedHttpSchema === void 0 ? void 0 : manuallyDefinedHttpSchema.bodyLines.reduce((prev, current, _) => prev + '\n' + current);
85
105
  const asJson = yaml.load(inYaml);
86
- const isReference = this.isReferenceString(asJson);
87
- if (isReference) {
106
+ const isReferenceString = this.isReferenceString(asJson);
107
+ if (isReferenceString) {
88
108
  const reference = this.build(asJson);
89
109
  properties[current.name] = reference.entrypointReferenceObject;
90
110
  reference.referenceComponents.forEach((current) => referencedComponents.push(current));
@@ -104,6 +124,9 @@ class ReferenceBuilder {
104
124
  if (typeBundle.isCollection) {
105
125
  referenceName = `${referenceName}_array`;
106
126
  }
127
+ if (typeBundle.referenceOverrides.length) {
128
+ referenceName = `${referenceName}_${typeBundle.originalTypeName}`;
129
+ }
107
130
  return referenceName;
108
131
  }
109
132
  buildMainReferenceComponent(typeBundle, properties) {
@@ -166,13 +189,15 @@ class ReferenceBuilder {
166
189
  // For Maps, we treat them as objects but do not try to define their shape, because their keys can vary
167
190
  // at runtime.
168
191
  return { schema: { type: 'object' }, referenceComponents: [] };
192
+ case 'object':
193
+ return { schema: { type: 'object' }, referenceComponents: [] };
169
194
  default:
170
195
  // If we got here we are dealing with a non-primitive (most likely a custom class or an SObject).
171
196
  const referencedType = types_repository_1.TypesRepository.getInstance().getFromAllByName(typeName);
172
197
  if (!referencedType) {
173
198
  return { schema: { type: 'object' }, referenceComponents: [] };
174
199
  }
175
- const reference = this.buildReferenceFromType(Object.assign(Object.assign({}, referencedType), { isCollection: false }));
200
+ const reference = this.buildReferenceFromType(Object.assign(Object.assign({}, referencedType), { isCollection: false, referenceOverrides: [], originalTypeName: typeName }));
176
201
  return {
177
202
  schema: reference.entrypointReferenceObject,
178
203
  referenceComponents: [...reference.referenceComponents],
@@ -188,4 +213,14 @@ class ReferenceBuilder {
188
213
  }
189
214
  }
190
215
  exports.ReferenceBuilder = ReferenceBuilder;
216
+ class ReferenceOverrides {
217
+ static build(referenceAsString) {
218
+ const cleanedUpReference = referenceAsString.replace(/[\[\]]/g, '');
219
+ const referenceStrings = cleanedUpReference.split(',').map((item) => item.replace(/\s/g, ''));
220
+ return referenceStrings.map((item) => {
221
+ const [propertyName, referenceName] = item.split(':');
222
+ return { propertyName, referenceName };
223
+ });
224
+ }
225
+ }
191
226
  //# sourceMappingURL=ReferenceBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ReferenceBuilder.ts"],"names":[],"mappings":";;;AAAA,gCAAgC;AAQhC,sEAA8E;AAO9E,MAAa,gBAAgB;IAA7B;QAwMU,sBAAiB,GAAG,CAAC,YAAqB,EAA0B,EAAE;YAC5E,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,YAAY,MAAM,CAAC;QAC5E,CAAC,CAAC;IACJ,CAAC;IA1MC,KAAK,CAAC,kBAA0B;QAC9B,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC,iCAAiC,CAAC,kBAAkB,CAAC,CAAC;QACxG,MAAM,oBAAoB,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;QAElG,IAAI,CAAC,oBAAoB,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,wBAAwB,oBAAoB,kBAAkB,CAAC,CAAC;SACjF;QACD,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE;YACnD,MAAM,IAAI,KAAK,CACb,2DAA2D,oBAAoB,CAAC,IAAI,CAAC,SAAS,GAAG,CAClG,CAAC;SACH;QACD,MAAM,0BAA0B,mCAAQ,oBAAoB,KAAE,YAAY,EAAE,YAAY,GAAE,CAAC;QAC3F,OAAO,IAAI,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACK,iCAAiC,CAAC,kBAA0B;QAClE,kBAAkB,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QACtD,IAAI,kBAAkB,CAAC,UAAU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AE,EAAE,CAAC,CAAC,CAAC;QAC9F,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACnC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -1,2 +1,2 @@
1
- export declare function stringUtils(str: string, n: number): string;
1
+ export declare function truncate(str: string, n: number): string;
2
2
  export declare const camel2title: (camelCase: string) => string;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.camel2title = exports.stringUtils = void 0;
4
- function stringUtils(str, n) {
3
+ exports.camel2title = exports.truncate = void 0;
4
+ function truncate(str, n) {
5
5
  return str.length > n ? str.substr(0, n - 1) + '&hellip;' : str;
6
6
  }
7
- exports.stringUtils = stringUtils;
7
+ exports.truncate = truncate;
8
8
  const camel2title = (camelCase) => camelCase
9
9
  .replace(/([A-Z])/g, (match) => ` ${match}`)
10
10
  .replace(/^./, (match) => match.toUpperCase())
@@ -1 +1 @@
1
- {"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../src/util/string-utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,GAAW,EAAE,CAAS;IAChD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;AAClE,CAAC;AAFD,kCAEC;AAEM,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,EAAE,CAC/C,SAAS;KACN,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;KAC3C,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;KAC7C,IAAI,EAAE,CAAC;AAJC,QAAA,WAAW,eAIZ"}
1
+ {"version":3,"file":"string-utils.js","sourceRoot":"","sources":["../../src/util/string-utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,GAAW,EAAE,CAAS;IAC7C,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC;AAClE,CAAC;AAFD,4BAEC;AAEM,MAAM,WAAW,GAAG,CAAC,SAAiB,EAAE,EAAE,CAC/C,SAAS;KACN,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC;KAC3C,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;KAC7C,IAAI,EAAE,CAAC;AAJC,QAAA,WAAW,eAIZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.13.0-alpha.4",
3
+ "version": "2.13.1",
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.2.0",
69
+ "@cparra/apex-reflection": "2.3.1",
70
70
  "chalk": "^4.1.2",
71
71
  "fast-xml-parser": "^4.0.1",
72
72
  "js-yaml": "^4.1.0",
@@ -93,4 +93,9 @@ Settings.build({
93
93
  openApiFileName: argv.openApiFileName,
94
94
  });
95
95
 
96
- Apexdocs.generate();
96
+ try {
97
+ Apexdocs.generate();
98
+ } catch (error) {
99
+ console.error(error);
100
+ process.exit(1);
101
+ }
@@ -1,4 +1,4 @@
1
- import { Annotation, DocCommentAnnotation, MethodMirror } from '@cparra/apex-reflection';
1
+ import { DocCommentAnnotation, MethodMirror } from '@cparra/apex-reflection';
2
2
 
3
3
  export class MethodMirrorWrapper {
4
4
  constructor(public methodMirror: MethodMirror) {}
@@ -1,6 +1,14 @@
1
- import { ClassMirror, EnumMirror, InterfaceMirror, Type, Annotation } from '@cparra/apex-reflection';
1
+ import {
2
+ ClassMirror,
3
+ EnumMirror,
4
+ InterfaceMirror,
5
+ Type,
6
+ Annotation,
7
+ DocComment,
8
+ DocCommentAnnotation,
9
+ } from '@cparra/apex-reflection';
2
10
 
3
- type AccessAware = { access_modifier: string } & { annotations: Annotation[] };
11
+ type AccessAndDocAware = { access_modifier: string; annotations: Annotation[]; docComment?: DocComment };
4
12
 
5
13
  /**
6
14
  * Represents the full library of Apex top-level types (classes, enums, and interface) for a Salesforce project.
@@ -49,8 +57,14 @@ export default class Manifest {
49
57
  return typesToReturn;
50
58
  }
51
59
 
52
- filterAccessibleModifier(accessAware: AccessAware[], modifiers: string[]) {
53
- return accessAware.filter((currentType) => {
60
+ filterAccessibleModifier(accessAndDocAwares: AccessAndDocAware[], modifiers: string[]) {
61
+ return accessAndDocAwares.filter((currentType) => {
62
+ const hasIgnoreDocAnnotation = currentType.docComment?.annotations.some(
63
+ (annotation: DocCommentAnnotation) => annotation.name === 'ignore',
64
+ );
65
+ if (hasIgnoreDocAnnotation) {
66
+ return false;
67
+ }
54
68
  return (
55
69
  modifiers.includes(currentType.access_modifier) ||
56
70
  currentType.annotations.some((annotation: Annotation) => modifiers.includes(annotation.type.toLowerCase()))
@@ -1,7 +1,7 @@
1
1
  import { Type } from '@cparra/apex-reflection';
2
2
  import ClassFileGeneratorHelper from '../transpiler/markdown/class-file-generatorHelper';
3
3
  import { MarkdownFile } from './markdown-file';
4
- import { stringUtils } from '../util/string-utils';
4
+ import { truncate } from '../util/string-utils';
5
5
  import { Settings } from '../settings';
6
6
 
7
7
  export class MarkdownHomeFile extends MarkdownFile {
@@ -34,7 +34,7 @@ export class MarkdownHomeFile extends MarkdownFile {
34
34
  (previous, current) => previous + current + '\n',
35
35
  '',
36
36
  );
37
- this.addText(stringUtils(description, 300));
37
+ this.addText(truncate(description, 300));
38
38
  this.addBlankLine();
39
39
  }
40
40
  }
@@ -21,7 +21,7 @@ it('should add a path based on the @UrlResource annotation on the class', functi
21
21
  const processor = new OpenApiDocsProcessor();
22
22
  processor.onProcess(classMirror);
23
23
 
24
- expect(processor.openApiModel.paths).toHaveProperty('/Account/');
24
+ expect(processor.openApiModel.paths).toHaveProperty('Account/');
25
25
  });
26
26
 
27
27
  it('should contain a path with a description when the class has an ApexDoc comment', function () {
@@ -37,5 +37,5 @@ it('should contain a path with a description when the class has an ApexDoc comme
37
37
  const processor = new OpenApiDocsProcessor();
38
38
  processor.onProcess(classMirror);
39
39
 
40
- expect(processor.openApiModel.paths['/Account/'].description).toBe('My Description');
40
+ expect(processor.openApiModel.paths['Account/'].description).toBe('My Description');
41
41
  });
@@ -11,22 +11,42 @@ import { ClassMirror, DocCommentAnnotation, FieldMirror, PropertyMirror } from '
11
11
  import { ListObjectType, ReferencedType } from '@cparra/apex-reflection';
12
12
  import { ApexDocSchemaObject } from '../../../model/openapi/apex-doc-types';
13
13
 
14
- type TypeBundleWithIsCollection = TypeBundle & { isCollection: boolean };
14
+ type TypeBundleWithIsCollectionAndReferenceOverrides = TypeBundle & {
15
+ originalTypeName: string;
16
+ isCollection: boolean;
17
+ referenceOverrides: ReferenceOverride[];
18
+ };
15
19
 
16
20
  export class ReferenceBuilder {
17
21
  build(referencedTypeName: string): Reference {
22
+ const originalTypeName = referencedTypeName;
23
+
24
+ // Checking for inline overrides of the type: [memberName:ClassOverrideName]
25
+ const regexForSchemaOverrides = /\[(.*?)]/g;
26
+ const schemaOverrides = referencedTypeName.match(regexForSchemaOverrides);
27
+ let referenceOverrides: ReferenceOverride[] = [];
28
+ if (schemaOverrides && schemaOverrides.length > 0) {
29
+ referenceOverrides = ReferenceOverrides.build(schemaOverrides[0]);
30
+ referencedTypeName = referencedTypeName.replace(regexForSchemaOverrides, '');
31
+ }
32
+
18
33
  const [parsedReferencedType, isCollection] = this.handlePossibleCollectionReference(referencedTypeName);
19
34
  const referencedTypeBundle = TypesRepository.getInstance().getFromAllByName(parsedReferencedType);
20
35
 
21
36
  if (!referencedTypeBundle) {
22
- throw new Error(`The referenced type "${parsedReferencedType}" was not found.`);
37
+ throw new Error(`The referenced type ${referencedTypeName} was not found.`);
23
38
  }
24
39
  if (referencedTypeBundle.type.type_name !== 'class') {
25
40
  throw new Error(
26
41
  `Expected the referenced type to be a class, but found a ${referencedTypeBundle.type.type_name}.`,
27
42
  );
28
43
  }
29
- const typeBundleWithIsCollection = { ...referencedTypeBundle, isCollection: isCollection };
44
+ const typeBundleWithIsCollection = {
45
+ ...referencedTypeBundle,
46
+ originalTypeName: originalTypeName,
47
+ isCollection: isCollection,
48
+ referenceOverrides: referenceOverrides,
49
+ };
30
50
  return this.buildReferenceFromType(typeBundleWithIsCollection);
31
51
  }
32
52
 
@@ -51,7 +71,7 @@ export class ReferenceBuilder {
51
71
  return [referencedTypeName, false];
52
72
  }
53
73
 
54
- private buildReferenceFromType(typeBundle: TypeBundleWithIsCollection): Reference {
74
+ private buildReferenceFromType(typeBundle: TypeBundleWithIsCollectionAndReferenceOverrides): Reference {
55
75
  // Filtering based on Salesforce's documentation:
56
76
  // https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm#ApexRESTUserDefinedTypes
57
77
  // We assume that the class only contains object types allowed by Apex Rest:
@@ -66,18 +86,29 @@ export class ReferenceBuilder {
66
86
  const properties: PropertiesObject = {};
67
87
  let referencedComponents: ReferenceComponent[] = [];
68
88
  propertiesAndFields.forEach((current) => {
69
- // Check for "@http-schema" annotations within properties themselves. If these are specified they
70
- // take precedence over the property type itself.
71
- const manuallyDefinedHttpSchema = current.docComment?.annotations.find(
72
- (annotation) => annotation.name.toLowerCase() === 'http-schema',
73
- );
74
- if (manuallyDefinedHttpSchema) {
75
- this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
89
+ // Check if there are reference overrides for the current property, this takes priority over anything else.
90
+ const referenceOverride = typeBundle.referenceOverrides.find((currentOverride) => {
91
+ return currentOverride.propertyName.toLowerCase() === current.name.toLowerCase();
92
+ });
93
+ if (referenceOverride) {
94
+ const reference = this.build(referenceOverride.referenceName);
95
+ properties[current.name] = reference.entrypointReferenceObject;
96
+ reference.referenceComponents.forEach((current) => referencedComponents.push(current));
76
97
  } else {
77
- const pair = this.getReferenceType(current.typeReference);
78
- properties[current.name] = pair.schema;
79
- pair.referenceComponents.forEach((current) => referencedComponents.push(current));
98
+ // Check for "@http-schema" annotations within properties themselves. If these are specified they
99
+ // take precedence over the property type itself.
100
+ const manuallyDefinedHttpSchema = current.docComment?.annotations.find(
101
+ (annotation) => annotation.name.toLowerCase() === 'http-schema',
102
+ );
103
+ if (manuallyDefinedHttpSchema) {
104
+ this.handleOverriddenSchema(manuallyDefinedHttpSchema, properties, current, referencedComponents);
105
+ } else {
106
+ const pair = this.getReferenceType(current.typeReference);
107
+ properties[current.name] = pair.schema;
108
+ referencedComponents.push(...pair.referenceComponents);
109
+ }
80
110
  }
111
+
81
112
  properties[current.name].description = current.docComment?.description;
82
113
  });
83
114
  const mainReferenceComponents = this.buildMainReferenceComponent(typeBundle, properties);
@@ -102,9 +133,9 @@ export class ReferenceBuilder {
102
133
  // This can be of type ApexDocSchemaObject
103
134
  const inYaml = manuallyDefinedHttpSchema?.bodyLines.reduce((prev, current, _) => prev + '\n' + current);
104
135
  const asJson = yaml.load(inYaml) as ApexDocSchemaObject;
105
- const isReference = this.isReferenceString(asJson);
136
+ const isReferenceString = this.isReferenceString(asJson);
106
137
 
107
- if (isReference) {
138
+ if (isReferenceString) {
108
139
  const reference = this.build(asJson);
109
140
  properties[current.name] = reference.entrypointReferenceObject;
110
141
  reference.referenceComponents.forEach((current) => referencedComponents.push(current));
@@ -115,7 +146,7 @@ export class ReferenceBuilder {
115
146
  }
116
147
  }
117
148
 
118
- private getReferenceName(typeBundle: TypeBundleWithIsCollection): string {
149
+ private getReferenceName(typeBundle: TypeBundleWithIsCollectionAndReferenceOverrides): string {
119
150
  let referenceName = typeBundle.type.name;
120
151
  if (typeBundle.isChild) {
121
152
  referenceName = `${typeBundle.parentType?.name}.${typeBundle.type.name}`;
@@ -123,11 +154,14 @@ export class ReferenceBuilder {
123
154
  if (typeBundle.isCollection) {
124
155
  referenceName = `${referenceName}_array`;
125
156
  }
157
+ if (typeBundle.referenceOverrides.length) {
158
+ referenceName = `${referenceName}_${typeBundle.originalTypeName}`;
159
+ }
126
160
  return referenceName;
127
161
  }
128
162
 
129
163
  private buildMainReferenceComponent(
130
- typeBundle: TypeBundleWithIsCollection,
164
+ typeBundle: TypeBundleWithIsCollectionAndReferenceOverrides,
131
165
  properties: PropertiesObject,
132
166
  ): ReferenceComponent[] {
133
167
  // For the main reference, we always want to get the reference of the object without the collection part,
@@ -191,13 +225,20 @@ export class ReferenceBuilder {
191
225
  // For Maps, we treat them as objects but do not try to define their shape, because their keys can vary
192
226
  // at runtime.
193
227
  return { schema: { type: 'object' }, referenceComponents: [] };
228
+ case 'object':
229
+ return { schema: { type: 'object' }, referenceComponents: [] };
194
230
  default:
195
231
  // If we got here we are dealing with a non-primitive (most likely a custom class or an SObject).
196
232
  const referencedType = TypesRepository.getInstance().getFromAllByName(typeName);
197
233
  if (!referencedType) {
198
234
  return { schema: { type: 'object' }, referenceComponents: [] };
199
235
  }
200
- const reference = this.buildReferenceFromType({ ...referencedType, isCollection: false });
236
+ const reference = this.buildReferenceFromType({
237
+ ...referencedType,
238
+ isCollection: false,
239
+ referenceOverrides: [],
240
+ originalTypeName: typeName,
241
+ });
201
242
  return {
202
243
  schema: reference.entrypointReferenceObject,
203
244
  referenceComponents: [...reference.referenceComponents],
@@ -223,6 +264,22 @@ type SchemaObjectReferencePair = {
223
264
  referenceComponents: ReferenceComponent[];
224
265
  };
225
266
 
267
+ class ReferenceOverrides {
268
+ static build(referenceAsString: string): ReferenceOverride[] {
269
+ const cleanedUpReference = referenceAsString.replace(/[\[\]]/g, '');
270
+ const referenceStrings = cleanedUpReference.split(',').map((item) => item.replace(/\s/g, ''));
271
+ return referenceStrings.map((item) => {
272
+ const [propertyName, referenceName] = item.split(':');
273
+ return { propertyName, referenceName };
274
+ });
275
+ }
276
+ }
277
+
278
+ type ReferenceOverride = {
279
+ propertyName: string;
280
+ referenceName: string;
281
+ };
282
+
226
283
  /**
227
284
  * In case where the Request Body contains a reference, this contains information about the handled reference
228
285
  */