@azure-tools/typespec-azure-core 0.30.0-dev.11 → 0.30.0-dev.13
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/src/lib.d.ts +50 -8
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +13 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +4 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/api-version-parameter.d.ts +2 -0
- package/dist/src/rules/api-version-parameter.d.ts.map +1 -0
- package/dist/src/rules/api-version-parameter.js +46 -0
- package/dist/src/rules/api-version-parameter.js.map +1 -0
- package/dist/src/rules/no-operation-id.d.ts +2 -0
- package/dist/src/rules/no-operation-id.d.ts.map +1 -0
- package/dist/src/rules/{avoid-operation-id.js → no-operation-id.js} +4 -4
- package/dist/src/rules/no-operation-id.js.map +1 -0
- package/dist/src/rules/no-order-by.d.ts +2 -0
- package/dist/src/rules/no-order-by.d.ts.map +1 -0
- package/dist/src/rules/no-order-by.js +26 -0
- package/dist/src/rules/no-order-by.js.map +1 -0
- package/package.json +1 -1
- package/dist/src/rules/avoid-operation-id.d.ts +0 -2
- package/dist/src/rules/avoid-operation-id.d.ts.map +0 -1
- package/dist/src/rules/avoid-operation-id.js.map +0 -1
package/dist/src/lib.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export declare const libDef: {
|
|
|
8
8
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
readonly "operation-missing-api-version": {
|
|
12
|
+
readonly severity: "warning";
|
|
13
|
+
readonly messages: {
|
|
14
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
11
17
|
readonly "casing-style": {
|
|
12
18
|
readonly severity: "warning";
|
|
13
19
|
readonly messages: {
|
|
@@ -100,6 +106,12 @@ export declare const libDef: {
|
|
|
100
106
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
101
107
|
};
|
|
102
108
|
};
|
|
109
|
+
readonly "no-order-by": {
|
|
110
|
+
readonly severity: "warning";
|
|
111
|
+
readonly messages: {
|
|
112
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
113
|
+
};
|
|
114
|
+
};
|
|
103
115
|
readonly "no-rest-library-interfaces": {
|
|
104
116
|
readonly severity: "error";
|
|
105
117
|
readonly messages: {
|
|
@@ -203,7 +215,7 @@ export declare const libDef: {
|
|
|
203
215
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
204
216
|
};
|
|
205
217
|
};
|
|
206
|
-
readonly "
|
|
218
|
+
readonly "no-operation-id": {
|
|
207
219
|
readonly severity: "warning";
|
|
208
220
|
readonly messages: {
|
|
209
221
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
@@ -221,6 +233,9 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
221
233
|
byos: {
|
|
222
234
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
223
235
|
};
|
|
236
|
+
"operation-missing-api-version": {
|
|
237
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
238
|
+
};
|
|
224
239
|
"casing-style": {
|
|
225
240
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
226
241
|
};
|
|
@@ -268,6 +283,9 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
268
283
|
"no-format": {
|
|
269
284
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
270
285
|
};
|
|
286
|
+
"no-order-by": {
|
|
287
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
288
|
+
};
|
|
271
289
|
"no-rest-library-interfaces": {
|
|
272
290
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
273
291
|
};
|
|
@@ -320,17 +338,20 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
320
338
|
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
321
339
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
322
340
|
};
|
|
323
|
-
"
|
|
341
|
+
"no-operation-id": {
|
|
324
342
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
325
343
|
};
|
|
326
344
|
"invalid-body-schema": {
|
|
327
345
|
readonly array: "Body schema should not be of raw array type.";
|
|
328
346
|
};
|
|
329
347
|
}, Record<string, any>>;
|
|
330
|
-
export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro-status-union-non-string" | "lro-status-property-invalid-type" | "lro-status-missing" | "bad-record-type" | "request-parameter-invalid" | "request-body-problem" | "response-property-invalid" | "no-multiple-discriminator" | "no-fixed-enum-discriminator" | "operation-link-parameter-invalid" | "invalid-resource-type" | "use-extensible-enum" | "use-standard-operations" | "no-format" | "no-rest-library-interfaces" | "no-unknown" | "documentation-required" | "key-visibility-required" | "long-running-polling-operation-required" | "rpc-operation-needs-route" | "invalid-trait-property-count" | "invalid-trait-property-type" | "invalid-trait-context" | "trait-property-without-location" | "expected-trait-missing" | "invalid-parameter" | "expected-success-response" | "lro-polling-data-missing-from-operation-response" | "no-nullable" | "no-object" | "property-name-conflict" | "
|
|
348
|
+
export declare const reportDiagnostic: <C extends "byos" | "operation-missing-api-version" | "casing-style" | "lro-status-union-non-string" | "lro-status-property-invalid-type" | "lro-status-missing" | "bad-record-type" | "request-parameter-invalid" | "request-body-problem" | "response-property-invalid" | "no-multiple-discriminator" | "no-fixed-enum-discriminator" | "operation-link-parameter-invalid" | "invalid-resource-type" | "use-extensible-enum" | "use-standard-operations" | "no-format" | "no-order-by" | "no-rest-library-interfaces" | "no-unknown" | "documentation-required" | "key-visibility-required" | "long-running-polling-operation-required" | "rpc-operation-needs-route" | "invalid-trait-property-count" | "invalid-trait-property-type" | "invalid-trait-context" | "trait-property-without-location" | "expected-trait-missing" | "invalid-parameter" | "expected-success-response" | "lro-polling-data-missing-from-operation-response" | "no-nullable" | "no-object" | "property-name-conflict" | "no-operation-id" | "invalid-body-schema", M extends keyof {
|
|
331
349
|
byos: {
|
|
332
350
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
333
351
|
};
|
|
352
|
+
"operation-missing-api-version": {
|
|
353
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
354
|
+
};
|
|
334
355
|
"casing-style": {
|
|
335
356
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
336
357
|
};
|
|
@@ -378,6 +399,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
378
399
|
"no-format": {
|
|
379
400
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
380
401
|
};
|
|
402
|
+
"no-order-by": {
|
|
403
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
404
|
+
};
|
|
381
405
|
"no-rest-library-interfaces": {
|
|
382
406
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
383
407
|
};
|
|
@@ -430,7 +454,7 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
430
454
|
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
431
455
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
432
456
|
};
|
|
433
|
-
"
|
|
457
|
+
"no-operation-id": {
|
|
434
458
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
435
459
|
};
|
|
436
460
|
"invalid-body-schema": {
|
|
@@ -440,6 +464,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
440
464
|
byos: {
|
|
441
465
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
442
466
|
};
|
|
467
|
+
"operation-missing-api-version": {
|
|
468
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
469
|
+
};
|
|
443
470
|
"casing-style": {
|
|
444
471
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
445
472
|
};
|
|
@@ -487,6 +514,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
487
514
|
"no-format": {
|
|
488
515
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
489
516
|
};
|
|
517
|
+
"no-order-by": {
|
|
518
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
519
|
+
};
|
|
490
520
|
"no-rest-library-interfaces": {
|
|
491
521
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
492
522
|
};
|
|
@@ -539,16 +569,19 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
539
569
|
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
540
570
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
541
571
|
};
|
|
542
|
-
"
|
|
572
|
+
"no-operation-id": {
|
|
543
573
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
544
574
|
};
|
|
545
575
|
"invalid-body-schema": {
|
|
546
576
|
readonly array: "Body schema should not be of raw array type.";
|
|
547
577
|
};
|
|
548
|
-
}, C, M>) => void, createDiagnostic: <C extends "byos" | "casing-style" | "lro-status-union-non-string" | "lro-status-property-invalid-type" | "lro-status-missing" | "bad-record-type" | "request-parameter-invalid" | "request-body-problem" | "response-property-invalid" | "no-multiple-discriminator" | "no-fixed-enum-discriminator" | "operation-link-parameter-invalid" | "invalid-resource-type" | "use-extensible-enum" | "use-standard-operations" | "no-format" | "no-rest-library-interfaces" | "no-unknown" | "documentation-required" | "key-visibility-required" | "long-running-polling-operation-required" | "rpc-operation-needs-route" | "invalid-trait-property-count" | "invalid-trait-property-type" | "invalid-trait-context" | "trait-property-without-location" | "expected-trait-missing" | "invalid-parameter" | "expected-success-response" | "lro-polling-data-missing-from-operation-response" | "no-nullable" | "no-object" | "property-name-conflict" | "
|
|
578
|
+
}, C, M>) => void, createDiagnostic: <C extends "byos" | "operation-missing-api-version" | "casing-style" | "lro-status-union-non-string" | "lro-status-property-invalid-type" | "lro-status-missing" | "bad-record-type" | "request-parameter-invalid" | "request-body-problem" | "response-property-invalid" | "no-multiple-discriminator" | "no-fixed-enum-discriminator" | "operation-link-parameter-invalid" | "invalid-resource-type" | "use-extensible-enum" | "use-standard-operations" | "no-format" | "no-order-by" | "no-rest-library-interfaces" | "no-unknown" | "documentation-required" | "key-visibility-required" | "long-running-polling-operation-required" | "rpc-operation-needs-route" | "invalid-trait-property-count" | "invalid-trait-property-type" | "invalid-trait-context" | "trait-property-without-location" | "expected-trait-missing" | "invalid-parameter" | "expected-success-response" | "lro-polling-data-missing-from-operation-response" | "no-nullable" | "no-object" | "property-name-conflict" | "no-operation-id" | "invalid-body-schema", M extends keyof {
|
|
549
579
|
byos: {
|
|
550
580
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
551
581
|
};
|
|
582
|
+
"operation-missing-api-version": {
|
|
583
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
584
|
+
};
|
|
552
585
|
"casing-style": {
|
|
553
586
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
554
587
|
};
|
|
@@ -596,6 +629,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
596
629
|
"no-format": {
|
|
597
630
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
598
631
|
};
|
|
632
|
+
"no-order-by": {
|
|
633
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
634
|
+
};
|
|
599
635
|
"no-rest-library-interfaces": {
|
|
600
636
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
601
637
|
};
|
|
@@ -648,7 +684,7 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
648
684
|
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
649
685
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
650
686
|
};
|
|
651
|
-
"
|
|
687
|
+
"no-operation-id": {
|
|
652
688
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
653
689
|
};
|
|
654
690
|
"invalid-body-schema": {
|
|
@@ -658,6 +694,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
658
694
|
byos: {
|
|
659
695
|
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
660
696
|
};
|
|
697
|
+
"operation-missing-api-version": {
|
|
698
|
+
readonly default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.";
|
|
699
|
+
};
|
|
661
700
|
"casing-style": {
|
|
662
701
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
663
702
|
};
|
|
@@ -705,6 +744,9 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
705
744
|
"no-format": {
|
|
706
745
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
707
746
|
};
|
|
747
|
+
"no-order-by": {
|
|
748
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
749
|
+
};
|
|
708
750
|
"no-rest-library-interfaces": {
|
|
709
751
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
710
752
|
};
|
|
@@ -757,7 +799,7 @@ export declare const reportDiagnostic: <C extends "byos" | "casing-style" | "lro
|
|
|
757
799
|
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
758
800
|
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
759
801
|
};
|
|
760
|
-
"
|
|
802
|
+
"no-operation-id": {
|
|
761
803
|
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
762
804
|
};
|
|
763
805
|
"invalid-body-schema": {
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6OT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAAE,iBAAiB,0BAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -9,6 +9,12 @@ export const libDef = {
|
|
|
9
9
|
default: paramMessage `The content type "${"contentType"}" indicates this operation is storing binary data. It is recommended to use the BYOS pattern for Azure Services. https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#bring-your-own-storage-byos`,
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
|
+
"operation-missing-api-version": {
|
|
13
|
+
severity: "warning",
|
|
14
|
+
messages: {
|
|
15
|
+
default: "All versioned operations must use an api-version parameter. Please include Azure.Core.Foundations.ApiVersionParameter in the operation parameter list using the spread (...ApiVersionParameter) operator, or using one of the common resource parameter models.",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
12
18
|
"casing-style": {
|
|
13
19
|
severity: "warning",
|
|
14
20
|
messages: {
|
|
@@ -101,6 +107,12 @@ export const libDef = {
|
|
|
101
107
|
default: "Azure services should not use the `@format` decorator.",
|
|
102
108
|
},
|
|
103
109
|
},
|
|
110
|
+
"no-order-by": {
|
|
111
|
+
severity: "warning",
|
|
112
|
+
messages: {
|
|
113
|
+
default: `List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.`,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
104
116
|
"no-rest-library-interfaces": {
|
|
105
117
|
severity: "error",
|
|
106
118
|
messages: {
|
|
@@ -204,7 +216,7 @@ export const libDef = {
|
|
|
204
216
|
projectedName: paramMessage `Use of @projectedName on property '${"propertyName"}' results in '${"propertyName"}' having the same name as its enclosing type in C#. Please use a different @projectedName value.`,
|
|
205
217
|
},
|
|
206
218
|
},
|
|
207
|
-
"
|
|
219
|
+
"no-operation-id": {
|
|
208
220
|
severity: "warning",
|
|
209
221
|
messages: {
|
|
210
222
|
default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.",
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,kCAAkC;IACxC,WAAW,EAAE;QACX,IAAI,EAAE;YACJ,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,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AA,sCAAsC,cAAc,iBAAiB,cAAc,kGAAkG;aACjN;SACF;QACD,iBAAiB,EAAE;YACjB,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EACL,uGAAuG;aAC1G;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,KAAK,EAAE,8CAA8C;aACtD;SACF;KACF;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"}
|
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAoD7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAM3C"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLinter } from "@typespec/lint";
|
|
2
2
|
import { checkRpcRoutes } from "./decorators.js";
|
|
3
3
|
import { $lib } from "./lib.js";
|
|
4
|
-
import {
|
|
4
|
+
import { apiVersionRule } from "./rules/api-version-parameter.js";
|
|
5
5
|
import { byosRule } from "./rules/byos.js";
|
|
6
6
|
import { casingRule } from "./rules/casing.js";
|
|
7
7
|
import { extensibleEnumRule } from "./rules/extensible-enums.js";
|
|
@@ -9,6 +9,7 @@ import { longRunningOperationsRequirePollingOperation } from "./rules/lro-pollin
|
|
|
9
9
|
import { noFixedEnumDiscriminatorRule } from "./rules/no-fixed-enum-discriminator.js";
|
|
10
10
|
import { noNullableRule } from "./rules/no-nullable.js";
|
|
11
11
|
import { noObjectRule } from "./rules/no-object.js";
|
|
12
|
+
import { operationIdRule } from "./rules/no-operation-id.js";
|
|
12
13
|
import { preventFormatUse } from "./rules/prevent-format.js";
|
|
13
14
|
import { preventMultipleDiscriminator } from "./rules/prevent-multiple-discriminator.js";
|
|
14
15
|
import { preventRestLibraryInterfaces } from "./rules/prevent-rest-library.js";
|
|
@@ -21,9 +22,10 @@ import { requireKeyVisibility } from "./rules/require-key-visibility.js";
|
|
|
21
22
|
import { useStandardOperations } from "./rules/use-standard-ops.js";
|
|
22
23
|
const linter = getLinter($lib);
|
|
23
24
|
linter.registerRules([
|
|
24
|
-
|
|
25
|
+
operationIdRule,
|
|
25
26
|
bodyArrayRule,
|
|
26
27
|
byosRule,
|
|
28
|
+
apiVersionRule,
|
|
27
29
|
casingRule,
|
|
28
30
|
extensibleEnumRule,
|
|
29
31
|
useStandardOperations,
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAA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;IACE,UAAU,EAAE,IAAI;CACjB,CACF,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,CAAC,eAAe,EAAE,CAAC;IACzB,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE/B,wBAAwB;IACxB,cAAc,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-version-parameter.d.ts","sourceRoot":"","sources":["../../../src/rules/api-version-parameter.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,cAAc,mCAsBzB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRule } from "@typespec/lint";
|
|
2
|
+
import { getVersion } from "@typespec/versioning";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
import { isExcludedCoreType } from "./utils.js";
|
|
5
|
+
function isApiVersionParam(prop) {
|
|
6
|
+
return prop.name === "apiVersion" && prop.type.kind === "Scalar" && prop.type.name === "string";
|
|
7
|
+
}
|
|
8
|
+
// TODO: Remove this function once we have a mechanism for overriding or disabling linter rules
|
|
9
|
+
// See: https://github.com/microsoft/typespec/issues/1785
|
|
10
|
+
function isArmProviderNamespace(ns) {
|
|
11
|
+
for (const dec of ns.decorators) {
|
|
12
|
+
if (dec.decorator.name === "$armProviderNamespace") {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
export const apiVersionRule = createRule({
|
|
19
|
+
name: "api-version-parameter",
|
|
20
|
+
create({ program }) {
|
|
21
|
+
return {
|
|
22
|
+
operation: (op) => {
|
|
23
|
+
if (isExcludedCoreType(program, op))
|
|
24
|
+
return;
|
|
25
|
+
if (!op.namespace)
|
|
26
|
+
return;
|
|
27
|
+
// ignore ARM namespaces. They have their own rule
|
|
28
|
+
if (isArmProviderNamespace(op.namespace))
|
|
29
|
+
return;
|
|
30
|
+
const versionMap = getVersion(program, op.namespace);
|
|
31
|
+
// rule only applies to versioned Azure operations
|
|
32
|
+
if (!versionMap)
|
|
33
|
+
return;
|
|
34
|
+
for (const param of op.parameters.properties.values()) {
|
|
35
|
+
if (isApiVersionParam(param))
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
reportDiagnostic(program, {
|
|
39
|
+
code: "operation-missing-api-version",
|
|
40
|
+
target: op,
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=api-version-parameter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-version-parameter.js","sourceRoot":"","sources":["../../../src/rules/api-version-parameter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,SAAS,iBAAiB,CAAC,IAAmB;IAC5C,OAAO,IAAI,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClG,CAAC;AAED,+FAA+F;AAC/F,yDAAyD;AACzD,SAAS,sBAAsB,CAAC,EAAa;IAC3C,KAAK,MAAM,GAAG,IAAI,EAAE,CAAC,UAAU,EAAE;QAC/B,IAAI,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,uBAAuB,EAAE;YAClD,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,uBAAuB;IAC7B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,IAAI,kBAAkB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAAE,OAAO;gBAC5C,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,OAAO;gBAC1B,kDAAkD;gBAClD,IAAI,sBAAsB,CAAC,EAAE,CAAC,SAAS,CAAC;oBAAE,OAAO;gBACjD,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;gBACrD,kDAAkD;gBAClD,IAAI,CAAC,UAAU;oBAAE,OAAO;gBACxB,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE;oBACrD,IAAI,iBAAiB,CAAC,KAAK,CAAC;wBAAE,OAAO;iBACtC;gBACD,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,+BAA+B;oBACrC,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-operation-id.d.ts","sourceRoot":"","sources":["../../../src/rules/no-operation-id.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,mCAgB1B,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { createRule } from "@typespec/lint";
|
|
|
2
2
|
import { getOperationId } from "@typespec/openapi";
|
|
3
3
|
import { reportDiagnostic } from "../lib.js";
|
|
4
4
|
import { isExcludedCoreType } from "./utils.js";
|
|
5
|
-
export const
|
|
6
|
-
name: "
|
|
5
|
+
export const operationIdRule = createRule({
|
|
6
|
+
name: "no-operation-id",
|
|
7
7
|
create({ program }) {
|
|
8
8
|
return {
|
|
9
9
|
operation: (operation) => {
|
|
@@ -11,7 +11,7 @@ export const avoidOperationIdRule = createRule({
|
|
|
11
11
|
return;
|
|
12
12
|
if (getOperationId(program, operation)) {
|
|
13
13
|
reportDiagnostic(program, {
|
|
14
|
-
code: "
|
|
14
|
+
code: "no-operation-id",
|
|
15
15
|
format: { operationId: operation.name },
|
|
16
16
|
target: operation,
|
|
17
17
|
});
|
|
@@ -20,4 +20,4 @@ export const avoidOperationIdRule = createRule({
|
|
|
20
20
|
};
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=no-operation-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-operation-id.js","sourceRoot":"","sources":["../../../src/rules/no-operation-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,iBAAiB;IACvB,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC;oBAAE,OAAO;gBACnD,IAAI,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBACtC,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,iBAAiB;wBACvB,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE;wBACvC,MAAM,EAAE,SAAS;qBAClB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-order-by.d.ts","sourceRoot":"","sources":["../../../src/rules/no-order-by.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,mCAmBtB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRule } from "@typespec/lint";
|
|
2
|
+
import { getResourceOperation } from "@typespec/rest";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
import { isExcludedCoreType } from "./utils.js";
|
|
5
|
+
export const orderByRule = createRule({
|
|
6
|
+
name: "no-order-by",
|
|
7
|
+
create({ program }) {
|
|
8
|
+
return {
|
|
9
|
+
operation: (operation) => {
|
|
10
|
+
if (isExcludedCoreType(program, operation))
|
|
11
|
+
return;
|
|
12
|
+
const resOperation = getResourceOperation(program, operation);
|
|
13
|
+
for (const param of operation.parameters.properties.values()) {
|
|
14
|
+
if (param.name.toLowerCase() === "orderby" && (resOperation === null || resOperation === void 0 ? void 0 : resOperation.operation) === "list") {
|
|
15
|
+
reportDiagnostic(program, {
|
|
16
|
+
code: "no-order-by",
|
|
17
|
+
format: { operationId: operation.name },
|
|
18
|
+
target: operation,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=no-order-by.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-order-by.js","sourceRoot":"","sources":["../../../src/rules/no-order-by.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;IACpC,IAAI,EAAE,aAAa;IACnB,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC;oBAAE,OAAO;gBACnD,MAAM,YAAY,GAAG,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAC9D,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE;oBAC5D,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,SAAS,IAAI,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,SAAS,MAAK,MAAM,EAAE;wBAChF,gBAAgB,CAAC,OAAO,EAAE;4BACxB,IAAI,EAAE,aAAa;4BACnB,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE;4BACvC,MAAM,EAAE,SAAS;yBAClB,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avoid-operation-id.d.ts","sourceRoot":"","sources":["../../../src/rules/avoid-operation-id.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,mCAgB/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avoid-operation-id.js","sourceRoot":"","sources":["../../../src/rules/avoid-operation-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC;oBAAE,OAAO;gBACnD,IAAI,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBACtC,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,oBAAoB;wBAC1B,MAAM,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC,IAAI,EAAE;wBACvC,MAAM,EAAE,SAAS;qBAClB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|