@komaci/static-analyzer 240.1.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.
Files changed (36) hide show
  1. package/build/WireGraph.d.ts +34 -0
  2. package/build/WireGraph.js +82 -0
  3. package/build/__mocks__/@babel/parser.d.ts +2 -0
  4. package/build/__mocks__/@babel/parser.js +6 -0
  5. package/build/adaptersMapping.d.ts +3 -0
  6. package/build/adaptersMapping.js +25 -0
  7. package/build/allowlistAdapters.d.ts +6 -0
  8. package/build/allowlistAdapters.js +10 -0
  9. package/build/index.d.ts +7 -0
  10. package/build/index.js +35 -0
  11. package/build/invariantFunctions/assignmentExpressionInvariantFunctions.d.ts +16 -0
  12. package/build/invariantFunctions/assignmentExpressionInvariantFunctions.js +34 -0
  13. package/build/invariantFunctions/callExpressionInvariantFunctions.d.ts +33 -0
  14. package/build/invariantFunctions/callExpressionInvariantFunctions.js +87 -0
  15. package/build/invariantFunctions/functionExpressionInvariantFunctions.d.ts +31 -0
  16. package/build/invariantFunctions/functionExpressionInvariantFunctions.js +69 -0
  17. package/build/invariantFunctions/identifierInvariantFunctions.d.ts +28 -0
  18. package/build/invariantFunctions/identifierInvariantFunctions.js +56 -0
  19. package/build/invariantFunctions/memberExpressionInvariantFunctions.d.ts +50 -0
  20. package/build/invariantFunctions/memberExpressionInvariantFunctions.js +146 -0
  21. package/build/invariantFunctions/returnStatementInvariantFunctions.d.ts +12 -0
  22. package/build/invariantFunctions/returnStatementInvariantFunctions.js +23 -0
  23. package/build/invariantFunctions/taggedTemplateExpressionInvariantFunctions.d.ts +12 -0
  24. package/build/invariantFunctions/taggedTemplateExpressionInvariantFunctions.js +25 -0
  25. package/build/komaci-mapping.json +288 -0
  26. package/build/rules.d.ts +22 -0
  27. package/build/rules.js +310 -0
  28. package/build/shared.d.ts +52 -0
  29. package/build/shared.js +184 -0
  30. package/build/staticAnalyzer.d.ts +100 -0
  31. package/build/staticAnalyzer.js +822 -0
  32. package/build/types.d.ts +102 -0
  33. package/build/types.js +3 -0
  34. package/build/validateGetter.d.ts +46 -0
  35. package/build/validateGetter.js +154 -0
  36. package/package.json +39 -0
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.checkForUnsupportedGlobalRef = exports.checkForNoUseOfSuper = exports.checkNoUsageOfDocumentOrWindow = exports.checkMemberExpressionForNonSupportedNamespaceRefs = exports.checkForNonExistentMemberRefs = exports.checkForNonSupportedMemberRefs = void 0;
23
+ const t = __importStar(require("@babel/types"));
24
+ const shared_1 = require("../shared");
25
+ const common_shared_1 = require("@komaci/common-shared");
26
+ const rules_1 = require("../rules");
27
+ /**
28
+ * Invariant function for checking if a member expression references a non decorated member var.
29
+ * @param path the babel path object for the current member expressoin
30
+ * @param memberVars a set of approved member variable names.
31
+ * @returns undefined if the member expression does NOT reference an unsupported member var, PrimingDiagnostic object if an unsuppported
32
+ * member variable is referenced
33
+ */
34
+ function checkForNonSupportedMemberRefs(path, memberVars) {
35
+ const memberExprNode = path.node;
36
+ if (memberExprNode.object.type == 'ThisExpression') {
37
+ const memberExprProperty = memberExprNode.property;
38
+ if (memberVars.find((classPropInfo) => classPropInfo.classPropId === memberExprProperty.name &&
39
+ !classPropInfo.isDecorated &&
40
+ !classPropInfo.hasInitialValue &&
41
+ !t.isClassMethod(classPropInfo.classProp))) {
42
+ if (memberExprProperty.loc !== null) {
43
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_UNSUPPORTED_MEMBER_VARIABLE_IN_MEMBER_EXPRESSION, shared_1.LLSRange.fromBabelSourceLocation(memberExprProperty.loc), [memberExprProperty.name]);
44
+ }
45
+ }
46
+ }
47
+ return undefined;
48
+ }
49
+ exports.checkForNonSupportedMemberRefs = checkForNonSupportedMemberRefs;
50
+ /**
51
+ * Invariant function for checking if a member expression references a non-existent member property variable
52
+ * @param {NodePath<MemberExpression>} path babel/types path object representing the current member expression
53
+ * @param {string[]} memberVars an string[] of member variable names
54
+ * @param {Set<string>} thisAliases a Set of the aliases of `this` used. ex: in `let that = this;`, `that` would be an alias.
55
+ * @returns {(PrimingDiagnostic | undefined)} undefined if the member expression does NOT reference a non-existent member property variable. Returns a
56
+ * PrimingDiagnostic object if a non-existent member property variable is referenced
57
+ */
58
+ function checkForNonExistentMemberRefs(path, memberVars, thisAliases) {
59
+ const memberExprNode = path.node;
60
+ const memberExprProperty = memberExprNode.property;
61
+ const parentNode = path.parent;
62
+ if ((0, common_shared_1.isExpressionThisOrAlias)(thisAliases, memberExprNode.object) && // check that the MemberExpression starts with a `this.` or an equivalent alias
63
+ parentNode.type !== 'CallExpression' // check that this is not a part of a function call, which is already handled by invariant: `checkForNoReferenceToClassFunctions`
64
+ ) {
65
+ const memberExprValue = (0, common_shared_1.getFromIdentifierOrStringLiteral)(memberExprProperty);
66
+ if (!memberVars.find((classPropInfo) => classPropInfo.classPropId === memberExprValue)) {
67
+ const sourceLoc = memberExprProperty.loc;
68
+ if (sourceLoc !== null) {
69
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_NON_EXISTENT_MEMBER_VARIABLE, shared_1.LLSRange.fromBabelSourceLocation(sourceLoc), [memberExprValue]);
70
+ }
71
+ }
72
+ }
73
+ return undefined;
74
+ }
75
+ exports.checkForNonExistentMemberRefs = checkForNonExistentMemberRefs;
76
+ /**
77
+ * Invariant function to check if a member expression references an unsupported import.
78
+ * @param path the babel path object for the current member expression
79
+ * @param supportedImportRefs a set of supported import references.
80
+ * @returns undefined if a member expression does NOT reference an unsuppoerted import, PrimingDiagnostic object
81
+ * if an unsupported import is reference.
82
+ */
83
+ function checkMemberExpressionForNonSupportedNamespaceRefs(path, importReferences) {
84
+ const mememberExprNode = path.node;
85
+ const objectIdentifier = mememberExprNode.object;
86
+ if (importReferences.get(objectIdentifier.name)) {
87
+ if (!importReferences.get(objectIdentifier.name)?.isSupported) {
88
+ if (objectIdentifier.loc !== null) {
89
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_UNSUPPORTED_NAMESPACE_REFERENCE, shared_1.LLSRange.fromBabelSourceLocation(objectIdentifier.loc), [objectIdentifier.name]);
90
+ }
91
+ }
92
+ }
93
+ return undefined;
94
+ }
95
+ exports.checkMemberExpressionForNonSupportedNamespaceRefs = checkMemberExpressionForNonSupportedNamespaceRefs;
96
+ /**
97
+ * Validates whether a MemberExpression Node on the AST adheres to a portability invariant (whether it doesn't
98
+ * contain 'document', 'window' indentifiers within an expression).
99
+ * @param path NodePath<MemberExpression> containing a MemberExpression to analyze for invariants
100
+ * @returns PrimingDiagnostic of the MemberExpression if an invariant is detected, or undefined if none was found
101
+ */
102
+ function checkNoUsageOfDocumentOrWindow(path) {
103
+ const memberExpr = path.node;
104
+ if (memberExpr.object.type === 'Identifier' &&
105
+ (memberExpr.object.name === 'window' || memberExpr.object.name === 'document')) {
106
+ if (memberExpr.loc !== null) {
107
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_CONTAINS_NON_PORTABLE_IDENTIFIER, shared_1.LLSRange.fromBabelSourceLocation(memberExpr.loc), [memberExpr.object.name]);
108
+ }
109
+ }
110
+ return undefined;
111
+ }
112
+ exports.checkNoUsageOfDocumentOrWindow = checkNoUsageOfDocumentOrWindow;
113
+ /**
114
+ * Invariant function to check weather a member expression contains a call to super.
115
+ * @param path the babel path object for the current member expressoin
116
+ * @returns undefined if the member expressoin does NOT contain a reference to a super var or function. Location object if there is a super reference.
117
+ */
118
+ function checkForNoUseOfSuper(path) {
119
+ const memberExpr = path.node;
120
+ if (memberExpr.object.type === 'Super') {
121
+ if (memberExpr.loc !== null) {
122
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_SUPER_CLASS, shared_1.LLSRange.fromBabelSourceLocation(memberExpr.loc), [memberExpr.property.name]);
123
+ }
124
+ }
125
+ return undefined;
126
+ }
127
+ exports.checkForNoUseOfSuper = checkForNoUseOfSuper;
128
+ /**
129
+ * Function to check if there is an reference to an unsupported global reference.
130
+ * @param path the member expression path node
131
+ * @param astContext the ast context that holds meta data about the scr code.
132
+ * @returns a Priming Diagnostic if there is a global reference undefined if none
133
+ */
134
+ function checkForUnsupportedGlobalRef(path, astContext, declaredGetterVars) {
135
+ const memberExpr = path.node;
136
+ const memberObj = memberExpr.object;
137
+ if (memberObj.type === 'Identifier' &&
138
+ !(0, common_shared_1.isDeclaredInAst)(astContext, declaredGetterVars, memberObj.name) &&
139
+ !common_shared_1.allowlistGlobals.globals.has(memberObj.name) &&
140
+ memberExpr.loc !== null) {
141
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_UNSUPPORTED_GLOBAL, shared_1.LLSRange.fromBabelSourceLocation(memberExpr.loc), [memberObj.name]);
142
+ }
143
+ return undefined;
144
+ }
145
+ exports.checkForUnsupportedGlobalRef = checkForUnsupportedGlobalRef;
146
+ //# sourceMappingURL=memberExpressionInvariantFunctions.js.map
@@ -0,0 +1,12 @@
1
+ import { NodePath } from '@babel/traverse';
2
+ import * as t from '@babel/types';
3
+ import { PrimingDiagnostic } from '../types';
4
+ /**
5
+ * Invariant function for checking if an getter defined in an external module has only a
6
+ * statement in it, a return statement.
7
+ * @param blockStatement the babel path object for the BlockStatement representing the contents of the getter
8
+ * @param statements the babel path object array for all of the Statements in the getter
9
+ * @returns PrimingDiagnostic of the BlockStatement if the invariant is detected, or undefined if the invariant wasn't found
10
+ */
11
+ export declare function checkExternalModuleGetterReturnStatement(blockStatement: NodePath<t.BlockStatement>, statements: NodePath<t.Statement>[]): PrimingDiagnostic | undefined;
12
+ //# sourceMappingURL=returnStatementInvariantFunctions.d.ts.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkExternalModuleGetterReturnStatement = void 0;
4
+ const shared_1 = require("../shared");
5
+ const rules_1 = require("../rules");
6
+ /**
7
+ * Invariant function for checking if an getter defined in an external module has only a
8
+ * statement in it, a return statement.
9
+ * @param blockStatement the babel path object for the BlockStatement representing the contents of the getter
10
+ * @param statements the babel path object array for all of the Statements in the getter
11
+ * @returns PrimingDiagnostic of the BlockStatement if the invariant is detected, or undefined if the invariant wasn't found
12
+ */
13
+ function checkExternalModuleGetterReturnStatement(blockStatement, statements) {
14
+ // the getter doesn't only have a return method as expected. Skip traversal, then return from this method here
15
+ if (!(statements.length === 1 && statements[0].isReturnStatement())) {
16
+ if (blockStatement.node.loc) {
17
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_GETTER_CONTAINS_MORE_THAN_RETURN_STATEMENT, shared_1.LLSRange.fromBabelSourceLocation(blockStatement.node.loc), []);
18
+ }
19
+ }
20
+ return undefined;
21
+ }
22
+ exports.checkExternalModuleGetterReturnStatement = checkExternalModuleGetterReturnStatement;
23
+ //# sourceMappingURL=returnStatementInvariantFunctions.js.map
@@ -0,0 +1,12 @@
1
+ import { NodePath } from '@babel/traverse';
2
+ import * as t from '@babel/types';
3
+ import { ImportDeclarationInfo } from '@komaci/common-shared';
4
+ import { PrimingDiagnostic } from '../types';
5
+ /**
6
+ * Invariant function for checking if a tagged template expression contains a reference to an unsupported namespace.
7
+ * @param path the babel path object for the current TaggedTemplateExpression
8
+ * @param decoratedMemberVars a set of approved member variable names.
9
+ * @returns undefined if the member expressoin does NOT reference an unsupported member var, a location obj if an unsuppported namespace is referenced.
10
+ */
11
+ export declare function checkTaggedTemplateExprForNonSupportedNamespaceRefs(path: NodePath<t.TaggedTemplateExpression>, importReferences: Map<string, ImportDeclarationInfo>): PrimingDiagnostic | undefined;
12
+ //# sourceMappingURL=taggedTemplateExpressionInvariantFunctions.d.ts.map
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkTaggedTemplateExprForNonSupportedNamespaceRefs = void 0;
4
+ const rules_1 = require("../rules");
5
+ const shared_1 = require("../shared");
6
+ /**
7
+ * Invariant function for checking if a tagged template expression contains a reference to an unsupported namespace.
8
+ * @param path the babel path object for the current TaggedTemplateExpression
9
+ * @param decoratedMemberVars a set of approved member variable names.
10
+ * @returns undefined if the member expressoin does NOT reference an unsupported member var, a location obj if an unsuppported namespace is referenced.
11
+ */
12
+ function checkTaggedTemplateExprForNonSupportedNamespaceRefs(path, importReferences) {
13
+ const taggedTemplateExpr = path.node;
14
+ const identifier = taggedTemplateExpr.tag;
15
+ if (importReferences.has(identifier.name)) {
16
+ if (!importReferences.get(identifier.name)?.isSupported) {
17
+ if (identifier.loc !== null) {
18
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_TAGGED_TEMPLATE_EXPRESSION_CONTAINS_UNSUPPORTED_NAMESPACE, shared_1.LLSRange.fromBabelSourceLocation(identifier.loc), [identifier.name]);
19
+ }
20
+ }
21
+ }
22
+ return undefined;
23
+ }
24
+ exports.checkTaggedTemplateExprForNonSupportedNamespaceRefs = checkTaggedTemplateExprForNonSupportedNamespaceRefs;
25
+ //# sourceMappingURL=taggedTemplateExpressionInvariantFunctions.js.map
@@ -0,0 +1,288 @@
1
+ {
2
+ "lightning/uiRecordActionsApi": {
3
+ "getRecordActions": {
4
+ "prime": {
5
+ "importPath": "lightning/unstable_uiRecordActionsApi",
6
+ "identifier": "unstable_getRecordActions_imperative"
7
+ }
8
+ },
9
+ "getRelatedListsActions": {
10
+ "prime": {
11
+ "importPath": "lightning/unstable_uiRecordActionsApi",
12
+ "identifier": "unstable_getRelatedListsActions_imperative"
13
+ }
14
+ },
15
+ "getRelatedListActions": {
16
+ "prime": {
17
+ "importPath": "lightning/unstable_uiRecordActionsApi",
18
+ "identifier": "unstable_getRelatedListActions_imperative"
19
+ },
20
+ "batch": {
21
+ "prime": {
22
+ "importPath": "lightning/unstable_uiRecordActionsApi",
23
+ "identifier": "unstable_getRelatedListsActions_imperative"
24
+ },
25
+ "reducer": {
26
+ "importPath": "laf/batchingPortable",
27
+ "identifier": "RelatedListActionsBatchReducer"
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "lightning/uiLayoutApi": {
33
+ "getLayout": {
34
+ "prime": {
35
+ "importPath": "lightning/unstable_uiLayoutApi",
36
+ "identifier": "unstable_getLayout_imperative"
37
+ }
38
+ },
39
+ "getLayoutUserState": {
40
+ "prime": {
41
+ "importPath": "lightning/unstable_uiLayoutApi",
42
+ "identifier": "unstable_getLayoutUserState_imperative"
43
+ }
44
+ }
45
+ },
46
+ "lightning/uiListsApi": {
47
+ "getListInfoByName": {
48
+ "prime": {
49
+ "importPath": "lightning/unstable_uiListsApi",
50
+ "identifier": "unstable_getListInfoByName_imperative"
51
+ }
52
+ }
53
+ },
54
+ "lightning/uiAppsApi": {
55
+ "getNavItems": {
56
+ "prime": {
57
+ "importPath": "lightning/unstable_uiAppsApi",
58
+ "identifier": "unstable_getNavItems_imperative"
59
+ }
60
+ }
61
+ },
62
+ "lightning/uiObjectInfoApi": {
63
+ "getObjectInfos": {
64
+ "prime": {
65
+ "importPath": "lightning/unstable_uiObjectInfoApi",
66
+ "identifier": "unstable_getObjectInfos_imperative"
67
+ },
68
+ "batch": {
69
+ "prime": {
70
+ "importPath": "lightning/unstable_uiObjectInfoApi",
71
+ "identifier": "unstable_getObjectInfos_imperative"
72
+ },
73
+ "reducer": {
74
+ "importPath": "laf/batchingPortable",
75
+ "identifier": "ObjectInfosBatchReducer"
76
+ }
77
+ }
78
+ },
79
+ "getObjectInfo": {
80
+ "prime": {
81
+ "importPath": "lightning/unstable_uiObjectInfoApi",
82
+ "identifier": "unstable_getObjectInfo_imperative"
83
+ },
84
+ "batch": {
85
+ "prime": {
86
+ "importPath": "lightning/unstable_uiObjectInfoApi",
87
+ "identifier": "unstable_getObjectInfos_imperative"
88
+ },
89
+ "reducer": {
90
+ "importPath": "laf/batchingPortable",
91
+ "identifier": "ObjectInfoBatchReducer"
92
+ }
93
+ }
94
+ },
95
+ "getPicklistValuesByRecordType": {
96
+ "prime": {
97
+ "importPath": "lightning/unstable_uiObjectInfoApi",
98
+ "identifier": "unstable_getPicklistValuesByRecordType_imperative"
99
+ }
100
+ },
101
+ "getPicklistValues": {
102
+ "prime": {
103
+ "importPath": "lightning/unstable_uiObjectInfoApi",
104
+ "identifier": "unstable_getPicklistValues_imperative"
105
+ }
106
+ }
107
+ },
108
+ "lightning/uiRecordAvatarApi": {
109
+ "getRecordAvatars": {
110
+ "prime": {
111
+ "importPath": "lightning/unstable_uiRecordAvatarApi",
112
+ "identifier": "unstable_getRecordAvatars_imperative"
113
+ },
114
+ "batch": {
115
+ "prime": {
116
+ "importPath": "lightning/unstable_uiRecordAvatarApi",
117
+ "identifier": "unstable_getRecordAvatars_imperative"
118
+ },
119
+ "reducer": {
120
+ "importPath": "laf/batchingPortable",
121
+ "identifier": "RecordAvatarBatchReducer"
122
+ }
123
+ }
124
+ }
125
+ },
126
+ "lightning/uiRecordApi": {
127
+ "getRecordCreateDefaults": {
128
+ "prime": {
129
+ "importPath": "lightning/unstable_uiRecordApi",
130
+ "identifier": "unstable_getRecordCreateDefaults_imperative"
131
+ }
132
+ },
133
+ "getRecordUi": {
134
+ "prime": {
135
+ "importPath": "lightning/unstable_uiRecordApi",
136
+ "identifier": "unstable_getRecordUi_imperative"
137
+ }
138
+ },
139
+ "getRecords": {
140
+ "prime": {
141
+ "importPath": "lightning/unstable_uiRecordApi",
142
+ "identifier": "unstable_getRecords_imperative"
143
+ }
144
+ },
145
+ "getRecord": {
146
+ "prime": {
147
+ "importPath": "lightning/unstable_uiRecordApi",
148
+ "identifier": "unstable_getRecord_imperative"
149
+ },
150
+ "batch": {
151
+ "prime": {
152
+ "importPath": "lightning/unstable_uiRecordApi",
153
+ "identifier": "unstable_getRecords_imperative"
154
+ },
155
+ "reducer": {
156
+ "importPath": "laf/batchingPortable",
157
+ "identifier": "GetRecordBatchReducer"
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "lightning/uiRelatedListApi": {
163
+ "getRelatedListsCount": {
164
+ "prime": {
165
+ "importPath": "lightning/unstable_uiRelatedListApi",
166
+ "identifier": "unstable_getRelatedListsCount_imperative"
167
+ }
168
+ },
169
+ "getRelatedListCount": {
170
+ "prime": {
171
+ "importPath": "lightning/unstable_uiRelatedListApi",
172
+ "identifier": "unstable_getRelatedListCount_imperative"
173
+ }
174
+ },
175
+ "getRelatedListInfoBatch": {
176
+ "prime": {
177
+ "importPath": "lightning/unstable_uiRelatedListApi",
178
+ "identifier": "unstable_getRelatedListInfoBatch_imperative"
179
+ }
180
+ },
181
+ "getRelatedListsInfo": {
182
+ "prime": {
183
+ "importPath": "lightning/unstable_uiRelatedListApi",
184
+ "identifier": "unstable_getRelatedListsInfo_imperative"
185
+ }
186
+ },
187
+ "getRelatedListInfo": {
188
+ "prime": {
189
+ "importPath": "lightning/unstable_uiRelatedListApi",
190
+ "identifier": "unstable_getRelatedListInfo_imperative"
191
+ },
192
+ "batch": {
193
+ "prime": {
194
+ "importPath": "lightning/unstable_uiRelatedListApi",
195
+ "identifier": "unstable_getRelatedListInfoBatch_imperative"
196
+ },
197
+ "reducer": {
198
+ "importPath": "laf/batchingPortable",
199
+ "identifier": "RelatedListInfoBatchReducer"
200
+ }
201
+ }
202
+ },
203
+ "getRelatedListRecordsBatch": {
204
+ "prime": {
205
+ "importPath": "lightning/unstable_uiRelatedListApi",
206
+ "identifier": "unstable_getRelatedListRecordsBatch_imperative"
207
+ }
208
+ },
209
+ "getRelatedListRecords": {
210
+ "prime": {
211
+ "importPath": "lightning/unstable_uiRelatedListApi",
212
+ "identifier": "unstable_getRelatedListRecords_imperative"
213
+ },
214
+ "batch": {
215
+ "prime": {
216
+ "importPath": "lightning/unstable_uiRelatedListApi",
217
+ "identifier": "unstable_getRelatedListRecordsBatch_imperative"
218
+ },
219
+ "reducer": {
220
+ "importPath": "laf/batchingPortable",
221
+ "identifier": "RelatedListRecordsBatchReducer"
222
+ }
223
+ }
224
+ }
225
+ },
226
+ "lightning/unstable_uiRelatedListApi": {
227
+ "unstable_getRelatedListInfoBatch": {
228
+ "prime": {
229
+ "importPath": "lightning/unstable_uiRelatedListApi",
230
+ "identifier": "unstable_getRelatedListInfoBatch_imperative"
231
+ }
232
+ },
233
+ "unstable_getRelatedListRecordsBatch": {
234
+ "prime": {
235
+ "importPath": "lightning/unstable_uiRelatedListApi",
236
+ "identifier": "unstable_getRelatedListRecordsBatch_imperative"
237
+ }
238
+ }
239
+ },
240
+ "lightning/uiSearchApi": {
241
+ "getSearchFilterOptions": {
242
+ "prime": {
243
+ "importPath": "lightning/unstable_uiSearchApi",
244
+ "identifier": "unstable_getSearchFilterOptions_imperative"
245
+ }
246
+ },
247
+ "getSearchResults": {
248
+ "prime": {
249
+ "importPath": "lightning/unstable_uiSearchApi",
250
+ "identifier": "unstable_getSearchResults_imperative"
251
+ }
252
+ },
253
+ "getKeywordSearchResults": {
254
+ "prime": {
255
+ "importPath": "lightning/unstable_uiSearchApi",
256
+ "identifier": "unstable_getKeywordSearchResults_imperative"
257
+ }
258
+ }
259
+ },
260
+ "lightning/unstable_uiSearchApi": {
261
+ "unstable_getSearchFilterOptions": {
262
+ "prime": {
263
+ "importPath": "lightning/unstable_uiSearchApi",
264
+ "identifier": "unstable_getSearchFilterOptions_imperative"
265
+ }
266
+ },
267
+ "unstable_getSearchResults": {
268
+ "prime": {
269
+ "importPath": "lightning/unstable_uiSearchApi",
270
+ "identifier": "unstable_getSearchResults_imperative"
271
+ }
272
+ },
273
+ "unstable_getKeywordSearchResults": {
274
+ "prime": {
275
+ "importPath": "lightning/unstable_uiSearchApi",
276
+ "identifier": "unstable_getKeywordSearchResults_imperative"
277
+ }
278
+ }
279
+ },
280
+ "lightning/unstable_uiGraphQLApi": {
281
+ "graphQL": {
282
+ "prime": {
283
+ "importPath": "lightning/unstable_uiGraphQLApi",
284
+ "identifier": "unstable_graphQL_imperative"
285
+ }
286
+ }
287
+ }
288
+ }
@@ -0,0 +1,22 @@
1
+ import { DiagnosticMessage, PrimingDiagnostic, Range } from './types';
2
+ /**
3
+ * Returns the processed PrimingDiagnostic for a given DianosticMessage message key. If {args} are passed in, they will be substituted into
4
+ * the message string in the order of the array. If a {filename} is passed in, a {Uri} will be generated that will be included in the DiagnosticMessage
5
+ * in the format expected by the VSCode language server
6
+ * @param {DiagnosticMessage} diagnosticMessage the unprocessed diagnostic message (the caller of this method looks up the message with a key)
7
+ * @param {Range} range the line numbers and column numbers for the starting and endline line and starting and ending columns of the cause of the diagnostic
8
+ * message in the code, respectively.
9
+ * @param {Array<string>} args arguments to substitute into the message string
10
+ * @returns a new, processed instance of PrimingDiagnostic (with arguments substituted in, and Uri set) which is compatible with the VSCode language server
11
+ */
12
+ export declare function getPrimingDiagnostic(diagnosticMessage: DiagnosticMessage, range: Range, args?: string[]): PrimingDiagnostic;
13
+ /**
14
+ * This method augments the PrimingDiagnostic with filename information. It augments the
15
+ * object by reference and does not return a modified object.
16
+ * @param {PrimingDiagnostic} primingDiagnostic The PrimingDiagnostic that needs to be augmented with filename informations
17
+ * @param {string | undefined} filename The name of the file that the PrimingDiagnostic is for
18
+ * @returns {PrimingDiagnostic} a PrimingDiagnostic (this is optional to use)
19
+ */
20
+ export declare function updatePrimingDiagnosticWithFileInfo(primingDiagnostic: PrimingDiagnostic, filename: string | undefined): PrimingDiagnostic;
21
+ export declare const diagnosticMessages: Record<string, DiagnosticMessage>;
22
+ //# sourceMappingURL=rules.d.ts.map