@luxass/spectral-ruleset 1.0.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ruleset.cjs +68 -92
- package/dist/{ruleset.js → ruleset.mjs} +49 -49
- package/package.json +22 -20
package/dist/ruleset.cjs
CHANGED
|
@@ -1,154 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
const __stoplight_spectral_functions = __toESM(require("@stoplight/spectral-functions"));
|
|
26
|
-
const __stoplight_spectral_rulesets = __toESM(require("@stoplight/spectral-rulesets"));
|
|
27
|
-
const __stoplight_spectral_formats = __toESM(require("@stoplight/spectral-formats"));
|
|
1
|
+
let _stoplight_spectral_functions = require("@stoplight/spectral-functions");
|
|
2
|
+
let _stoplight_spectral_rulesets = require("@stoplight/spectral-rulesets");
|
|
3
|
+
let _stoplight_spectral_formats = require("@stoplight/spectral-formats");
|
|
28
4
|
|
|
29
5
|
//#region node_modules/.pnpm/@stoplight+types@14.1.1/node_modules/@stoplight/types/dist/index.mjs
|
|
30
6
|
var HttpOperationSecurityDeclarationTypes;
|
|
31
|
-
(function(HttpOperationSecurityDeclarationTypes
|
|
7
|
+
(function(HttpOperationSecurityDeclarationTypes) {
|
|
32
8
|
/** Indicates that the operation has no security declarations. */
|
|
33
|
-
HttpOperationSecurityDeclarationTypes
|
|
9
|
+
HttpOperationSecurityDeclarationTypes["None"] = "none";
|
|
34
10
|
/** Indicates that the operation has explicit security declarations. */
|
|
35
|
-
HttpOperationSecurityDeclarationTypes
|
|
11
|
+
HttpOperationSecurityDeclarationTypes["Declared"] = "declared";
|
|
36
12
|
/** Indicates that the operation inherits its security declarations from the service. */
|
|
37
|
-
HttpOperationSecurityDeclarationTypes
|
|
13
|
+
HttpOperationSecurityDeclarationTypes["InheritedFromService"] = "inheritedFromService";
|
|
38
14
|
})(HttpOperationSecurityDeclarationTypes || (HttpOperationSecurityDeclarationTypes = {}));
|
|
39
15
|
var HttpParamStyles;
|
|
40
|
-
(function(HttpParamStyles
|
|
16
|
+
(function(HttpParamStyles) {
|
|
41
17
|
/** Used when OAS2 type !== array */
|
|
42
|
-
HttpParamStyles
|
|
18
|
+
HttpParamStyles["Unspecified"] = "unspecified";
|
|
43
19
|
/**
|
|
44
20
|
* OAS 3.x style simple
|
|
45
21
|
* OAS 2 collectionFormat csv
|
|
46
22
|
*/
|
|
47
|
-
HttpParamStyles
|
|
23
|
+
HttpParamStyles["Simple"] = "simple";
|
|
48
24
|
/**
|
|
49
25
|
* OAS 3.x style matrix
|
|
50
26
|
* OAS 2 collectionFormat no support
|
|
51
27
|
*/
|
|
52
|
-
HttpParamStyles
|
|
28
|
+
HttpParamStyles["Matrix"] = "matrix";
|
|
53
29
|
/**
|
|
54
30
|
* OAS 3.x style label
|
|
55
31
|
* OAS 2 collectionFormat no support
|
|
56
32
|
*/
|
|
57
|
-
HttpParamStyles
|
|
33
|
+
HttpParamStyles["Label"] = "label";
|
|
58
34
|
/**
|
|
59
35
|
* OAS 3.x style form
|
|
60
36
|
* OAS 2 collectionFormat
|
|
61
37
|
* * csv, when explode === false
|
|
62
38
|
* * multi, when explode === true
|
|
63
39
|
*/
|
|
64
|
-
HttpParamStyles
|
|
40
|
+
HttpParamStyles["Form"] = "form";
|
|
65
41
|
/**
|
|
66
42
|
* OAS 3.x no support
|
|
67
43
|
* OAS 2 collectionFormat csv when explode === undefined
|
|
68
44
|
*/
|
|
69
|
-
HttpParamStyles
|
|
45
|
+
HttpParamStyles["CommaDelimited"] = "commaDelimited";
|
|
70
46
|
/**
|
|
71
47
|
* OAS 3.x style spaceDelimited
|
|
72
48
|
* OAS 2 collectionFormat ssv
|
|
73
49
|
*/
|
|
74
|
-
HttpParamStyles
|
|
50
|
+
HttpParamStyles["SpaceDelimited"] = "spaceDelimited";
|
|
75
51
|
/**
|
|
76
52
|
* OAS 3.x style spaceDelimited
|
|
77
53
|
* OAS 2 collectionFormat pipes
|
|
78
54
|
*/
|
|
79
|
-
HttpParamStyles
|
|
55
|
+
HttpParamStyles["PipeDelimited"] = "pipeDelimited";
|
|
80
56
|
/**
|
|
81
57
|
* OAS 3.x style deepObject
|
|
82
58
|
* OAS 2 collectionFormat no support
|
|
83
59
|
*/
|
|
84
|
-
HttpParamStyles
|
|
60
|
+
HttpParamStyles["DeepObject"] = "deepObject";
|
|
85
61
|
/**
|
|
86
62
|
* OAS 3.x style no support
|
|
87
63
|
* OAS 2 collectionFormat tsv
|
|
88
64
|
*/
|
|
89
|
-
HttpParamStyles
|
|
65
|
+
HttpParamStyles["TabDelimited"] = "tabDelimited";
|
|
90
66
|
})(HttpParamStyles || (HttpParamStyles = {}));
|
|
91
67
|
/**
|
|
92
68
|
* Represents the severity of diagnostics.
|
|
93
69
|
*/
|
|
94
70
|
var DiagnosticSeverity;
|
|
95
|
-
(function(DiagnosticSeverity
|
|
71
|
+
(function(DiagnosticSeverity) {
|
|
96
72
|
/**
|
|
97
73
|
* Something not allowed by the rules of a language or other means.
|
|
98
74
|
*/
|
|
99
|
-
DiagnosticSeverity
|
|
75
|
+
DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
|
|
100
76
|
/**
|
|
101
77
|
* Something suspicious but allowed.
|
|
102
78
|
*/
|
|
103
|
-
DiagnosticSeverity
|
|
79
|
+
DiagnosticSeverity[DiagnosticSeverity["Warning"] = 1] = "Warning";
|
|
104
80
|
/**
|
|
105
81
|
* Something to inform about but not a problem.
|
|
106
82
|
*/
|
|
107
|
-
DiagnosticSeverity
|
|
83
|
+
DiagnosticSeverity[DiagnosticSeverity["Information"] = 2] = "Information";
|
|
108
84
|
/**
|
|
109
85
|
* Something to hint to a better way of doing it, like proposing
|
|
110
86
|
* a refactoring.
|
|
111
87
|
*/
|
|
112
|
-
DiagnosticSeverity
|
|
88
|
+
DiagnosticSeverity[DiagnosticSeverity["Hint"] = 3] = "Hint";
|
|
113
89
|
})(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
|
114
90
|
/**
|
|
115
91
|
* Stoplight node types
|
|
116
92
|
*/
|
|
117
93
|
var NodeType;
|
|
118
|
-
(function(NodeType
|
|
119
|
-
NodeType
|
|
120
|
-
NodeType
|
|
121
|
-
NodeType
|
|
122
|
-
NodeType
|
|
123
|
-
NodeType
|
|
124
|
-
NodeType
|
|
125
|
-
NodeType
|
|
126
|
-
NodeType
|
|
127
|
-
NodeType
|
|
128
|
-
NodeType
|
|
129
|
-
NodeType
|
|
130
|
-
NodeType
|
|
131
|
-
NodeType
|
|
132
|
-
NodeType
|
|
133
|
-
NodeType
|
|
94
|
+
(function(NodeType) {
|
|
95
|
+
NodeType["Article"] = "article";
|
|
96
|
+
NodeType["HttpService"] = "http_service";
|
|
97
|
+
NodeType["HttpServer"] = "http_server";
|
|
98
|
+
NodeType["HttpOperation"] = "http_operation";
|
|
99
|
+
NodeType["HttpCallback"] = "http_callback";
|
|
100
|
+
NodeType["HttpWebhook"] = "http_webhook";
|
|
101
|
+
NodeType["Model"] = "model";
|
|
102
|
+
NodeType["Generic"] = "generic";
|
|
103
|
+
NodeType["Unknown"] = "unknown";
|
|
104
|
+
NodeType["TableOfContents"] = "table_of_contents";
|
|
105
|
+
NodeType["SpectralRuleset"] = "spectral_ruleset";
|
|
106
|
+
NodeType["Styleguide"] = "styleguide";
|
|
107
|
+
NodeType["Image"] = "image";
|
|
108
|
+
NodeType["StoplightResolutions"] = "stoplight_resolutions";
|
|
109
|
+
NodeType["StoplightOverride"] = "stoplight_override";
|
|
134
110
|
})(NodeType || (NodeType = {}));
|
|
135
111
|
/**
|
|
136
112
|
* Node data formats
|
|
137
113
|
*/
|
|
138
114
|
var NodeFormat;
|
|
139
|
-
(function(NodeFormat
|
|
140
|
-
NodeFormat
|
|
141
|
-
NodeFormat
|
|
142
|
-
NodeFormat
|
|
143
|
-
NodeFormat
|
|
144
|
-
NodeFormat
|
|
145
|
-
NodeFormat
|
|
146
|
-
NodeFormat
|
|
147
|
-
NodeFormat
|
|
148
|
-
NodeFormat
|
|
149
|
-
NodeFormat
|
|
150
|
-
NodeFormat
|
|
151
|
-
NodeFormat
|
|
115
|
+
(function(NodeFormat) {
|
|
116
|
+
NodeFormat["Json"] = "json";
|
|
117
|
+
NodeFormat["Markdown"] = "markdown";
|
|
118
|
+
NodeFormat["Yaml"] = "yaml";
|
|
119
|
+
NodeFormat["Javascript"] = "javascript";
|
|
120
|
+
NodeFormat["Apng"] = "apng";
|
|
121
|
+
NodeFormat["Avif"] = "avif";
|
|
122
|
+
NodeFormat["Bmp"] = "bmp";
|
|
123
|
+
NodeFormat["Gif"] = "gif";
|
|
124
|
+
NodeFormat["Jpeg"] = "jpeg";
|
|
125
|
+
NodeFormat["Png"] = "png";
|
|
126
|
+
NodeFormat["Svg"] = "svg";
|
|
127
|
+
NodeFormat["Webp"] = "webp";
|
|
152
128
|
})(NodeFormat || (NodeFormat = {}));
|
|
153
129
|
|
|
154
130
|
//#endregion
|
|
@@ -159,15 +135,15 @@ var oas2_default = {
|
|
|
159
135
|
description: "Defining a request body on a HTTP GET is technically possible in some implementations, but is increasingly frowned upon due to the confusion that comes from unspecified behavior in the HTTP specification.",
|
|
160
136
|
given: "$.paths..get.parameters..in",
|
|
161
137
|
then: {
|
|
162
|
-
function:
|
|
138
|
+
function: _stoplight_spectral_functions.pattern,
|
|
163
139
|
functionOptions: { notMatch: "/^body$/" }
|
|
164
140
|
},
|
|
165
141
|
severity: DiagnosticSeverity.Error,
|
|
166
|
-
formats: [
|
|
142
|
+
formats: [_stoplight_spectral_formats.oas2]
|
|
167
143
|
},
|
|
168
144
|
"luxass/oas2/protocol-https-only": {
|
|
169
145
|
description: "ALL requests MUST go through `https` protocol only.",
|
|
170
|
-
formats: [
|
|
146
|
+
formats: [_stoplight_spectral_formats.oas2],
|
|
171
147
|
message: "Schemes MUST be https and no other value is allowed.",
|
|
172
148
|
severity: DiagnosticSeverity.Error,
|
|
173
149
|
recommended: true,
|
|
@@ -175,7 +151,7 @@ var oas2_default = {
|
|
|
175
151
|
given: "$",
|
|
176
152
|
then: {
|
|
177
153
|
field: "schemes",
|
|
178
|
-
function:
|
|
154
|
+
function: _stoplight_spectral_functions.schema,
|
|
179
155
|
functionOptions: { schema: {
|
|
180
156
|
type: "array",
|
|
181
157
|
items: {
|
|
@@ -192,14 +168,14 @@ var oas2_default = {
|
|
|
192
168
|
var oas3_default = {
|
|
193
169
|
"luxass/oas3/protocol-https-only": {
|
|
194
170
|
description: "ALL requests MUST go through `https` protocol only.",
|
|
195
|
-
formats: [
|
|
171
|
+
formats: [_stoplight_spectral_formats.oas3],
|
|
196
172
|
message: "Schemes MUST be https and no other value is allowed.",
|
|
197
173
|
severity: DiagnosticSeverity.Error,
|
|
198
174
|
recommended: true,
|
|
199
175
|
type: "style",
|
|
200
176
|
given: "$.servers..url",
|
|
201
177
|
then: {
|
|
202
|
-
function:
|
|
178
|
+
function: _stoplight_spectral_functions.pattern,
|
|
203
179
|
functionOptions: { match: "/^https:/" }
|
|
204
180
|
}
|
|
205
181
|
},
|
|
@@ -207,8 +183,8 @@ var oas3_default = {
|
|
|
207
183
|
message: "A `GET` request MUST NOT accept a request body.",
|
|
208
184
|
description: "Defining a request body on a HTTP GET is in some implementations, but is increasingly frowned upon due to the confusion that comes from unspecified behavior in the HTTP specification.",
|
|
209
185
|
given: "$.paths..get.requestBody",
|
|
210
|
-
then: { function:
|
|
211
|
-
formats: [
|
|
186
|
+
then: { function: _stoplight_spectral_functions.undefined },
|
|
187
|
+
formats: [_stoplight_spectral_formats.oas3],
|
|
212
188
|
severity: DiagnosticSeverity.Error
|
|
213
189
|
}
|
|
214
190
|
};
|
|
@@ -216,7 +192,7 @@ var oas3_default = {
|
|
|
216
192
|
//#endregion
|
|
217
193
|
//#region src/ruleset.ts
|
|
218
194
|
var ruleset_default = {
|
|
219
|
-
extends: [[
|
|
195
|
+
extends: [[_stoplight_spectral_rulesets.oas, "all"], [_stoplight_spectral_rulesets.asyncapi, "all"]],
|
|
220
196
|
rules: {
|
|
221
197
|
"operation-tags": "off",
|
|
222
198
|
"operation-operationId": "off",
|
|
@@ -227,7 +203,7 @@ var ruleset_default = {
|
|
|
227
203
|
given: "$.paths",
|
|
228
204
|
then: {
|
|
229
205
|
field: "/",
|
|
230
|
-
function:
|
|
206
|
+
function: _stoplight_spectral_functions.truthy
|
|
231
207
|
},
|
|
232
208
|
severity: DiagnosticSeverity.Warning
|
|
233
209
|
},
|
|
@@ -237,7 +213,7 @@ var ruleset_default = {
|
|
|
237
213
|
given: "$.paths[/]",
|
|
238
214
|
then: {
|
|
239
215
|
field: "get",
|
|
240
|
-
function:
|
|
216
|
+
function: _stoplight_spectral_functions.truthy
|
|
241
217
|
},
|
|
242
218
|
severity: DiagnosticSeverity.Warning
|
|
243
219
|
},
|
|
@@ -246,7 +222,7 @@ var ruleset_default = {
|
|
|
246
222
|
description: "Headers starting with X- is an awkward convention which is entirely unnecessary. There is probably a standard for what you're trying to do, so it would be better to use that. If there is not a standard already perhaps there's a draft that you could help mature through use and feedback.\n\nSee what you can find on https://standards.rest.\n\nMore about X- headers here: https://tools.ietf.org/html/rfc6648.",
|
|
247
223
|
given: "$..parameters[?(@.in === 'header')].name",
|
|
248
224
|
then: {
|
|
249
|
-
function:
|
|
225
|
+
function: _stoplight_spectral_functions.pattern,
|
|
250
226
|
functionOptions: { notMatch: "^(x|X)-" }
|
|
251
227
|
},
|
|
252
228
|
severity: DiagnosticSeverity.Error
|
|
@@ -256,7 +232,7 @@ var ruleset_default = {
|
|
|
256
232
|
description: "Paths must not include file extensions such as `.json`, `.xml`, `.html` and `.txt`. Use the OpenAPI `content` keyword to tell consumers which Media Types are available.",
|
|
257
233
|
given: "$.paths[*]~",
|
|
258
234
|
then: {
|
|
259
|
-
function:
|
|
235
|
+
function: _stoplight_spectral_functions.pattern,
|
|
260
236
|
functionOptions: { notMatch: ".(json|xml|html|txt)$" }
|
|
261
237
|
},
|
|
262
238
|
severity: DiagnosticSeverity.Error
|
|
@@ -268,7 +244,7 @@ var ruleset_default = {
|
|
|
268
244
|
message: "{{property}} is not kebab-case: {{error}}",
|
|
269
245
|
given: "$.paths[*]~",
|
|
270
246
|
then: {
|
|
271
|
-
function:
|
|
247
|
+
function: _stoplight_spectral_functions.pattern,
|
|
272
248
|
functionOptions: { match: "^/([a-z0-9]+(-[a-z0-9]+)*)?(/[a-z0-9]+(-[a-z0-9]+)*|/{.+})*$" }
|
|
273
249
|
}
|
|
274
250
|
},
|
|
@@ -279,7 +255,7 @@ var ruleset_default = {
|
|
|
279
255
|
message: "{{property}} is not hyphenated-pascal-case: {{error}}",
|
|
280
256
|
given: "$..parameters[?(@.in == 'header')].name",
|
|
281
257
|
then: {
|
|
282
|
-
function:
|
|
258
|
+
function: _stoplight_spectral_functions.pattern,
|
|
283
259
|
functionOptions: { match: "^[A-Z][a-z0-9]*(-[A-Z][a-z0-9]*)*$" }
|
|
284
260
|
}
|
|
285
261
|
},
|
|
@@ -288,7 +264,7 @@ var ruleset_default = {
|
|
|
288
264
|
description: "The info.version field should follow semantic versioning (e.g., 1.0.0).",
|
|
289
265
|
given: "$.info.version",
|
|
290
266
|
then: {
|
|
291
|
-
function:
|
|
267
|
+
function: _stoplight_spectral_functions.pattern,
|
|
292
268
|
functionOptions: { match: "^\\d+\\.\\d+\\.\\d+" }
|
|
293
269
|
},
|
|
294
270
|
severity: DiagnosticSeverity.Warning
|
|
@@ -4,127 +4,127 @@ import { oas2, oas3 } from "@stoplight/spectral-formats";
|
|
|
4
4
|
|
|
5
5
|
//#region node_modules/.pnpm/@stoplight+types@14.1.1/node_modules/@stoplight/types/dist/index.mjs
|
|
6
6
|
var HttpOperationSecurityDeclarationTypes;
|
|
7
|
-
(function(HttpOperationSecurityDeclarationTypes
|
|
7
|
+
(function(HttpOperationSecurityDeclarationTypes) {
|
|
8
8
|
/** Indicates that the operation has no security declarations. */
|
|
9
|
-
HttpOperationSecurityDeclarationTypes
|
|
9
|
+
HttpOperationSecurityDeclarationTypes["None"] = "none";
|
|
10
10
|
/** Indicates that the operation has explicit security declarations. */
|
|
11
|
-
HttpOperationSecurityDeclarationTypes
|
|
11
|
+
HttpOperationSecurityDeclarationTypes["Declared"] = "declared";
|
|
12
12
|
/** Indicates that the operation inherits its security declarations from the service. */
|
|
13
|
-
HttpOperationSecurityDeclarationTypes
|
|
13
|
+
HttpOperationSecurityDeclarationTypes["InheritedFromService"] = "inheritedFromService";
|
|
14
14
|
})(HttpOperationSecurityDeclarationTypes || (HttpOperationSecurityDeclarationTypes = {}));
|
|
15
15
|
var HttpParamStyles;
|
|
16
|
-
(function(HttpParamStyles
|
|
16
|
+
(function(HttpParamStyles) {
|
|
17
17
|
/** Used when OAS2 type !== array */
|
|
18
|
-
HttpParamStyles
|
|
18
|
+
HttpParamStyles["Unspecified"] = "unspecified";
|
|
19
19
|
/**
|
|
20
20
|
* OAS 3.x style simple
|
|
21
21
|
* OAS 2 collectionFormat csv
|
|
22
22
|
*/
|
|
23
|
-
HttpParamStyles
|
|
23
|
+
HttpParamStyles["Simple"] = "simple";
|
|
24
24
|
/**
|
|
25
25
|
* OAS 3.x style matrix
|
|
26
26
|
* OAS 2 collectionFormat no support
|
|
27
27
|
*/
|
|
28
|
-
HttpParamStyles
|
|
28
|
+
HttpParamStyles["Matrix"] = "matrix";
|
|
29
29
|
/**
|
|
30
30
|
* OAS 3.x style label
|
|
31
31
|
* OAS 2 collectionFormat no support
|
|
32
32
|
*/
|
|
33
|
-
HttpParamStyles
|
|
33
|
+
HttpParamStyles["Label"] = "label";
|
|
34
34
|
/**
|
|
35
35
|
* OAS 3.x style form
|
|
36
36
|
* OAS 2 collectionFormat
|
|
37
37
|
* * csv, when explode === false
|
|
38
38
|
* * multi, when explode === true
|
|
39
39
|
*/
|
|
40
|
-
HttpParamStyles
|
|
40
|
+
HttpParamStyles["Form"] = "form";
|
|
41
41
|
/**
|
|
42
42
|
* OAS 3.x no support
|
|
43
43
|
* OAS 2 collectionFormat csv when explode === undefined
|
|
44
44
|
*/
|
|
45
|
-
HttpParamStyles
|
|
45
|
+
HttpParamStyles["CommaDelimited"] = "commaDelimited";
|
|
46
46
|
/**
|
|
47
47
|
* OAS 3.x style spaceDelimited
|
|
48
48
|
* OAS 2 collectionFormat ssv
|
|
49
49
|
*/
|
|
50
|
-
HttpParamStyles
|
|
50
|
+
HttpParamStyles["SpaceDelimited"] = "spaceDelimited";
|
|
51
51
|
/**
|
|
52
52
|
* OAS 3.x style spaceDelimited
|
|
53
53
|
* OAS 2 collectionFormat pipes
|
|
54
54
|
*/
|
|
55
|
-
HttpParamStyles
|
|
55
|
+
HttpParamStyles["PipeDelimited"] = "pipeDelimited";
|
|
56
56
|
/**
|
|
57
57
|
* OAS 3.x style deepObject
|
|
58
58
|
* OAS 2 collectionFormat no support
|
|
59
59
|
*/
|
|
60
|
-
HttpParamStyles
|
|
60
|
+
HttpParamStyles["DeepObject"] = "deepObject";
|
|
61
61
|
/**
|
|
62
62
|
* OAS 3.x style no support
|
|
63
63
|
* OAS 2 collectionFormat tsv
|
|
64
64
|
*/
|
|
65
|
-
HttpParamStyles
|
|
65
|
+
HttpParamStyles["TabDelimited"] = "tabDelimited";
|
|
66
66
|
})(HttpParamStyles || (HttpParamStyles = {}));
|
|
67
67
|
/**
|
|
68
68
|
* Represents the severity of diagnostics.
|
|
69
69
|
*/
|
|
70
70
|
var DiagnosticSeverity;
|
|
71
|
-
(function(DiagnosticSeverity
|
|
71
|
+
(function(DiagnosticSeverity) {
|
|
72
72
|
/**
|
|
73
73
|
* Something not allowed by the rules of a language or other means.
|
|
74
74
|
*/
|
|
75
|
-
DiagnosticSeverity
|
|
75
|
+
DiagnosticSeverity[DiagnosticSeverity["Error"] = 0] = "Error";
|
|
76
76
|
/**
|
|
77
77
|
* Something suspicious but allowed.
|
|
78
78
|
*/
|
|
79
|
-
DiagnosticSeverity
|
|
79
|
+
DiagnosticSeverity[DiagnosticSeverity["Warning"] = 1] = "Warning";
|
|
80
80
|
/**
|
|
81
81
|
* Something to inform about but not a problem.
|
|
82
82
|
*/
|
|
83
|
-
DiagnosticSeverity
|
|
83
|
+
DiagnosticSeverity[DiagnosticSeverity["Information"] = 2] = "Information";
|
|
84
84
|
/**
|
|
85
85
|
* Something to hint to a better way of doing it, like proposing
|
|
86
86
|
* a refactoring.
|
|
87
87
|
*/
|
|
88
|
-
DiagnosticSeverity
|
|
88
|
+
DiagnosticSeverity[DiagnosticSeverity["Hint"] = 3] = "Hint";
|
|
89
89
|
})(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
|
90
90
|
/**
|
|
91
91
|
* Stoplight node types
|
|
92
92
|
*/
|
|
93
93
|
var NodeType;
|
|
94
|
-
(function(NodeType
|
|
95
|
-
NodeType
|
|
96
|
-
NodeType
|
|
97
|
-
NodeType
|
|
98
|
-
NodeType
|
|
99
|
-
NodeType
|
|
100
|
-
NodeType
|
|
101
|
-
NodeType
|
|
102
|
-
NodeType
|
|
103
|
-
NodeType
|
|
104
|
-
NodeType
|
|
105
|
-
NodeType
|
|
106
|
-
NodeType
|
|
107
|
-
NodeType
|
|
108
|
-
NodeType
|
|
109
|
-
NodeType
|
|
94
|
+
(function(NodeType) {
|
|
95
|
+
NodeType["Article"] = "article";
|
|
96
|
+
NodeType["HttpService"] = "http_service";
|
|
97
|
+
NodeType["HttpServer"] = "http_server";
|
|
98
|
+
NodeType["HttpOperation"] = "http_operation";
|
|
99
|
+
NodeType["HttpCallback"] = "http_callback";
|
|
100
|
+
NodeType["HttpWebhook"] = "http_webhook";
|
|
101
|
+
NodeType["Model"] = "model";
|
|
102
|
+
NodeType["Generic"] = "generic";
|
|
103
|
+
NodeType["Unknown"] = "unknown";
|
|
104
|
+
NodeType["TableOfContents"] = "table_of_contents";
|
|
105
|
+
NodeType["SpectralRuleset"] = "spectral_ruleset";
|
|
106
|
+
NodeType["Styleguide"] = "styleguide";
|
|
107
|
+
NodeType["Image"] = "image";
|
|
108
|
+
NodeType["StoplightResolutions"] = "stoplight_resolutions";
|
|
109
|
+
NodeType["StoplightOverride"] = "stoplight_override";
|
|
110
110
|
})(NodeType || (NodeType = {}));
|
|
111
111
|
/**
|
|
112
112
|
* Node data formats
|
|
113
113
|
*/
|
|
114
114
|
var NodeFormat;
|
|
115
|
-
(function(NodeFormat
|
|
116
|
-
NodeFormat
|
|
117
|
-
NodeFormat
|
|
118
|
-
NodeFormat
|
|
119
|
-
NodeFormat
|
|
120
|
-
NodeFormat
|
|
121
|
-
NodeFormat
|
|
122
|
-
NodeFormat
|
|
123
|
-
NodeFormat
|
|
124
|
-
NodeFormat
|
|
125
|
-
NodeFormat
|
|
126
|
-
NodeFormat
|
|
127
|
-
NodeFormat
|
|
115
|
+
(function(NodeFormat) {
|
|
116
|
+
NodeFormat["Json"] = "json";
|
|
117
|
+
NodeFormat["Markdown"] = "markdown";
|
|
118
|
+
NodeFormat["Yaml"] = "yaml";
|
|
119
|
+
NodeFormat["Javascript"] = "javascript";
|
|
120
|
+
NodeFormat["Apng"] = "apng";
|
|
121
|
+
NodeFormat["Avif"] = "avif";
|
|
122
|
+
NodeFormat["Bmp"] = "bmp";
|
|
123
|
+
NodeFormat["Gif"] = "gif";
|
|
124
|
+
NodeFormat["Jpeg"] = "jpeg";
|
|
125
|
+
NodeFormat["Png"] = "png";
|
|
126
|
+
NodeFormat["Svg"] = "svg";
|
|
127
|
+
NodeFormat["Webp"] = "webp";
|
|
128
128
|
})(NodeFormat || (NodeFormat = {}));
|
|
129
129
|
|
|
130
130
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/spectral-ruleset",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Opinonated ruleset for Spectral",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@10.28.2",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/luxass/spectral-ruleset.git"
|
|
9
10
|
},
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
|
-
"
|
|
13
|
-
"import": "./dist/ruleset.js",
|
|
13
|
+
"import": "./dist/ruleset.mjs",
|
|
14
14
|
"require": "./dist/ruleset.cjs"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
16
17
|
},
|
|
17
|
-
"main": "dist/ruleset.cjs",
|
|
18
|
-
"module": "dist/ruleset.
|
|
18
|
+
"main": "./dist/ruleset.cjs",
|
|
19
|
+
"module": "./dist/ruleset.mjs",
|
|
19
20
|
"files": [
|
|
20
21
|
"dist"
|
|
21
22
|
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsdown",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"lint": "eslint .",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
22
29
|
"devDependencies": {
|
|
23
|
-
"@luxass/eslint-config": "^
|
|
24
|
-
"@stoplight/spectral-core": "^1.
|
|
30
|
+
"@luxass/eslint-config": "^6.0.3",
|
|
31
|
+
"@stoplight/spectral-core": "^1.21.0",
|
|
25
32
|
"@stoplight/spectral-formats": "^1.8.2",
|
|
26
33
|
"@stoplight/spectral-functions": "^1.10.1",
|
|
27
34
|
"@stoplight/spectral-ref-resolver": "^1.0.5",
|
|
28
35
|
"@stoplight/spectral-rulesets": "^1.22.0",
|
|
29
36
|
"@stoplight/types": "^14.1.1",
|
|
30
|
-
"@types/node": "^22.
|
|
31
|
-
"eslint": "^9.
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "tsdown",
|
|
38
|
-
"test": "vitest run",
|
|
39
|
-
"lint": "eslint .",
|
|
40
|
-
"typecheck": "tsc --noEmit"
|
|
37
|
+
"@types/node": "^22.16.4",
|
|
38
|
+
"eslint": "^9.39.2",
|
|
39
|
+
"publint": "^0.3.17",
|
|
40
|
+
"tsdown": "^0.20.1",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vitest": "^4.0.18"
|
|
41
43
|
}
|
|
42
|
-
}
|
|
44
|
+
}
|