@azure-tools/typespec-azure-core 0.29.0 → 0.30.0-dev.10
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 +175 -22
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +48 -5
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +14 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/avoid-operation-id.d.ts +2 -0
- package/dist/src/rules/avoid-operation-id.d.ts.map +1 -0
- package/dist/src/rules/avoid-operation-id.js +23 -0
- package/dist/src/rules/avoid-operation-id.js.map +1 -0
- package/dist/src/rules/byos.d.ts +2 -0
- package/dist/src/rules/byos.d.ts.map +1 -0
- package/dist/src/rules/byos.js +27 -0
- package/dist/src/rules/byos.js.map +1 -0
- package/dist/src/rules/no-fixed-enum-discriminator.d.ts +2 -0
- package/dist/src/rules/no-fixed-enum-discriminator.d.ts.map +1 -0
- package/dist/src/rules/no-fixed-enum-discriminator.js +29 -0
- package/dist/src/rules/no-fixed-enum-discriminator.js.map +1 -0
- package/dist/src/rules/no-nullable.d.ts +2 -0
- package/dist/src/rules/no-nullable.d.ts.map +1 -0
- package/dist/src/rules/no-nullable.js +22 -0
- package/dist/src/rules/no-nullable.js.map +1 -0
- package/dist/src/rules/no-object.d.ts +2 -0
- package/dist/src/rules/no-object.d.ts.map +1 -0
- package/dist/src/rules/no-object.js +42 -0
- package/dist/src/rules/no-object.js.map +1 -0
- package/dist/src/rules/property-naming.d.ts +2 -0
- package/dist/src/rules/property-naming.d.ts.map +1 -0
- package/dist/src/rules/property-naming.js +40 -0
- package/dist/src/rules/property-naming.js.map +1 -0
- package/dist/src/rules/request-body-array.d.ts +2 -0
- package/dist/src/rules/request-body-array.d.ts.map +1 -0
- package/dist/src/rules/request-body-array.js +22 -0
- package/dist/src/rules/request-body-array.js.map +1 -0
- package/dist/src/rules/utils.d.ts +5 -3
- package/dist/src/rules/utils.d.ts.map +1 -1
- package/dist/src/rules/utils.js +5 -0
- package/dist/src/rules/utils.js.map +1 -1
- package/lib/foundations.tsp +1 -0
- package/package.json +18 -17
package/dist/src/lib.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ export declare const namespace = "Azure.Core";
|
|
|
2
2
|
export declare const libDef: {
|
|
3
3
|
readonly name: "@azure-tools/typespec-azure-core";
|
|
4
4
|
readonly diagnostics: {
|
|
5
|
+
readonly byos: {
|
|
6
|
+
readonly severity: "warning";
|
|
7
|
+
readonly messages: {
|
|
8
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
5
11
|
readonly "casing-style": {
|
|
6
12
|
readonly severity: "warning";
|
|
7
13
|
readonly messages: {
|
|
@@ -39,6 +45,12 @@ export declare const libDef: {
|
|
|
39
45
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
40
46
|
};
|
|
41
47
|
};
|
|
48
|
+
readonly "request-body-problem": {
|
|
49
|
+
readonly severity: "warning";
|
|
50
|
+
readonly messages: {
|
|
51
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
42
54
|
readonly "response-property-invalid": {
|
|
43
55
|
readonly severity: "error";
|
|
44
56
|
readonly messages: {
|
|
@@ -51,16 +63,16 @@ export declare const libDef: {
|
|
|
51
63
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
52
64
|
};
|
|
53
65
|
};
|
|
54
|
-
readonly "
|
|
55
|
-
readonly severity: "
|
|
66
|
+
readonly "no-fixed-enum-discriminator": {
|
|
67
|
+
readonly severity: "warning";
|
|
56
68
|
readonly messages: {
|
|
57
|
-
readonly default: "
|
|
69
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
58
70
|
};
|
|
59
71
|
};
|
|
60
|
-
readonly "
|
|
72
|
+
readonly "operation-link-parameter-invalid": {
|
|
61
73
|
readonly severity: "error";
|
|
62
74
|
readonly messages: {
|
|
63
|
-
readonly default: "
|
|
75
|
+
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
64
76
|
};
|
|
65
77
|
};
|
|
66
78
|
readonly "invalid-resource-type": {
|
|
@@ -172,9 +184,43 @@ export declare const libDef: {
|
|
|
172
184
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
173
185
|
};
|
|
174
186
|
};
|
|
187
|
+
readonly "no-nullable": {
|
|
188
|
+
readonly severity: "warning";
|
|
189
|
+
readonly messages: {
|
|
190
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly "no-object": {
|
|
194
|
+
readonly severity: "warning";
|
|
195
|
+
readonly messages: {
|
|
196
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
readonly "property-name-conflict": {
|
|
200
|
+
readonly severity: "warning";
|
|
201
|
+
readonly messages: {
|
|
202
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
203
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly "avoid-operation-id": {
|
|
207
|
+
readonly severity: "warning";
|
|
208
|
+
readonly messages: {
|
|
209
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
readonly "invalid-body-schema": {
|
|
213
|
+
readonly severity: "warning";
|
|
214
|
+
readonly messages: {
|
|
215
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
216
|
+
};
|
|
217
|
+
};
|
|
175
218
|
};
|
|
176
219
|
};
|
|
177
220
|
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
221
|
+
byos: {
|
|
222
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
223
|
+
};
|
|
178
224
|
"casing-style": {
|
|
179
225
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
180
226
|
};
|
|
@@ -194,18 +240,21 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
194
240
|
"request-parameter-invalid": {
|
|
195
241
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
196
242
|
};
|
|
243
|
+
"request-body-problem": {
|
|
244
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
245
|
+
};
|
|
197
246
|
"response-property-invalid": {
|
|
198
247
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
199
248
|
};
|
|
200
249
|
"no-multiple-discriminator": {
|
|
201
250
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
202
251
|
};
|
|
252
|
+
"no-fixed-enum-discriminator": {
|
|
253
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
254
|
+
};
|
|
203
255
|
"operation-link-parameter-invalid": {
|
|
204
256
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
205
257
|
};
|
|
206
|
-
"client-definition-parameters-not-model": {
|
|
207
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
208
|
-
};
|
|
209
258
|
"invalid-resource-type": {
|
|
210
259
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
211
260
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -261,8 +310,27 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
261
310
|
"lro-polling-data-missing-from-operation-response": {
|
|
262
311
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
263
312
|
};
|
|
313
|
+
"no-nullable": {
|
|
314
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
315
|
+
};
|
|
316
|
+
"no-object": {
|
|
317
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
318
|
+
};
|
|
319
|
+
"property-name-conflict": {
|
|
320
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
321
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
322
|
+
};
|
|
323
|
+
"avoid-operation-id": {
|
|
324
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
325
|
+
};
|
|
326
|
+
"invalid-body-schema": {
|
|
327
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
328
|
+
};
|
|
264
329
|
}, Record<string, any>>;
|
|
265
|
-
export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-union-non-string" | "lro-status-property-invalid-type" | "lro-status-missing" | "bad-record-type" | "request-parameter-invalid" | "response-property-invalid" | "no-multiple-discriminator" | "
|
|
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" | "avoid-operation-id" | "invalid-body-schema", M extends keyof {
|
|
331
|
+
byos: {
|
|
332
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
333
|
+
};
|
|
266
334
|
"casing-style": {
|
|
267
335
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
268
336
|
};
|
|
@@ -282,18 +350,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
282
350
|
"request-parameter-invalid": {
|
|
283
351
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
284
352
|
};
|
|
353
|
+
"request-body-problem": {
|
|
354
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
355
|
+
};
|
|
285
356
|
"response-property-invalid": {
|
|
286
357
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
287
358
|
};
|
|
288
359
|
"no-multiple-discriminator": {
|
|
289
360
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
290
361
|
};
|
|
362
|
+
"no-fixed-enum-discriminator": {
|
|
363
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
364
|
+
};
|
|
291
365
|
"operation-link-parameter-invalid": {
|
|
292
366
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
293
367
|
};
|
|
294
|
-
"client-definition-parameters-not-model": {
|
|
295
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
296
|
-
};
|
|
297
368
|
"invalid-resource-type": {
|
|
298
369
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
299
370
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -349,7 +420,26 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
349
420
|
"lro-polling-data-missing-from-operation-response": {
|
|
350
421
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
351
422
|
};
|
|
423
|
+
"no-nullable": {
|
|
424
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
425
|
+
};
|
|
426
|
+
"no-object": {
|
|
427
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
428
|
+
};
|
|
429
|
+
"property-name-conflict": {
|
|
430
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
431
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
432
|
+
};
|
|
433
|
+
"avoid-operation-id": {
|
|
434
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
435
|
+
};
|
|
436
|
+
"invalid-body-schema": {
|
|
437
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
438
|
+
};
|
|
352
439
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
440
|
+
byos: {
|
|
441
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
442
|
+
};
|
|
353
443
|
"casing-style": {
|
|
354
444
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
355
445
|
};
|
|
@@ -369,18 +459,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
369
459
|
"request-parameter-invalid": {
|
|
370
460
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
371
461
|
};
|
|
462
|
+
"request-body-problem": {
|
|
463
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
464
|
+
};
|
|
372
465
|
"response-property-invalid": {
|
|
373
466
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
374
467
|
};
|
|
375
468
|
"no-multiple-discriminator": {
|
|
376
469
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
377
470
|
};
|
|
471
|
+
"no-fixed-enum-discriminator": {
|
|
472
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
473
|
+
};
|
|
378
474
|
"operation-link-parameter-invalid": {
|
|
379
475
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
380
476
|
};
|
|
381
|
-
"client-definition-parameters-not-model": {
|
|
382
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
383
|
-
};
|
|
384
477
|
"invalid-resource-type": {
|
|
385
478
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
386
479
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -436,7 +529,26 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
436
529
|
"lro-polling-data-missing-from-operation-response": {
|
|
437
530
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
438
531
|
};
|
|
439
|
-
|
|
532
|
+
"no-nullable": {
|
|
533
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
534
|
+
};
|
|
535
|
+
"no-object": {
|
|
536
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
537
|
+
};
|
|
538
|
+
"property-name-conflict": {
|
|
539
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
540
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
541
|
+
};
|
|
542
|
+
"avoid-operation-id": {
|
|
543
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
544
|
+
};
|
|
545
|
+
"invalid-body-schema": {
|
|
546
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
547
|
+
};
|
|
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" | "avoid-operation-id" | "invalid-body-schema", M extends keyof {
|
|
549
|
+
byos: {
|
|
550
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
551
|
+
};
|
|
440
552
|
"casing-style": {
|
|
441
553
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
442
554
|
};
|
|
@@ -456,18 +568,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
456
568
|
"request-parameter-invalid": {
|
|
457
569
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
458
570
|
};
|
|
571
|
+
"request-body-problem": {
|
|
572
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
573
|
+
};
|
|
459
574
|
"response-property-invalid": {
|
|
460
575
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
461
576
|
};
|
|
462
577
|
"no-multiple-discriminator": {
|
|
463
578
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
464
579
|
};
|
|
580
|
+
"no-fixed-enum-discriminator": {
|
|
581
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
582
|
+
};
|
|
465
583
|
"operation-link-parameter-invalid": {
|
|
466
584
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
467
585
|
};
|
|
468
|
-
"client-definition-parameters-not-model": {
|
|
469
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
470
|
-
};
|
|
471
586
|
"invalid-resource-type": {
|
|
472
587
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
473
588
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -523,7 +638,26 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
523
638
|
"lro-polling-data-missing-from-operation-response": {
|
|
524
639
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
525
640
|
};
|
|
641
|
+
"no-nullable": {
|
|
642
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
643
|
+
};
|
|
644
|
+
"no-object": {
|
|
645
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
646
|
+
};
|
|
647
|
+
"property-name-conflict": {
|
|
648
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
649
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
650
|
+
};
|
|
651
|
+
"avoid-operation-id": {
|
|
652
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
653
|
+
};
|
|
654
|
+
"invalid-body-schema": {
|
|
655
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
656
|
+
};
|
|
526
657
|
}[C]>(diag: import("@typespec/compiler").DiagnosticReport<{
|
|
658
|
+
byos: {
|
|
659
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
660
|
+
};
|
|
527
661
|
"casing-style": {
|
|
528
662
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
529
663
|
};
|
|
@@ -543,18 +677,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
543
677
|
"request-parameter-invalid": {
|
|
544
678
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
545
679
|
};
|
|
680
|
+
"request-body-problem": {
|
|
681
|
+
readonly array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.";
|
|
682
|
+
};
|
|
546
683
|
"response-property-invalid": {
|
|
547
684
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
548
685
|
};
|
|
549
686
|
"no-multiple-discriminator": {
|
|
550
687
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
551
688
|
};
|
|
689
|
+
"no-fixed-enum-discriminator": {
|
|
690
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
691
|
+
};
|
|
552
692
|
"operation-link-parameter-invalid": {
|
|
553
693
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
554
694
|
};
|
|
555
|
-
"client-definition-parameters-not-model": {
|
|
556
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
557
|
-
};
|
|
558
695
|
"invalid-resource-type": {
|
|
559
696
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
560
697
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -610,5 +747,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
610
747
|
"lro-polling-data-missing-from-operation-response": {
|
|
611
748
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
612
749
|
};
|
|
750
|
+
"no-nullable": {
|
|
751
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
752
|
+
};
|
|
753
|
+
"no-object": {
|
|
754
|
+
readonly default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.";
|
|
755
|
+
};
|
|
756
|
+
"property-name-conflict": {
|
|
757
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
758
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
759
|
+
};
|
|
760
|
+
"avoid-operation-id": {
|
|
761
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
762
|
+
};
|
|
763
|
+
"invalid-body-schema": {
|
|
764
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
765
|
+
};
|
|
613
766
|
}, C, M>) => import("@typespec/compiler").Diagnostic, createStateSymbol: (name: string) => symbol;
|
|
614
767
|
//# sourceMappingURL=lib.d.ts.map
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgOT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAAE,iBAAiB,0BAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -3,6 +3,12 @@ export const namespace = "Azure.Core";
|
|
|
3
3
|
export const libDef = {
|
|
4
4
|
name: "@azure-tools/typespec-azure-core",
|
|
5
5
|
diagnostics: {
|
|
6
|
+
byos: {
|
|
7
|
+
severity: "warning",
|
|
8
|
+
messages: {
|
|
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
|
+
},
|
|
11
|
+
},
|
|
6
12
|
"casing-style": {
|
|
7
13
|
severity: "warning",
|
|
8
14
|
messages: {
|
|
@@ -40,6 +46,12 @@ export const libDef = {
|
|
|
40
46
|
default: paramMessage `Request parameter '${"name"}' not found on request body model.`,
|
|
41
47
|
},
|
|
42
48
|
},
|
|
49
|
+
"request-body-problem": {
|
|
50
|
+
severity: "warning",
|
|
51
|
+
messages: {
|
|
52
|
+
array: "Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes.",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
43
55
|
"response-property-invalid": {
|
|
44
56
|
severity: "error",
|
|
45
57
|
messages: {
|
|
@@ -52,16 +64,16 @@ export const libDef = {
|
|
|
52
64
|
default: paramMessage `Class hierarchy for '${"name"}' should only have, at most, one discriminator, but found: ${"values"}.`,
|
|
53
65
|
},
|
|
54
66
|
},
|
|
55
|
-
"
|
|
56
|
-
severity: "
|
|
67
|
+
"no-fixed-enum-discriminator": {
|
|
68
|
+
severity: "warning",
|
|
57
69
|
messages: {
|
|
58
|
-
default:
|
|
70
|
+
default: paramMessage `Discriminator shouldn't be a fixed enum. A discriminated model is likely to expand over time. Removed "@fixed" from "${"enumName"}" enum.`,
|
|
59
71
|
},
|
|
60
72
|
},
|
|
61
|
-
"
|
|
73
|
+
"operation-link-parameter-invalid": {
|
|
62
74
|
severity: "error",
|
|
63
75
|
messages: {
|
|
64
|
-
default:
|
|
76
|
+
default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.",
|
|
65
77
|
},
|
|
66
78
|
},
|
|
67
79
|
"invalid-resource-type": {
|
|
@@ -173,6 +185,37 @@ export const libDef = {
|
|
|
173
185
|
default: "At least one operation response must contain a field marked with `@lroStatus`",
|
|
174
186
|
},
|
|
175
187
|
},
|
|
188
|
+
"no-nullable": {
|
|
189
|
+
severity: "warning",
|
|
190
|
+
messages: {
|
|
191
|
+
default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
"no-object": {
|
|
195
|
+
severity: "warning",
|
|
196
|
+
messages: {
|
|
197
|
+
default: "Don't use 'object'.\n - If you want an object with any properties, use `Record<unknown>`\n - If you meant anything, use `unknown`.",
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
"property-name-conflict": {
|
|
201
|
+
severity: "warning",
|
|
202
|
+
messages: {
|
|
203
|
+
default: paramMessage `Property '${"propertyName"}' having the same name as its enclosing model will cause problems with C# code generation. Consider renaming the property directly or using the @projectedName decorator to rename the property for C#.`,
|
|
204
|
+
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
|
+
},
|
|
206
|
+
},
|
|
207
|
+
"avoid-operation-id": {
|
|
208
|
+
severity: "warning",
|
|
209
|
+
messages: {
|
|
210
|
+
default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.",
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
"invalid-body-schema": {
|
|
214
|
+
severity: "warning",
|
|
215
|
+
messages: {
|
|
216
|
+
array: "Body schema should not be of raw array type.",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
176
219
|
},
|
|
177
220
|
};
|
|
178
221
|
export const $lib = createTypeSpecLibrary(libDef);
|
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,cAAc,EAAE;YACd,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,gBAAgB,MAAM,mBAAmB,QAAQ,EAAE;aACzE;SACF;QACD,6BAA6B,EAAE;YAC7B,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,wCAAwC,MAAM,GAAG;aACvE;SACF;QACD,kCAAkC,EAAE;YAClC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,sDAAsD;aAChE;SACF;QACD,oBAAoB,EAAE;YACpB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EA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F;QACD,wBAAwB,EAAE;YACxB,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,aAAa,cAAc,yMAAyM;gBACzP,aAAa,EAAE,YAAY,CAAA,sCAAsC,cAAc,iBAAiB,cAAc,kGAAkG;aACjN;SACF;QACD,oBAAoB,EAAE;YACpB,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;AAkD7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAM3C"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
import { getLinter } from "@typespec/lint";
|
|
2
2
|
import { checkRpcRoutes } from "./decorators.js";
|
|
3
3
|
import { $lib } from "./lib.js";
|
|
4
|
+
import { avoidOperationIdRule } from "./rules/avoid-operation-id.js";
|
|
5
|
+
import { byosRule } from "./rules/byos.js";
|
|
4
6
|
import { casingRule } from "./rules/casing.js";
|
|
5
7
|
import { extensibleEnumRule } from "./rules/extensible-enums.js";
|
|
6
8
|
import { longRunningOperationsRequirePollingOperation } from "./rules/lro-polling-operation.js";
|
|
9
|
+
import { noFixedEnumDiscriminatorRule } from "./rules/no-fixed-enum-discriminator.js";
|
|
10
|
+
import { noNullableRule } from "./rules/no-nullable.js";
|
|
11
|
+
import { noObjectRule } from "./rules/no-object.js";
|
|
7
12
|
import { preventFormatUse } from "./rules/prevent-format.js";
|
|
8
13
|
import { preventMultipleDiscriminator } from "./rules/prevent-multiple-discriminator.js";
|
|
9
14
|
import { preventRestLibraryInterfaces } from "./rules/prevent-rest-library.js";
|
|
10
15
|
import { preventUnknownType } from "./rules/prevent-unknown.js";
|
|
16
|
+
import { propertyNameRule } from "./rules/property-naming.js";
|
|
11
17
|
import { recordTypeRule } from "./rules/record-types.js";
|
|
18
|
+
import { bodyArrayRule } from "./rules/request-body-array.js";
|
|
12
19
|
import { requireDocumentation } from "./rules/require-docs.js";
|
|
13
20
|
import { requireKeyVisibility } from "./rules/require-key-visibility.js";
|
|
14
21
|
import { useStandardOperations } from "./rules/use-standard-ops.js";
|
|
15
22
|
const linter = getLinter($lib);
|
|
16
23
|
linter.registerRules([
|
|
24
|
+
avoidOperationIdRule,
|
|
25
|
+
bodyArrayRule,
|
|
26
|
+
byosRule,
|
|
17
27
|
casingRule,
|
|
18
28
|
extensibleEnumRule,
|
|
19
29
|
useStandardOperations,
|
|
30
|
+
noFixedEnumDiscriminatorRule,
|
|
31
|
+
noNullableRule,
|
|
32
|
+
noObjectRule,
|
|
20
33
|
preventFormatUse,
|
|
21
34
|
preventMultipleDiscriminator,
|
|
22
35
|
preventRestLibraryInterfaces,
|
|
23
36
|
preventUnknownType,
|
|
24
37
|
recordTypeRule,
|
|
38
|
+
propertyNameRule,
|
|
25
39
|
requireDocumentation,
|
|
26
40
|
requireKeyVisibility,
|
|
27
41
|
longRunningOperationsRequirePollingOperation,
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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AAS,CAAC,IAAI,CAAC,CAAC;AAC/B,MAAM,CAAC,aAAa,CAClB;IACE,oBAAoB;IACpB,aAAa;IACb,QAAQ;IACR,UAAU;IACV,kBAAkB;IAClB,qBAAqB;IACrB,4BAA4B;IAC5B,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,4BAA4B;IAC5B,4BAA4B;IAC5B,kBAAkB;IAClB,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,4CAA4C;CAC7C,EACD;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":"avoid-operation-id.d.ts","sourceRoot":"","sources":["../../../src/rules/avoid-operation-id.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,mCAgB/B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRule } from "@typespec/lint";
|
|
2
|
+
import { getOperationId } from "@typespec/openapi";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
import { isExcludedCoreType } from "./utils.js";
|
|
5
|
+
export const avoidOperationIdRule = createRule({
|
|
6
|
+
name: "avoid-operation-id",
|
|
7
|
+
create({ program }) {
|
|
8
|
+
return {
|
|
9
|
+
operation: (operation) => {
|
|
10
|
+
if (isExcludedCoreType(program, operation))
|
|
11
|
+
return;
|
|
12
|
+
if (getOperationId(program, operation)) {
|
|
13
|
+
reportDiagnostic(program, {
|
|
14
|
+
code: "avoid-operation-id",
|
|
15
|
+
format: { operationId: operation.name },
|
|
16
|
+
target: operation,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=avoid-operation-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byos.d.ts","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ,mCAoBnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ignoreDiagnostics } from "@typespec/compiler";
|
|
2
|
+
import { getHttpOperation } from "@typespec/http";
|
|
3
|
+
import { createRule } from "@typespec/lint";
|
|
4
|
+
import { reportDiagnostic } from "../lib.js";
|
|
5
|
+
const binaryContentTypes = new Set(["application/octet-stream", "multipart/form-data"]);
|
|
6
|
+
export const byosRule = createRule({
|
|
7
|
+
name: "byos",
|
|
8
|
+
create({ program }) {
|
|
9
|
+
return {
|
|
10
|
+
operation: (operation) => {
|
|
11
|
+
const httpOperation = ignoreDiagnostics(getHttpOperation(program, operation));
|
|
12
|
+
if (httpOperation.parameters.body !== undefined) {
|
|
13
|
+
for (const contentType of httpOperation.parameters.body.contentTypes) {
|
|
14
|
+
if (binaryContentTypes.has(contentType)) {
|
|
15
|
+
reportDiagnostic(program, {
|
|
16
|
+
code: "byos",
|
|
17
|
+
format: { contentType },
|
|
18
|
+
target: operation,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=byos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byos.js","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,0BAA0B,EAAE,qBAAqB,CAAC,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,MAAM;IACZ,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,MAAM,aAAa,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;gBAC9E,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBAC/C,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;wBACpE,IAAI,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;4BACvC,gBAAgB,CAAC,OAAO,EAAE;gCACxB,IAAI,EAAE,MAAM;gCACZ,MAAM,EAAE,EAAE,WAAW,EAAE;gCACvB,MAAM,EAAE,SAAS;6BAClB,CAAC,CAAC;yBACJ;qBACF;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-fixed-enum-discriminator.d.ts","sourceRoot":"","sources":["../../../src/rules/no-fixed-enum-discriminator.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B,mCAyBvC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getDiscriminator } from "@typespec/compiler";
|
|
2
|
+
import { createRule } from "@typespec/lint";
|
|
3
|
+
import { isFixed } from "../decorators.js";
|
|
4
|
+
import { reportDiagnostic } from "../lib.js";
|
|
5
|
+
export const noFixedEnumDiscriminatorRule = createRule({
|
|
6
|
+
name: "no-fixed-enum-discriminator",
|
|
7
|
+
create({ program }) {
|
|
8
|
+
return {
|
|
9
|
+
model: (model) => {
|
|
10
|
+
const discriminator = getDiscriminator(program, model);
|
|
11
|
+
if (discriminator === undefined) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const property = model.properties.get(discriminator.propertyName);
|
|
15
|
+
if (property === undefined || property.type.kind !== "Enum") {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (isFixed(program, property.type)) {
|
|
19
|
+
reportDiagnostic(program, {
|
|
20
|
+
code: "no-fixed-enum-discriminator",
|
|
21
|
+
format: { enumName: property.type.name },
|
|
22
|
+
target: property,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=no-fixed-enum-discriminator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-fixed-enum-discriminator.js","sourceRoot":"","sources":["../../../src/rules/no-fixed-enum-discriminator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAS,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;IACrD,IAAI,EAAE,6BAA6B;IACnC,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;gBACtB,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBACvD,IAAI,aAAa,KAAK,SAAS,EAAE;oBAC/B,OAAO;iBACR;gBAED,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;gBAClE,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;oBAC3D,OAAO;iBACR;gBAED,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE;oBACnC,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,6BAA6B;wBACnC,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;wBACxC,MAAM,EAAE,QAAQ;qBACjB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-nullable.d.ts","sourceRoot":"","sources":["../../../src/rules/no-nullable.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,mCAiBzB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isNullType } from "@typespec/compiler";
|
|
2
|
+
import { createRule } from "@typespec/lint";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
export const noNullableRule = createRule({
|
|
5
|
+
name: "no-nullable",
|
|
6
|
+
create({ program }) {
|
|
7
|
+
return {
|
|
8
|
+
modelProperty: (property) => {
|
|
9
|
+
if (property.type.kind !== "Union") {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if ([...property.type.variants.values()].some((x) => isNullType(x.type))) {
|
|
13
|
+
reportDiagnostic(program, {
|
|
14
|
+
code: "no-nullable",
|
|
15
|
+
target: property,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=no-nullable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-nullable.js","sourceRoot":"","sources":["../../../src/rules/no-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,aAAa;IACnB,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,aAAa,EAAE,CAAC,QAAuB,EAAE,EAAE;gBACzC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;oBAClC,OAAO;iBACR;gBACD,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;oBACxE,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,aAAa;wBACnB,MAAM,EAAE,QAAQ;qBACjB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-object.d.ts","sourceRoot":"","sources":["../../../src/rules/no-object.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,mCAmCvB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRule } from "@typespec/lint";
|
|
2
|
+
import { reportDiagnostic } from "../lib.js";
|
|
3
|
+
import { isExcludedCoreType } from "./utils.js";
|
|
4
|
+
export const noObjectRule = createRule({
|
|
5
|
+
name: "no-object",
|
|
6
|
+
create({ program }) {
|
|
7
|
+
const [objectType] = program.resolveTypeReference("TypeSpec.object");
|
|
8
|
+
const reportIfObject = (program, type, target) => {
|
|
9
|
+
if (type === objectType) {
|
|
10
|
+
reportDiagnostic(program, {
|
|
11
|
+
code: "no-object",
|
|
12
|
+
target,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
model: (model) => {
|
|
18
|
+
if (isExcludedCoreType(program, model))
|
|
19
|
+
return;
|
|
20
|
+
if (model.baseModel) {
|
|
21
|
+
reportIfObject(program, model.baseModel, model);
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
modelProperty: (property) => {
|
|
25
|
+
if (isExcludedCoreType(program, property))
|
|
26
|
+
return;
|
|
27
|
+
reportIfObject(program, property.type, property);
|
|
28
|
+
},
|
|
29
|
+
unionVariant: (variant) => {
|
|
30
|
+
if (isExcludedCoreType(program, variant))
|
|
31
|
+
return;
|
|
32
|
+
reportIfObject(program, variant.type, variant);
|
|
33
|
+
},
|
|
34
|
+
operation: (operation) => {
|
|
35
|
+
if (isExcludedCoreType(program, operation))
|
|
36
|
+
return;
|
|
37
|
+
reportIfObject(program, operation.returnType, operation);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=no-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-object.js","sourceRoot":"","sources":["../../../src/rules/no-object.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,WAAW;IACjB,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;QAErE,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,IAAU,EAAE,MAAwB,EAAE,EAAE;YAChF,IAAI,IAAI,KAAK,UAAU,EAAE;gBACvB,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,WAAW;oBACjB,MAAM;iBACP,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QAEF,OAAO;YACL,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;gBACtB,IAAI,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC;oBAAE,OAAO;gBAC/C,IAAI,KAAK,CAAC,SAAS,EAAE;oBACnB,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;iBACjD;YACH,CAAC;YACD,aAAa,EAAE,CAAC,QAAuB,EAAE,EAAE;gBACzC,IAAI,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC;oBAAE,OAAO;gBAClD,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACnD,CAAC;YACD,YAAY,EAAE,CAAC,OAAqB,EAAE,EAAE;gBACtC,IAAI,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC;oBAAE,OAAO;gBACjD,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACjD,CAAC;YACD,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC;oBAAE,OAAO;gBACnD,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YAC3D,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-naming.d.ts","sourceRoot":"","sources":["../../../src/rules/property-naming.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,mCAgC3B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getProjectedNames } from "@typespec/compiler";
|
|
2
|
+
import { createRule } from "@typespec/lint";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
import { isExcludedCoreType } from "./utils.js";
|
|
5
|
+
export const propertyNameRule = createRule({
|
|
6
|
+
name: "property-name-conflict",
|
|
7
|
+
create({ program }) {
|
|
8
|
+
return {
|
|
9
|
+
modelProperty: (property) => {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
if (isExcludedCoreType(program, property))
|
|
12
|
+
return;
|
|
13
|
+
const projectedNames = getProjectedNames(program, property);
|
|
14
|
+
const modelName = (_a = property.model) === null || _a === void 0 ? void 0 : _a.name.toLocaleLowerCase();
|
|
15
|
+
const propertyName = property.name.toLocaleLowerCase();
|
|
16
|
+
const csharpProjection = (_b = projectedNames === null || projectedNames === void 0 ? void 0 : projectedNames.get("csharp")) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
|
|
17
|
+
const clientProjection = (_c = projectedNames === null || projectedNames === void 0 ? void 0 : projectedNames.get("client")) === null || _c === void 0 ? void 0 : _c.toLocaleLowerCase();
|
|
18
|
+
if (csharpProjection === modelName || // csharp projection conflicts with model name
|
|
19
|
+
(clientProjection === modelName && !csharpProjection) // client projection conflicts with model name and there is no csharp projection
|
|
20
|
+
) {
|
|
21
|
+
reportDiagnostic(program, {
|
|
22
|
+
code: "property-name-conflict",
|
|
23
|
+
messageId: "projectedName",
|
|
24
|
+
format: { propertyName: property.name },
|
|
25
|
+
target: property,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else if (propertyName === modelName && !(csharpProjection || clientProjection)) {
|
|
29
|
+
// warning if the property name conflicts with the model name and there is no csharp or client projected name
|
|
30
|
+
reportDiagnostic(program, {
|
|
31
|
+
code: "property-name-conflict",
|
|
32
|
+
format: { propertyName: property.name },
|
|
33
|
+
target: property,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=property-naming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-naming.js","sourceRoot":"","sources":["../../../src/rules/property-naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC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ACvC,MAAM,EAAE,QAAQ;qBACjB,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-body-array.d.ts","sourceRoot":"","sources":["../../../src/rules/request-body-array.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,mCAiBxB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isBody } from "@typespec/http";
|
|
2
|
+
import { createRule } from "@typespec/lint";
|
|
3
|
+
import { reportDiagnostic } from "../lib.js";
|
|
4
|
+
export const bodyArrayRule = createRule({
|
|
5
|
+
name: "request-body-array",
|
|
6
|
+
create({ program }) {
|
|
7
|
+
return {
|
|
8
|
+
operation: (op) => {
|
|
9
|
+
for (const prop of op.parameters.properties.values()) {
|
|
10
|
+
if (isBody(program, prop) && prop.type.kind === "Model" && prop.type.name === "Array") {
|
|
11
|
+
reportDiagnostic(program, {
|
|
12
|
+
code: "request-body-problem",
|
|
13
|
+
target: prop,
|
|
14
|
+
messageId: "array",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=request-body-array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-body-array.js","sourceRoot":"","sources":["../../../src/rules/request-body-array.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE;oBACpD,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;wBACrF,gBAAgB,CAAC,OAAO,EAAE;4BACxB,IAAI,EAAE,sBAAsB;4BAC5B,MAAM,EAAE,IAAI;4BACZ,SAAS,EAAE,OAAO;yBACnB,CAAC,CAAC;qBACJ;iBACF;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { Interface, Model, ModelProperty, Namespace, Operation, Program, Scalar } from "@typespec/compiler";
|
|
1
|
+
import { Enum, EnumMember, Interface, Model, ModelProperty, Namespace, Operation, Program, Scalar, Union, UnionVariant } from "@typespec/compiler";
|
|
2
|
+
type DeclarableType = Namespace | Model | ModelProperty | Enum | EnumMember | Union | UnionVariant | Scalar | Operation | Interface;
|
|
2
3
|
/**
|
|
3
4
|
* Returns the full namespace name for the given type, if available.
|
|
4
5
|
* @param program the TypeSpec program
|
|
5
6
|
* @param type the type to query
|
|
6
7
|
* @returns The name of the namespace the type belongs in.
|
|
7
8
|
*/
|
|
8
|
-
export declare function getNamespaceName(program: Program, type:
|
|
9
|
+
export declare function getNamespaceName(program: Program, type: DeclarableType | undefined): string;
|
|
9
10
|
/**
|
|
10
11
|
* Returns true if the type is defined in a namespace that is excluded from linting.
|
|
11
12
|
* @param program the TypeSpec program
|
|
12
13
|
* @param type the type to query
|
|
13
14
|
* @returns true if the type is defined in a namespace that is excluded from linting.
|
|
14
15
|
*/
|
|
15
|
-
export declare function isExcludedCoreType(program: Program, type:
|
|
16
|
+
export declare function isExcludedCoreType(program: Program, type: DeclarableType): boolean;
|
|
16
17
|
/**
|
|
17
18
|
* Returns true if the model type is inline (has no name).
|
|
18
19
|
* @param target the target model
|
|
@@ -56,4 +57,5 @@ export declare function isCamelCaseNoAcronyms(name: string): boolean;
|
|
|
56
57
|
* @returns boolean indicating whether the provided model is in the Azure namespace.
|
|
57
58
|
*/
|
|
58
59
|
export declare function isInAzureNamespace(program: Program, context: Model | Scalar | Operation | ModelProperty | Interface | Namespace | undefined): boolean;
|
|
60
|
+
export {};
|
|
59
61
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EAEV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EAEN,KAAK,EACL,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B,KAAK,cAAc,GACf,SAAS,GACT,KAAK,GACL,aAAa,GACb,IAAI,GACJ,UAAU,GACV,KAAK,GACL,YAAY,GACZ,MAAM,GACN,SAAS,GACT,SAAS,CAAC;AAEd;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAW3F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAclF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,KAAK,WAE1C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,KAAK,kBAEtD;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,2BAO9D;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,WAM9D;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GACtF,OAAO,CAET"}
|
package/dist/src/rules/utils.js
CHANGED
|
@@ -10,11 +10,16 @@ export function getNamespaceName(program, type) {
|
|
|
10
10
|
return "";
|
|
11
11
|
if (type.kind === "ModelProperty")
|
|
12
12
|
return type.model ? getNamespaceName(program, type.model) : "";
|
|
13
|
+
if (type.kind === "EnumMember")
|
|
14
|
+
return type.enum ? getNamespaceName(program, type.enum) : "";
|
|
15
|
+
if (type.kind === "UnionVariant")
|
|
16
|
+
return type.union ? getNamespaceName(program, type.union) : "";
|
|
13
17
|
if (type.kind !== "Namespace")
|
|
14
18
|
type = type.namespace;
|
|
15
19
|
if (type === undefined) {
|
|
16
20
|
return "";
|
|
17
21
|
}
|
|
22
|
+
getNamespaceFullName;
|
|
18
23
|
return getNamespaceFullName(type);
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EAQpB,UAAU,GAGX,MAAM,oBAAoB,CAAC;AAc5B;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,IAAgC;IACjF,IAA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,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACpE,OAAO,yCAAyC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAgB,EAChB,OAAuF;IAEvF,OAAO,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAChE,CAAC"}
|
package/lib/foundations.tsp
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0-dev.10",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Core library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -42,30 +42,31 @@
|
|
|
42
42
|
"!dist/test/**"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@typespec/compiler": "
|
|
46
|
-
"@typespec/http": "
|
|
47
|
-
"@typespec/rest": "
|
|
45
|
+
"@typespec/compiler": ">=0.43.0",
|
|
46
|
+
"@typespec/http": ">=0.43.1",
|
|
47
|
+
"@typespec/rest": ">=0.43.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@typespec/lint": "
|
|
50
|
+
"@typespec/lint": ">=0.43.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@typespec/compiler": "
|
|
54
|
-
"@typespec/http": "
|
|
55
|
-
"@typespec/rest": "
|
|
56
|
-
"@typespec/eslint-config-typespec": "
|
|
57
|
-
"@typespec/library-linter": "
|
|
58
|
-
"@typespec/eslint-plugin": "
|
|
59
|
-
"@typespec/
|
|
53
|
+
"@typespec/compiler": ">=0.43.0",
|
|
54
|
+
"@typespec/http": ">=0.43.1",
|
|
55
|
+
"@typespec/rest": ">=0.43.0",
|
|
56
|
+
"@typespec/eslint-config-typespec": ">=0.6.0",
|
|
57
|
+
"@typespec/library-linter": ">=0.43.0",
|
|
58
|
+
"@typespec/eslint-plugin": ">=0.43.0",
|
|
59
|
+
"@typespec/openapi": ">=0.43.0",
|
|
60
|
+
"@typespec/versioning": ">=0.43.0",
|
|
60
61
|
"@types/mocha": "~10.0.0",
|
|
61
62
|
"@types/node": "~18.11.9",
|
|
62
|
-
"eslint": "^8.
|
|
63
|
-
"mocha": "~10.
|
|
63
|
+
"eslint": "^8.36.0",
|
|
64
|
+
"mocha": "~10.2.0",
|
|
64
65
|
"mocha-junit-reporter": "~2.2.0",
|
|
65
66
|
"mocha-multi-reporters": "~1.5.1",
|
|
66
|
-
"c8": "~7.
|
|
67
|
-
"rimraf": "~
|
|
68
|
-
"typescript": "~
|
|
67
|
+
"c8": "~7.13.0",
|
|
68
|
+
"rimraf": "~5.0.0",
|
|
69
|
+
"typescript": "~5.0.2"
|
|
69
70
|
},
|
|
70
71
|
"scripts": {
|
|
71
72
|
"clean": "rimraf ./dist ./temp",
|