@azure-tools/typespec-azure-core 0.30.0-dev.27 → 0.30.0-dev.29
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/rules/byos.d.ts.map +1 -1
- package/dist/src/rules/byos.js +5 -1
- package/dist/src/rules/byos.js.map +1 -1
- package/lib/foundations.tsp +0 -1
- package/lib/operations.tsp +92 -0
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byos.d.ts","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"byos.d.ts","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ,mCAwBnB,CAAC"}
|
package/dist/src/rules/byos.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ignoreDiagnostics } from "@typespec/compiler";
|
|
1
|
+
import { ignoreDiagnostics, isTemplateInstance } from "@typespec/compiler";
|
|
2
2
|
import { getHttpOperation } from "@typespec/http";
|
|
3
3
|
import { createRule } from "@typespec/lint";
|
|
4
4
|
import { reportDiagnostic } from "../lib.js";
|
|
@@ -8,6 +8,10 @@ export const byosRule = createRule({
|
|
|
8
8
|
create({ program }) {
|
|
9
9
|
return {
|
|
10
10
|
operation: (operation) => {
|
|
11
|
+
if (isTemplateInstance(operation)) {
|
|
12
|
+
// Operation template instance are just referenced in `op is`. Main operation will be validated.
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
const httpOperation = ignoreDiagnostics(getHttpOperation(program, operation));
|
|
12
16
|
if (httpOperation.parameters.body !== undefined) {
|
|
13
17
|
for (const contentType of httpOperation.parameters.body.contentTypes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byos.js","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAa,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"byos.js","sourceRoot":"","sources":["../../../src/rules/byos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAa,MAAM,oBAAoB,CAAC;AACtF,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,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE;oBACjC,gGAAgG;oBAChG,OAAO;iBACR;gBACD,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"}
|
package/lib/foundations.tsp
CHANGED
|
@@ -261,7 +261,6 @@ model CustomizationFields {
|
|
|
261
261
|
* @template Traits Traits which apply to the operation.
|
|
262
262
|
* @template TErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
263
263
|
*/
|
|
264
|
-
#suppress "@azure-tools/typespec-providerhub/operation-requires-documentation" "This is a library operation."
|
|
265
264
|
op Operation<
|
|
266
265
|
TParams,
|
|
267
266
|
TResponse,
|
package/lib/operations.tsp
CHANGED
|
@@ -62,6 +62,11 @@ interface ResourceOperations<
|
|
|
62
62
|
InterfaceTraits,
|
|
63
63
|
TErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
64
64
|
> {
|
|
65
|
+
/**
|
|
66
|
+
* Create or replace operation template.
|
|
67
|
+
* @template TResource Resource type.
|
|
68
|
+
* @template Traits Object describing the traits of the operation.
|
|
69
|
+
*/
|
|
65
70
|
@createsOrReplacesResource(TResource)
|
|
66
71
|
ResourceCreateOrReplace<
|
|
67
72
|
TResource extends object,
|
|
@@ -84,6 +89,11 @@ interface ResourceOperations<
|
|
|
84
89
|
TErrorResponse
|
|
85
90
|
>;
|
|
86
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Long-running resource create or replace operation template.
|
|
94
|
+
* @template TResource Resource type.
|
|
95
|
+
* @template Traits Object describing the traits of the operation.
|
|
96
|
+
*/
|
|
87
97
|
@createsOrReplacesResource(TResource)
|
|
88
98
|
LongRunningResourceCreateOrReplace<
|
|
89
99
|
TResource extends object,
|
|
@@ -107,6 +117,11 @@ interface ResourceOperations<
|
|
|
107
117
|
TErrorResponse
|
|
108
118
|
>;
|
|
109
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Create or update operation template.
|
|
122
|
+
* @template TResource Resource type.
|
|
123
|
+
* @template Traits Object describing the traits of the operation.
|
|
124
|
+
*/
|
|
110
125
|
@createsOrUpdatesResource(TResource)
|
|
111
126
|
ResourceCreateOrUpdate<
|
|
112
127
|
TResource extends object,
|
|
@@ -134,6 +149,11 @@ interface ResourceOperations<
|
|
|
134
149
|
TErrorResponse
|
|
135
150
|
>;
|
|
136
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Long-running resource create or update operation template.
|
|
154
|
+
* @template TResource Resource type.
|
|
155
|
+
* @template Traits Object describing the traits of the operation.
|
|
156
|
+
*/
|
|
137
157
|
@createsOrUpdatesResource(TResource)
|
|
138
158
|
LongRunningResourceCreateOrUpdate<
|
|
139
159
|
TResource extends object,
|
|
@@ -162,6 +182,11 @@ interface ResourceOperations<
|
|
|
162
182
|
TErrorResponse
|
|
163
183
|
>;
|
|
164
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Resource update operation template.
|
|
187
|
+
* @template TResource Resource type.
|
|
188
|
+
* @template Traits Object describing the traits of the operation.
|
|
189
|
+
*/
|
|
165
190
|
@updatesResource(TResource)
|
|
166
191
|
ResourceUpdate<
|
|
167
192
|
TResource extends object,
|
|
@@ -181,6 +206,11 @@ interface ResourceOperations<
|
|
|
181
206
|
TErrorResponse
|
|
182
207
|
>;
|
|
183
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Resource create with service-provided name operation template.
|
|
211
|
+
* @template TResource Resource type.
|
|
212
|
+
* @template Traits Object describing the traits of the operation.
|
|
213
|
+
*/
|
|
184
214
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
185
215
|
@createsResource(TResource)
|
|
186
216
|
ResourceCreateWithServiceProvidedName<
|
|
@@ -196,6 +226,11 @@ interface ResourceOperations<
|
|
|
196
226
|
TErrorResponse
|
|
197
227
|
>;
|
|
198
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Long-running resource create with service-provided name operation template.
|
|
231
|
+
* @template TResource Resource type.
|
|
232
|
+
* @template Traits Object describing the traits of the operation.
|
|
233
|
+
*/
|
|
199
234
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
200
235
|
@createsResource(TResource)
|
|
201
236
|
LongRunningResourceCreateWithServiceProvidedName<
|
|
@@ -211,6 +246,11 @@ interface ResourceOperations<
|
|
|
211
246
|
TErrorResponse
|
|
212
247
|
>;
|
|
213
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Resource read operation template.
|
|
251
|
+
* @template TResource Resource type.
|
|
252
|
+
* @template Traits Object describing the traits of the operation.
|
|
253
|
+
*/
|
|
214
254
|
@readsResource(TResource)
|
|
215
255
|
ResourceRead<
|
|
216
256
|
TResource extends object,
|
|
@@ -224,6 +264,11 @@ interface ResourceOperations<
|
|
|
224
264
|
TErrorResponse
|
|
225
265
|
>;
|
|
226
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Resource delete operation template.
|
|
269
|
+
* @template TResource Resource type.
|
|
270
|
+
* @template Traits Object describing the traits of the operation.
|
|
271
|
+
*/
|
|
227
272
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
228
273
|
@deletesResource(TResource)
|
|
229
274
|
ResourceDelete<
|
|
@@ -238,6 +283,11 @@ interface ResourceOperations<
|
|
|
238
283
|
TErrorResponse
|
|
239
284
|
>;
|
|
240
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Long-running resource delete operation template.
|
|
288
|
+
* @template TResource Resource type.
|
|
289
|
+
* @template Traits Object describing the traits of the operation.
|
|
290
|
+
*/
|
|
241
291
|
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "We do support bodies in data plane service APIs..."
|
|
242
292
|
@deletesResource(TResource)
|
|
243
293
|
LongRunningResourceDelete<
|
|
@@ -253,6 +303,11 @@ interface ResourceOperations<
|
|
|
253
303
|
TErrorResponse
|
|
254
304
|
>;
|
|
255
305
|
|
|
306
|
+
/**
|
|
307
|
+
* Resource list operation template.
|
|
308
|
+
* @template TResource Resource type.
|
|
309
|
+
* @template Traits Object describing the traits of the operation.
|
|
310
|
+
*/
|
|
256
311
|
ResourceList<TResource extends object, Traits extends object = {}> is Foundations.ResourceList<
|
|
257
312
|
TResource,
|
|
258
313
|
TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.List>,
|
|
@@ -261,6 +316,13 @@ interface ResourceOperations<
|
|
|
261
316
|
TErrorResponse
|
|
262
317
|
>;
|
|
263
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Resource action operation template.
|
|
321
|
+
* @template TResource Resource type.
|
|
322
|
+
* @template TParams Object describing the parameters of the operation.
|
|
323
|
+
* @template TResponse Object describing the response of the operation.
|
|
324
|
+
* @template Traits Object describing the traits of the operation.
|
|
325
|
+
*/
|
|
264
326
|
@action
|
|
265
327
|
@actionSeparator(":")
|
|
266
328
|
ResourceAction<
|
|
@@ -278,6 +340,13 @@ interface ResourceOperations<
|
|
|
278
340
|
TErrorResponse
|
|
279
341
|
>;
|
|
280
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Resource collection action operation template.
|
|
345
|
+
* @template TResource Resource type.
|
|
346
|
+
* @template TParams Object describing the parameters of the operation.
|
|
347
|
+
* @template TResponse Object describing the response of the operation.
|
|
348
|
+
* @template Traits Object describing the traits of the operation.
|
|
349
|
+
*/
|
|
281
350
|
@collectionAction(TResource)
|
|
282
351
|
@actionSeparator(":")
|
|
283
352
|
ResourceCollectionAction<
|
|
@@ -295,6 +364,14 @@ interface ResourceOperations<
|
|
|
295
364
|
TErrorResponse
|
|
296
365
|
>;
|
|
297
366
|
|
|
367
|
+
/**
|
|
368
|
+
* Long-running resource action operation template.
|
|
369
|
+
* @template TResource Resource type.
|
|
370
|
+
* @template TParams Object describing the parameters of the operation.
|
|
371
|
+
* @template TStatusResult Object describing the status result of the operation.
|
|
372
|
+
* @template TStatusError Object describing the status error of the operation.
|
|
373
|
+
* @template Traits Object describing the traits of the operation.
|
|
374
|
+
*/
|
|
298
375
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
299
376
|
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
|
|
300
377
|
@action
|
|
@@ -317,6 +394,14 @@ interface ResourceOperations<
|
|
|
317
394
|
TErrorResponse
|
|
318
395
|
>;
|
|
319
396
|
|
|
397
|
+
/**
|
|
398
|
+
* Long-running resource collection action operation template.
|
|
399
|
+
* @template TResource Resource type.
|
|
400
|
+
* @template TParams Object describing the parameters of the operation.
|
|
401
|
+
* @template TStatusResult Object describing the status result of the operation.
|
|
402
|
+
* @template TStatusError Object describing the status error of the operation.
|
|
403
|
+
* @template Traits Object describing the traits of the operation.
|
|
404
|
+
*/
|
|
320
405
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
321
406
|
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
|
|
322
407
|
@autoRoute
|
|
@@ -340,6 +425,13 @@ interface ResourceOperations<
|
|
|
340
425
|
TErrorResponse
|
|
341
426
|
>;
|
|
342
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Resource operation status operation template.
|
|
430
|
+
* @template TResource Resource type.
|
|
431
|
+
* @template TStatusResult Object describing the status result of the operation.
|
|
432
|
+
* @template TStatusError Object describing the status error of the operation.
|
|
433
|
+
* @template Traits Object describing the traits of the operation.
|
|
434
|
+
*/
|
|
343
435
|
@readsResource(ResourceOperationStatus<TResource>)
|
|
344
436
|
@Foundations.Private.ensureResourceType(TResource)
|
|
345
437
|
GetResourceOperationStatus<
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-core",
|
|
3
|
-
"version": "0.30.0-dev.
|
|
3
|
+
"version": "0.30.0-dev.29",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Core library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -42,22 +42,22 @@
|
|
|
42
42
|
"!dist/test/**"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@typespec/compiler": "
|
|
46
|
-
"@typespec/http": "
|
|
47
|
-
"@typespec/rest": "
|
|
45
|
+
"@typespec/compiler": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
46
|
+
"@typespec/http": "~0.43.1 || >=0.44.0-dev <0.44.0",
|
|
47
|
+
"@typespec/rest": "~0.43.0 || >=0.44.0-dev <0.44.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@typespec/lint": "
|
|
50
|
+
"@typespec/lint": "~0.43.0 || >=0.44.0-dev <0.44.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/openapi": "
|
|
60
|
-
"@typespec/versioning": "
|
|
53
|
+
"@typespec/compiler": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
54
|
+
"@typespec/http": "~0.43.1 || >=0.44.0-dev <0.44.0",
|
|
55
|
+
"@typespec/rest": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
56
|
+
"@typespec/eslint-config-typespec": "~0.6.0 || >=0.7.0-dev <0.7.0",
|
|
57
|
+
"@typespec/library-linter": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
58
|
+
"@typespec/eslint-plugin": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
59
|
+
"@typespec/openapi": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
60
|
+
"@typespec/versioning": "~0.43.0 || >=0.44.0-dev <0.44.0",
|
|
61
61
|
"@types/mocha": "~10.0.0",
|
|
62
62
|
"@types/node": "~18.11.9",
|
|
63
63
|
"eslint": "^8.36.0",
|