@azure-tools/typespec-azure-core 0.30.0-dev.2 → 0.30.0-dev.21
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/README.md +2 -2
- package/dist/src/lib.d.ts +239 -23
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +67 -6
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +18 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/lro-helpers.js +2 -2
- package/dist/src/lro-helpers.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/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-offsetdatetime.d.ts +2 -0
- package/dist/src/rules/no-offsetdatetime.d.ts.map +1 -0
- package/dist/src/rules/no-offsetdatetime.js +42 -0
- package/dist/src/rules/no-offsetdatetime.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/no-operation-id.js +23 -0
- 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/dist/src/rules/prefer-csv-collection-format.d.ts +2 -0
- package/dist/src/rules/prefer-csv-collection-format.d.ts.map +1 -0
- package/dist/src/rules/prefer-csv-collection-format.js +25 -0
- package/dist/src/rules/prefer-csv-collection-format.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/lib/azure-core.tsp +3 -0
- package/lib/foundations.tsp +134 -0
- package/lib/models.tsp +20 -1
- package/lib/operations.tsp +111 -3
- package/lib/traits.tsp +37 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ This package provides TypeSpec decorators, models and interfaces to describe Azu
|
|
|
32
32
|
|
|
33
33
|
To get started using TypeSpec and `Azure.Core`, you have two options:
|
|
34
34
|
|
|
35
|
-
1. Visit the [TypeSpec Azure Playground](https://
|
|
35
|
+
1. Visit the [TypeSpec Azure Playground](https://cadlplayground.z22.web.core.windows.net/cadl-azure/) to experiment with TypeSpec in your web browser (recommended for first-time users)
|
|
36
36
|
2. Follow the [installation documentation](https://microsoft.github.io/typespec/docs/setup/installation/) at the official documentation website (recommended for real TypeSpec development)
|
|
37
37
|
|
|
38
38
|
You should also read the [language overview](https://microsoft.github.io/typespec/docs/language-basics/overview/) to get better acquainted with the language.
|
|
@@ -618,4 +618,4 @@ You can learn more about the `typespec-autorest` emitter and its options by read
|
|
|
618
618
|
|
|
619
619
|
A complete version of the `Contoso.WidgetManager` specification can be found in the [`widget-manager` sample folder](https://github.com/Azure/typespec-azure/blob/main/packages/typespec-samples/data-plane/widget-manager/main.tsp).
|
|
620
620
|
|
|
621
|
-
You can experiment with the full sample on the [TypeSpec Azure Playground](https://
|
|
621
|
+
You can experiment with the full sample on the [TypeSpec Azure Playground](https://cadlplayground.z22.web.core.windows.net/cadl-azure/?sample=Azure%20Core%20Data%20Plane20Service)!
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -2,12 +2,30 @@ 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
|
+
};
|
|
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
|
+
};
|
|
5
17
|
readonly "casing-style": {
|
|
6
18
|
readonly severity: "warning";
|
|
7
19
|
readonly messages: {
|
|
8
20
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
9
21
|
};
|
|
10
22
|
};
|
|
23
|
+
readonly "prefer-csv-collection-format": {
|
|
24
|
+
readonly severity: "warning";
|
|
25
|
+
readonly messages: {
|
|
26
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
11
29
|
readonly "lro-status-union-non-string": {
|
|
12
30
|
readonly severity: "error";
|
|
13
31
|
readonly messages: {
|
|
@@ -39,6 +57,12 @@ export declare const libDef: {
|
|
|
39
57
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
40
58
|
};
|
|
41
59
|
};
|
|
60
|
+
readonly "request-body-problem": {
|
|
61
|
+
readonly severity: "warning";
|
|
62
|
+
readonly messages: {
|
|
63
|
+
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.";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
42
66
|
readonly "response-property-invalid": {
|
|
43
67
|
readonly severity: "error";
|
|
44
68
|
readonly messages: {
|
|
@@ -51,16 +75,16 @@ export declare const libDef: {
|
|
|
51
75
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
52
76
|
};
|
|
53
77
|
};
|
|
54
|
-
readonly "
|
|
55
|
-
readonly severity: "
|
|
78
|
+
readonly "no-fixed-enum-discriminator": {
|
|
79
|
+
readonly severity: "warning";
|
|
56
80
|
readonly messages: {
|
|
57
|
-
readonly default: "
|
|
81
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
58
82
|
};
|
|
59
83
|
};
|
|
60
|
-
readonly "
|
|
84
|
+
readonly "operation-link-parameter-invalid": {
|
|
61
85
|
readonly severity: "error";
|
|
62
86
|
readonly messages: {
|
|
63
|
-
readonly default: "
|
|
87
|
+
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
64
88
|
};
|
|
65
89
|
};
|
|
66
90
|
readonly "invalid-resource-type": {
|
|
@@ -88,6 +112,12 @@ export declare const libDef: {
|
|
|
88
112
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
89
113
|
};
|
|
90
114
|
};
|
|
115
|
+
readonly "no-order-by": {
|
|
116
|
+
readonly severity: "warning";
|
|
117
|
+
readonly messages: {
|
|
118
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
91
121
|
readonly "no-rest-library-interfaces": {
|
|
92
122
|
readonly severity: "error";
|
|
93
123
|
readonly messages: {
|
|
@@ -172,18 +202,58 @@ export declare const libDef: {
|
|
|
172
202
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
173
203
|
};
|
|
174
204
|
};
|
|
205
|
+
readonly "no-nullable": {
|
|
206
|
+
readonly severity: "warning";
|
|
207
|
+
readonly messages: {
|
|
208
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
209
|
+
};
|
|
210
|
+
};
|
|
175
211
|
readonly "no-object": {
|
|
176
|
-
readonly severity: "
|
|
212
|
+
readonly severity: "warning";
|
|
177
213
|
readonly messages: {
|
|
178
214
|
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`.";
|
|
179
215
|
};
|
|
180
216
|
};
|
|
217
|
+
readonly "no-offsetdatetime": {
|
|
218
|
+
readonly severity: "warning";
|
|
219
|
+
readonly messages: {
|
|
220
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
readonly "property-name-conflict": {
|
|
224
|
+
readonly severity: "warning";
|
|
225
|
+
readonly messages: {
|
|
226
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
227
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly "no-operation-id": {
|
|
231
|
+
readonly severity: "warning";
|
|
232
|
+
readonly messages: {
|
|
233
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
readonly "invalid-body-schema": {
|
|
237
|
+
readonly severity: "warning";
|
|
238
|
+
readonly messages: {
|
|
239
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
181
242
|
};
|
|
182
243
|
};
|
|
183
244
|
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
245
|
+
byos: {
|
|
246
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
247
|
+
};
|
|
248
|
+
"operation-missing-api-version": {
|
|
249
|
+
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.";
|
|
250
|
+
};
|
|
184
251
|
"casing-style": {
|
|
185
252
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
186
253
|
};
|
|
254
|
+
"prefer-csv-collection-format": {
|
|
255
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
256
|
+
};
|
|
187
257
|
"lro-status-union-non-string": {
|
|
188
258
|
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
189
259
|
};
|
|
@@ -200,18 +270,21 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
200
270
|
"request-parameter-invalid": {
|
|
201
271
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
202
272
|
};
|
|
273
|
+
"request-body-problem": {
|
|
274
|
+
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.";
|
|
275
|
+
};
|
|
203
276
|
"response-property-invalid": {
|
|
204
277
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
205
278
|
};
|
|
206
279
|
"no-multiple-discriminator": {
|
|
207
280
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
208
281
|
};
|
|
282
|
+
"no-fixed-enum-discriminator": {
|
|
283
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
284
|
+
};
|
|
209
285
|
"operation-link-parameter-invalid": {
|
|
210
286
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
211
287
|
};
|
|
212
|
-
"client-definition-parameters-not-model": {
|
|
213
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
214
|
-
};
|
|
215
288
|
"invalid-resource-type": {
|
|
216
289
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
217
290
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -225,6 +298,9 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
225
298
|
"no-format": {
|
|
226
299
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
227
300
|
};
|
|
301
|
+
"no-order-by": {
|
|
302
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
303
|
+
};
|
|
228
304
|
"no-rest-library-interfaces": {
|
|
229
305
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
230
306
|
};
|
|
@@ -267,14 +343,39 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
267
343
|
"lro-polling-data-missing-from-operation-response": {
|
|
268
344
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
269
345
|
};
|
|
346
|
+
"no-nullable": {
|
|
347
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
348
|
+
};
|
|
270
349
|
"no-object": {
|
|
271
350
|
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`.";
|
|
272
351
|
};
|
|
352
|
+
"no-offsetdatetime": {
|
|
353
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
354
|
+
};
|
|
355
|
+
"property-name-conflict": {
|
|
356
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
357
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
358
|
+
};
|
|
359
|
+
"no-operation-id": {
|
|
360
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
361
|
+
};
|
|
362
|
+
"invalid-body-schema": {
|
|
363
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
364
|
+
};
|
|
273
365
|
}, Record<string, any>>;
|
|
274
|
-
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" | "
|
|
366
|
+
export declare const reportDiagnostic: <C extends "byos" | "operation-missing-api-version" | "casing-style" | "prefer-csv-collection-format" | "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" | "no-offsetdatetime" | "property-name-conflict" | "no-operation-id" | "invalid-body-schema", M extends keyof {
|
|
367
|
+
byos: {
|
|
368
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
369
|
+
};
|
|
370
|
+
"operation-missing-api-version": {
|
|
371
|
+
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.";
|
|
372
|
+
};
|
|
275
373
|
"casing-style": {
|
|
276
374
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
277
375
|
};
|
|
376
|
+
"prefer-csv-collection-format": {
|
|
377
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
378
|
+
};
|
|
278
379
|
"lro-status-union-non-string": {
|
|
279
380
|
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
280
381
|
};
|
|
@@ -291,18 +392,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
291
392
|
"request-parameter-invalid": {
|
|
292
393
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
293
394
|
};
|
|
395
|
+
"request-body-problem": {
|
|
396
|
+
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.";
|
|
397
|
+
};
|
|
294
398
|
"response-property-invalid": {
|
|
295
399
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
296
400
|
};
|
|
297
401
|
"no-multiple-discriminator": {
|
|
298
402
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
299
403
|
};
|
|
404
|
+
"no-fixed-enum-discriminator": {
|
|
405
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
406
|
+
};
|
|
300
407
|
"operation-link-parameter-invalid": {
|
|
301
408
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
302
409
|
};
|
|
303
|
-
"client-definition-parameters-not-model": {
|
|
304
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
305
|
-
};
|
|
306
410
|
"invalid-resource-type": {
|
|
307
411
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
308
412
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -316,6 +420,9 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
316
420
|
"no-format": {
|
|
317
421
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
318
422
|
};
|
|
423
|
+
"no-order-by": {
|
|
424
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
425
|
+
};
|
|
319
426
|
"no-rest-library-interfaces": {
|
|
320
427
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
321
428
|
};
|
|
@@ -358,13 +465,38 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
358
465
|
"lro-polling-data-missing-from-operation-response": {
|
|
359
466
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
360
467
|
};
|
|
468
|
+
"no-nullable": {
|
|
469
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
470
|
+
};
|
|
361
471
|
"no-object": {
|
|
362
472
|
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`.";
|
|
363
473
|
};
|
|
474
|
+
"no-offsetdatetime": {
|
|
475
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
476
|
+
};
|
|
477
|
+
"property-name-conflict": {
|
|
478
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
479
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
480
|
+
};
|
|
481
|
+
"no-operation-id": {
|
|
482
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
483
|
+
};
|
|
484
|
+
"invalid-body-schema": {
|
|
485
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
486
|
+
};
|
|
364
487
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
488
|
+
byos: {
|
|
489
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
490
|
+
};
|
|
491
|
+
"operation-missing-api-version": {
|
|
492
|
+
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.";
|
|
493
|
+
};
|
|
365
494
|
"casing-style": {
|
|
366
495
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
367
496
|
};
|
|
497
|
+
"prefer-csv-collection-format": {
|
|
498
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
499
|
+
};
|
|
368
500
|
"lro-status-union-non-string": {
|
|
369
501
|
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
370
502
|
};
|
|
@@ -381,18 +513,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
381
513
|
"request-parameter-invalid": {
|
|
382
514
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
383
515
|
};
|
|
516
|
+
"request-body-problem": {
|
|
517
|
+
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.";
|
|
518
|
+
};
|
|
384
519
|
"response-property-invalid": {
|
|
385
520
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
386
521
|
};
|
|
387
522
|
"no-multiple-discriminator": {
|
|
388
523
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
389
524
|
};
|
|
525
|
+
"no-fixed-enum-discriminator": {
|
|
526
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
527
|
+
};
|
|
390
528
|
"operation-link-parameter-invalid": {
|
|
391
529
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
392
530
|
};
|
|
393
|
-
"client-definition-parameters-not-model": {
|
|
394
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
395
|
-
};
|
|
396
531
|
"invalid-resource-type": {
|
|
397
532
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
398
533
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -406,6 +541,9 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
406
541
|
"no-format": {
|
|
407
542
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
408
543
|
};
|
|
544
|
+
"no-order-by": {
|
|
545
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
546
|
+
};
|
|
409
547
|
"no-rest-library-interfaces": {
|
|
410
548
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
411
549
|
};
|
|
@@ -448,13 +586,38 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
448
586
|
"lro-polling-data-missing-from-operation-response": {
|
|
449
587
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
450
588
|
};
|
|
589
|
+
"no-nullable": {
|
|
590
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
591
|
+
};
|
|
451
592
|
"no-object": {
|
|
452
593
|
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`.";
|
|
453
594
|
};
|
|
454
|
-
|
|
595
|
+
"no-offsetdatetime": {
|
|
596
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
597
|
+
};
|
|
598
|
+
"property-name-conflict": {
|
|
599
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
600
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
601
|
+
};
|
|
602
|
+
"no-operation-id": {
|
|
603
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
604
|
+
};
|
|
605
|
+
"invalid-body-schema": {
|
|
606
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
607
|
+
};
|
|
608
|
+
}, C, M>) => void, createDiagnostic: <C extends "byos" | "operation-missing-api-version" | "casing-style" | "prefer-csv-collection-format" | "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" | "no-offsetdatetime" | "property-name-conflict" | "no-operation-id" | "invalid-body-schema", M extends keyof {
|
|
609
|
+
byos: {
|
|
610
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
611
|
+
};
|
|
612
|
+
"operation-missing-api-version": {
|
|
613
|
+
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.";
|
|
614
|
+
};
|
|
455
615
|
"casing-style": {
|
|
456
616
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
457
617
|
};
|
|
618
|
+
"prefer-csv-collection-format": {
|
|
619
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
620
|
+
};
|
|
458
621
|
"lro-status-union-non-string": {
|
|
459
622
|
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
460
623
|
};
|
|
@@ -471,18 +634,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
471
634
|
"request-parameter-invalid": {
|
|
472
635
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
473
636
|
};
|
|
637
|
+
"request-body-problem": {
|
|
638
|
+
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.";
|
|
639
|
+
};
|
|
474
640
|
"response-property-invalid": {
|
|
475
641
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
476
642
|
};
|
|
477
643
|
"no-multiple-discriminator": {
|
|
478
644
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
479
645
|
};
|
|
646
|
+
"no-fixed-enum-discriminator": {
|
|
647
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
648
|
+
};
|
|
480
649
|
"operation-link-parameter-invalid": {
|
|
481
650
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
482
651
|
};
|
|
483
|
-
"client-definition-parameters-not-model": {
|
|
484
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
485
|
-
};
|
|
486
652
|
"invalid-resource-type": {
|
|
487
653
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
488
654
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -496,6 +662,9 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
496
662
|
"no-format": {
|
|
497
663
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
498
664
|
};
|
|
665
|
+
"no-order-by": {
|
|
666
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
667
|
+
};
|
|
499
668
|
"no-rest-library-interfaces": {
|
|
500
669
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
501
670
|
};
|
|
@@ -538,13 +707,38 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
538
707
|
"lro-polling-data-missing-from-operation-response": {
|
|
539
708
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
540
709
|
};
|
|
710
|
+
"no-nullable": {
|
|
711
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
712
|
+
};
|
|
541
713
|
"no-object": {
|
|
542
714
|
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`.";
|
|
543
715
|
};
|
|
716
|
+
"no-offsetdatetime": {
|
|
717
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
718
|
+
};
|
|
719
|
+
"property-name-conflict": {
|
|
720
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
721
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
722
|
+
};
|
|
723
|
+
"no-operation-id": {
|
|
724
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
725
|
+
};
|
|
726
|
+
"invalid-body-schema": {
|
|
727
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
728
|
+
};
|
|
544
729
|
}[C]>(diag: import("@typespec/compiler").DiagnosticReport<{
|
|
730
|
+
byos: {
|
|
731
|
+
readonly default: import("@typespec/compiler").CallableMessage<["contentType"]>;
|
|
732
|
+
};
|
|
733
|
+
"operation-missing-api-version": {
|
|
734
|
+
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.";
|
|
735
|
+
};
|
|
545
736
|
"casing-style": {
|
|
546
737
|
readonly default: import("@typespec/compiler").CallableMessage<["type", "casing"]>;
|
|
547
738
|
};
|
|
739
|
+
"prefer-csv-collection-format": {
|
|
740
|
+
readonly default: "It is recommended to use \"csv\" for collection format of parameters.";
|
|
741
|
+
};
|
|
548
742
|
"lro-status-union-non-string": {
|
|
549
743
|
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
|
550
744
|
};
|
|
@@ -561,18 +755,21 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
561
755
|
"request-parameter-invalid": {
|
|
562
756
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
563
757
|
};
|
|
758
|
+
"request-body-problem": {
|
|
759
|
+
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.";
|
|
760
|
+
};
|
|
564
761
|
"response-property-invalid": {
|
|
565
762
|
readonly default: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
566
763
|
};
|
|
567
764
|
"no-multiple-discriminator": {
|
|
568
765
|
readonly default: import("@typespec/compiler").CallableMessage<["name", "values"]>;
|
|
569
766
|
};
|
|
767
|
+
"no-fixed-enum-discriminator": {
|
|
768
|
+
readonly default: import("@typespec/compiler").CallableMessage<["enumName"]>;
|
|
769
|
+
};
|
|
570
770
|
"operation-link-parameter-invalid": {
|
|
571
771
|
readonly default: "Parameters must be of template type RequestParameter<T> or ResponseProperty<T>.";
|
|
572
772
|
};
|
|
573
|
-
"client-definition-parameters-not-model": {
|
|
574
|
-
readonly default: "The value for \"parameters\" property must be a model type";
|
|
575
|
-
};
|
|
576
773
|
"invalid-resource-type": {
|
|
577
774
|
readonly missingKey: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
578
775
|
readonly missingSegment: import("@typespec/compiler").CallableMessage<["name"]>;
|
|
@@ -586,6 +783,9 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
586
783
|
"no-format": {
|
|
587
784
|
readonly default: "Azure services should not use the `@format` decorator.";
|
|
588
785
|
};
|
|
786
|
+
"no-order-by": {
|
|
787
|
+
readonly default: "List operations with an 'orderBy' parameter are uncommon; support should only be added after large collection sorting performance concerns are considered.";
|
|
788
|
+
};
|
|
589
789
|
"no-rest-library-interfaces": {
|
|
590
790
|
readonly default: "Resource interfaces from the TypeSpec.Rest.Resource library are incompatible with Azure.Core.";
|
|
591
791
|
};
|
|
@@ -628,8 +828,24 @@ export declare const reportDiagnostic: <C extends "casing-style" | "lro-status-u
|
|
|
628
828
|
"lro-polling-data-missing-from-operation-response": {
|
|
629
829
|
readonly default: "At least one operation response must contain a field marked with `@lroStatus`";
|
|
630
830
|
};
|
|
831
|
+
"no-nullable": {
|
|
832
|
+
readonly default: "Don't use `| null`. If you meant to have an optional property, use `?`. (e.g. `myProp?: string`)";
|
|
833
|
+
};
|
|
631
834
|
"no-object": {
|
|
632
835
|
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`.";
|
|
633
836
|
};
|
|
837
|
+
"no-offsetdatetime": {
|
|
838
|
+
readonly default: "Prefer using `utcDateTime` when representing a datetime unless an offset is necessary.";
|
|
839
|
+
};
|
|
840
|
+
"property-name-conflict": {
|
|
841
|
+
readonly default: import("@typespec/compiler").CallableMessage<["propertyName"]>;
|
|
842
|
+
readonly projectedName: import("@typespec/compiler").CallableMessage<["propertyName", "propertyName"]>;
|
|
843
|
+
};
|
|
844
|
+
"no-operation-id": {
|
|
845
|
+
readonly default: "Operation ID is automatically generated by the OpenAPI emitters and should not normally be specified.";
|
|
846
|
+
};
|
|
847
|
+
"invalid-body-schema": {
|
|
848
|
+
readonly array: "Body schema should not be of raw array type.";
|
|
849
|
+
};
|
|
634
850
|
}, C, M>) => import("@typespec/compiler").Diagnostic, createStateSymbol: (name: string) => symbol;
|
|
635
851
|
//# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0PT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAAE,iBAAiB,0BAAS,CAAC"}
|