@terafina/tffa-sfdx-plugin 0.1.2 → 1.0.3
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/README.md +7 -0
- package/assets/favicon.png +0 -0
- package/assets/highlight.css +68 -0
- package/assets/highlight.js +2801 -0
- package/assets/icon.png +0 -0
- package/assets/index.css +447 -0
- package/assets/index.js +411 -0
- package/assets/logo.png +0 -0
- package/assets/lunr.js +3471 -0
- package/assets/mark.js +13 -0
- package/assets/menu.js +34 -0
- package/assets/search.js +98 -0
- package/lib/apexdoc/common/apex-docs-error.d.ts +23 -0
- package/lib/apexdoc/common/apex-docs-error.js +28 -0
- package/lib/apexdoc/common/apex-docs-error.js.map +1 -0
- package/lib/apexdoc/common/array-utils.d.ts +9 -0
- package/lib/apexdoc/common/array-utils.js +36 -0
- package/lib/apexdoc/common/array-utils.js.map +1 -0
- package/lib/apexdoc/common/line-reader.d.ts +40 -0
- package/lib/apexdoc/common/line-reader.js +92 -0
- package/lib/apexdoc/common/line-reader.js.map +1 -0
- package/lib/apexdoc/common/models/apex-model.d.ts +51 -0
- package/lib/apexdoc/common/models/apex-model.js +264 -0
- package/lib/apexdoc/common/models/apex-model.js.map +1 -0
- package/lib/apexdoc/common/models/class-group.d.ts +10 -0
- package/lib/apexdoc/common/models/class-group.js +32 -0
- package/lib/apexdoc/common/models/class-group.js.map +1 -0
- package/lib/apexdoc/common/models/class-model.d.ts +38 -0
- package/lib/apexdoc/common/models/class-model.js +216 -0
- package/lib/apexdoc/common/models/class-model.js.map +1 -0
- package/lib/apexdoc/common/models/engine-config.d.ts +21 -0
- package/lib/apexdoc/common/models/engine-config.js +29 -0
- package/lib/apexdoc/common/models/engine-config.js.map +1 -0
- package/lib/apexdoc/common/models/enum-model.d.ts +15 -0
- package/lib/apexdoc/common/models/enum-model.js +47 -0
- package/lib/apexdoc/common/models/enum-model.js.map +1 -0
- package/lib/apexdoc/common/models/index.d.ts +10 -0
- package/lib/apexdoc/common/models/index.js +14 -0
- package/lib/apexdoc/common/models/index.js.map +1 -0
- package/lib/apexdoc/common/models/method-model.d.ts +26 -0
- package/lib/apexdoc/common/models/method-model.js +309 -0
- package/lib/apexdoc/common/models/method-model.js.map +1 -0
- package/lib/apexdoc/common/models/property-model.d.ts +12 -0
- package/lib/apexdoc/common/models/property-model.js +47 -0
- package/lib/apexdoc/common/models/property-model.js.map +1 -0
- package/lib/apexdoc/common/models/top-level-model.d.ts +19 -0
- package/lib/apexdoc/common/models/top-level-model.js +32 -0
- package/lib/apexdoc/common/models/top-level-model.js.map +1 -0
- package/lib/apexdoc/common/settings.d.ts +55 -0
- package/lib/apexdoc/common/settings.js +124 -0
- package/lib/apexdoc/common/settings.js.map +1 -0
- package/lib/apexdoc/common/tags.d.ts +22 -0
- package/lib/apexdoc/common/tags.js +168 -0
- package/lib/apexdoc/common/tags.js.map +1 -0
- package/lib/apexdoc/common/utils.d.ts +38 -0
- package/lib/apexdoc/common/utils.js +198 -0
- package/lib/apexdoc/common/utils.js.map +1 -0
- package/lib/apexdoc/common/validator-engine.d.ts +24 -0
- package/lib/apexdoc/common/validator-engine.js +162 -0
- package/lib/apexdoc/common/validator-engine.js.map +1 -0
- package/lib/apexdoc/common/validator.d.ts +16 -0
- package/lib/apexdoc/common/validator.js +35 -0
- package/lib/apexdoc/common/validator.js.map +1 -0
- package/lib/apexdoc/engine/file-manager.d.ts +52 -0
- package/lib/apexdoc/engine/file-manager.js +390 -0
- package/lib/apexdoc/engine/file-manager.js.map +1 -0
- package/lib/apexdoc/engine/generators/generator-utils.d.ts +12 -0
- package/lib/apexdoc/engine/generators/generator-utils.js +100 -0
- package/lib/apexdoc/engine/generators/generator-utils.js.map +1 -0
- package/lib/apexdoc/engine/generators/menu-generator.d.ts +9 -0
- package/lib/apexdoc/engine/generators/menu-generator.js +81 -0
- package/lib/apexdoc/engine/generators/menu-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/child-enum-markup-generator.d.ts +10 -0
- package/lib/apexdoc/engine/generators/models/child-enum-markup-generator.js +65 -0
- package/lib/apexdoc/engine/generators/models/child-enum-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/class-markup-generator.d.ts +8 -0
- package/lib/apexdoc/engine/generators/models/class-markup-generator.js +49 -0
- package/lib/apexdoc/engine/generators/models/class-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/enum-markup-generator.d.ts +9 -0
- package/lib/apexdoc/engine/generators/models/enum-markup-generator.js +40 -0
- package/lib/apexdoc/engine/generators/models/enum-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/markup-generator.d.ts +27 -0
- package/lib/apexdoc/engine/generators/models/markup-generator.js +148 -0
- package/lib/apexdoc/engine/generators/models/markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/method-markup-generator.d.ts +22 -0
- package/lib/apexdoc/engine/generators/models/method-markup-generator.js +224 -0
- package/lib/apexdoc/engine/generators/models/method-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/property-markup-generator.d.ts +11 -0
- package/lib/apexdoc/engine/generators/models/property-markup-generator.js +66 -0
- package/lib/apexdoc/engine/generators/models/property-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/source-markup-generator.d.ts +10 -0
- package/lib/apexdoc/engine/generators/models/source-markup-generator.js +39 -0
- package/lib/apexdoc/engine/generators/models/source-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/models/top-level-markup-generator.d.ts +10 -0
- package/lib/apexdoc/engine/generators/models/top-level-markup-generator.js +49 -0
- package/lib/apexdoc/engine/generators/models/top-level-markup-generator.js.map +1 -0
- package/lib/apexdoc/engine/generators/see-link-generator.d.ts +20 -0
- package/lib/apexdoc/engine/generators/see-link-generator.js +183 -0
- package/lib/apexdoc/engine/generators/see-link-generator.js.map +1 -0
- package/lib/commands/tffa/apexdoc.d.ts +29 -0
- package/lib/commands/tffa/apexdoc.js +272 -0
- package/lib/commands/tffa/apexdoc.js.map +1 -0
- package/lib/commands/tffa/ping.d.ts +3 -0
- package/lib/commands/tffa/ping.js +4 -0
- package/lib/commands/tffa/ping.js.map +1 -1
- package/lib/commands/tffa/scan.d.ts +52 -0
- package/lib/commands/tffa/scan.js +348 -0
- package/lib/commands/tffa/scan.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/shared/model.d.ts +30 -0
- package/lib/shared/model.js +17 -0
- package/lib/shared/model.js.map +1 -0
- package/lib/shared/parser.d.ts +3 -0
- package/lib/shared/parser.js +101 -0
- package/lib/shared/parser.js.map +1 -0
- package/lib/shared/rules.d.ts +3 -0
- package/lib/shared/rules.js +5 -0
- package/lib/shared/rules.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +47 -25
- package/CHANGELOG.md +0 -14
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Feature = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright (c) NCR Terafina
|
|
7
|
+
**/
|
|
8
|
+
const apex_docs_error_1 = tslib_1.__importDefault(require("./apex-docs-error"));
|
|
9
|
+
const engine_config_1 = tslib_1.__importDefault(require("./models/engine-config"));
|
|
10
|
+
const validator_engine_1 = tslib_1.__importDefault(require("./validator-engine"));
|
|
11
|
+
const line_reader_1 = tslib_1.__importDefault(require("./line-reader"));
|
|
12
|
+
const fs_1 = require("fs");
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
var Feature;
|
|
15
|
+
(function (Feature) {
|
|
16
|
+
Feature[Feature["ENGINE"] = 0] = "ENGINE";
|
|
17
|
+
Feature[Feature["DOC_BLOCK"] = 1] = "DOC_BLOCK";
|
|
18
|
+
})(Feature = exports.Feature || (exports.Feature = {}));
|
|
19
|
+
class Settings {
|
|
20
|
+
/**
|
|
21
|
+
* Note that casting user provided configs as ApexDox configs
|
|
22
|
+
* can potentially result in run-time errors. The onus is on
|
|
23
|
+
* the user to ensure the correct shape of their config files,
|
|
24
|
+
* however, the app should fail loudly and gracefully if the
|
|
25
|
+
* user provides an invalid config.
|
|
26
|
+
*/
|
|
27
|
+
static getRcFile() {
|
|
28
|
+
const rcJsonPath = path_1.resolve(this.projectRoot, '.apexdoxrc');
|
|
29
|
+
let fileName = '';
|
|
30
|
+
try {
|
|
31
|
+
// .apexdoxrc (json)
|
|
32
|
+
if (fs_1.existsSync(rcJsonPath)) {
|
|
33
|
+
fileName = '.apexdoxrc';
|
|
34
|
+
const rcString = new line_reader_1.default(rcJsonPath).toString();
|
|
35
|
+
return JSON.parse(rcString);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
throw new apex_docs_error_1.default(apex_docs_error_1.default.CONFIG_PARSE_ERROR(fileName));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get user's ApexDox config and set defaults where needed.
|
|
44
|
+
* Order of preference for config files is listed below. If more than one
|
|
45
|
+
* config file is present, this is the order that will be honored by ApexDox.
|
|
46
|
+
*
|
|
47
|
+
* 3. .apexdoxrc
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
static getConfig(type) {
|
|
51
|
+
const rcConfig = this.getRcFile();
|
|
52
|
+
// getting engine config
|
|
53
|
+
if (type === Feature.ENGINE) {
|
|
54
|
+
let config;
|
|
55
|
+
if (rcConfig) {
|
|
56
|
+
config = Object.assign(Object.assign({}, new engine_config_1.default()), (rcConfig.engine || {}));
|
|
57
|
+
}
|
|
58
|
+
// pass result of either to directory defaulter and validate
|
|
59
|
+
return new validator_engine_1.default(this.setEngineDirectoryDefaults(config)).validate();
|
|
60
|
+
}
|
|
61
|
+
throw new apex_docs_error_1.default('Feature type not supported!');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Source and Target Dir default settings are dynamic and determined at runtime. If user
|
|
65
|
+
* omits these settings or provides invalid values, overwrite with default settings.
|
|
66
|
+
* @param config The `IEngineConfig` instance fetched from the user's settings.json or .apexdoxrc file.
|
|
67
|
+
*/
|
|
68
|
+
static setEngineDirectoryDefaults(config) {
|
|
69
|
+
const defaultSource = [{ path: this.getDefaultDir(this.projectRoot) }];
|
|
70
|
+
const defaultTarget = path_1.resolve(this.projectRoot, 'apex-documentation');
|
|
71
|
+
if (!config.source ||
|
|
72
|
+
(Array.isArray(config.source) && !config.source.length) ||
|
|
73
|
+
(config.source.length === 1 && !config.source[0].path)) {
|
|
74
|
+
config.source = defaultSource;
|
|
75
|
+
}
|
|
76
|
+
if (!config.targetDirectory) {
|
|
77
|
+
config.targetDirectory = defaultTarget;
|
|
78
|
+
}
|
|
79
|
+
return config;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the default source directory based on the type of project.
|
|
83
|
+
*
|
|
84
|
+
* @param projectRoot The workspace's root folder.
|
|
85
|
+
*/
|
|
86
|
+
static getDefaultDir(projectRoot) {
|
|
87
|
+
return !this.isDX(projectRoot)
|
|
88
|
+
? path_1.resolve(projectRoot, 'src', 'classes')
|
|
89
|
+
: path_1.resolve(projectRoot, 'force-app', 'main', 'default', 'classes');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Determine with reasonable certainty whether this is a DX project or not.
|
|
93
|
+
* This will help us determine what the default source directory should be.
|
|
94
|
+
*
|
|
95
|
+
* @param projectRoot The workspace's root folder.
|
|
96
|
+
*/
|
|
97
|
+
static isDX(projectRoot) {
|
|
98
|
+
if (fs_1.existsSync(path_1.resolve(projectRoot, 'force-app')) && !fs_1.existsSync(path_1.resolve(projectRoot, 'src'))) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// this should be a safe cast. If running this tool, workspace folders should always exist.
|
|
105
|
+
// private static projectRoot = (<WorkspaceFolder[]>workspace.workspaceFolders)[0].uri.fsPath;
|
|
106
|
+
Settings.projectRoot = '.';
|
|
107
|
+
// constants
|
|
108
|
+
Settings.SCOPES = ['global', 'public', 'private', 'protected', 'webservice', 'testmethod'];
|
|
109
|
+
Settings.ORDER_ALPHA = 'alpha';
|
|
110
|
+
Settings.ORDER_LOGICAL = 'logical';
|
|
111
|
+
Settings.CLASS = 'class';
|
|
112
|
+
Settings.ENUM = 'enum';
|
|
113
|
+
Settings.INTERFACE = 'interface';
|
|
114
|
+
// use special token for marking the end of a doc block
|
|
115
|
+
// comment. Now that we're supporting multi-line for all
|
|
116
|
+
// tags and using a common comment parser, the parser
|
|
117
|
+
// must know when a block ends in order to prevent weird
|
|
118
|
+
// behavior when lesser scopes than available are indicated
|
|
119
|
+
// e.g. private;public when there are protected methods
|
|
120
|
+
Settings.DOC_BLOCK_BREAK = '@@BREAK@@';
|
|
121
|
+
Settings.COMMENT_CLOSE = '*/';
|
|
122
|
+
Settings.COMMENT_OPEN = '/**';
|
|
123
|
+
exports.default = Settings;
|
|
124
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/apexdoc/common/settings.ts"],"names":[],"mappings":";;;;AAAA;;IAEI;AACJ,gFAA6C;AAC7C,mFAAkD;AAClD,kFAAiD;AACjD,wEAAuC;AACvC,2BAAgC;AAGhC,+BAA+B;AAE/B,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,yCAAM,CAAA;IACN,+CAAS,CAAA;AACX,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AAED,MAAM,QAAQ;IAyBZ;;;;;;OAMG;IACK,MAAM,CAAC,SAAS;QACtB,MAAM,UAAU,GAAG,cAAO,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAE3D,IAAI,QAAQ,GAAG,EAAE,CAAC;QAElB,IAAI;YACF,oBAAoB;YACpB,IA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qD;AACrD,wDAAwD;AACxD,2DAA2D;AAC3D,uDAAuD;AAChC,wBAAe,GAAW,WAAW,CAAC;AACtC,sBAAa,GAAW,IAAI,CAAC;AAC7B,qBAAY,GAAW,KAAK,CAAC;AAuGtD,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) NCR Terafina
|
|
3
|
+
**/
|
|
4
|
+
import { IApexDoxTag } from '..';
|
|
5
|
+
export declare const AUTHOR: IApexDoxTag;
|
|
6
|
+
export declare const SINCE: IApexDoxTag;
|
|
7
|
+
export declare const DEPRECATED: IApexDoxTag;
|
|
8
|
+
export declare const DESCRIPTION: IApexDoxTag;
|
|
9
|
+
export declare const EXAMPLE: IApexDoxTag;
|
|
10
|
+
export declare const EXCEPTION: IApexDoxTag;
|
|
11
|
+
export declare const GROUP: IApexDoxTag;
|
|
12
|
+
export declare const TAGS: IApexDoxTag;
|
|
13
|
+
export declare const GROUP_CONTENT: IApexDoxTag;
|
|
14
|
+
export declare const PARAM: IApexDoxTag;
|
|
15
|
+
export declare const QUERYPARAM: IApexDoxTag;
|
|
16
|
+
export declare const RETURN: IApexDoxTag;
|
|
17
|
+
export declare const RETURNS: IApexDoxTag;
|
|
18
|
+
export declare const SEE: IApexDoxTag;
|
|
19
|
+
export declare const APIPATH: IApexDoxTag;
|
|
20
|
+
export declare const APIMETHOD: IApexDoxTag;
|
|
21
|
+
export declare const REQUESTHEADER: IApexDoxTag;
|
|
22
|
+
export declare const RESPONSEHEADER: IApexDoxTag;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESPONSEHEADER = exports.REQUESTHEADER = exports.APIMETHOD = exports.APIPATH = exports.SEE = exports.RETURNS = exports.RETURN = exports.QUERYPARAM = exports.PARAM = exports.GROUP_CONTENT = exports.TAGS = exports.GROUP = exports.EXCEPTION = exports.EXAMPLE = exports.DESCRIPTION = exports.DEPRECATED = exports.SINCE = exports.AUTHOR = void 0;
|
|
4
|
+
exports.AUTHOR = {
|
|
5
|
+
label: '@author',
|
|
6
|
+
snippet: `author \${1:}`,
|
|
7
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
8
|
+
|
|
9
|
+
\`\`\`
|
|
10
|
+
@author [The type or method author]
|
|
11
|
+
\`\`\``
|
|
12
|
+
};
|
|
13
|
+
exports.SINCE = {
|
|
14
|
+
label: '@since',
|
|
15
|
+
snippet: `since \${1:}`,
|
|
16
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
17
|
+
|
|
18
|
+
\`\`\`
|
|
19
|
+
@since [The date the type or method was implemented]
|
|
20
|
+
\`\`\``
|
|
21
|
+
};
|
|
22
|
+
exports.DEPRECATED = {
|
|
23
|
+
label: '@deprecated',
|
|
24
|
+
snippet: `deprecated \${1:}`,
|
|
25
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
26
|
+
|
|
27
|
+
\`\`\`
|
|
28
|
+
@deprecated [The reason the type or method is deprecated & migration path]
|
|
29
|
+
\`\`\``
|
|
30
|
+
};
|
|
31
|
+
exports.DESCRIPTION = {
|
|
32
|
+
label: '@description',
|
|
33
|
+
snippet: `description \${1:}`,
|
|
34
|
+
documentation: `For: **Class**, **Interface**, **Enum**, **Method**, & **Property**
|
|
35
|
+
|
|
36
|
+
\`\`\`
|
|
37
|
+
@description [Description]
|
|
38
|
+
\`\`\``
|
|
39
|
+
};
|
|
40
|
+
exports.EXAMPLE = {
|
|
41
|
+
label: '@example',
|
|
42
|
+
snippet: `example \${1:}`,
|
|
43
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
44
|
+
|
|
45
|
+
\`\`\`
|
|
46
|
+
@example
|
|
47
|
+
[An optionally multi-line code example.
|
|
48
|
+
Starts on the line below the tag]
|
|
49
|
+
\`\`\``
|
|
50
|
+
};
|
|
51
|
+
exports.EXCEPTION = {
|
|
52
|
+
label: '@exception',
|
|
53
|
+
snippet: `exception \${1:}`,
|
|
54
|
+
documentation: `For: **Method**
|
|
55
|
+
|
|
56
|
+
\`\`\`
|
|
57
|
+
@exception [A list or description of exceptions a method throws]
|
|
58
|
+
\`\`\``
|
|
59
|
+
};
|
|
60
|
+
exports.GROUP = {
|
|
61
|
+
label: '@group ',
|
|
62
|
+
snippet: `group \${1:}`,
|
|
63
|
+
documentation: `For: Top-level **Class**, **Interface**, & **Enum**
|
|
64
|
+
|
|
65
|
+
\`\`\`
|
|
66
|
+
@group [The group the type belongs to. Used to create the docs menu, un-grouped types will go under 'Miscellaneous'.]
|
|
67
|
+
\`\`\``
|
|
68
|
+
};
|
|
69
|
+
exports.TAGS = {
|
|
70
|
+
label: '@tags ',
|
|
71
|
+
snippet: `tags \${1:}`,
|
|
72
|
+
documentation: `For: Top-level **Class**, **Interface**, & **Enum**
|
|
73
|
+
|
|
74
|
+
\`\`\`
|
|
75
|
+
@tags [The tags the type belongs to. Used to create the docs menu, un-grouped types will go under 'Miscellaneous'.]
|
|
76
|
+
\`\`\``
|
|
77
|
+
};
|
|
78
|
+
exports.GROUP_CONTENT = {
|
|
79
|
+
label: '@group-content',
|
|
80
|
+
snippet: `group-content \${1:}`,
|
|
81
|
+
documentation: `For: Top-level **Class**, **Interface**, & **Enum**
|
|
82
|
+
|
|
83
|
+
\`\`\`
|
|
84
|
+
@group-content [A file-path relative to the target directory. Should point to an HTML file that describes a class group.]
|
|
85
|
+
\`\`\``
|
|
86
|
+
};
|
|
87
|
+
exports.PARAM = {
|
|
88
|
+
label: '@param',
|
|
89
|
+
snippet: `param \${1:paramName} \${2:description}`,
|
|
90
|
+
documentation: `For: **Method**
|
|
91
|
+
|
|
92
|
+
\`\`\`
|
|
93
|
+
@param paramName [param description]
|
|
94
|
+
\`\`\``
|
|
95
|
+
};
|
|
96
|
+
exports.QUERYPARAM = {
|
|
97
|
+
label: '@queryparam',
|
|
98
|
+
snippet: `queryparam \${1:paramType} \${2:paramName} \${3:description}`,
|
|
99
|
+
documentation: `For: **Method**
|
|
100
|
+
|
|
101
|
+
\`\`\`
|
|
102
|
+
@queryparam paramName paramType [param description]
|
|
103
|
+
\`\`\``
|
|
104
|
+
};
|
|
105
|
+
exports.RETURN = {
|
|
106
|
+
label: '@return ',
|
|
107
|
+
snippet: `return \${1:}`,
|
|
108
|
+
documentation: `For: **Method**
|
|
109
|
+
|
|
110
|
+
\`\`\`
|
|
111
|
+
@return {return type} [description]
|
|
112
|
+
\`\`\``
|
|
113
|
+
};
|
|
114
|
+
exports.RETURNS = {
|
|
115
|
+
label: '@returns',
|
|
116
|
+
snippet: `returns \${1:}`,
|
|
117
|
+
documentation: `For: **Method**
|
|
118
|
+
|
|
119
|
+
\`\`\`
|
|
120
|
+
@returns {return type} [description]
|
|
121
|
+
\`\`\``
|
|
122
|
+
};
|
|
123
|
+
exports.SEE = {
|
|
124
|
+
label: '@see',
|
|
125
|
+
snippet: `see \${1:}`,
|
|
126
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
127
|
+
|
|
128
|
+
\`\`\`
|
|
129
|
+
@see [URL, Markdown URL, or Name Path]
|
|
130
|
+
\`\`\``
|
|
131
|
+
};
|
|
132
|
+
exports.APIPATH = {
|
|
133
|
+
label: '@apipath',
|
|
134
|
+
snippet: `apipath \${1:}`,
|
|
135
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
136
|
+
|
|
137
|
+
\`\`\`
|
|
138
|
+
@apipath [/]
|
|
139
|
+
\`\`\``
|
|
140
|
+
};
|
|
141
|
+
exports.APIMETHOD = {
|
|
142
|
+
label: '@apimethod',
|
|
143
|
+
snippet: `apimethod \${1:}`,
|
|
144
|
+
documentation: `For: **Class**, **Interface**, **Enum** (top level), & **Method**
|
|
145
|
+
|
|
146
|
+
\`\`\`
|
|
147
|
+
@apimethod [GET]
|
|
148
|
+
\`\`\``
|
|
149
|
+
};
|
|
150
|
+
exports.REQUESTHEADER = {
|
|
151
|
+
label: '@requestheader',
|
|
152
|
+
snippet: `requestheader \${1:paramType} \${2:paramName} \${3:description}`,
|
|
153
|
+
documentation: `For: **Method**
|
|
154
|
+
|
|
155
|
+
\`\`\`
|
|
156
|
+
@requestheader paramType paramName [param description]
|
|
157
|
+
\`\`\``
|
|
158
|
+
};
|
|
159
|
+
exports.RESPONSEHEADER = {
|
|
160
|
+
label: '@responseheader',
|
|
161
|
+
snippet: `responseheader \${1:paramType} \${2:paramName} \${3:description}`,
|
|
162
|
+
documentation: `For: **Method**
|
|
163
|
+
|
|
164
|
+
\`\`\`
|
|
165
|
+
@responseheader paramType paramName [param description]
|
|
166
|
+
\`\`\``
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../../../src/apexdoc/common/tags.ts"],"names":[],"mappings":";;;AAKa,QAAA,MAAM,GAAgB;IAC/B,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,eAAe;IACxB,aAAa,EAAE;;;;OAIZ;CACN,CAAC;AAEW,QAAA,KAAK,GAAgB;IAC9B,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,cAAc;IACvB,aAAa,EAAE;;;;OAIZ;CACN,CAAC;AAEW,QAAA,UAAU,GAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,mBAAmB;IAC5B,aAAa,EAAE;;;;OAIZ;CACN,CAAC;AAEW,QAAA,WAAW,GAAgB;IACpC,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,oBAAoB;IAC7B,aAAa,EAAE;;;;OAIZ;CACN,CAAC;AAEW,QAAA,OAAO,GAAgB;IAChC,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,gBAAgB;IACzB,aAAa,EAAE;;;;;;OAMZ;CACN,CAAC;AAEW,QAAA,SAAS,GAAgB;IAClC,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N,CAAC;AAEW,QAAA,aAAa,GAAgB;IACtC,KAAK,EAAE,gBAAgB;IACvB,OAAO,EAAE,iEAAiE;IAC1E,aAAa,EAAE;;;;OAIZ;CACN,CAAC;AAEW,QAAA,cAAc,GAAgB;IACvC,KAAK,EAAE,iBAAiB;IACxB,OAAO,EAAE,kEAAkE;IAC3E,aAAa,EAAE;;;;OAIZ;CACN,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) NCR Terafina
|
|
3
|
+
**/
|
|
4
|
+
import { ClassModel } from './models/class-model';
|
|
5
|
+
import { Option } from '..';
|
|
6
|
+
declare class Utils {
|
|
7
|
+
private static readonly PRIVATE;
|
|
8
|
+
private static readonly TEST_METHOD;
|
|
9
|
+
private static COLLECTIONS;
|
|
10
|
+
private static KEYWORDS;
|
|
11
|
+
static isClassOrInterface(line: string): boolean;
|
|
12
|
+
static isEnum(line: string): boolean;
|
|
13
|
+
static stripAnnotations(line: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Helper method to determine if a line being parsed should be skipped.
|
|
16
|
+
* Ignore lines not dealing with scope unless they start with the certain keywords:
|
|
17
|
+
* We do not want to skip @isTest classes, inner classes, inner interfaces, or inner
|
|
18
|
+
* enums defined without without explicit access modifiers. These are assumed to be
|
|
19
|
+
* private. Also, interface methods don't have scope, so don't skip those lines either.
|
|
20
|
+
*/
|
|
21
|
+
static shouldSkipLine(line: string, cModel?: ClassModel): boolean;
|
|
22
|
+
/** Can match some implicitly private methods, but not all! */
|
|
23
|
+
static getScope(line: string): Option<string, void>;
|
|
24
|
+
static previousWord(str: string, searchIdx: number): string;
|
|
25
|
+
static countChars(str: string, char: string): number;
|
|
26
|
+
static isURL(str: string): boolean;
|
|
27
|
+
static resolveWorkspaceFolder(path: string): string;
|
|
28
|
+
static escapeRegExp(str: string): string;
|
|
29
|
+
static boolGuard(bool: boolean, defaultValue: boolean): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* We use the plugin `pretty` to make the output HTML more readable. As a side effect
|
|
32
|
+
* there is whitespace between the pre and code tags which causes unwanted space in the HTML
|
|
33
|
+
* document. Here, we're removing that space so pre and code tags do not have space between them.
|
|
34
|
+
* @param html The html string to make replacements on.
|
|
35
|
+
*/
|
|
36
|
+
static preCodeTrim(html: string): string;
|
|
37
|
+
}
|
|
38
|
+
export default Utils;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const array_utils_1 = require("./array-utils");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const settings_1 = tslib_1.__importDefault(require("./settings"));
|
|
7
|
+
class Utils {
|
|
8
|
+
static isClassOrInterface(line) {
|
|
9
|
+
// Account for inner classes or @isTest classes without an access modifier; implicitly private
|
|
10
|
+
if (/.*\bclass\b.*/.test(line.toLowerCase()) || /\s?\binterface\s/i.test(line.toLowerCase())) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
static isEnum(line) {
|
|
16
|
+
line = this.stripAnnotations(line);
|
|
17
|
+
if (/^(global\s+|public\s+|private\s+)?enum\b.*/.test(line)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
static stripAnnotations(line) {
|
|
23
|
+
let i = 0;
|
|
24
|
+
while (line && line.trim().startsWith('@')) {
|
|
25
|
+
line = line.trim().replace(/@\w+\s*(\([\w=.*''/\s]+\))?/, '');
|
|
26
|
+
if (i >= 100) {
|
|
27
|
+
break; // infinite loop protect, just in case
|
|
28
|
+
}
|
|
29
|
+
i++;
|
|
30
|
+
}
|
|
31
|
+
return line;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Helper method to determine if a line being parsed should be skipped.
|
|
35
|
+
* Ignore lines not dealing with scope unless they start with the certain keywords:
|
|
36
|
+
* We do not want to skip @isTest classes, inner classes, inner interfaces, or inner
|
|
37
|
+
* enums defined without without explicit access modifiers. These are assumed to be
|
|
38
|
+
* private. Also, interface methods don't have scope, so don't skip those lines either.
|
|
39
|
+
*/
|
|
40
|
+
static shouldSkipLine(line, cModel) {
|
|
41
|
+
const classNameParts = (cModel && cModel.name.split('.')) || [''];
|
|
42
|
+
const className = array_utils_1.last(classNameParts);
|
|
43
|
+
if (!this.getScope(line) &&
|
|
44
|
+
!line.toLowerCase().startsWith(settings_1.default.ENUM + ' ') &&
|
|
45
|
+
!line.toLowerCase().startsWith(settings_1.default.CLASS + ' ') &&
|
|
46
|
+
!line.toLowerCase().startsWith(settings_1.default.INTERFACE + ' ') &&
|
|
47
|
+
// don't skip default constructors without access modifiers
|
|
48
|
+
!(cModel && new RegExp('\\b' + className + '\\s*\\(').test(line)) &&
|
|
49
|
+
// don't skip interface methods - they don't have access modifiers
|
|
50
|
+
!(cModel && cModel.isInterface && line.includes('('))) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
/** Can match some implicitly private methods, but not all! */
|
|
56
|
+
static getScope(line) {
|
|
57
|
+
for (let scope of settings_1.default.config.scope) {
|
|
58
|
+
// if line starts with annotations, replace them, so
|
|
59
|
+
// we can accurately use startsWith to match scope.
|
|
60
|
+
line = this.stripAnnotations(line).toLowerCase().trim();
|
|
61
|
+
scope = scope.toLowerCase();
|
|
62
|
+
// line starts with registered scope
|
|
63
|
+
if (line.startsWith(scope + ' ')) {
|
|
64
|
+
return scope;
|
|
65
|
+
}
|
|
66
|
+
// current scope is testmethod and our line is a test method
|
|
67
|
+
if (scope === this.TEST_METHOD && line.startsWith(`static ${this.TEST_METHOD} `)) {
|
|
68
|
+
return scope;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// try to reasonably match implicitly private lines if
|
|
72
|
+
// 'private' included in user's documentable scopes list
|
|
73
|
+
if (settings_1.default.config.scope.includes(this.PRIVATE)) {
|
|
74
|
+
// match static props or methods
|
|
75
|
+
if (line.startsWith('static ') && !line.includes(` ${this.TEST_METHOD} `)) {
|
|
76
|
+
return this.PRIVATE;
|
|
77
|
+
}
|
|
78
|
+
// match methods that start with
|
|
79
|
+
// keywords or return primitive types
|
|
80
|
+
for (const keyword of this.KEYWORDS) {
|
|
81
|
+
if (line.startsWith(keyword + ' ') && line.includes('(')) {
|
|
82
|
+
return this.PRIVATE;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// match methods that return collections
|
|
86
|
+
for (const collection of this.COLLECTIONS) {
|
|
87
|
+
if (new RegExp('^' + collection + '<.+>\\s.*').test(line) && line.includes('(')) {
|
|
88
|
+
return this.PRIVATE;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
static previousWord(str, searchIdx) {
|
|
94
|
+
if (!str) {
|
|
95
|
+
return '';
|
|
96
|
+
}
|
|
97
|
+
if (searchIdx >= str.length) {
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
let idxStart, idxEnd;
|
|
101
|
+
for (idxStart = searchIdx - 1, idxEnd = 0; idxStart > 0; idxStart--) {
|
|
102
|
+
if (idxEnd === 0) {
|
|
103
|
+
if (str.charAt(idxStart) === ' ') {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
idxEnd = idxStart + 1;
|
|
107
|
+
}
|
|
108
|
+
else if (str.charAt(idxStart) === ' ') {
|
|
109
|
+
idxStart++;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return str.substring(idxStart, idxEnd);
|
|
114
|
+
}
|
|
115
|
+
static countChars(str, char) {
|
|
116
|
+
let count = 0;
|
|
117
|
+
for (let i = 0; i < str.length; ++i) {
|
|
118
|
+
if (str.charAt(i) === char) {
|
|
119
|
+
++count;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return count;
|
|
123
|
+
}
|
|
124
|
+
static isURL(str) {
|
|
125
|
+
if (!str) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return /^(https?):\/\/[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]/.test(str.trim());
|
|
129
|
+
}
|
|
130
|
+
static resolveWorkspaceFolder(path) {
|
|
131
|
+
// should be safe to cast this as not-undefined
|
|
132
|
+
// If running this tool, workspace folders should always exist.
|
|
133
|
+
const rootFolderRe = /\$\{workspaceFolder\}(.*)?/;
|
|
134
|
+
// const multiFolderRe = /\$\{workspaceFolder:(.*)\}(.*)/;
|
|
135
|
+
if (rootFolderRe.test(path)) {
|
|
136
|
+
const results = rootFolderRe.exec(path);
|
|
137
|
+
return path_1.resolve('./', ...results[1].split(/\\|\//));
|
|
138
|
+
}
|
|
139
|
+
// else if (multiFolderRe.test(path)) {
|
|
140
|
+
// const results = <RegExpExecArray>multiFolderRe.exec(path);
|
|
141
|
+
// for (let folder of folders) {
|
|
142
|
+
// if (folder.name === results[1]) {
|
|
143
|
+
// return resolve('./', ...results[2].split(/\\|\//));
|
|
144
|
+
// }
|
|
145
|
+
// }
|
|
146
|
+
// throw new SfdxError(`Workspace variable in path '${path}' could not be resolved.`);
|
|
147
|
+
// }
|
|
148
|
+
return path;
|
|
149
|
+
}
|
|
150
|
+
static escapeRegExp(str) {
|
|
151
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
152
|
+
}
|
|
153
|
+
// common guard utility for Validator classes
|
|
154
|
+
static boolGuard(bool, defaultValue) {
|
|
155
|
+
if (typeof bool !== 'boolean') {
|
|
156
|
+
return defaultValue;
|
|
157
|
+
}
|
|
158
|
+
return bool;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* We use the plugin `pretty` to make the output HTML more readable. As a side effect
|
|
162
|
+
* there is whitespace between the pre and code tags which causes unwanted space in the HTML
|
|
163
|
+
* document. Here, we're removing that space so pre and code tags do not have space between them.
|
|
164
|
+
* @param html The html string to make replacements on.
|
|
165
|
+
*/
|
|
166
|
+
static preCodeTrim(html) {
|
|
167
|
+
if (!/<pre/.test(html)) {
|
|
168
|
+
return html;
|
|
169
|
+
}
|
|
170
|
+
html = html.replace(/<pre class="([a-z-]+)">\s+<code>/g, '<pre class="$1"><code>');
|
|
171
|
+
html = html.replace(/<\/code>\s+<\/pre>/g, '</code></pre>');
|
|
172
|
+
return html;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
Utils.PRIVATE = 'private';
|
|
176
|
+
Utils.TEST_METHOD = 'testmethod';
|
|
177
|
+
Utils.COLLECTIONS = ['list', 'set', 'map'];
|
|
178
|
+
Utils.KEYWORDS = [
|
|
179
|
+
'abstract',
|
|
180
|
+
'final',
|
|
181
|
+
'virtual',
|
|
182
|
+
'override',
|
|
183
|
+
'void',
|
|
184
|
+
'blob',
|
|
185
|
+
'boolean',
|
|
186
|
+
'date',
|
|
187
|
+
'datetime',
|
|
188
|
+
'decimal',
|
|
189
|
+
'double',
|
|
190
|
+
'id',
|
|
191
|
+
'integer',
|
|
192
|
+
'long',
|
|
193
|
+
'object',
|
|
194
|
+
'string',
|
|
195
|
+
'time'
|
|
196
|
+
];
|
|
197
|
+
exports.default = Utils;
|
|
198
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/apexdoc/common/utils.ts"],"names":[],"mappings":";;;AAIA,+CAAqC;AAErC,+BAA+B;AAC/B,kEAAkC;AAElC,MAAM,KAAK;IAwBF,MAAM,CAAC,kBAAkB,CAAC,IAAY;QAC3C,8FAA8F;QAC9F,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE;YAC5F,OAAO,IAAI,CAAC;SACb;QAED,O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AC;IACd,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,WAAW,CAAC,IAAY;QACpC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,IAAI,CAAC;SACb;QAED,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mCAAmC,EAAE,wBAAwB,CAAC,CAAC;QACnF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;;AA5NuB,aAAO,GAAW,SAAS,CAAC;AAC5B,iBAAW,GAAW,YAAY,CAAC;AAC5C,iBAAW,GAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC/C,cAAQ,GAAa;IAClC,UAAU;IACV,OAAO;IACP,SAAS;IACT,UAAU;IACV,MAAM;IACN,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,SAAS;IACT,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;CACP,CAAC;AA0MJ,kBAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Validator from './validator';
|
|
2
|
+
import { IEngineConfig } from '../index';
|
|
3
|
+
declare class ValidatorEngine extends Validator<IEngineConfig> {
|
|
4
|
+
constructor(config: IEngineConfig);
|
|
5
|
+
private includes;
|
|
6
|
+
private excludes;
|
|
7
|
+
private cleanDir;
|
|
8
|
+
private showTOCSnippets;
|
|
9
|
+
private subtitle;
|
|
10
|
+
private pages;
|
|
11
|
+
private assets;
|
|
12
|
+
private targetDirectory;
|
|
13
|
+
private homePagePath;
|
|
14
|
+
private sortOrder;
|
|
15
|
+
private title;
|
|
16
|
+
private scope;
|
|
17
|
+
private source;
|
|
18
|
+
static port(port: number): number;
|
|
19
|
+
private static directory;
|
|
20
|
+
private static sourceUrl;
|
|
21
|
+
private static stringArray;
|
|
22
|
+
private static typeGuard;
|
|
23
|
+
}
|
|
24
|
+
export default ValidatorEngine;
|