@speclynx/apidom-ls 2.11.6 → 2.11.7
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/CHANGELOG.md +8 -0
- package/dist/apidom-ls.browser.min.js +1 -1
- package/package.json +29 -29
- package/src/config/arazzo/JSONSchema/{description--no-script-tags.cjs → lint/description--no-script-tags.cjs} +2 -2
- package/src/config/arazzo/JSONSchema/{description--no-script-tags.mjs → lint/description--no-script-tags.mjs} +2 -2
- package/src/config/arazzo/JSONSchema/lint/index.cjs +81 -0
- package/src/config/arazzo/JSONSchema/lint/index.mjs +72 -0
- package/src/config/arazzo/JSONSchema/{title--no-script-tags.cjs → lint/title--no-script-tags.cjs} +2 -2
- package/src/config/arazzo/JSONSchema/{title--no-script-tags.mjs → lint/title--no-script-tags.mjs} +2 -2
- package/src/config/arazzo/JSONSchema/meta.cjs +2 -2
- package/src/config/arazzo/JSONSchema/meta.mjs +1 -1
- package/src/config/arazzo/failureAction/lint/allowed-fields.cjs +4 -0
- package/src/config/arazzo/failureAction/lint/allowed-fields.mjs +4 -0
- package/src/config/arazzo/failureAction/lint/name--required.cjs +4 -0
- package/src/config/arazzo/failureAction/lint/name--required.mjs +4 -0
- package/src/config/arazzo/failureAction/lint/type--required.cjs +4 -0
- package/src/config/arazzo/failureAction/lint/type--required.mjs +4 -0
- package/src/config/arazzo/parameter/lint/allowed-fields.cjs +4 -0
- package/src/config/arazzo/parameter/lint/allowed-fields.mjs +4 -0
- package/src/config/arazzo/parameter/lint/name--required.cjs +4 -0
- package/src/config/arazzo/parameter/lint/name--required.mjs +4 -0
- package/src/config/arazzo/parameter/lint/value--required.cjs +4 -0
- package/src/config/arazzo/parameter/lint/value--required.mjs +4 -0
- package/src/config/arazzo/successAction/lint/allowed-fields.cjs +4 -0
- package/src/config/arazzo/successAction/lint/allowed-fields.mjs +4 -0
- package/src/config/arazzo/successAction/lint/name--required.cjs +4 -0
- package/src/config/arazzo/successAction/lint/name--required.mjs +4 -0
- package/src/config/arazzo/successAction/lint/type--required.cjs +4 -0
- package/src/config/arazzo/successAction/lint/type--required.mjs +4 -0
- package/src/config/codes.cjs +0 -10
- package/src/config/codes.mjs +0 -10
- package/src/config/config.cjs +6 -8
- package/src/config/config.mjs +0 -2
- package/src/config/openapi/schema/lint.cjs +5 -1
- package/src/config/openapi/schema/lint.mjs +5 -1
- package/src/config/symbols.cjs +3 -4
- package/src/config/symbols.mjs +1 -2
- package/src/config/tokens.cjs +5 -6
- package/src/config/tokens.mjs +1 -2
- package/src/services/completion/completion-service.cjs +1 -1
- package/src/services/completion/completion-service.mjs +1 -1
- package/src/services/hover/hover-service.cjs +1 -1
- package/src/services/hover/hover-service.mjs +1 -1
- package/src/services/validation/validation-service.cjs +5 -3
- package/src/services/validation/validation-service.mjs +5 -3
- package/src/utils/utils.cjs +5 -1
- package/src/utils/utils.mjs +5 -1
- package/types/apidom-ls.d.ts +0 -10
- package/src/config/ads/config.cjs +0 -25
- package/src/config/ads/config.mjs +0 -18
- package/src/config/ads/info/completion.cjs +0 -31
- package/src/config/ads/info/completion.mjs +0 -25
- package/src/config/ads/info/documentation.cjs +0 -14
- package/src/config/ads/info/documentation.mjs +0 -8
- package/src/config/ads/info/lint/allowed-fields.cjs +0 -19
- package/src/config/ads/info/lint/allowed-fields.mjs +0 -12
- package/src/config/ads/info/lint/description--type.cjs +0 -21
- package/src/config/ads/info/lint/description--type.mjs +0 -14
- package/src/config/ads/info/lint/index.cjs +0 -13
- package/src/config/ads/info/lint/index.mjs +0 -6
- package/src/config/ads/info/lint/title--required.cjs +0 -27
- package/src/config/ads/info/lint/title--required.mjs +0 -20
- package/src/config/ads/info/lint/title--type.cjs +0 -21
- package/src/config/ads/info/lint/title--type.mjs +0 -14
- package/src/config/ads/info/meta.cjs +0 -16
- package/src/config/ads/info/meta.mjs +0 -9
- package/src/config/ads/main/completion.cjs +0 -72
- package/src/config/ads/main/completion.mjs +0 -66
- package/src/config/ads/main/documentation.cjs +0 -23
- package/src/config/ads/main/documentation.mjs +0 -17
- package/src/config/ads/main/lint/allowed-fields.cjs +0 -19
- package/src/config/ads/main/lint/allowed-fields.mjs +0 -12
- package/src/config/ads/main/lint/index.cjs +0 -14
- package/src/config/ads/main/lint/index.mjs +0 -7
- package/src/config/ads/main/lint/info--required.cjs +0 -27
- package/src/config/ads/main/lint/info--required.mjs +0 -20
- package/src/config/ads/main/lint/info--type.cjs +0 -21
- package/src/config/ads/main/lint/info--type.mjs +0 -14
- package/src/config/ads/main/lint/version--pattern.cjs +0 -27
- package/src/config/ads/main/lint/version--pattern.mjs +0 -20
- package/src/config/ads/main/lint/version--required.cjs +0 -27
- package/src/config/ads/main/lint/version--required.mjs +0 -20
- package/src/config/ads/main/meta.cjs +0 -16
- package/src/config/ads/main/meta.mjs +0 -9
- package/src/config/ads/symbols.cjs +0 -8
- package/src/config/ads/symbols.mjs +0 -2
- package/src/config/ads/tokens.cjs +0 -8
- package/src/config/ads/tokens.mjs +0 -2
- package/src/config/arazzo/JSONSchema/lint.cjs +0 -77
- package/src/config/arazzo/JSONSchema/lint.mjs +0 -68
|
@@ -86,7 +86,11 @@ var _writeOnlyType = _interopRequireDefault(require("../../common/schema/lint/wr
|
|
|
86
86
|
var _exampleDeprecated = _interopRequireDefault(require("../../common/schema/lint/example--deprecated.cjs"));
|
|
87
87
|
var _typeArrayNonItems = _interopRequireDefault(require("../../common/schema/lint/type--array-non-items.cjs"));
|
|
88
88
|
var _targetSpecs2 = require("../target-specs.cjs");
|
|
89
|
-
// below are older rule variants that need to be replaced
|
|
89
|
+
// below are older rule variants that need to be replaced.
|
|
90
|
+
// $id and $ref are deliberately absent: the composed JSON Schema 2020-12 rules
|
|
91
|
+
// above already cover them (codes 8030100 / 8030300). importing the
|
|
92
|
+
// common/schema equivalents ($id--format-uri, $ref--valid) adds functionally
|
|
93
|
+
// identical rules and yields duplicate diagnostics on the same range.
|
|
90
94
|
|
|
91
95
|
const schemaLints = [...(0, _targetSpecs.compose)([_lint.default], (0, _targetSpecs.assoc)(_targetSpecs2.OpenAPI31)), _additionalItemsNonArray.default, _additionalItemsType.default, _additionalItemsTypeOpenapi31Asyncapi.default, _additionalPropertiesNonObject.default, _additionalPropertiesType.default, _allOfType.default, _allOfTypeOpenapi31Asyncapi.default, _anyOfTypeOpenapi31Asyncapi.default, _anyOfType.default, _containsNonArray.default, _containsType.default, _containsTypeOpenapi31Asyncapi.default, _descriptionType.default, _discriminatorExistInRequired.default, _discriminatorTypeOpenapi.default, _elseNonIf.default, _elseType.default, _enumUnique.default, _examplesType.default, _exclusiveMaximumTypeNumber.default, _exclusiveMaximumTypeBoolean.default, _exclusiveMinimumTypeNumber.default, _exclusiveMinimumTypeBoolean.default, _xmlType.default, _externalDocsType.default, _formatType.default, _ifNonThen.default, _ifType.default, _itemsNonArray.default, _itemsType.default, _maxItemsNonArray.default, _maxItemsType.default, _maxLengthNonString.default, _maxLengthType.default, _maxPropertiesNonObject.default, _maxPropertiesType.default, _maximumType.default, _minItemsNonArray.default, _minItemsType.default, _minLengthNonString.default, _minLengthType.default, _minPropertiesNonObject.default, _minPropertiesType.default, _minimumType.default, _missingCoreFieldsOpenapi.default, _multipleOfType.default, _notType.default, _notTypeOpenapi31Asyncapi.default, _nullableType.default, _nullableNotRecommended.default, _oneOfType.default, _oneOfTypeOpenapi31Asyncapi.default, _patternType.default, _patternPropertiesKeysRegexp.default, _patternPropertiesNonObject.default, _patternPropertiesType.default, _patternPropertiesValuesType.default, _propertiesNonObject.default, _propertiesType.default, _propertiesValuesType.default, _propertiesValuesTypeOpenapi31Asyncapi.default, _propertyNamesNonObject.default, _propertyNamesType.default, _readOnlyType.default, _requiredDefined.default, _requiredNonObject.default, _requiredType.default, _thenNonIf.default, _thenType.default, _titleType.default, _typeType.default, _typeEquals.default, _typeEqualsOpenapi31Asyncapi.default, _uniqueItemsNonArray.default, _uniqueItemsType.default, _writeOnlyType.default, _exampleDeprecated.default, _typeArrayNonItems.default];
|
|
92
96
|
var _default = exports.default = schemaLints;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import jsonSchema202012Lint from "../../json-schema/2020-12/json-schema/lint.mjs";
|
|
2
|
-
import { compose, assoc } from "../../json-schema/2020-12/target-specs.mjs"; // below are older rule variants that need to be replaced
|
|
2
|
+
import { compose, assoc } from "../../json-schema/2020-12/target-specs.mjs"; // below are older rule variants that need to be replaced.
|
|
3
|
+
// $id and $ref are deliberately absent: the composed JSON Schema 2020-12 rules
|
|
4
|
+
// above already cover them (codes 8030100 / 8030300). importing the
|
|
5
|
+
// common/schema equivalents ($id--format-uri, $ref--valid) adds functionally
|
|
6
|
+
// identical rules and yields duplicate diagnostics on the same range.
|
|
3
7
|
import additionalItemsNonArrayLint from "../../common/schema/lint/additional-items--non-array.mjs";
|
|
4
8
|
import additionalItemsTypeLint from "../../common/schema/lint/additional-items--type.mjs";
|
|
5
9
|
import additionalItemsTypeOpenAPI3_1__AsyncAPI2Lint from "../../common/schema/lint/additional-items--type-openapi-3-1--asyncapi-2.mjs";
|
package/src/config/symbols.cjs
CHANGED
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _symbols = _interopRequireDefault(require("./
|
|
9
|
-
var _symbols2 = _interopRequireDefault(require("./
|
|
10
|
-
var _symbols3 = _interopRequireDefault(require("./openapi/symbols.cjs"));
|
|
8
|
+
var _symbols = _interopRequireDefault(require("./asyncapi/symbols.cjs"));
|
|
9
|
+
var _symbols2 = _interopRequireDefault(require("./openapi/symbols.cjs"));
|
|
11
10
|
// creating list of unique symbols
|
|
12
|
-
const symbols = Array.from(new Set([..._symbols.default, ..._symbols2.default
|
|
11
|
+
const symbols = Array.from(new Set([..._symbols.default, ..._symbols2.default]));
|
|
13
12
|
var _default = exports.default = symbols;
|
package/src/config/symbols.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import adsSymbols from "./ads/symbols.mjs";
|
|
2
1
|
import asyncapiSymbols from "./asyncapi/symbols.mjs";
|
|
3
2
|
import openapiSymbols from "./openapi/symbols.mjs"; // creating list of unique symbols
|
|
4
|
-
const symbols = Array.from(new Set([...
|
|
3
|
+
const symbols = Array.from(new Set([...asyncapiSymbols, ...openapiSymbols]));
|
|
5
4
|
export default symbols;
|
package/src/config/tokens.cjs
CHANGED
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _tokens = _interopRequireDefault(require("./
|
|
9
|
-
var _tokens2 = _interopRequireDefault(require("./
|
|
10
|
-
var _tokens3 = _interopRequireDefault(require("./
|
|
11
|
-
var _tokens4 = _interopRequireDefault(require("./
|
|
12
|
-
var _tokens5 = _interopRequireDefault(require("./overlay/tokens.cjs"));
|
|
8
|
+
var _tokens = _interopRequireDefault(require("./arazzo/tokens.cjs"));
|
|
9
|
+
var _tokens2 = _interopRequireDefault(require("./asyncapi/tokens.cjs"));
|
|
10
|
+
var _tokens3 = _interopRequireDefault(require("./openapi/tokens.cjs"));
|
|
11
|
+
var _tokens4 = _interopRequireDefault(require("./overlay/tokens.cjs"));
|
|
13
12
|
// creating list of unique tokens
|
|
14
|
-
const tokens = Array.from(new Set(['value', 'string', 'number', 'key', ...
|
|
13
|
+
const tokens = Array.from(new Set(['value', 'string', 'number', 'key', ..._tokens2.default, ..._tokens3.default, ..._tokens.default, ..._tokens4.default]));
|
|
15
14
|
var _default = exports.default = tokens;
|
package/src/config/tokens.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import adsTokens from "./ads/tokens.mjs";
|
|
2
1
|
import arazzoTokens from "./arazzo/tokens.mjs";
|
|
3
2
|
import asyncapiTokens from "./asyncapi/tokens.mjs";
|
|
4
3
|
import openapiTokens from "./openapi/tokens.mjs";
|
|
5
4
|
import overlayTokens from "./overlay/tokens.mjs"; // creating list of unique tokens
|
|
6
|
-
const tokens = Array.from(new Set(['value', 'string', 'number', 'key', ...
|
|
5
|
+
const tokens = Array.from(new Set(['value', 'string', 'number', 'key', ...asyncapiTokens, ...openapiTokens, ...arazzoTokens, ...overlayTokens]));
|
|
7
6
|
export default tokens;
|
|
@@ -851,7 +851,7 @@ class DefaultCompletionService {
|
|
|
851
851
|
let func = _linterFunctions.standardLinterfunctionsMap.get(funcName);
|
|
852
852
|
// else get it from configuration
|
|
853
853
|
if (!func) {
|
|
854
|
-
func = this.settings?.metadata?.linterFunctions[docNs][funcName];
|
|
854
|
+
func = this.settings?.metadata?.linterFunctions?.[docNs]?.[funcName];
|
|
855
855
|
}
|
|
856
856
|
if (func) {
|
|
857
857
|
try {
|
|
@@ -845,7 +845,7 @@ export class DefaultCompletionService {
|
|
|
845
845
|
let func = standardLinterfunctionsMap.get(funcName);
|
|
846
846
|
// else get it from configuration
|
|
847
847
|
if (!func) {
|
|
848
|
-
func = this.settings?.metadata?.linterFunctions[docNs][funcName];
|
|
848
|
+
func = this.settings?.metadata?.linterFunctions?.[docNs]?.[funcName];
|
|
849
849
|
}
|
|
850
850
|
if (func) {
|
|
851
851
|
try {
|
|
@@ -262,7 +262,7 @@ class DefaultHoverService {
|
|
|
262
262
|
return res;
|
|
263
263
|
}
|
|
264
264
|
getMetadataPropertyDocs(node, ns, key, specVersion) {
|
|
265
|
-
const map = this.settings?.metadata?.metadataMaps[ns] || {};
|
|
265
|
+
const map = this.settings?.metadata?.metadataMaps?.[ns] || {};
|
|
266
266
|
if (node.parent && (0, _utils.isMember)(node.parent)) {
|
|
267
267
|
const containerNode = node.parent.parent;
|
|
268
268
|
const nodeKey = (0, _apidomCore.toValue)(node.parent.key);
|
|
@@ -256,7 +256,7 @@ export class DefaultHoverService {
|
|
|
256
256
|
return res;
|
|
257
257
|
}
|
|
258
258
|
getMetadataPropertyDocs(node, ns, key, specVersion) {
|
|
259
|
-
const map = this.settings?.metadata?.metadataMaps[ns] || {};
|
|
259
|
+
const map = this.settings?.metadata?.metadataMaps?.[ns] || {};
|
|
260
260
|
if (node.parent && isMember(node.parent)) {
|
|
261
261
|
const containerNode = node.parent.parent;
|
|
262
262
|
const nodeKey = toValue(node.parent.key);
|
|
@@ -702,7 +702,7 @@ class DefaultValidationService {
|
|
|
702
702
|
let lintFunc = _linterFunctions.standardLinterfunctionsMap.get(linterFuncName);
|
|
703
703
|
// else get it from configuration
|
|
704
704
|
if (!lintFunc) {
|
|
705
|
-
lintFunc = this.settings?.metadata?.linterFunctions[docNs][linterFuncName];
|
|
705
|
+
lintFunc = this.settings?.metadata?.linterFunctions?.[docNs]?.[linterFuncName];
|
|
706
706
|
}
|
|
707
707
|
if (lintFunc) {
|
|
708
708
|
try {
|
|
@@ -849,8 +849,10 @@ class DefaultValidationService {
|
|
|
849
849
|
return quicks;
|
|
850
850
|
}
|
|
851
851
|
if (diagnostic.source === _apidomLanguageTypes.APIDOM_LINTER) {
|
|
852
|
-
|
|
853
|
-
|
|
852
|
+
const map = this.settings?.metadata?.metadataMaps?.[lang];
|
|
853
|
+
if (!map) {
|
|
854
|
+
return undefined;
|
|
855
|
+
}
|
|
854
856
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
855
857
|
for (const [symbolKey, symbolValue] of Object.entries(map)) {
|
|
856
858
|
if (symbolValue.lint) {
|
|
@@ -696,7 +696,7 @@ export class DefaultValidationService {
|
|
|
696
696
|
let lintFunc = standardLinterfunctionsMap.get(linterFuncName);
|
|
697
697
|
// else get it from configuration
|
|
698
698
|
if (!lintFunc) {
|
|
699
|
-
lintFunc = this.settings?.metadata?.linterFunctions[docNs][linterFuncName];
|
|
699
|
+
lintFunc = this.settings?.metadata?.linterFunctions?.[docNs]?.[linterFuncName];
|
|
700
700
|
}
|
|
701
701
|
if (lintFunc) {
|
|
702
702
|
try {
|
|
@@ -843,8 +843,10 @@ export class DefaultValidationService {
|
|
|
843
843
|
return quicks;
|
|
844
844
|
}
|
|
845
845
|
if (diagnostic.source === APIDOM_LINTER) {
|
|
846
|
-
|
|
847
|
-
|
|
846
|
+
const map = this.settings?.metadata?.metadataMaps?.[lang];
|
|
847
|
+
if (!map) {
|
|
848
|
+
return undefined;
|
|
849
|
+
}
|
|
848
850
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
849
851
|
for (const [symbolKey, symbolValue] of Object.entries(map)) {
|
|
850
852
|
if (symbolValue.lint) {
|
package/src/utils/utils.cjs
CHANGED
|
@@ -276,7 +276,7 @@ function checkConditions(meta, docNs, element, api, settings) {
|
|
|
276
276
|
let conditionFunc = _linterFunctions.standardLinterfunctionsMap.get(conditionFuncName);
|
|
277
277
|
// else get it from configuration
|
|
278
278
|
if (!conditionFunc) {
|
|
279
|
-
conditionFunc = settings?.metadata?.linterFunctions[docNs][conditionFuncName];
|
|
279
|
+
conditionFunc = settings?.metadata?.linterFunctions?.[docNs]?.[conditionFuncName];
|
|
280
280
|
}
|
|
281
281
|
if (conditionFunc) {
|
|
282
282
|
let conditionTargetEl = element;
|
|
@@ -335,6 +335,10 @@ function checkConditions(meta, docNs, element, api, settings) {
|
|
|
335
335
|
break;
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
+
} else {
|
|
339
|
+
// condition function could not be resolved (neither standard nor from metadata);
|
|
340
|
+
// treat the condition as failed rather than silently passing it
|
|
341
|
+
conditionsSuccess = false;
|
|
338
342
|
}
|
|
339
343
|
}
|
|
340
344
|
}
|
package/src/utils/utils.mjs
CHANGED
|
@@ -211,7 +211,7 @@ export function checkConditions(meta, docNs, element, api, settings) {
|
|
|
211
211
|
let conditionFunc = standardLinterfunctionsMap.get(conditionFuncName);
|
|
212
212
|
// else get it from configuration
|
|
213
213
|
if (!conditionFunc) {
|
|
214
|
-
conditionFunc = settings?.metadata?.linterFunctions[docNs][conditionFuncName];
|
|
214
|
+
conditionFunc = settings?.metadata?.linterFunctions?.[docNs]?.[conditionFuncName];
|
|
215
215
|
}
|
|
216
216
|
if (conditionFunc) {
|
|
217
217
|
let conditionTargetEl = element;
|
|
@@ -270,6 +270,10 @@ export function checkConditions(meta, docNs, element, api, settings) {
|
|
|
270
270
|
break;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
+
} else {
|
|
274
|
+
// condition function could not be resolved (neither standard nor from metadata);
|
|
275
|
+
// treat the condition as failed rather than silently passing it
|
|
276
|
+
conditionsSuccess = false;
|
|
273
277
|
}
|
|
274
278
|
}
|
|
275
279
|
}
|
package/types/apidom-ls.d.ts
CHANGED
|
@@ -1063,16 +1063,6 @@ export declare enum ApilintCodes {
|
|
|
1063
1063
|
OPENAPI3_1_HEADER_FIELD_CONTENT_ALLOWED_FIELDS = 7080100,
|
|
1064
1064
|
OPENAPI3_1_COMPONENTS = 7090000,
|
|
1065
1065
|
OPENAPI3_1_COMPONENTS_FIELD_PATH_ITEMS_VALUES_TYPE = 7090100,
|
|
1066
|
-
ADS = 8000000,
|
|
1067
|
-
ADS_INFO = 8010000,
|
|
1068
|
-
ADS_INFO_FIELD_DESCRIPTION_TYPE = 8010100,
|
|
1069
|
-
ADS_INFO_FIELD_TITLE_TYPE = 8010200,
|
|
1070
|
-
ADS_INFO_FIELD_TITLE_REQUIRED = 8010201,
|
|
1071
|
-
ADS_MAIN = 8020000,
|
|
1072
|
-
ADS_MAIN_FIELD_VERSION_PATTERN = 8020100,
|
|
1073
|
-
ADS_MAIN_FIELD_VERSION_REQUIRED = 8020101,
|
|
1074
|
-
ADS_MAIN_FIELD_INFO_TYPE = 8020200,
|
|
1075
|
-
ADS_MAIN_FIELD_INFO_REQUIRED = 8020201,
|
|
1076
1066
|
JSON_SCHEMA_2020_12 = 8030000,
|
|
1077
1067
|
JSON_SCHEMA_2020_12_KEYWORD_$ID_FORMAT_URI = 8030100,
|
|
1078
1068
|
JSON_SCHEMA_2020_12_KEYWORD_$SCHEMA_FORMAT_URI = 8030200,
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
|
|
9
|
-
var _meta = _interopRequireDefault(require("./info/meta.cjs"));
|
|
10
|
-
var _meta2 = _interopRequireDefault(require("./main/meta.cjs"));
|
|
11
|
-
var _codes = _interopRequireDefault(require("../codes.cjs"));
|
|
12
|
-
var _default = exports.default = {
|
|
13
|
-
'*': {
|
|
14
|
-
lint: [{
|
|
15
|
-
code: _codes.default.DUPLICATE_KEYS,
|
|
16
|
-
source: 'apilint',
|
|
17
|
-
message: 'an object cannot contain duplicate keys',
|
|
18
|
-
severity: _vscodeLanguageserverTypes.DiagnosticSeverity.Error,
|
|
19
|
-
linterFunction: 'apilintNoDuplicateKeys',
|
|
20
|
-
marker: 'key'
|
|
21
|
-
}]
|
|
22
|
-
},
|
|
23
|
-
info: _meta.default,
|
|
24
|
-
main: _meta2.default
|
|
25
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
2
|
-
import infoMeta from "./info/meta.mjs";
|
|
3
|
-
import mainMeta from "./main/meta.mjs";
|
|
4
|
-
import ApilintCodes from "../codes.mjs";
|
|
5
|
-
export default {
|
|
6
|
-
'*': {
|
|
7
|
-
lint: [{
|
|
8
|
-
code: ApilintCodes.DUPLICATE_KEYS,
|
|
9
|
-
source: 'apilint',
|
|
10
|
-
message: 'an object cannot contain duplicate keys',
|
|
11
|
-
severity: DiagnosticSeverity.Error,
|
|
12
|
-
linterFunction: 'apilintNoDuplicateKeys',
|
|
13
|
-
marker: 'key'
|
|
14
|
-
}]
|
|
15
|
-
},
|
|
16
|
-
info: infoMeta,
|
|
17
|
-
main: mainMeta
|
|
18
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _apidomLanguageTypes = require("../../../apidom-language-types.cjs");
|
|
8
|
-
const completion = [{
|
|
9
|
-
label: 'title',
|
|
10
|
-
insertText: 'title',
|
|
11
|
-
kind: 14,
|
|
12
|
-
format: _apidomLanguageTypes.CompletionFormat.QUOTED,
|
|
13
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
14
|
-
insertTextFormat: 2,
|
|
15
|
-
documentation: {
|
|
16
|
-
kind: 'markdown',
|
|
17
|
-
value: 'Title of API Design System'
|
|
18
|
-
}
|
|
19
|
-
}, {
|
|
20
|
-
label: 'description',
|
|
21
|
-
insertText: 'description',
|
|
22
|
-
kind: 14,
|
|
23
|
-
format: _apidomLanguageTypes.CompletionFormat.QUOTED,
|
|
24
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
25
|
-
insertTextFormat: 2,
|
|
26
|
-
documentation: {
|
|
27
|
-
kind: 'markdown',
|
|
28
|
-
value: '(optional) - description of the API Design System'
|
|
29
|
-
}
|
|
30
|
-
}];
|
|
31
|
-
var _default = exports.default = completion;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CompletionFormat, CompletionType } from "../../../apidom-language-types.mjs";
|
|
2
|
-
const completion = [{
|
|
3
|
-
label: 'title',
|
|
4
|
-
insertText: 'title',
|
|
5
|
-
kind: 14,
|
|
6
|
-
format: CompletionFormat.QUOTED,
|
|
7
|
-
type: CompletionType.PROPERTY,
|
|
8
|
-
insertTextFormat: 2,
|
|
9
|
-
documentation: {
|
|
10
|
-
kind: 'markdown',
|
|
11
|
-
value: 'Title of API Design System'
|
|
12
|
-
}
|
|
13
|
-
}, {
|
|
14
|
-
label: 'description',
|
|
15
|
-
insertText: 'description',
|
|
16
|
-
kind: 14,
|
|
17
|
-
format: CompletionFormat.QUOTED,
|
|
18
|
-
type: CompletionType.PROPERTY,
|
|
19
|
-
insertTextFormat: 2,
|
|
20
|
-
documentation: {
|
|
21
|
-
kind: 'markdown',
|
|
22
|
-
value: '(optional) - description of the API Design System'
|
|
23
|
-
}
|
|
24
|
-
}];
|
|
25
|
-
export default completion;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
const documentation = [{
|
|
8
|
-
target: 'title',
|
|
9
|
-
docs: 'Title of API Design System'
|
|
10
|
-
}, {
|
|
11
|
-
target: 'description',
|
|
12
|
-
docs: '(optional) - description of the API Design System'
|
|
13
|
-
}];
|
|
14
|
-
var _default = exports.default = documentation;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
|
|
9
|
-
var _codes = _interopRequireDefault(require("../../../codes.cjs"));
|
|
10
|
-
const allowedFieldsLint = {
|
|
11
|
-
code: _codes.default.NOT_ALLOWED_FIELDS,
|
|
12
|
-
source: 'apilint',
|
|
13
|
-
message: 'Object includes not allowed fields',
|
|
14
|
-
severity: _vscodeLanguageserverTypes.DiagnosticSeverity.Error,
|
|
15
|
-
linterFunction: 'allowedFields',
|
|
16
|
-
linterParams: [['title', 'description'], 'x-'],
|
|
17
|
-
marker: 'key'
|
|
18
|
-
};
|
|
19
|
-
var _default = exports.default = allowedFieldsLint;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
2
|
-
import ApilintCodes from "../../../codes.mjs";
|
|
3
|
-
const allowedFieldsLint = {
|
|
4
|
-
code: ApilintCodes.NOT_ALLOWED_FIELDS,
|
|
5
|
-
source: 'apilint',
|
|
6
|
-
message: 'Object includes not allowed fields',
|
|
7
|
-
severity: DiagnosticSeverity.Error,
|
|
8
|
-
linterFunction: 'allowedFields',
|
|
9
|
-
linterParams: [['title', 'description'], 'x-'],
|
|
10
|
-
marker: 'key'
|
|
11
|
-
};
|
|
12
|
-
export default allowedFieldsLint;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
|
|
9
|
-
var _codes = _interopRequireDefault(require("../../../codes.cjs"));
|
|
10
|
-
const descriptionTypeLint = {
|
|
11
|
-
code: _codes.default.ADS_INFO_FIELD_DESCRIPTION_TYPE,
|
|
12
|
-
source: 'apilint',
|
|
13
|
-
message: 'description must be a string',
|
|
14
|
-
severity: _vscodeLanguageserverTypes.DiagnosticSeverity.Error,
|
|
15
|
-
linterFunction: 'apilintType',
|
|
16
|
-
linterParams: ['string'],
|
|
17
|
-
marker: 'value',
|
|
18
|
-
target: 'description',
|
|
19
|
-
data: {}
|
|
20
|
-
};
|
|
21
|
-
var _default = exports.default = descriptionTypeLint;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
2
|
-
import ApilintCodes from "../../../codes.mjs";
|
|
3
|
-
const descriptionTypeLint = {
|
|
4
|
-
code: ApilintCodes.ADS_INFO_FIELD_DESCRIPTION_TYPE,
|
|
5
|
-
source: 'apilint',
|
|
6
|
-
message: 'description must be a string',
|
|
7
|
-
severity: DiagnosticSeverity.Error,
|
|
8
|
-
linterFunction: 'apilintType',
|
|
9
|
-
linterParams: ['string'],
|
|
10
|
-
marker: 'value',
|
|
11
|
-
target: 'description',
|
|
12
|
-
data: {}
|
|
13
|
-
};
|
|
14
|
-
export default descriptionTypeLint;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _titleRequired = _interopRequireDefault(require("./title--required.cjs"));
|
|
9
|
-
var _titleType = _interopRequireDefault(require("./title--type.cjs"));
|
|
10
|
-
var _descriptionType = _interopRequireDefault(require("./description--type.cjs"));
|
|
11
|
-
var _allowedFields = _interopRequireDefault(require("./allowed-fields.cjs"));
|
|
12
|
-
const lints = [_titleType.default, _titleRequired.default, _descriptionType.default, _allowedFields.default];
|
|
13
|
-
var _default = exports.default = lints;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import titleRequiredLint from "./title--required.mjs";
|
|
2
|
-
import titleTypeLint from "./title--type.mjs";
|
|
3
|
-
import descriptionTypeLint from "./description--type.mjs";
|
|
4
|
-
import allowedFieldsLint from "./allowed-fields.mjs";
|
|
5
|
-
const lints = [titleTypeLint, titleRequiredLint, descriptionTypeLint, allowedFieldsLint];
|
|
6
|
-
export default lints;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
|
|
9
|
-
var _codes = _interopRequireDefault(require("../../../codes.cjs"));
|
|
10
|
-
const titleRequiredLint = {
|
|
11
|
-
code: _codes.default.ADS_INFO_FIELD_TITLE_REQUIRED,
|
|
12
|
-
source: 'apilint',
|
|
13
|
-
message: "should always have a 'title'",
|
|
14
|
-
severity: _vscodeLanguageserverTypes.DiagnosticSeverity.Error,
|
|
15
|
-
linterFunction: 'hasRequiredField',
|
|
16
|
-
linterParams: ['title'],
|
|
17
|
-
marker: 'key',
|
|
18
|
-
data: {
|
|
19
|
-
quickFix: [{
|
|
20
|
-
message: "add 'title' field",
|
|
21
|
-
action: 'addChild',
|
|
22
|
-
snippetYaml: 'title: \n ',
|
|
23
|
-
snippetJson: '"title": "",\n '
|
|
24
|
-
}]
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var _default = exports.default = titleRequiredLint;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
2
|
-
import ApilintCodes from "../../../codes.mjs";
|
|
3
|
-
const titleRequiredLint = {
|
|
4
|
-
code: ApilintCodes.ADS_INFO_FIELD_TITLE_REQUIRED,
|
|
5
|
-
source: 'apilint',
|
|
6
|
-
message: "should always have a 'title'",
|
|
7
|
-
severity: DiagnosticSeverity.Error,
|
|
8
|
-
linterFunction: 'hasRequiredField',
|
|
9
|
-
linterParams: ['title'],
|
|
10
|
-
marker: 'key',
|
|
11
|
-
data: {
|
|
12
|
-
quickFix: [{
|
|
13
|
-
message: "add 'title' field",
|
|
14
|
-
action: 'addChild',
|
|
15
|
-
snippetYaml: 'title: \n ',
|
|
16
|
-
snippetJson: '"title": "",\n '
|
|
17
|
-
}]
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
export default titleRequiredLint;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
|
|
9
|
-
var _codes = _interopRequireDefault(require("../../../codes.cjs"));
|
|
10
|
-
const titleTypeLint = {
|
|
11
|
-
code: _codes.default.ADS_INFO_FIELD_TITLE_TYPE,
|
|
12
|
-
source: 'apilint',
|
|
13
|
-
message: 'title must be a string',
|
|
14
|
-
severity: _vscodeLanguageserverTypes.DiagnosticSeverity.Error,
|
|
15
|
-
linterFunction: 'apilintType',
|
|
16
|
-
linterParams: ['string'],
|
|
17
|
-
marker: 'value',
|
|
18
|
-
target: 'title',
|
|
19
|
-
data: {}
|
|
20
|
-
};
|
|
21
|
-
var _default = exports.default = titleTypeLint;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
2
|
-
import ApilintCodes from "../../../codes.mjs";
|
|
3
|
-
const titleTypeLint = {
|
|
4
|
-
code: ApilintCodes.ADS_INFO_FIELD_TITLE_TYPE,
|
|
5
|
-
source: 'apilint',
|
|
6
|
-
message: 'title must be a string',
|
|
7
|
-
severity: DiagnosticSeverity.Error,
|
|
8
|
-
linterFunction: 'apilintType',
|
|
9
|
-
linterParams: ['string'],
|
|
10
|
-
marker: 'value',
|
|
11
|
-
target: 'title',
|
|
12
|
-
data: {}
|
|
13
|
-
};
|
|
14
|
-
export default titleTypeLint;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _index = _interopRequireDefault(require("./lint/index.cjs"));
|
|
9
|
-
var _completion = _interopRequireDefault(require("./completion.cjs"));
|
|
10
|
-
var _documentation = _interopRequireDefault(require("./documentation.cjs"));
|
|
11
|
-
const meta = {
|
|
12
|
-
lint: _index.default,
|
|
13
|
-
completion: _completion.default,
|
|
14
|
-
documentation: _documentation.default
|
|
15
|
-
};
|
|
16
|
-
var _default = exports.default = meta;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _apidomLanguageTypes = require("../../../apidom-language-types.cjs");
|
|
8
|
-
const completion = [{
|
|
9
|
-
label: 'info',
|
|
10
|
-
insertText: 'info',
|
|
11
|
-
kind: 14,
|
|
12
|
-
format: _apidomLanguageTypes.CompletionFormat.OBJECT,
|
|
13
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
14
|
-
insertTextFormat: 2,
|
|
15
|
-
documentation: {
|
|
16
|
-
kind: 'markdown',
|
|
17
|
-
value: 'Info (object)'
|
|
18
|
-
}
|
|
19
|
-
}, {
|
|
20
|
-
label: 'version',
|
|
21
|
-
insertText: 'version',
|
|
22
|
-
kind: 14,
|
|
23
|
-
format: _apidomLanguageTypes.CompletionFormat.QUOTED,
|
|
24
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
25
|
-
insertTextFormat: 2,
|
|
26
|
-
documentation: {
|
|
27
|
-
kind: 'markdown',
|
|
28
|
-
value: 'current version of the specification.\n\n'
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
label: 'principles',
|
|
32
|
-
insertText: 'principles',
|
|
33
|
-
kind: 14,
|
|
34
|
-
format: _apidomLanguageTypes.CompletionFormat.ARRAY,
|
|
35
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
36
|
-
insertTextFormat: 2,
|
|
37
|
-
documentation: {
|
|
38
|
-
kind: 'markdown',
|
|
39
|
-
value: '(array[[Principle](https://apidesign.systems/specification/#principle)]) - requirements for API principles'
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
label: 'standards',
|
|
43
|
-
insertText: 'standards',
|
|
44
|
-
kind: 14,
|
|
45
|
-
format: _apidomLanguageTypes.CompletionFormat.ARRAY,
|
|
46
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
47
|
-
insertTextFormat: 2,
|
|
48
|
-
documentation: {
|
|
49
|
-
kind: 'markdown',
|
|
50
|
-
value: '(array[[Standard](https://apidesign.systems/specification/#standard)]) - requirements for API standards'
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
label: 'scenarios',
|
|
54
|
-
insertText: 'scenarios',
|
|
55
|
-
kind: 14,
|
|
56
|
-
format: _apidomLanguageTypes.CompletionFormat.ARRAY,
|
|
57
|
-
type: _apidomLanguageTypes.CompletionType.PROPERTY,
|
|
58
|
-
insertTextFormat: 2,
|
|
59
|
-
documentation: {
|
|
60
|
-
kind: 'markdown',
|
|
61
|
-
value: '(array[[Scenarios](https://apidesign.systems/specification/#scenario)]) - requirements for API scenarios'
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
target: 'version',
|
|
65
|
-
label: '2021-05-07',
|
|
66
|
-
insertText: '2021-05-07',
|
|
67
|
-
kind: 12,
|
|
68
|
-
format: _apidomLanguageTypes.CompletionFormat.QUOTED_FORCED,
|
|
69
|
-
type: _apidomLanguageTypes.CompletionType.VALUE,
|
|
70
|
-
insertTextFormat: 2
|
|
71
|
-
}];
|
|
72
|
-
var _default = exports.default = completion;
|