@cparra/apexdocs 3.0.0-alpha.1 → 3.0.0-alpha.10
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/dist/cli/generate.js +511 -293
- package/dist/{defaults-jLXD2y8-.js → defaults-DGKfeZq-.js} +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.js +1 -1
- package/examples/markdown/docs/miscellaneous/MultiInheritanceClass.md +1 -1
- package/examples/markdown/docs/miscellaneous/SampleInterface.md +12 -8
- package/examples/markdown/docs/miscellaneous/Url.md +3 -3
- package/examples/markdown/force-app/classes/SampleInterface.cls +4 -0
- package/examples/vitepress/apexdocs.config.ts +1 -1
- package/examples/vitepress/docs/index.md +10 -10
- package/examples/vitepress/docs/miscellaneous/BaseClass.md +1 -1
- package/examples/vitepress/docs/miscellaneous/MultiInheritanceClass.md +2 -2
- package/examples/vitepress/docs/miscellaneous/SampleException.md +1 -1
- package/examples/vitepress/docs/miscellaneous/SampleInterface.md +6 -6
- package/examples/vitepress/docs/miscellaneous/Url.md +3 -3
- package/examples/vitepress/docs/sample-enums/SampleEnum.md +3 -3
- package/examples/vitepress/docs/samplegroup/SampleClass.md +4 -4
- package/package.json +2 -3
- package/src/application/Apexdocs.ts +53 -10
- package/src/application/__tests__/apex-file-reader.spec.ts +25 -25
- package/src/application/apex-file-reader.ts +32 -19
- package/src/application/file-system.ts +46 -10
- package/src/application/file-writer.ts +37 -15
- package/src/application/generators/markdown.ts +18 -31
- package/src/application/generators/openapi.ts +12 -8
- package/src/cli/commands/markdown.ts +4 -3
- package/src/core/markdown/__test__/generating-class-docs.spec.ts +3 -5
- package/src/core/markdown/__test__/generating-enum-docs.spec.ts +3 -3
- package/src/core/markdown/__test__/generating-interface-docs.spec.ts +5 -5
- package/src/core/markdown/__test__/generating-reference-guide.spec.ts +3 -3
- package/src/core/markdown/__test__/test-helpers.ts +1 -1
- package/src/core/markdown/adapters/__tests__/interface-adapter.spec.ts +1 -1
- package/src/core/markdown/adapters/__tests__/link-generator.spec.ts +130 -0
- package/src/core/markdown/adapters/documentables.ts +0 -1
- package/src/core/markdown/adapters/generate-link.ts +82 -0
- package/src/core/markdown/adapters/reference-guide.ts +3 -1
- package/src/core/markdown/adapters/renderable-bundle.ts +5 -22
- package/src/core/markdown/adapters/renderable-to-page-data.ts +2 -2
- package/src/core/markdown/generate-docs.ts +9 -13
- package/src/core/markdown/reflection/reflect-source.ts +109 -31
- package/src/core/openapi/open-api-docs-processor.ts +1 -1
- package/src/core/openapi/openapi-type-file.ts +1 -1
- package/src/core/openapi/parser.ts +1 -15
- package/src/core/parse-apex-metadata.ts +21 -5
- package/src/core/shared/types.d.ts +22 -6
- package/src/defaults.ts +1 -1
- package/src/index.ts +1 -6
- package/src/util/logger.ts +8 -21
- package/dist/defaults-DUwru49Q.js +0 -12
- package/dist/defaults-SH0Rsi5E.js +0 -11
- package/src/core/markdown/reflection/error-handling.ts +0 -37
package/dist/cli/generate.js
CHANGED
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var _function = require('fp-ts/function');
|
|
5
|
-
var E = require('fp-ts/Either');
|
|
6
5
|
var TE = require('fp-ts/TaskEither');
|
|
7
6
|
var yaml = require('js-yaml');
|
|
8
7
|
var path = require('path');
|
|
8
|
+
var E = require('fp-ts/Either');
|
|
9
|
+
var T = require('fp-ts/Task');
|
|
10
|
+
var A = require('fp-ts/lib/Array');
|
|
9
11
|
var apexReflection = require('@cparra/apex-reflection');
|
|
10
12
|
var O = require('fp-ts/Option');
|
|
11
13
|
var fastXmlParser = require('fast-xml-parser');
|
|
12
14
|
var Handlebars = require('handlebars');
|
|
13
|
-
var defaults = require('../defaults-
|
|
15
|
+
var defaults = require('../defaults-DGKfeZq-.js');
|
|
14
16
|
var fs = require('fs');
|
|
17
|
+
var TE$1 = require('fp-ts/lib/TaskEither');
|
|
15
18
|
var chalk = require('chalk');
|
|
16
|
-
var logUpdate = require('log-update');
|
|
17
19
|
var cosmiconfig = require('cosmiconfig');
|
|
18
20
|
var yargs = require('yargs');
|
|
19
21
|
var cosmiconfigTypescriptLoader = require('cosmiconfig-typescript-loader');
|
|
@@ -35,12 +37,15 @@ function _interopNamespaceDefault(e) {
|
|
|
35
37
|
return Object.freeze(n);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
var E__namespace = /*#__PURE__*/_interopNamespaceDefault(E);
|
|
39
40
|
var TE__namespace = /*#__PURE__*/_interopNamespaceDefault(TE);
|
|
40
41
|
var yaml__namespace = /*#__PURE__*/_interopNamespaceDefault(yaml);
|
|
41
42
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
43
|
+
var E__namespace = /*#__PURE__*/_interopNamespaceDefault(E);
|
|
44
|
+
var T__namespace = /*#__PURE__*/_interopNamespaceDefault(T);
|
|
45
|
+
var A__namespace = /*#__PURE__*/_interopNamespaceDefault(A);
|
|
42
46
|
var O__namespace = /*#__PURE__*/_interopNamespaceDefault(O);
|
|
43
47
|
var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs);
|
|
48
|
+
var TE__namespace$1 = /*#__PURE__*/_interopNamespaceDefault(TE$1);
|
|
44
49
|
var yargs__namespace = /*#__PURE__*/_interopNamespaceDefault(yargs);
|
|
45
50
|
|
|
46
51
|
function apply(fn, ...front) {
|
|
@@ -146,25 +151,25 @@ function isInlineCode(content) {
|
|
|
146
151
|
return Object.keys(content).includes("__type") && content.__type === "inline-code";
|
|
147
152
|
}
|
|
148
153
|
|
|
149
|
-
var __defProp$
|
|
150
|
-
var __defProps$
|
|
151
|
-
var __getOwnPropDescs$
|
|
152
|
-
var __getOwnPropSymbols$
|
|
153
|
-
var __hasOwnProp$
|
|
154
|
-
var __propIsEnum$
|
|
155
|
-
var __defNormalProp$
|
|
156
|
-
var __spreadValues$
|
|
154
|
+
var __defProp$g = Object.defineProperty;
|
|
155
|
+
var __defProps$g = Object.defineProperties;
|
|
156
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
157
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
158
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
159
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
|
160
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
161
|
+
var __spreadValues$g = (a, b) => {
|
|
157
162
|
for (var prop in b || (b = {}))
|
|
158
|
-
if (__hasOwnProp$
|
|
159
|
-
__defNormalProp$
|
|
160
|
-
if (__getOwnPropSymbols$
|
|
161
|
-
for (var prop of __getOwnPropSymbols$
|
|
162
|
-
if (__propIsEnum$
|
|
163
|
-
__defNormalProp$
|
|
163
|
+
if (__hasOwnProp$g.call(b, prop))
|
|
164
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
165
|
+
if (__getOwnPropSymbols$g)
|
|
166
|
+
for (var prop of __getOwnPropSymbols$g(b)) {
|
|
167
|
+
if (__propIsEnum$g.call(b, prop))
|
|
168
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
164
169
|
}
|
|
165
170
|
return a;
|
|
166
171
|
};
|
|
167
|
-
var __spreadProps$
|
|
172
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
168
173
|
function adaptDescribable(describable, linkGenerator) {
|
|
169
174
|
return {
|
|
170
175
|
description: describableToRenderableContent(describable, linkGenerator)
|
|
@@ -216,7 +221,7 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
|
|
|
216
221
|
function extractCustomTags(type) {
|
|
217
222
|
var _a2, _b2;
|
|
218
223
|
const baseTags = ["description", "group", "author", "date", "see", "example", "throws", "exception"];
|
|
219
|
-
return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => __spreadProps$
|
|
224
|
+
return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => !baseTags.includes(currentAnnotation.name.toLowerCase())).map((currentAnnotation) => __spreadProps$g(__spreadValues$g({}, adaptDescribable(currentAnnotation.bodyLines, linkGenerator)), {
|
|
220
225
|
name: currentAnnotation.name
|
|
221
226
|
}))) != null ? _b2 : [];
|
|
222
227
|
}
|
|
@@ -230,7 +235,7 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
|
|
|
230
235
|
var _a2, _b2;
|
|
231
236
|
return (_b2 = (_a2 = type.docComment) == null ? void 0 : _a2.annotations.filter((currentAnnotation) => currentAnnotation.name.toLowerCase() === "see").map((currentAnnotation) => currentAnnotation.body)) != null ? _b2 : [];
|
|
232
237
|
}
|
|
233
|
-
return __spreadProps$
|
|
238
|
+
return __spreadProps$g(__spreadValues$g({}, adaptDescribable((_a = documentable.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
|
|
234
239
|
annotations: documentable.annotations.map((annotation) => annotation.type.toUpperCase()),
|
|
235
240
|
customTags: extractCustomTags(documentable),
|
|
236
241
|
example: {
|
|
@@ -245,25 +250,25 @@ function adaptDocumentable(documentable, linkGenerator, subHeadingLevel) {
|
|
|
245
250
|
});
|
|
246
251
|
}
|
|
247
252
|
|
|
248
|
-
var __defProp$
|
|
249
|
-
var __defProps$
|
|
250
|
-
var __getOwnPropDescs$
|
|
251
|
-
var __getOwnPropSymbols$
|
|
252
|
-
var __hasOwnProp$
|
|
253
|
-
var __propIsEnum$
|
|
254
|
-
var __defNormalProp$
|
|
255
|
-
var __spreadValues$
|
|
253
|
+
var __defProp$f = Object.defineProperty;
|
|
254
|
+
var __defProps$f = Object.defineProperties;
|
|
255
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
256
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
257
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
258
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
259
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
260
|
+
var __spreadValues$f = (a, b) => {
|
|
256
261
|
for (var prop in b || (b = {}))
|
|
257
|
-
if (__hasOwnProp$
|
|
258
|
-
__defNormalProp$
|
|
259
|
-
if (__getOwnPropSymbols$
|
|
260
|
-
for (var prop of __getOwnPropSymbols$
|
|
261
|
-
if (__propIsEnum$
|
|
262
|
-
__defNormalProp$
|
|
262
|
+
if (__hasOwnProp$f.call(b, prop))
|
|
263
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
264
|
+
if (__getOwnPropSymbols$f)
|
|
265
|
+
for (var prop of __getOwnPropSymbols$f(b)) {
|
|
266
|
+
if (__propIsEnum$f.call(b, prop))
|
|
267
|
+
__defNormalProp$f(a, prop, b[prop]);
|
|
263
268
|
}
|
|
264
269
|
return a;
|
|
265
270
|
};
|
|
266
|
-
var __spreadProps$
|
|
271
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
267
272
|
function adaptMethod(method, linkGenerator, baseHeadingLevel) {
|
|
268
273
|
var _a, _b, _c;
|
|
269
274
|
function buildTitle(method2) {
|
|
@@ -293,7 +298,7 @@ function adaptMethod(method, linkGenerator, baseHeadingLevel) {
|
|
|
293
298
|
returnType: {
|
|
294
299
|
headingLevel: baseHeadingLevel + 1,
|
|
295
300
|
heading: "Return Type",
|
|
296
|
-
value: __spreadProps$
|
|
301
|
+
value: __spreadProps$f(__spreadValues$f({}, adaptDescribable((_b = (_a = method.docComment) == null ? void 0 : _a.returnAnnotation) == null ? void 0 : _b.bodyLines, linkGenerator)), {
|
|
297
302
|
type: linkGenerator(method.typeReference.rawDeclaration)
|
|
298
303
|
})
|
|
299
304
|
},
|
|
@@ -352,13 +357,13 @@ function mapParameters(documentable, param, linkGenerator) {
|
|
|
352
357
|
const paramAnnotation = (_a = documentable.docComment) == null ? void 0 : _a.paramAnnotations.find(
|
|
353
358
|
(pa) => pa.paramName.toLowerCase() === param.name.toLowerCase()
|
|
354
359
|
);
|
|
355
|
-
return __spreadProps$
|
|
360
|
+
return __spreadProps$f(__spreadValues$f({}, adaptDescribable(paramAnnotation == null ? void 0 : paramAnnotation.bodyLines, linkGenerator)), {
|
|
356
361
|
name: param.name,
|
|
357
362
|
type: linkGenerator(param.typeReference.rawDeclaration)
|
|
358
363
|
});
|
|
359
364
|
}
|
|
360
365
|
function mapThrows(thrown, linkGenerator) {
|
|
361
|
-
return __spreadProps$
|
|
366
|
+
return __spreadProps$f(__spreadValues$f({}, adaptDescribable(thrown.bodyLines, linkGenerator)), {
|
|
362
367
|
type: linkGenerator(thrown.exceptionName)
|
|
363
368
|
});
|
|
364
369
|
}
|
|
@@ -393,25 +398,25 @@ function adaptFieldOrProperty(field, linkGenerator, baseHeadingLevel) {
|
|
|
393
398
|
};
|
|
394
399
|
}
|
|
395
400
|
|
|
396
|
-
var __defProp$
|
|
397
|
-
var __defProps$
|
|
398
|
-
var __getOwnPropDescs$
|
|
399
|
-
var __getOwnPropSymbols$
|
|
400
|
-
var __hasOwnProp$
|
|
401
|
-
var __propIsEnum$
|
|
402
|
-
var __defNormalProp$
|
|
403
|
-
var __spreadValues$
|
|
401
|
+
var __defProp$e = Object.defineProperty;
|
|
402
|
+
var __defProps$e = Object.defineProperties;
|
|
403
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
404
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
|
405
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
|
406
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
|
407
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
408
|
+
var __spreadValues$e = (a, b) => {
|
|
404
409
|
for (var prop in b || (b = {}))
|
|
405
|
-
if (__hasOwnProp$
|
|
406
|
-
__defNormalProp$
|
|
407
|
-
if (__getOwnPropSymbols$
|
|
408
|
-
for (var prop of __getOwnPropSymbols$
|
|
409
|
-
if (__propIsEnum$
|
|
410
|
-
__defNormalProp$
|
|
410
|
+
if (__hasOwnProp$e.call(b, prop))
|
|
411
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
412
|
+
if (__getOwnPropSymbols$e)
|
|
413
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
|
414
|
+
if (__propIsEnum$e.call(b, prop))
|
|
415
|
+
__defNormalProp$e(a, prop, b[prop]);
|
|
411
416
|
}
|
|
412
417
|
return a;
|
|
413
418
|
};
|
|
414
|
-
var __spreadProps$
|
|
419
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
415
420
|
function typeToRenderable(parsedFile, linkGenerator, config) {
|
|
416
421
|
function getRenderable() {
|
|
417
422
|
const { type } = parsedFile;
|
|
@@ -424,7 +429,7 @@ function typeToRenderable(parsedFile, linkGenerator, config) {
|
|
|
424
429
|
return classTypeToClassSource(type, linkGenerator);
|
|
425
430
|
}
|
|
426
431
|
}
|
|
427
|
-
return __spreadProps$
|
|
432
|
+
return __spreadProps$e(__spreadValues$e({}, getRenderable()), {
|
|
428
433
|
filePath: parsedFile.source.filePath,
|
|
429
434
|
namespace: config.namespace
|
|
430
435
|
});
|
|
@@ -449,7 +454,7 @@ function baseTypeAdapter(type, linkGenerator, baseHeadingLevel) {
|
|
|
449
454
|
};
|
|
450
455
|
}
|
|
451
456
|
function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1) {
|
|
452
|
-
return __spreadProps$
|
|
457
|
+
return __spreadProps$e(__spreadValues$e({
|
|
453
458
|
type: "enum"
|
|
454
459
|
}, baseTypeAdapter(enumType, linkGenerator, baseHeadingLevel)), {
|
|
455
460
|
values: {
|
|
@@ -457,7 +462,7 @@ function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1) {
|
|
|
457
462
|
heading: "Values",
|
|
458
463
|
value: enumType.values.map((value) => {
|
|
459
464
|
var _a;
|
|
460
|
-
return __spreadProps$
|
|
465
|
+
return __spreadProps$e(__spreadValues$e({}, adaptDescribable((_a = value.docComment) == null ? void 0 : _a.descriptionLines, linkGenerator)), {
|
|
461
466
|
value: value.name
|
|
462
467
|
});
|
|
463
468
|
})
|
|
@@ -465,7 +470,7 @@ function enumTypeToEnumSource(enumType, linkGenerator, baseHeadingLevel = 1) {
|
|
|
465
470
|
});
|
|
466
471
|
}
|
|
467
472
|
function interfaceTypeToInterfaceSource(interfaceType, linkGenerator, baseHeadingLevel = 1) {
|
|
468
|
-
return __spreadProps$
|
|
473
|
+
return __spreadProps$e(__spreadValues$e({
|
|
469
474
|
type: "interface"
|
|
470
475
|
}, baseTypeAdapter(interfaceType, linkGenerator, baseHeadingLevel)), {
|
|
471
476
|
extends: interfaceType.extended_interfaces.map(linkGenerator),
|
|
@@ -477,7 +482,7 @@ function interfaceTypeToInterfaceSource(interfaceType, linkGenerator, baseHeadin
|
|
|
477
482
|
});
|
|
478
483
|
}
|
|
479
484
|
function classTypeToClassSource(classType, linkGenerator, baseHeadingLevel = 1) {
|
|
480
|
-
return __spreadProps$
|
|
485
|
+
return __spreadProps$e(__spreadValues$e({
|
|
481
486
|
type: "class"
|
|
482
487
|
}, baseTypeAdapter(classType, linkGenerator, baseHeadingLevel)), {
|
|
483
488
|
classModifier: classType.classModifier,
|
|
@@ -510,7 +515,7 @@ function classTypeToClassSource(classType, linkGenerator, baseHeadingLevel = 1)
|
|
|
510
515
|
headingLevel: baseHeadingLevel + 1,
|
|
511
516
|
heading: "Classes",
|
|
512
517
|
value: classType.classes.map(
|
|
513
|
-
(innerClass) => classTypeToClassSource(__spreadProps$
|
|
518
|
+
(innerClass) => classTypeToClassSource(__spreadProps$e(__spreadValues$e({}, innerClass), { inheritanceChain: [] }), linkGenerator, baseHeadingLevel + 2)
|
|
514
519
|
)
|
|
515
520
|
},
|
|
516
521
|
innerEnums: {
|
|
@@ -569,17 +574,68 @@ function singleGroup(headingLevel, groupName, adapter, members, linkGenerator) {
|
|
|
569
574
|
};
|
|
570
575
|
}
|
|
571
576
|
|
|
577
|
+
const generateLink = (strategy) => {
|
|
578
|
+
switch (strategy) {
|
|
579
|
+
case "relative":
|
|
580
|
+
return generateRelativeLink;
|
|
581
|
+
case "no-link":
|
|
582
|
+
return generateNoLink;
|
|
583
|
+
case "none":
|
|
584
|
+
return returnReferenceAsIs;
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
const generateRelativeLink = (references, from, referenceName) => {
|
|
588
|
+
function getRelativePath(fromPath, toPath) {
|
|
589
|
+
return path.relative(path.parse(path.join("/", fromPath)).dir, path.join("/", toPath));
|
|
590
|
+
}
|
|
591
|
+
const referenceTo = references[referenceName];
|
|
592
|
+
if (!referenceTo) {
|
|
593
|
+
return referenceName;
|
|
594
|
+
}
|
|
595
|
+
if (referenceTo && from === "__base__") {
|
|
596
|
+
return {
|
|
597
|
+
__type: "link",
|
|
598
|
+
title: referenceTo.displayName,
|
|
599
|
+
url: getRelativePath("", referenceTo.referencePath)
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
const referenceFrom = references[from];
|
|
603
|
+
if (!referenceFrom) {
|
|
604
|
+
return referenceTo.displayName;
|
|
605
|
+
}
|
|
606
|
+
return {
|
|
607
|
+
__type: "link",
|
|
608
|
+
title: referenceTo.displayName,
|
|
609
|
+
url: getRelativePath(referenceFrom.referencePath, referenceTo.referencePath)
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
const generateNoLink = (references, _from, referenceName) => {
|
|
613
|
+
const referenceTo = references[referenceName];
|
|
614
|
+
return referenceTo ? referenceTo.displayName : referenceName;
|
|
615
|
+
};
|
|
616
|
+
const returnReferenceAsIs = (references, _from, referenceName) => {
|
|
617
|
+
const referenceTo = references[referenceName];
|
|
618
|
+
if (!referenceTo) {
|
|
619
|
+
return referenceName;
|
|
620
|
+
}
|
|
621
|
+
return {
|
|
622
|
+
__type: "link",
|
|
623
|
+
title: referenceTo.displayName,
|
|
624
|
+
url: referenceTo.referencePath
|
|
625
|
+
};
|
|
626
|
+
};
|
|
627
|
+
|
|
572
628
|
function parsedFilesToRenderableBundle(config, parsedFiles, references) {
|
|
573
|
-
const referenceFinder = apply(
|
|
629
|
+
const referenceFinder = apply(generateLink(config.linkingStrategy), references);
|
|
574
630
|
function toReferenceGuide(parsedFiles2) {
|
|
575
631
|
return parsedFiles2.reduce(
|
|
576
|
-
addToReferenceGuide(referenceFinder, config, references),
|
|
632
|
+
addToReferenceGuide(apply(referenceFinder, "__base__"), config, references),
|
|
577
633
|
{}
|
|
578
634
|
);
|
|
579
635
|
}
|
|
580
636
|
function toRenderables(parsedFiles2) {
|
|
581
637
|
return parsedFiles2.reduce((acc, parsedFile) => {
|
|
582
|
-
const renderable = typeToRenderable(parsedFile, referenceFinder, config);
|
|
638
|
+
const renderable = typeToRenderable(parsedFile, apply(referenceFinder, parsedFile.source.name), config);
|
|
583
639
|
acc.push(renderable);
|
|
584
640
|
return acc;
|
|
585
641
|
}, []);
|
|
@@ -604,17 +660,6 @@ function addToReferenceGuide(findLinkFromHome, config, references) {
|
|
|
604
660
|
return acc;
|
|
605
661
|
};
|
|
606
662
|
}
|
|
607
|
-
const linkGenerator = (references, documentationRootDir, referenceName) => {
|
|
608
|
-
const reference = references[referenceName];
|
|
609
|
-
return reference ? (
|
|
610
|
-
// Starting the path with a "/" will ensure the link will always be relative to the root of the site.
|
|
611
|
-
{
|
|
612
|
-
__type: "link",
|
|
613
|
-
title: reference.displayName,
|
|
614
|
-
url: path__namespace.join("/", documentationRootDir, reference.pathFromRoot)
|
|
615
|
-
}
|
|
616
|
-
) : referenceName;
|
|
617
|
-
};
|
|
618
663
|
function getTypeGroup$1(type, config) {
|
|
619
664
|
var _a, _b;
|
|
620
665
|
const groupAnnotation = (_a = type.docComment) == null ? void 0 : _a.annotations.find((annotation) => annotation.name.toLowerCase() === "group");
|
|
@@ -622,16 +667,59 @@ function getTypeGroup$1(type, config) {
|
|
|
622
667
|
}
|
|
623
668
|
|
|
624
669
|
function parseApexMetadata(input) {
|
|
625
|
-
|
|
670
|
+
return _function.pipe(input, parse, E__namespace.map(toMap));
|
|
671
|
+
}
|
|
672
|
+
function parse(input) {
|
|
673
|
+
return E__namespace.tryCatch(() => new fastXmlParser.XMLParser().parse(input), E__namespace.toError);
|
|
674
|
+
}
|
|
675
|
+
function toMap(metadata) {
|
|
626
676
|
const map = /* @__PURE__ */ new Map();
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
map.set("status", xml.ApexClass.status);
|
|
677
|
+
map.set("apiVersion", String(metadata.ApexClass.apiVersion));
|
|
678
|
+
if (metadata.ApexClass.status) {
|
|
679
|
+
map.set("status", String(metadata.ApexClass.status));
|
|
631
680
|
}
|
|
632
681
|
return map;
|
|
633
682
|
}
|
|
634
683
|
|
|
684
|
+
var __defProp$d = Object.defineProperty;
|
|
685
|
+
var __defProps$d = Object.defineProperties;
|
|
686
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
|
687
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
|
688
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
|
689
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
|
690
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
691
|
+
var __spreadValues$d = (a, b) => {
|
|
692
|
+
for (var prop in b || (b = {}))
|
|
693
|
+
if (__hasOwnProp$d.call(b, prop))
|
|
694
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
695
|
+
if (__getOwnPropSymbols$d)
|
|
696
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
|
697
|
+
if (__propIsEnum$d.call(b, prop))
|
|
698
|
+
__defNormalProp$d(a, prop, b[prop]);
|
|
699
|
+
}
|
|
700
|
+
return a;
|
|
701
|
+
};
|
|
702
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
|
703
|
+
var __async$5 = (__this, __arguments, generator) => {
|
|
704
|
+
return new Promise((resolve, reject) => {
|
|
705
|
+
var fulfilled = (value) => {
|
|
706
|
+
try {
|
|
707
|
+
step(generator.next(value));
|
|
708
|
+
} catch (e) {
|
|
709
|
+
reject(e);
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
var rejected = (value) => {
|
|
713
|
+
try {
|
|
714
|
+
step(generator.throw(value));
|
|
715
|
+
} catch (e) {
|
|
716
|
+
reject(e);
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
720
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
721
|
+
});
|
|
722
|
+
};
|
|
635
723
|
class ReflectionErrors {
|
|
636
724
|
constructor(errors) {
|
|
637
725
|
this.errors = errors;
|
|
@@ -644,59 +732,88 @@ class ReflectionError {
|
|
|
644
732
|
this.message = message;
|
|
645
733
|
}
|
|
646
734
|
}
|
|
647
|
-
function
|
|
648
|
-
function
|
|
649
|
-
return
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
return
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
735
|
+
function reflectAsync(rawSource) {
|
|
736
|
+
return __async$5(this, null, function* () {
|
|
737
|
+
return new Promise((resolve, reject) => {
|
|
738
|
+
const result = apexReflection.reflect(rawSource);
|
|
739
|
+
if (result.typeMirror) {
|
|
740
|
+
return resolve(result.typeMirror);
|
|
741
|
+
} else if (result.error) {
|
|
742
|
+
return reject(result.error);
|
|
743
|
+
} else {
|
|
744
|
+
return reject(new Error("Unknown error"));
|
|
657
745
|
}
|
|
658
|
-
);
|
|
659
|
-
}
|
|
660
|
-
return _function.pipe(
|
|
661
|
-
reflectionResult,
|
|
662
|
-
reduceReflectionResultIntoSingleEither,
|
|
663
|
-
({ errors, parsedFiles }) => errors.length ? E__namespace.left(new ReflectionErrors(errors)) : E__namespace.right(parsedFiles)
|
|
664
|
-
);
|
|
746
|
+
});
|
|
747
|
+
});
|
|
665
748
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
749
|
+
function reflectBundles(apexBundles) {
|
|
750
|
+
const semiGroupReflectionError = {
|
|
751
|
+
concat: (x, y) => new ReflectionErrors([...x.errors, ...y.errors])
|
|
752
|
+
};
|
|
753
|
+
const Ap = TE__namespace.getApplicativeTaskValidation(T__namespace.ApplyPar, semiGroupReflectionError);
|
|
754
|
+
return _function.pipe(apexBundles, A__namespace.traverse(Ap)(reflectBundle));
|
|
755
|
+
}
|
|
756
|
+
function reflectBundle(apexBundle) {
|
|
757
|
+
const convertToParsedFile = apply(toParsedFile, apexBundle.filePath);
|
|
758
|
+
const withMetadata = apply(addMetadata, apexBundle.metadataContent);
|
|
759
|
+
return _function.pipe(apexBundle, reflectAsTask, TE__namespace.map(convertToParsedFile), TE__namespace.flatMap(withMetadata));
|
|
760
|
+
}
|
|
761
|
+
function reflectAsTask(apexBundle) {
|
|
762
|
+
return TE__namespace.tryCatch(
|
|
763
|
+
() => reflectAsync(apexBundle.content),
|
|
764
|
+
(error) => new ReflectionErrors([new ReflectionError(apexBundle.filePath, error.message)])
|
|
765
|
+
);
|
|
669
766
|
}
|
|
670
|
-
function
|
|
671
|
-
|
|
672
|
-
const result = apexReflection.reflect(input);
|
|
673
|
-
return result.error ? E__namespace.left(new ReflectionError(filePath, result.error.message)) : E__namespace.right({
|
|
767
|
+
function toParsedFile(filePath, typeMirror) {
|
|
768
|
+
return {
|
|
674
769
|
source: {
|
|
675
770
|
filePath,
|
|
676
|
-
name:
|
|
677
|
-
type:
|
|
771
|
+
name: typeMirror.name,
|
|
772
|
+
type: typeMirror.type_name
|
|
678
773
|
},
|
|
679
|
-
type:
|
|
680
|
-
}
|
|
774
|
+
type: typeMirror
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
function addMetadata(rawMetadataContent, parsedFile) {
|
|
778
|
+
return TE__namespace.fromEither(
|
|
779
|
+
_function.pipe(
|
|
780
|
+
parsedFile.type,
|
|
781
|
+
(type) => addFileMetadataToTypeAnnotation(type, rawMetadataContent),
|
|
782
|
+
E__namespace.map((type) => __spreadProps$d(__spreadValues$d({}, parsedFile), { type })),
|
|
783
|
+
E__namespace.mapLeft((error) => errorToReflectionErrors(error, parsedFile.source.filePath))
|
|
784
|
+
)
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
function errorToReflectionErrors(error, filePath) {
|
|
788
|
+
return new ReflectionErrors([new ReflectionError(filePath, error.message)]);
|
|
681
789
|
}
|
|
682
790
|
function addFileMetadataToTypeAnnotation(type, metadata) {
|
|
791
|
+
const concatAnnotationToType = apply(concatAnnotations, type);
|
|
683
792
|
return _function.pipe(
|
|
684
793
|
O__namespace.fromNullable(metadata),
|
|
685
|
-
O__namespace.map(
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}),
|
|
697
|
-
O__namespace.getOrElse(() => type)
|
|
794
|
+
O__namespace.map(concatAnnotationToType),
|
|
795
|
+
O__namespace.getOrElse(() => E__namespace.right(type))
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
function concatAnnotations(type, metadataInput) {
|
|
799
|
+
return _function.pipe(
|
|
800
|
+
metadataInput,
|
|
801
|
+
parseApexMetadata,
|
|
802
|
+
E__namespace.map((metadataMap) => __spreadProps$d(__spreadValues$d({}, type), {
|
|
803
|
+
annotations: [...type.annotations, ...mapToAnnotations(metadataMap)]
|
|
804
|
+
}))
|
|
698
805
|
);
|
|
699
806
|
}
|
|
807
|
+
function mapToAnnotations(metadata) {
|
|
808
|
+
return Array.from(metadata.entries()).map(([key, value]) => {
|
|
809
|
+
const declaration = `${key}: ${value}`;
|
|
810
|
+
return {
|
|
811
|
+
name: declaration,
|
|
812
|
+
type: declaration,
|
|
813
|
+
rawDeclaration: declaration
|
|
814
|
+
};
|
|
815
|
+
});
|
|
816
|
+
}
|
|
700
817
|
|
|
701
818
|
function createInheritanceChain(repository, classMirror) {
|
|
702
819
|
return _function.pipe(
|
|
@@ -1198,7 +1315,7 @@ const convertToDocumentationBundle = (referenceGuideTemplate, { referencesByGrou
|
|
|
1198
1315
|
referenceGuide: {
|
|
1199
1316
|
frontmatter: null,
|
|
1200
1317
|
content: referencesToReferenceGuideContent(referencesByGroup, referenceGuideTemplate),
|
|
1201
|
-
|
|
1318
|
+
outputDocPath: "index.md"
|
|
1202
1319
|
},
|
|
1203
1320
|
docs: renderables.map(
|
|
1204
1321
|
(renderable) => renderableToPageData(Object.values(referencesByGroup).flat(), renderable)
|
|
@@ -1232,7 +1349,7 @@ function renderableToPageData(referenceGuideReference, renderable) {
|
|
|
1232
1349
|
name: renderable2.name,
|
|
1233
1350
|
type: renderable2.type
|
|
1234
1351
|
},
|
|
1235
|
-
|
|
1352
|
+
outputDocPath: reference.reference.outputDocPath,
|
|
1236
1353
|
frontmatter: null,
|
|
1237
1354
|
content: docContents,
|
|
1238
1355
|
group: (_a = renderable2.doc.group) != null ? _a : defaults.defaults.defaultGroupName
|
|
@@ -1450,10 +1567,12 @@ function parsedFilesToReferenceGuide(config, parsedFiles) {
|
|
|
1450
1567
|
}, {});
|
|
1451
1568
|
}
|
|
1452
1569
|
function parsedFileToDocPageReference(config, parsedFile) {
|
|
1570
|
+
const path = `${slugify(getTypeGroup(parsedFile.type, config))}/${parsedFile.type.name}.md`;
|
|
1453
1571
|
return {
|
|
1454
1572
|
source: parsedFile.source,
|
|
1455
1573
|
displayName: parsedFile.type.name,
|
|
1456
|
-
|
|
1574
|
+
outputDocPath: path,
|
|
1575
|
+
referencePath: path
|
|
1457
1576
|
};
|
|
1458
1577
|
}
|
|
1459
1578
|
function getTypeGroup(type, config) {
|
|
@@ -1484,7 +1603,7 @@ var __spreadValues$7 = (a, b) => {
|
|
|
1484
1603
|
return a;
|
|
1485
1604
|
};
|
|
1486
1605
|
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
|
1487
|
-
var __async$
|
|
1606
|
+
var __async$4 = (__this, __arguments, generator) => {
|
|
1488
1607
|
return new Promise((resolve, reject) => {
|
|
1489
1608
|
var fulfilled = (value) => {
|
|
1490
1609
|
try {
|
|
@@ -1518,15 +1637,13 @@ function generateDocs(apexBundles, config) {
|
|
|
1518
1637
|
const sortTypeMembers = apply(sortMembers, config.sortMembersAlphabetically);
|
|
1519
1638
|
return _function.pipe(
|
|
1520
1639
|
apexBundles,
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
E__namespace.bind("references", ({ parsedFiles }) => E__namespace.right(convertToReferences(parsedFiles))),
|
|
1529
|
-
TE__namespace.fromEither,
|
|
1640
|
+
reflectBundles,
|
|
1641
|
+
TE__namespace.map(filterOutOfScope),
|
|
1642
|
+
TE__namespace.map(addInheritedMembersToTypes),
|
|
1643
|
+
TE__namespace.map(addInheritanceChainToTypes),
|
|
1644
|
+
TE__namespace.map(sortTypeMembers),
|
|
1645
|
+
TE__namespace.bindTo("parsedFiles"),
|
|
1646
|
+
TE__namespace.bind("references", ({ parsedFiles }) => TE__namespace.right(convertToReferences(parsedFiles))),
|
|
1530
1647
|
TE__namespace.flatMap(({ parsedFiles, references }) => transformReferenceHook(config)({ references, parsedFiles })),
|
|
1531
1648
|
TE__namespace.map(({ parsedFiles, references }) => convertToRenderableBundle(parsedFiles, references)),
|
|
1532
1649
|
TE__namespace.map(convertToDocumentationBundleForTemplate),
|
|
@@ -1536,7 +1653,7 @@ function generateDocs(apexBundles, config) {
|
|
|
1536
1653
|
}
|
|
1537
1654
|
function transformReferenceHook(config) {
|
|
1538
1655
|
function _execute(references, parsedFiles, transformReference) {
|
|
1539
|
-
return __async$
|
|
1656
|
+
return __async$4(this, null, function* () {
|
|
1540
1657
|
return {
|
|
1541
1658
|
references: yield execTransformReferenceHook(Object.values(references), transformReference),
|
|
1542
1659
|
parsedFiles
|
|
@@ -1557,8 +1674,8 @@ function transformDocumentationBundleHook(config) {
|
|
|
1557
1674
|
function passThroughHook(value) {
|
|
1558
1675
|
return value;
|
|
1559
1676
|
}
|
|
1560
|
-
const execTransformReferenceHook = (_0, ..._1) => __async$
|
|
1561
|
-
const hooked = references.map((reference) => __async$
|
|
1677
|
+
const execTransformReferenceHook = (_0, ..._1) => __async$4(void 0, [_0, ..._1], function* (references, hook = passThroughHook) {
|
|
1678
|
+
const hooked = references.map((reference) => __async$4(void 0, null, function* () {
|
|
1562
1679
|
const hookedResult = yield hook(reference);
|
|
1563
1680
|
return __spreadValues$7(__spreadValues$7({}, reference), hookedResult);
|
|
1564
1681
|
}));
|
|
@@ -1568,24 +1685,24 @@ const execTransformReferenceHook = (_0, ..._1) => __async$2(void 0, [_0, ..._1],
|
|
|
1568
1685
|
return acc;
|
|
1569
1686
|
}, {});
|
|
1570
1687
|
});
|
|
1571
|
-
const documentationBundleHook = (bundle, config) => __async$
|
|
1688
|
+
const documentationBundleHook = (bundle, config) => __async$4(void 0, null, function* () {
|
|
1572
1689
|
return {
|
|
1573
1690
|
referenceGuide: yield transformReferenceGuide(bundle.referenceGuide, config.transformReferenceGuide),
|
|
1574
1691
|
docs: yield transformDocs(bundle.docs, config.transformDocs, config.transformDocPage)
|
|
1575
1692
|
};
|
|
1576
1693
|
});
|
|
1577
|
-
const transformReferenceGuide = (_0, ..._1) => __async$
|
|
1694
|
+
const transformReferenceGuide = (_0, ..._1) => __async$4(void 0, [_0, ..._1], function* (referenceGuide, hook = passThroughHook) {
|
|
1578
1695
|
const result = yield hook(referenceGuide);
|
|
1579
1696
|
if (isSkip(result)) {
|
|
1580
1697
|
return result;
|
|
1581
1698
|
}
|
|
1582
1699
|
return __spreadValues$7(__spreadValues$7({}, referenceGuide), yield hook(referenceGuide));
|
|
1583
1700
|
});
|
|
1584
|
-
const transformDocs = (_0, ..._1) => __async$
|
|
1701
|
+
const transformDocs = (_0, ..._1) => __async$4(void 0, [_0, ..._1], function* (docs, transformDocsHook = passThroughHook, transformDocPageHook = passThroughHook) {
|
|
1585
1702
|
const transformed = yield transformDocsHook(docs);
|
|
1586
1703
|
return Promise.all(transformed.map((doc) => transformDocPage(doc, transformDocPageHook)));
|
|
1587
1704
|
});
|
|
1588
|
-
const transformDocPage = (_0, ..._1) => __async$
|
|
1705
|
+
const transformDocPage = (_0, ..._1) => __async$4(void 0, [_0, ..._1], function* (doc, hook = passThroughHook) {
|
|
1589
1706
|
return __spreadValues$7(__spreadValues$7({}, doc), yield hook(doc));
|
|
1590
1707
|
});
|
|
1591
1708
|
function postHookCompile(bundle) {
|
|
@@ -1623,6 +1740,21 @@ ${yamlString}---
|
|
|
1623
1740
|
`;
|
|
1624
1741
|
}
|
|
1625
1742
|
|
|
1743
|
+
const referenceGuideTemplate = `
|
|
1744
|
+
# Apex Reference Guide
|
|
1745
|
+
|
|
1746
|
+
{{#each this}}
|
|
1747
|
+
## {{@key}}
|
|
1748
|
+
|
|
1749
|
+
{{#each this}}
|
|
1750
|
+
### {{link title}}
|
|
1751
|
+
|
|
1752
|
+
{{{renderContent description}}}
|
|
1753
|
+
|
|
1754
|
+
{{/each}}
|
|
1755
|
+
{{/each}}
|
|
1756
|
+
`.trim();
|
|
1757
|
+
|
|
1626
1758
|
var __defProp$6 = Object.defineProperty;
|
|
1627
1759
|
var __defProps$6 = Object.defineProperties;
|
|
1628
1760
|
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
@@ -1642,85 +1774,30 @@ var __spreadValues$6 = (a, b) => {
|
|
|
1642
1774
|
return a;
|
|
1643
1775
|
};
|
|
1644
1776
|
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
});
|
|
1653
|
-
}
|
|
1654
|
-
static getTargetLocation(file, outputDir) {
|
|
1655
|
-
return __spreadProps$6(__spreadValues$6({}, file), {
|
|
1656
|
-
filePath: path__namespace.join(outputDir, file.filePath)
|
|
1657
|
-
});
|
|
1658
|
-
}
|
|
1777
|
+
const mkdir = TE__namespace$1.taskify(fs__namespace.mkdir);
|
|
1778
|
+
const writeFile = TE__namespace$1.taskify(fs__namespace.writeFile);
|
|
1779
|
+
function writeFiles(files, outputDir, onWriteCallback) {
|
|
1780
|
+
return _function.pipe(
|
|
1781
|
+
files,
|
|
1782
|
+
TE__namespace$1.traverseArray((file) => writeSingle(file, outputDir, onWriteCallback))
|
|
1783
|
+
);
|
|
1659
1784
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
* @param message The error message to log.
|
|
1676
|
-
* @param args Optional arguments.
|
|
1677
|
-
*/
|
|
1678
|
-
static error(message, ...args) {
|
|
1679
|
-
this.logSingle(message, false, "red", false);
|
|
1680
|
-
args.forEach(() => {
|
|
1681
|
-
this.logSingle(message, false, "red", false);
|
|
1682
|
-
});
|
|
1683
|
-
}
|
|
1684
|
-
static logSingle(text, showSpinner = true, color = "green", overrideConsole = true) {
|
|
1685
|
-
if (this.currentFrame > 9) {
|
|
1686
|
-
this.currentFrame = 0;
|
|
1687
|
-
}
|
|
1688
|
-
const spinner = showSpinner ? `${this.frames[this.currentFrame++]}` : "";
|
|
1689
|
-
let logMessage;
|
|
1690
|
-
if (color === "green") {
|
|
1691
|
-
logMessage = `${chalk.green((/* @__PURE__ */ new Date()).toLocaleString() + ": ")}${text}
|
|
1692
|
-
`;
|
|
1693
|
-
} else {
|
|
1694
|
-
logMessage = `${chalk.red((/* @__PURE__ */ new Date()).toLocaleString() + ": ")}${text}
|
|
1695
|
-
`;
|
|
1696
|
-
}
|
|
1697
|
-
if (overrideConsole) {
|
|
1698
|
-
logUpdate(`${spinner} ${logMessage}`);
|
|
1699
|
-
} else {
|
|
1700
|
-
process.stdout.write(`${spinner} ${logMessage}`);
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
static clear() {
|
|
1704
|
-
logUpdate.clear();
|
|
1705
|
-
}
|
|
1785
|
+
function writeSingle(file, outputDir, onWriteCallback) {
|
|
1786
|
+
const ensureDirectoryExists = ({ outputDocPath }) => mkdir(path__namespace.dirname(outputDocPath), { recursive: true });
|
|
1787
|
+
const writeContents = (file2) => writeFile(file2.outputDocPath, file2.content, "utf8");
|
|
1788
|
+
return _function.pipe(
|
|
1789
|
+
resolveTargetLocation(file, outputDir),
|
|
1790
|
+
(file2) => TE__namespace$1.right(file2),
|
|
1791
|
+
TE__namespace$1.tapIO(ensureDirectoryExists),
|
|
1792
|
+
TE__namespace$1.flatMap(writeContents),
|
|
1793
|
+
TE__namespace$1.map(() => onWriteCallback == null ? void 0 : onWriteCallback(file))
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
function resolveTargetLocation(file, outputDir) {
|
|
1797
|
+
return __spreadProps$6(__spreadValues$6({}, file), {
|
|
1798
|
+
outputDocPath: path__namespace.join(outputDir, file.outputDocPath)
|
|
1799
|
+
});
|
|
1706
1800
|
}
|
|
1707
|
-
Logger.currentFrame = 0;
|
|
1708
|
-
Logger.frames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
1709
|
-
|
|
1710
|
-
const referenceGuideTemplate = `
|
|
1711
|
-
# Apex Reference Guide
|
|
1712
|
-
|
|
1713
|
-
{{#each this}}
|
|
1714
|
-
## {{@key}}
|
|
1715
|
-
|
|
1716
|
-
{{#each this}}
|
|
1717
|
-
### {{link title}}
|
|
1718
|
-
|
|
1719
|
-
{{{renderContent description}}}
|
|
1720
|
-
|
|
1721
|
-
{{/each}}
|
|
1722
|
-
{{/each}}
|
|
1723
|
-
`.trim();
|
|
1724
1801
|
|
|
1725
1802
|
var __defProp$5 = Object.defineProperty;
|
|
1726
1803
|
var __defProps$5 = Object.defineProperties;
|
|
@@ -1741,23 +1818,18 @@ var __spreadValues$5 = (a, b) => {
|
|
|
1741
1818
|
return a;
|
|
1742
1819
|
};
|
|
1743
1820
|
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
1821
|
+
class FileWritingError {
|
|
1822
|
+
constructor(message, error) {
|
|
1823
|
+
this.message = message;
|
|
1824
|
+
this.error = error;
|
|
1825
|
+
this._tag = "FileWritingError";
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1744
1828
|
function generate(bundles, config) {
|
|
1745
1829
|
return _function.pipe(
|
|
1746
1830
|
generateDocumentationBundle(bundles, config),
|
|
1747
|
-
TE__namespace.
|
|
1748
|
-
|
|
1749
|
-
if (error._tag === "HookError") {
|
|
1750
|
-
Logger.error("Error(s) occurred while processing hooks. Please review the following issues:");
|
|
1751
|
-
Logger.error(error.error);
|
|
1752
|
-
return;
|
|
1753
|
-
}
|
|
1754
|
-
const errorMessages = [
|
|
1755
|
-
"Error(s) occurred while parsing files. Please review the following issues:",
|
|
1756
|
-
...error.errors.map(formatReflectionError)
|
|
1757
|
-
].join("\n");
|
|
1758
|
-
Logger.error(errorMessages);
|
|
1759
|
-
})
|
|
1760
|
-
)();
|
|
1831
|
+
TE__namespace.flatMap((files) => writeFilesToSystem(files, config.targetDir))
|
|
1832
|
+
);
|
|
1761
1833
|
}
|
|
1762
1834
|
function generateDocumentationBundle(bundles, config) {
|
|
1763
1835
|
return generateDocs(bundles, __spreadProps$5(__spreadValues$5({}, config), {
|
|
@@ -1765,24 +1837,56 @@ function generateDocumentationBundle(bundles, config) {
|
|
|
1765
1837
|
}));
|
|
1766
1838
|
}
|
|
1767
1839
|
function writeFilesToSystem(files, outputDir) {
|
|
1768
|
-
|
|
1840
|
+
return _function.pipe(
|
|
1769
1841
|
[files.referenceGuide, ...files.docs].filter((file) => !isSkip(file)),
|
|
1770
|
-
outputDir,
|
|
1771
|
-
(
|
|
1772
|
-
|
|
1773
|
-
}
|
|
1842
|
+
(files2) => writeFiles(files2, outputDir),
|
|
1843
|
+
TE__namespace.mapLeft((error) => {
|
|
1844
|
+
return new FileWritingError("An error occurred while writing files to the system.", error);
|
|
1845
|
+
})
|
|
1774
1846
|
);
|
|
1775
1847
|
}
|
|
1776
|
-
function formatReflectionError(error) {
|
|
1777
|
-
return `Source file: ${error.file}
|
|
1778
|
-
${error.message}
|
|
1779
|
-
`;
|
|
1780
|
-
}
|
|
1781
1848
|
|
|
1782
1849
|
function createManifest(typeParser, reflect) {
|
|
1783
1850
|
return new Manifest(typeParser.parse(reflect));
|
|
1784
1851
|
}
|
|
1785
1852
|
|
|
1853
|
+
class Logger {
|
|
1854
|
+
/**
|
|
1855
|
+
* Logs a message with optional arguments.
|
|
1856
|
+
* @param message The message to log.
|
|
1857
|
+
* @param args Optional arguments.
|
|
1858
|
+
*/
|
|
1859
|
+
static log(message, ...args) {
|
|
1860
|
+
this.logSingle(message);
|
|
1861
|
+
args.forEach((arg) => {
|
|
1862
|
+
this.logSingle(arg);
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Logs an error message with optional arguments.
|
|
1867
|
+
* @param message The error message to log.
|
|
1868
|
+
* @param args Optional arguments.
|
|
1869
|
+
*/
|
|
1870
|
+
static error(message, ...args) {
|
|
1871
|
+
this.logSingle(message, "red");
|
|
1872
|
+
args.forEach(() => {
|
|
1873
|
+
this.logSingle(message, "red");
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
static logSingle(text, color = "green") {
|
|
1877
|
+
if (this.currentFrame > 9) {
|
|
1878
|
+
this.currentFrame = 0;
|
|
1879
|
+
}
|
|
1880
|
+
const logMessage = `${this.getChalkFn(color)((/* @__PURE__ */ new Date()).toLocaleString() + ": ")}${text}
|
|
1881
|
+
`;
|
|
1882
|
+
process.stdout.write(logMessage);
|
|
1883
|
+
}
|
|
1884
|
+
static getChalkFn(color) {
|
|
1885
|
+
return color === "green" ? chalk.green : chalk.red;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
Logger.currentFrame = 0;
|
|
1889
|
+
|
|
1786
1890
|
var __defProp$4 = Object.defineProperty;
|
|
1787
1891
|
var __defProps$4 = Object.defineProperties;
|
|
1788
1892
|
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
@@ -1809,20 +1913,7 @@ class RawBodyParser {
|
|
|
1809
1913
|
parse(reflect) {
|
|
1810
1914
|
const types = this.typeBundles.map((currentBundle) => {
|
|
1811
1915
|
Logger.log(`Parsing file: ${currentBundle.filePath}`);
|
|
1812
|
-
|
|
1813
|
-
if (!!result.typeMirror && !!currentBundle.metadataContent) {
|
|
1814
|
-
const metadataParams = parseApexMetadata(currentBundle.metadataContent);
|
|
1815
|
-
metadataParams.forEach((value, key) => {
|
|
1816
|
-
var _a;
|
|
1817
|
-
const declaration = `${key}: ${value}`;
|
|
1818
|
-
(_a = result.typeMirror) == null ? void 0 : _a.annotations.push({
|
|
1819
|
-
rawDeclaration: declaration,
|
|
1820
|
-
name: declaration,
|
|
1821
|
-
type: declaration
|
|
1822
|
-
});
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
return result;
|
|
1916
|
+
return reflect(currentBundle);
|
|
1826
1917
|
}).filter((reflectionResult) => {
|
|
1827
1918
|
return reflectionResult.typeMirror;
|
|
1828
1919
|
}).map((reflectionResult) => reflectionResult.typeMirror);
|
|
@@ -2654,7 +2745,7 @@ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
|
2654
2745
|
function createOpenApiFile(fileName, openApiModel) {
|
|
2655
2746
|
const content = JSON.stringify(__spreadProps$1(__spreadValues$1({}, openApiModel), { namespace: void 0 }), null, 2);
|
|
2656
2747
|
return {
|
|
2657
|
-
|
|
2748
|
+
outputDocPath: "",
|
|
2658
2749
|
content,
|
|
2659
2750
|
frontmatter: null,
|
|
2660
2751
|
group: null
|
|
@@ -2679,7 +2770,7 @@ class OpenApiDocsProcessor {
|
|
|
2679
2770
|
}
|
|
2680
2771
|
onProcess(type) {
|
|
2681
2772
|
var _a, _b;
|
|
2682
|
-
Logger.logSingle(`Processing ${type.name}`,
|
|
2773
|
+
Logger.logSingle(`Processing ${type.name}`, "green");
|
|
2683
2774
|
const endpointPath = this.getEndpointPath(type);
|
|
2684
2775
|
if (!endpointPath) {
|
|
2685
2776
|
return;
|
|
@@ -2726,9 +2817,12 @@ function openApi(fileBodies, config) {
|
|
|
2726
2817
|
const processor = new OpenApiDocsProcessor();
|
|
2727
2818
|
Transpiler.generate(filteredTypes, processor);
|
|
2728
2819
|
const generatedFiles = processor.fileBuilder().files();
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2820
|
+
_function.pipe(
|
|
2821
|
+
writeFiles(generatedFiles, config.targetDir, (file) => {
|
|
2822
|
+
Logger.logSingle(`${file.outputDocPath} processed.`, "green");
|
|
2823
|
+
}),
|
|
2824
|
+
TE__namespace.mapError((error) => Logger.error(error))
|
|
2825
|
+
);
|
|
2732
2826
|
ErrorLogger.logErrors(filteredTypes);
|
|
2733
2827
|
}
|
|
2734
2828
|
function reflectionWithLogger(apexBundle) {
|
|
@@ -2749,53 +2843,139 @@ function filterByScopes(manifest) {
|
|
|
2749
2843
|
"httpput"
|
|
2750
2844
|
]);
|
|
2751
2845
|
const filteredLogMessage = `Filtered ${manifest.types.length - filteredTypes.length} file(s), only keeping classes annotated as @RestResource.`;
|
|
2752
|
-
Logger.
|
|
2753
|
-
Logger.logSingle(
|
|
2754
|
-
Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, false, "green", false);
|
|
2846
|
+
Logger.logSingle(filteredLogMessage, "green");
|
|
2847
|
+
Logger.logSingle(`Creating documentation for ${filteredTypes.length} file(s)`, "green");
|
|
2755
2848
|
return filteredTypes;
|
|
2756
2849
|
}
|
|
2757
2850
|
|
|
2851
|
+
var __async$3 = (__this, __arguments, generator) => {
|
|
2852
|
+
return new Promise((resolve, reject) => {
|
|
2853
|
+
var fulfilled = (value) => {
|
|
2854
|
+
try {
|
|
2855
|
+
step(generator.next(value));
|
|
2856
|
+
} catch (e) {
|
|
2857
|
+
reject(e);
|
|
2858
|
+
}
|
|
2859
|
+
};
|
|
2860
|
+
var rejected = (value) => {
|
|
2861
|
+
try {
|
|
2862
|
+
step(generator.throw(value));
|
|
2863
|
+
} catch (e) {
|
|
2864
|
+
reject(e);
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2868
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
2869
|
+
});
|
|
2870
|
+
};
|
|
2758
2871
|
const APEX_FILE_EXTENSION = ".cls";
|
|
2759
2872
|
class ApexFileReader {
|
|
2760
2873
|
/**
|
|
2761
2874
|
* Reads from .cls files and returns their raw body.
|
|
2762
2875
|
*/
|
|
2763
2876
|
static processFiles(fileSystem, rootPath, includeMetadata) {
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2877
|
+
return __async$3(this, null, function* () {
|
|
2878
|
+
const filePaths = yield this.getFilePaths(fileSystem, rootPath);
|
|
2879
|
+
const apexFilePaths = filePaths.filter((filePath) => this.isApexFile(filePath));
|
|
2880
|
+
const filePromises = apexFilePaths.map((filePath) => this.processFile(fileSystem, filePath, includeMetadata));
|
|
2881
|
+
return Promise.all(filePromises);
|
|
2882
|
+
});
|
|
2883
|
+
}
|
|
2884
|
+
static getFilePaths(fileSystem, rootPath) {
|
|
2885
|
+
return __async$3(this, null, function* () {
|
|
2886
|
+
const directoryContents = yield fileSystem.readDirectory(rootPath);
|
|
2887
|
+
const paths = [];
|
|
2888
|
+
for (const filePath of directoryContents) {
|
|
2889
|
+
const currentPath = fileSystem.joinPath(rootPath, filePath);
|
|
2890
|
+
if (yield fileSystem.isDirectory(currentPath)) {
|
|
2891
|
+
paths.push(...yield this.getFilePaths(fileSystem, currentPath));
|
|
2892
|
+
}
|
|
2893
|
+
paths.push(currentPath);
|
|
2773
2894
|
}
|
|
2774
|
-
|
|
2775
|
-
|
|
2895
|
+
return paths;
|
|
2896
|
+
});
|
|
2897
|
+
}
|
|
2898
|
+
static processFile(fileSystem, filePath, includeMetadata) {
|
|
2899
|
+
return __async$3(this, null, function* () {
|
|
2900
|
+
const rawTypeContent = yield fileSystem.readFile(filePath);
|
|
2901
|
+
const metadataPath = `${filePath}-meta.xml`;
|
|
2776
2902
|
let rawMetadataContent = null;
|
|
2777
2903
|
if (includeMetadata) {
|
|
2778
|
-
rawMetadataContent = fileSystem.exists(metadataPath) ? fileSystem.readFile(metadataPath) : null;
|
|
2904
|
+
rawMetadataContent = fileSystem.exists(metadataPath) ? yield fileSystem.readFile(metadataPath) : null;
|
|
2779
2905
|
}
|
|
2780
|
-
|
|
2906
|
+
return { filePath, content: rawTypeContent, metadataContent: rawMetadataContent };
|
|
2781
2907
|
});
|
|
2782
|
-
return bundles;
|
|
2783
2908
|
}
|
|
2784
2909
|
static isApexFile(currentFile) {
|
|
2785
2910
|
return currentFile.endsWith(APEX_FILE_EXTENSION);
|
|
2786
2911
|
}
|
|
2787
2912
|
}
|
|
2788
2913
|
|
|
2914
|
+
var __async$2 = (__this, __arguments, generator) => {
|
|
2915
|
+
return new Promise((resolve, reject) => {
|
|
2916
|
+
var fulfilled = (value) => {
|
|
2917
|
+
try {
|
|
2918
|
+
step(generator.next(value));
|
|
2919
|
+
} catch (e) {
|
|
2920
|
+
reject(e);
|
|
2921
|
+
}
|
|
2922
|
+
};
|
|
2923
|
+
var rejected = (value) => {
|
|
2924
|
+
try {
|
|
2925
|
+
step(generator.throw(value));
|
|
2926
|
+
} catch (e) {
|
|
2927
|
+
reject(e);
|
|
2928
|
+
}
|
|
2929
|
+
};
|
|
2930
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2931
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
2932
|
+
});
|
|
2933
|
+
};
|
|
2934
|
+
function stat(path2) {
|
|
2935
|
+
return new Promise((resolve, reject) => {
|
|
2936
|
+
fs__namespace.stat(path2, (err, stats) => {
|
|
2937
|
+
if (err) {
|
|
2938
|
+
reject(err);
|
|
2939
|
+
} else {
|
|
2940
|
+
resolve(stats);
|
|
2941
|
+
}
|
|
2942
|
+
});
|
|
2943
|
+
});
|
|
2944
|
+
}
|
|
2945
|
+
function readdir(path2) {
|
|
2946
|
+
return new Promise((resolve, reject) => {
|
|
2947
|
+
fs__namespace.readdir(path2, (err, files) => {
|
|
2948
|
+
if (err) {
|
|
2949
|
+
reject(err);
|
|
2950
|
+
} else {
|
|
2951
|
+
resolve(files);
|
|
2952
|
+
}
|
|
2953
|
+
});
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
function readFile(path2) {
|
|
2957
|
+
return new Promise((resolve, reject) => {
|
|
2958
|
+
fs__namespace.readFile(path2, (err, data) => {
|
|
2959
|
+
if (err) {
|
|
2960
|
+
reject(err);
|
|
2961
|
+
} else {
|
|
2962
|
+
resolve(data.toString());
|
|
2963
|
+
}
|
|
2964
|
+
});
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2789
2967
|
class DefaultFileSystem {
|
|
2790
2968
|
isDirectory(pathToRead) {
|
|
2791
|
-
return
|
|
2969
|
+
return __async$2(this, null, function* () {
|
|
2970
|
+
const stats = yield stat(pathToRead);
|
|
2971
|
+
return stats.isDirectory();
|
|
2972
|
+
});
|
|
2792
2973
|
}
|
|
2793
2974
|
readDirectory(sourceDirectory) {
|
|
2794
|
-
return
|
|
2975
|
+
return readdir(sourceDirectory);
|
|
2795
2976
|
}
|
|
2796
2977
|
readFile(pathToRead) {
|
|
2797
|
-
|
|
2798
|
-
return rawFile.toString();
|
|
2978
|
+
return readFile(pathToRead);
|
|
2799
2979
|
}
|
|
2800
2980
|
joinPath(...paths) {
|
|
2801
2981
|
return path__namespace.join(...paths);
|
|
@@ -2831,19 +3011,56 @@ class Apexdocs {
|
|
|
2831
3011
|
*/
|
|
2832
3012
|
static generate(config) {
|
|
2833
3013
|
return __async$1(this, null, function* () {
|
|
2834
|
-
Logger.logSingle(
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
3014
|
+
Logger.logSingle(`Generating ${config.targetGenerator} documentation...`);
|
|
3015
|
+
try {
|
|
3016
|
+
const fileBodies = yield ApexFileReader.processFiles(
|
|
3017
|
+
new DefaultFileSystem(),
|
|
3018
|
+
config.sourceDir,
|
|
3019
|
+
config.includeMetadata
|
|
3020
|
+
);
|
|
3021
|
+
switch (config.targetGenerator) {
|
|
3022
|
+
case "markdown":
|
|
3023
|
+
yield generateMarkdownDocumentation(fileBodies, config)();
|
|
3024
|
+
break;
|
|
3025
|
+
case "openapi":
|
|
3026
|
+
openApi(fileBodies, config);
|
|
3027
|
+
Logger.logSingle("\u2714\uFE0F Documentation generated successfully!");
|
|
3028
|
+
break;
|
|
3029
|
+
}
|
|
3030
|
+
} catch (error) {
|
|
3031
|
+
Logger.logSingle(`\u274C An error occurred while generating the documentation: ${error}`, "red");
|
|
2843
3032
|
}
|
|
2844
3033
|
});
|
|
2845
3034
|
}
|
|
2846
3035
|
}
|
|
3036
|
+
function generateMarkdownDocumentation(fileBodies, config) {
|
|
3037
|
+
return _function.pipe(
|
|
3038
|
+
generate(fileBodies, config),
|
|
3039
|
+
TE__namespace.map(() => Logger.logSingle("\u2714\uFE0F Documentation generated successfully!")),
|
|
3040
|
+
TE__namespace.mapLeft((error) => {
|
|
3041
|
+
if (error._tag === "HookError") {
|
|
3042
|
+
Logger.error("Error(s) occurred while processing hooks. Please review the following issues:");
|
|
3043
|
+
Logger.error(error.error);
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
if (error._tag === "FileWritingError") {
|
|
3047
|
+
Logger.error(error.message);
|
|
3048
|
+
Logger.error(error.error);
|
|
3049
|
+
return;
|
|
3050
|
+
}
|
|
3051
|
+
const errorMessages = [
|
|
3052
|
+
"Error(s) occurred while parsing files. Please review the following issues:",
|
|
3053
|
+
...error.errors.map(formatReflectionError)
|
|
3054
|
+
].join("\n");
|
|
3055
|
+
Logger.error(errorMessages);
|
|
3056
|
+
})
|
|
3057
|
+
);
|
|
3058
|
+
}
|
|
3059
|
+
function formatReflectionError(error) {
|
|
3060
|
+
return `Source file: ${error.file}
|
|
3061
|
+
${error.message}
|
|
3062
|
+
`;
|
|
3063
|
+
}
|
|
2847
3064
|
|
|
2848
3065
|
const markdownOptions = {
|
|
2849
3066
|
sourceDir: {
|
|
@@ -2884,10 +3101,11 @@ const markdownOptions = {
|
|
|
2884
3101
|
describe: "Whether to include the file's meta.xml information: Whether it is active and and the API version",
|
|
2885
3102
|
default: defaults.defaults.includeMetadata
|
|
2886
3103
|
},
|
|
2887
|
-
|
|
3104
|
+
linkingStrategy: {
|
|
2888
3105
|
type: "string",
|
|
2889
|
-
describe: "The
|
|
2890
|
-
|
|
3106
|
+
describe: "The strategy to use when linking to other documentation pages.",
|
|
3107
|
+
choices: ["relative", "no-link", "none"],
|
|
3108
|
+
default: defaults.defaults.linkingStrategy
|
|
2891
3109
|
}
|
|
2892
3110
|
};
|
|
2893
3111
|
|